entities
listlengths
1
9.05k
max_stars_repo_path
stringlengths
5
154
max_stars_repo_name
stringlengths
6
76
max_stars_count
int64
0
38.8k
content
stringlengths
24
1.03M
id
stringlengths
1
5
new_content
stringlengths
17
1.03M
modified
bool
1 class
references
stringlengths
31
1.03M
[ { "context": ";; Copyright (c) 2015 YOKOTA Yuki <[email protected]>\n;;\n;; This work is free", "end": 33, "score": 0.9997040629386902, "start": 22, "tag": "NAME", "value": "YOKOTA Yuki" }, { "context": ";; Copyright (c) 2015 YOKOTA Yuki <[email protected]>\n;;\n;; This work is free. You can redistribute it", "end": 58, "score": 0.9999285936355591, "start": 35, "tag": "EMAIL", "value": "[email protected]" } ]
example/smp-acl.lisp
y2q-actionman/cl-libnuma
0
;; Copyright (c) 2015 YOKOTA Yuki <[email protected]> ;; ;; This work is free. You can redistribute it and/or modify it under ;; the terms of the Do What The Fuck You Want To Public License, ;; Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ ;; for more details. ;; This code works on Allegro Only (in-package :cl-user) (defpackage :cl-libnuma.example.acl-smp (:use :cl :cl-libnuma :excl)) (in-package :cl-libnuma.example.acl-smp) (defparameter *allocation-size* (* 16 (numa-pagesize))) (defun libnuma-alloc-test (allocation-type loop-count) (let* ((nodes (numa-num-configured-nodes)) (a-mems (loop for n from 0 below nodes collect (ecase allocation-type (:onnode (numa-alloc-onnode *allocation-size* n)) (:interleave (numa-alloc-interleaved *allocation-size*)) (:only-one-node (numa-alloc-onnode *allocation-size* 0))))) (procs)) (unwind-protect (flet ((worker-function (node mem) (numa-run-on-node node) (format t "~&I am node=~A, mem=~A~%" (numa-get-run-node-mask) mem) ;; zero fill (loop for pos from 0 below *allocation-size* do (setf (system:memref-int mem 0 pos :unsigned-byte) 0)) ;; main loop (loop for lc from 1 to loop-count do ;; increment (loop for pos from 0 below *allocation-size* do (incf (system:memref-int mem 0 pos :unsigned-byte))) ;; summing (loop for pos from 0 below *allocation-size* sum (system:memref-int mem 0 pos :unsigned-byte) into result finally (format t "~&I am node=~A, mem=~A, loop ~A~%" (numa-get-run-node-mask) mem lc) (format t "~& result = ~A~%" result))))) (loop for n from 0 below nodes do (push (mp:process-run-function "libnuma test" #'worker-function n (nth n a-mems)) procs) finally (map nil #'mp:process-join procs))) (map nil #'mp:process-kill procs) (loop for mem in a-mems do (numa-free mem *allocation-size*)))))
71268
;; Copyright (c) 2015 <NAME> <<EMAIL>> ;; ;; This work is free. You can redistribute it and/or modify it under ;; the terms of the Do What The Fuck You Want To Public License, ;; Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ ;; for more details. ;; This code works on Allegro Only (in-package :cl-user) (defpackage :cl-libnuma.example.acl-smp (:use :cl :cl-libnuma :excl)) (in-package :cl-libnuma.example.acl-smp) (defparameter *allocation-size* (* 16 (numa-pagesize))) (defun libnuma-alloc-test (allocation-type loop-count) (let* ((nodes (numa-num-configured-nodes)) (a-mems (loop for n from 0 below nodes collect (ecase allocation-type (:onnode (numa-alloc-onnode *allocation-size* n)) (:interleave (numa-alloc-interleaved *allocation-size*)) (:only-one-node (numa-alloc-onnode *allocation-size* 0))))) (procs)) (unwind-protect (flet ((worker-function (node mem) (numa-run-on-node node) (format t "~&I am node=~A, mem=~A~%" (numa-get-run-node-mask) mem) ;; zero fill (loop for pos from 0 below *allocation-size* do (setf (system:memref-int mem 0 pos :unsigned-byte) 0)) ;; main loop (loop for lc from 1 to loop-count do ;; increment (loop for pos from 0 below *allocation-size* do (incf (system:memref-int mem 0 pos :unsigned-byte))) ;; summing (loop for pos from 0 below *allocation-size* sum (system:memref-int mem 0 pos :unsigned-byte) into result finally (format t "~&I am node=~A, mem=~A, loop ~A~%" (numa-get-run-node-mask) mem lc) (format t "~& result = ~A~%" result))))) (loop for n from 0 below nodes do (push (mp:process-run-function "libnuma test" #'worker-function n (nth n a-mems)) procs) finally (map nil #'mp:process-join procs))) (map nil #'mp:process-kill procs) (loop for mem in a-mems do (numa-free mem *allocation-size*)))))
true
;; Copyright (c) 2015 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;; ;; This work is free. You can redistribute it and/or modify it under ;; the terms of the Do What The Fuck You Want To Public License, ;; Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ ;; for more details. ;; This code works on Allegro Only (in-package :cl-user) (defpackage :cl-libnuma.example.acl-smp (:use :cl :cl-libnuma :excl)) (in-package :cl-libnuma.example.acl-smp) (defparameter *allocation-size* (* 16 (numa-pagesize))) (defun libnuma-alloc-test (allocation-type loop-count) (let* ((nodes (numa-num-configured-nodes)) (a-mems (loop for n from 0 below nodes collect (ecase allocation-type (:onnode (numa-alloc-onnode *allocation-size* n)) (:interleave (numa-alloc-interleaved *allocation-size*)) (:only-one-node (numa-alloc-onnode *allocation-size* 0))))) (procs)) (unwind-protect (flet ((worker-function (node mem) (numa-run-on-node node) (format t "~&I am node=~A, mem=~A~%" (numa-get-run-node-mask) mem) ;; zero fill (loop for pos from 0 below *allocation-size* do (setf (system:memref-int mem 0 pos :unsigned-byte) 0)) ;; main loop (loop for lc from 1 to loop-count do ;; increment (loop for pos from 0 below *allocation-size* do (incf (system:memref-int mem 0 pos :unsigned-byte))) ;; summing (loop for pos from 0 below *allocation-size* sum (system:memref-int mem 0 pos :unsigned-byte) into result finally (format t "~&I am node=~A, mem=~A, loop ~A~%" (numa-get-run-node-mask) mem lc) (format t "~& result = ~A~%" result))))) (loop for n from 0 below nodes do (push (mp:process-run-function "libnuma test" #'worker-function n (nth n a-mems)) procs) finally (map nil #'mp:process-join procs))) (map nil #'mp:process-kill procs) (loop for mem in a-mems do (numa-free mem *allocation-size*)))))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"FGL\")\n\n(incl", "end": 1412, "score": 0.9998603463172913, "start": 1402, "tag": "NAME", "value": "Sol Swords" }, { "context": "IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"FGL\")\n\n(include-book \"arith-base\")", "end": 1434, "score": 0.9999318718910217, "start": 1414, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/fgl/checks.lisp
mayankmanj/acl2
305
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Sol Swords <[email protected]> (in-package "FGL") (include-book "arith-base") (include-book "syntax-bind") (defxdoc fgl-syntactic-checker-binders :parents (fgl-rewrite-rules) :short "Functions for checking syntactic properties of objects, and inferring the logical properties that they imply" :long "<p>These functions are useful for creating FGL rewrite rules that prescribe some behavior based on the syntax of the objects passed in. See @(see binder) for background on the FGL binder facility, which these depend on. Each checker function, when encountered in the FGL interpreter, checks some syntactic property of its input. Its logical definition reflects what it checks. For example, @('(check-integerp ans x)') implies @('(integerp x)') in its logical formulation. Under the FGL interpreter, when invoked as @('(binder (check-integerp x-intp x))') where @('x-intp') is an unbound variable, its meta rule checks whether @('x') can be syntactically determined to be an integer; if so, it returns T.</p> <p>Each of these checker functions also has a corresponding macro whose name is suffixed with @('!') and simply wraps the function invocation in @('(binder ...)').</p> ") (local (xdoc::set-default-parents fgl-syntactic-checker-binders)) (define check-true (ans x) :short "FGL binder that checks whether X is syntactically known true." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and x ans t) /// (defthm check-true-implies-true (implies (check-true ans x) x) :rule-classes :forward-chaining) (defcong iff equal (check-true ans x) 2)) (define check-integerp (ans x) :short "FGL binder that checks whether X is syntactically an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (integerp x) ans t) /// (defthm check-integerp-implies-integerp (implies (check-integerp ans x) (integerp x)) :rule-classes :forward-chaining) (defmacro check-integerp! (&rest args) `(binder (check-integerp . ,args)))) (define check-natp (ans x) :short "FGL binder that checks whether X is syntactically a natural number." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (natp x) ans t) /// (defthm check-natp-implies-natp (implies (check-natp ans x) (natp x)) :rule-classes :forward-chaining) (defmacro check-natp! (&rest args) `(binder (check-natp . ,args)))) (define check-int-endp (ans (x integerp)) :short "FGL binder that checks whether X is syntactically a @('int-endp'), i.e. either 0, -1, or not an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (int-endp x) ans t) /// (defthm check-int-endp-fn-implies-int-endp (implies (acl2::rewriting-negative-literal `(check-int-endp ,ans ,x)) (iff (check-int-endp ans x) (and (int-endp x) (hide (check-int-endp ans x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-int-endp! (&rest args) `(binder (check-int-endp . ,args)))) (define check-bitp (ans x) :short "FGL binder that checks whether X is syntactically a bit." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (bitp x) ans t) /// (defthm check-bitp-implies-bitp (implies (check-bitp ans x) (bitp x)) :rule-classes :forward-chaining) (defmacro check-bitp! (&rest args) `(binder (check-bitp . ,args)))) (define check-signed-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically a signed integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (signed-byte-p n x) ans t) /// (defthm check-signed-byte-p-implies-signed-byte-p (implies (acl2::rewriting-negative-literal `(check-signed-byte-p ,ans ,n ,x)) (iff (check-signed-byte-p ans n x) (and (signed-byte-p n x) (hide (check-signed-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-signed-byte-p! (&rest args) `(binder (check-signed-byte-p . ,args)))) (define check-unsigned-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically an unsigned integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (unsigned-byte-p n x) ans t) /// (defthm check-unsigned-byte-p-implies-unsigned-byte-p (implies (acl2::rewriting-negative-literal `(check-unsigned-byte-p ,ans ,n ,x)) (iff (check-unsigned-byte-p ans n x) (and (unsigned-byte-p n x) (hide (check-unsigned-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-unsigned-byte-p! (&rest args) `(binder (check-unsigned-byte-p . ,args)))) (define check-non-integerp (ans x) :short "FGL binder that checks whether X is syntactically a non-integer, i.e. known not to be an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (integerp x)) ans t) /// (defthm check-non-integerp-implies-not-integerp (implies (check-non-integerp ans x) (not (integerp x))) :rule-classes :forward-chaining) (defmacro check-non-integerp! (&rest args) `(binder (check-non-integerp . ,args)))) (define check-consp (ans x) :short "FGL binder that checks whether X is syntactically cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (consp x) ans t) /// (defthm check-consp-implies-consp (implies (check-consp ans x) (consp x)) :rule-classes :forward-chaining) (defmacro check-consp! (&rest args) `(binder (check-consp . ,args)))) (define check-non-consp (ans x) :short "FGL binder that checks whether X is syntactically a non-cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (consp x)) ans t) /// (defthm check-non-consp-implies-not-consp (implies (check-non-consp ans x) (not (consp x))) :rule-classes :forward-chaining) (defmacro check-non-consp! (&rest args) `(binder (check-non-consp . ,args)))) (define check-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (booleanp x) ans t) /// (defthm check-booleanp-implies-booleanp (implies (check-booleanp ans x) (booleanp x)) :rule-classes :forward-chaining) (defmacro check-booleanp! (&rest args) `(binder (check-booleanp . ,args)))) (define check-non-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a non-Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (booleanp x)) ans t) /// (defthm check-non-booleanp-implies-not-booleanp (implies (check-non-booleanp ans x) (not (booleanp x))) :rule-classes :forward-chaining) (defmacro check-non-booleanp! (&rest args) `(binder (check-non-booleanp . ,args)))) (define integer-length-bound ((ans acl2::maybe-natp) (x integerp)) :short "FGL binder that finds a bound for the integer-length of X if possible." :long "<p>Logically, this function returns either NIL or a natural number greater than or equal to the integer length of @('x'). Its FGL binder meta rule checks whether @('x') is a symbolic integer and if so returns the count of its symbolic bits.</p>" :returns (bound acl2::maybe-natp :rule-classes :type-prescription) (and (natp ans) (<= (integer-length x) ans) ans) /// (defthm integer-length-bound-implies-integer-length (implies (integer-length-bound ans x) (<= (integer-length x) (integer-length-bound ans x))) :hints (("goal" :expand ((:free (x) (hide x))))) :rule-classes :linear) (defmacro integer-length-bound! (&rest args) `(binder (integer-length-bound . ,args)))) (define check-equal (ans x y) :short "FGL binder that checks whether X and Y are syntactically equal." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (equal x y) ans t) /// (defthm check-equal-implies-equal (implies (check-equal ans x y) (equal x y)) :rule-classes :forward-chaining) (defmacro check-equal! (&rest args) `(binder (check-equal . ,args))))
33511
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "FGL") (include-book "arith-base") (include-book "syntax-bind") (defxdoc fgl-syntactic-checker-binders :parents (fgl-rewrite-rules) :short "Functions for checking syntactic properties of objects, and inferring the logical properties that they imply" :long "<p>These functions are useful for creating FGL rewrite rules that prescribe some behavior based on the syntax of the objects passed in. See @(see binder) for background on the FGL binder facility, which these depend on. Each checker function, when encountered in the FGL interpreter, checks some syntactic property of its input. Its logical definition reflects what it checks. For example, @('(check-integerp ans x)') implies @('(integerp x)') in its logical formulation. Under the FGL interpreter, when invoked as @('(binder (check-integerp x-intp x))') where @('x-intp') is an unbound variable, its meta rule checks whether @('x') can be syntactically determined to be an integer; if so, it returns T.</p> <p>Each of these checker functions also has a corresponding macro whose name is suffixed with @('!') and simply wraps the function invocation in @('(binder ...)').</p> ") (local (xdoc::set-default-parents fgl-syntactic-checker-binders)) (define check-true (ans x) :short "FGL binder that checks whether X is syntactically known true." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and x ans t) /// (defthm check-true-implies-true (implies (check-true ans x) x) :rule-classes :forward-chaining) (defcong iff equal (check-true ans x) 2)) (define check-integerp (ans x) :short "FGL binder that checks whether X is syntactically an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (integerp x) ans t) /// (defthm check-integerp-implies-integerp (implies (check-integerp ans x) (integerp x)) :rule-classes :forward-chaining) (defmacro check-integerp! (&rest args) `(binder (check-integerp . ,args)))) (define check-natp (ans x) :short "FGL binder that checks whether X is syntactically a natural number." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (natp x) ans t) /// (defthm check-natp-implies-natp (implies (check-natp ans x) (natp x)) :rule-classes :forward-chaining) (defmacro check-natp! (&rest args) `(binder (check-natp . ,args)))) (define check-int-endp (ans (x integerp)) :short "FGL binder that checks whether X is syntactically a @('int-endp'), i.e. either 0, -1, or not an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (int-endp x) ans t) /// (defthm check-int-endp-fn-implies-int-endp (implies (acl2::rewriting-negative-literal `(check-int-endp ,ans ,x)) (iff (check-int-endp ans x) (and (int-endp x) (hide (check-int-endp ans x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-int-endp! (&rest args) `(binder (check-int-endp . ,args)))) (define check-bitp (ans x) :short "FGL binder that checks whether X is syntactically a bit." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (bitp x) ans t) /// (defthm check-bitp-implies-bitp (implies (check-bitp ans x) (bitp x)) :rule-classes :forward-chaining) (defmacro check-bitp! (&rest args) `(binder (check-bitp . ,args)))) (define check-signed-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically a signed integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (signed-byte-p n x) ans t) /// (defthm check-signed-byte-p-implies-signed-byte-p (implies (acl2::rewriting-negative-literal `(check-signed-byte-p ,ans ,n ,x)) (iff (check-signed-byte-p ans n x) (and (signed-byte-p n x) (hide (check-signed-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-signed-byte-p! (&rest args) `(binder (check-signed-byte-p . ,args)))) (define check-unsigned-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically an unsigned integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (unsigned-byte-p n x) ans t) /// (defthm check-unsigned-byte-p-implies-unsigned-byte-p (implies (acl2::rewriting-negative-literal `(check-unsigned-byte-p ,ans ,n ,x)) (iff (check-unsigned-byte-p ans n x) (and (unsigned-byte-p n x) (hide (check-unsigned-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-unsigned-byte-p! (&rest args) `(binder (check-unsigned-byte-p . ,args)))) (define check-non-integerp (ans x) :short "FGL binder that checks whether X is syntactically a non-integer, i.e. known not to be an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (integerp x)) ans t) /// (defthm check-non-integerp-implies-not-integerp (implies (check-non-integerp ans x) (not (integerp x))) :rule-classes :forward-chaining) (defmacro check-non-integerp! (&rest args) `(binder (check-non-integerp . ,args)))) (define check-consp (ans x) :short "FGL binder that checks whether X is syntactically cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (consp x) ans t) /// (defthm check-consp-implies-consp (implies (check-consp ans x) (consp x)) :rule-classes :forward-chaining) (defmacro check-consp! (&rest args) `(binder (check-consp . ,args)))) (define check-non-consp (ans x) :short "FGL binder that checks whether X is syntactically a non-cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (consp x)) ans t) /// (defthm check-non-consp-implies-not-consp (implies (check-non-consp ans x) (not (consp x))) :rule-classes :forward-chaining) (defmacro check-non-consp! (&rest args) `(binder (check-non-consp . ,args)))) (define check-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (booleanp x) ans t) /// (defthm check-booleanp-implies-booleanp (implies (check-booleanp ans x) (booleanp x)) :rule-classes :forward-chaining) (defmacro check-booleanp! (&rest args) `(binder (check-booleanp . ,args)))) (define check-non-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a non-Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (booleanp x)) ans t) /// (defthm check-non-booleanp-implies-not-booleanp (implies (check-non-booleanp ans x) (not (booleanp x))) :rule-classes :forward-chaining) (defmacro check-non-booleanp! (&rest args) `(binder (check-non-booleanp . ,args)))) (define integer-length-bound ((ans acl2::maybe-natp) (x integerp)) :short "FGL binder that finds a bound for the integer-length of X if possible." :long "<p>Logically, this function returns either NIL or a natural number greater than or equal to the integer length of @('x'). Its FGL binder meta rule checks whether @('x') is a symbolic integer and if so returns the count of its symbolic bits.</p>" :returns (bound acl2::maybe-natp :rule-classes :type-prescription) (and (natp ans) (<= (integer-length x) ans) ans) /// (defthm integer-length-bound-implies-integer-length (implies (integer-length-bound ans x) (<= (integer-length x) (integer-length-bound ans x))) :hints (("goal" :expand ((:free (x) (hide x))))) :rule-classes :linear) (defmacro integer-length-bound! (&rest args) `(binder (integer-length-bound . ,args)))) (define check-equal (ans x y) :short "FGL binder that checks whether X and Y are syntactically equal." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (equal x y) ans t) /// (defthm check-equal-implies-equal (implies (check-equal ans x y) (equal x y)) :rule-classes :forward-chaining) (defmacro check-equal! (&rest args) `(binder (check-equal . ,args))))
true
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "FGL") (include-book "arith-base") (include-book "syntax-bind") (defxdoc fgl-syntactic-checker-binders :parents (fgl-rewrite-rules) :short "Functions for checking syntactic properties of objects, and inferring the logical properties that they imply" :long "<p>These functions are useful for creating FGL rewrite rules that prescribe some behavior based on the syntax of the objects passed in. See @(see binder) for background on the FGL binder facility, which these depend on. Each checker function, when encountered in the FGL interpreter, checks some syntactic property of its input. Its logical definition reflects what it checks. For example, @('(check-integerp ans x)') implies @('(integerp x)') in its logical formulation. Under the FGL interpreter, when invoked as @('(binder (check-integerp x-intp x))') where @('x-intp') is an unbound variable, its meta rule checks whether @('x') can be syntactically determined to be an integer; if so, it returns T.</p> <p>Each of these checker functions also has a corresponding macro whose name is suffixed with @('!') and simply wraps the function invocation in @('(binder ...)').</p> ") (local (xdoc::set-default-parents fgl-syntactic-checker-binders)) (define check-true (ans x) :short "FGL binder that checks whether X is syntactically known true." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and x ans t) /// (defthm check-true-implies-true (implies (check-true ans x) x) :rule-classes :forward-chaining) (defcong iff equal (check-true ans x) 2)) (define check-integerp (ans x) :short "FGL binder that checks whether X is syntactically an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (integerp x) ans t) /// (defthm check-integerp-implies-integerp (implies (check-integerp ans x) (integerp x)) :rule-classes :forward-chaining) (defmacro check-integerp! (&rest args) `(binder (check-integerp . ,args)))) (define check-natp (ans x) :short "FGL binder that checks whether X is syntactically a natural number." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (natp x) ans t) /// (defthm check-natp-implies-natp (implies (check-natp ans x) (natp x)) :rule-classes :forward-chaining) (defmacro check-natp! (&rest args) `(binder (check-natp . ,args)))) (define check-int-endp (ans (x integerp)) :short "FGL binder that checks whether X is syntactically a @('int-endp'), i.e. either 0, -1, or not an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (int-endp x) ans t) /// (defthm check-int-endp-fn-implies-int-endp (implies (acl2::rewriting-negative-literal `(check-int-endp ,ans ,x)) (iff (check-int-endp ans x) (and (int-endp x) (hide (check-int-endp ans x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-int-endp! (&rest args) `(binder (check-int-endp . ,args)))) (define check-bitp (ans x) :short "FGL binder that checks whether X is syntactically a bit." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (bitp x) ans t) /// (defthm check-bitp-implies-bitp (implies (check-bitp ans x) (bitp x)) :rule-classes :forward-chaining) (defmacro check-bitp! (&rest args) `(binder (check-bitp . ,args)))) (define check-signed-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically a signed integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (signed-byte-p n x) ans t) /// (defthm check-signed-byte-p-implies-signed-byte-p (implies (acl2::rewriting-negative-literal `(check-signed-byte-p ,ans ,n ,x)) (iff (check-signed-byte-p ans n x) (and (signed-byte-p n x) (hide (check-signed-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-signed-byte-p! (&rest args) `(binder (check-signed-byte-p . ,args)))) (define check-unsigned-byte-p (ans n x) :short "FGL binder that checks whether X is syntactically an unsigned integer of length at most @('n')." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (unsigned-byte-p n x) ans t) /// (defthm check-unsigned-byte-p-implies-unsigned-byte-p (implies (acl2::rewriting-negative-literal `(check-unsigned-byte-p ,ans ,n ,x)) (iff (check-unsigned-byte-p ans n x) (and (unsigned-byte-p n x) (hide (check-unsigned-byte-p ans n x))))) :hints(("Goal" :expand ((:free (x) (hide x)))))) (defmacro check-unsigned-byte-p! (&rest args) `(binder (check-unsigned-byte-p . ,args)))) (define check-non-integerp (ans x) :short "FGL binder that checks whether X is syntactically a non-integer, i.e. known not to be an integer." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (integerp x)) ans t) /// (defthm check-non-integerp-implies-not-integerp (implies (check-non-integerp ans x) (not (integerp x))) :rule-classes :forward-chaining) (defmacro check-non-integerp! (&rest args) `(binder (check-non-integerp . ,args)))) (define check-consp (ans x) :short "FGL binder that checks whether X is syntactically cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (consp x) ans t) /// (defthm check-consp-implies-consp (implies (check-consp ans x) (consp x)) :rule-classes :forward-chaining) (defmacro check-consp! (&rest args) `(binder (check-consp . ,args)))) (define check-non-consp (ans x) :short "FGL binder that checks whether X is syntactically a non-cons." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (consp x)) ans t) /// (defthm check-non-consp-implies-not-consp (implies (check-non-consp ans x) (not (consp x))) :rule-classes :forward-chaining) (defmacro check-non-consp! (&rest args) `(binder (check-non-consp . ,args)))) (define check-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (booleanp x) ans t) /// (defthm check-booleanp-implies-booleanp (implies (check-booleanp ans x) (booleanp x)) :rule-classes :forward-chaining) (defmacro check-booleanp! (&rest args) `(binder (check-booleanp . ,args)))) (define check-non-booleanp (ans x) :short "FGL binder that checks whether X is syntactically a non-Boolean." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (not (booleanp x)) ans t) /// (defthm check-non-booleanp-implies-not-booleanp (implies (check-non-booleanp ans x) (not (booleanp x))) :rule-classes :forward-chaining) (defmacro check-non-booleanp! (&rest args) `(binder (check-non-booleanp . ,args)))) (define integer-length-bound ((ans acl2::maybe-natp) (x integerp)) :short "FGL binder that finds a bound for the integer-length of X if possible." :long "<p>Logically, this function returns either NIL or a natural number greater than or equal to the integer length of @('x'). Its FGL binder meta rule checks whether @('x') is a symbolic integer and if so returns the count of its symbolic bits.</p>" :returns (bound acl2::maybe-natp :rule-classes :type-prescription) (and (natp ans) (<= (integer-length x) ans) ans) /// (defthm integer-length-bound-implies-integer-length (implies (integer-length-bound ans x) (<= (integer-length x) (integer-length-bound ans x))) :hints (("goal" :expand ((:free (x) (hide x))))) :rule-classes :linear) (defmacro integer-length-bound! (&rest args) `(binder (integer-length-bound . ,args)))) (define check-equal (ans x y) :short "FGL binder that checks whether X and Y are syntactically equal." :long "<p>See @(see fgl-syntactic-checker-binders) and see @(see binder) for details.</p>" (and (equal x y) ans t) /// (defthm check-equal-implies-equal (implies (check-equal ans x y) (equal x y)) :rule-classes :forward-chaining) (defmacro check-equal! (&rest args) `(binder (check-equal . ,args))))
[ { "context": "gnals-invalid-format (na4:make-network-from-cidr \"100.100.100.100\"))\n (signals-invalid-format (na4:make-network-fr", "end": 413, "score": 0.9996450543403625, "start": 398, "tag": "IP_ADDRESS", "value": "100.100.100.100" }, { "context": "gnals-invalid-format (na4:make-network-from-cidr \"300.100.100.100/24\"))\n (signals-invalid-format (na4:make-network", "end": 487, "score": 0.9814746975898743, "start": 472, "tag": "IP_ADDRESS", "value": "300.100.100.100" }, { "context": "gnals-invalid-format (na4:make-network-from-cidr \"100.100.100.100/33\")))\n\n(test sanity\n (let ((network (na4:make-n", "end": 564, "score": 0.9996216297149658, "start": 549, "tag": "IP_ADDRESS", "value": "100.100.100.100" }, { "context": "ity\n (let ((network (na4:make-network-from-cidr \"255.255.255.255/32\")))\n (is (= (na:subnet-length network) 32))", "end": 647, "score": 0.9996153116226196, "start": 632, "tag": "IP_ADDRESS", "value": "255.255.255.255" }, { "context": "ask\n (let ((network (na4:make-network-from-cidr \"192.168.0.0/16\")))\n (is (string= (na:as-str (na:netmask ne", "end": 816, "score": 0.9997497200965881, "start": 805, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": " (is (string= (na:as-str (na:netmask network)) \"255.255.0.0\")))\n (let ((network (na4:make-network-from-cidr ", "end": 886, "score": 0.9997559189796448, "start": 875, "tag": "IP_ADDRESS", "value": "255.255.0.0" }, { "context": ")))\n (let ((network (na4:make-network-from-cidr \"192.168.0.0/18\")))\n (is (string= (na:as-str (na:netmask ne", "end": 948, "score": 0.9997514486312866, "start": 937, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": " (is (string= (na:as-str (na:netmask network)) \"255.255.192.0\"))))\n\n(test hostmask\n (let ((network (na4:make-n", "end": 1020, "score": 0.9997621178627014, "start": 1007, "tag": "IP_ADDRESS", "value": "255.255.192.0" }, { "context": "ask\n (let ((network (na4:make-network-from-cidr \"192.168.0.0/16\")))\n (is (string= (na:as-str (na:hostmask n", "end": 1099, "score": 0.9997562170028687, "start": 1088, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": " (is (string= (na:as-str (na:hostmask network)) \"0.0.255.255\"))))\n\n(test str-network\n (let ((network (na4:ma", "end": 1169, "score": 0.9996362924575806, "start": 1159, "tag": "IP_ADDRESS", "value": "0.0.255.25" }, { "context": "ork\n (let ((network (na4:make-network-from-cidr \"192.168.0.0/16\")))\n (is (string= (na:as-str network) \"192.", "end": 1252, "score": 0.9996858239173889, "start": 1241, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": ".0.0/16\")))\n (is (string= (na:as-str network) \"192.168.0.0/16\")))\n (let ((network (na4:make-network-from-ci", "end": 1309, "score": 0.999684751033783, "start": 1298, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": ")))\n (let ((network (na4:make-network-from-cidr \"192.168.0.255/16\")))\n (is (string= (na:as-str network) \"192.", "end": 1376, "score": 0.9996729493141174, "start": 1363, "tag": "IP_ADDRESS", "value": "192.168.0.255" }, { "context": ".255/16\")))\n (is (string= (na:as-str network) \"192.168.0.255/16\"))))\n\n(test broadcast\n (let ((network (na4:ma", "end": 1435, "score": 0.9996801614761353, "start": 1422, "tag": "IP_ADDRESS", "value": "192.168.0.255" }, { "context": "ast\n (let ((network (na4:make-network-from-cidr \"192.168.0.0/16\")))\n (is (string= (na:as-str (na:broadcast ", "end": 1518, "score": 0.9996827840805054, "start": 1507, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": " (is (string= (na:as-str (na:broadcast network)) \"192.168.255.255\"))))\n\n(test loop-network-addresses\n (let* ((netw", "end": 1594, "score": 0.9996852874755859, "start": 1579, "tag": "IP_ADDRESS", "value": "192.168.255.255" }, { "context": "es\n (let* ((network (na4:make-network-from-cidr \"192.168.0.0/16\"))\n (addresses (na:addresses network))", "end": 1688, "score": 0.9996861815452576, "start": 1677, "tag": "IP_ADDRESS", "value": "192.168.0.0" }, { "context": ")\n (is (string= (na:as-str (first addresses)) \"192.168.0.1\"))\n (is (string= (na:as-str (first (last addre", "end": 1799, "score": 0.9996677041053772, "start": 1788, "tag": "IP_ADDRESS", "value": "192.168.0.1" }, { "context": "is (string= (na:as-str (first (last addresses))) \"192.168.255.254\"))))\n", "end": 1873, "score": 0.9996950626373291, "start": 1858, "tag": "IP_ADDRESS", "value": "192.168.255.254" } ]
t/ipv4.lisp
ralt/network-addresses
5
(in-package #:network-addresses-test) (def-suite ipv4 :description "IPv4 addresses") (in-suite ipv4) (defmacro signals-invalid-format (&body body) `(signals (na:invalid-format) ,@body)) (test invalid-formats (signals-invalid-format (na4:make-network-from-cidr "foo")) (signals-invalid-format (na4:make-network-from-cidr "100")) (signals-invalid-format (na4:make-network-from-cidr "100.100.100.100")) (signals-invalid-format (na4:make-network-from-cidr "300.100.100.100/24")) (signals-invalid-format (na4:make-network-from-cidr "100.100.100.100/33"))) (test sanity (let ((network (na4:make-network-from-cidr "255.255.255.255/32"))) (is (= (na:subnet-length network) 32)) (is (= (na:as-int network) 4294967295)))) (test netmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:netmask network)) "255.255.0.0"))) (let ((network (na4:make-network-from-cidr "192.168.0.0/18"))) (is (string= (na:as-str (na:netmask network)) "255.255.192.0")))) (test hostmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:hostmask network)) "0.0.255.255")))) (test str-network (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str network) "192.168.0.0/16"))) (let ((network (na4:make-network-from-cidr "192.168.0.255/16"))) (is (string= (na:as-str network) "192.168.0.255/16")))) (test broadcast (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:broadcast network)) "192.168.255.255")))) (test loop-network-addresses (let* ((network (na4:make-network-from-cidr "192.168.0.0/16")) (addresses (na:addresses network))) (is (string= (na:as-str (first addresses)) "192.168.0.1")) (is (string= (na:as-str (first (last addresses))) "192.168.255.254"))))
77200
(in-package #:network-addresses-test) (def-suite ipv4 :description "IPv4 addresses") (in-suite ipv4) (defmacro signals-invalid-format (&body body) `(signals (na:invalid-format) ,@body)) (test invalid-formats (signals-invalid-format (na4:make-network-from-cidr "foo")) (signals-invalid-format (na4:make-network-from-cidr "100")) (signals-invalid-format (na4:make-network-from-cidr "172.16.31.10")) (signals-invalid-format (na4:make-network-from-cidr "300.100.100.100/24")) (signals-invalid-format (na4:make-network-from-cidr "172.16.31.10/33"))) (test sanity (let ((network (na4:make-network-from-cidr "255.255.255.255/32"))) (is (= (na:subnet-length network) 32)) (is (= (na:as-int network) 4294967295)))) (test netmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:netmask network)) "255.255.0.0"))) (let ((network (na4:make-network-from-cidr "192.168.0.0/18"))) (is (string= (na:as-str (na:netmask network)) "255.255.192.0")))) (test hostmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:hostmask network)) "0.0.255.255")))) (test str-network (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str network) "192.168.0.0/16"))) (let ((network (na4:make-network-from-cidr "192.168.0.255/16"))) (is (string= (na:as-str network) "192.168.0.255/16")))) (test broadcast (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:broadcast network)) "192.168.255.255")))) (test loop-network-addresses (let* ((network (na4:make-network-from-cidr "192.168.0.0/16")) (addresses (na:addresses network))) (is (string= (na:as-str (first addresses)) "192.168.0.1")) (is (string= (na:as-str (first (last addresses))) "192.168.255.254"))))
true
(in-package #:network-addresses-test) (def-suite ipv4 :description "IPv4 addresses") (in-suite ipv4) (defmacro signals-invalid-format (&body body) `(signals (na:invalid-format) ,@body)) (test invalid-formats (signals-invalid-format (na4:make-network-from-cidr "foo")) (signals-invalid-format (na4:make-network-from-cidr "100")) (signals-invalid-format (na4:make-network-from-cidr "PI:IP_ADDRESS:172.16.31.10END_PI")) (signals-invalid-format (na4:make-network-from-cidr "300.100.100.100/24")) (signals-invalid-format (na4:make-network-from-cidr "PI:IP_ADDRESS:172.16.31.10END_PI/33"))) (test sanity (let ((network (na4:make-network-from-cidr "255.255.255.255/32"))) (is (= (na:subnet-length network) 32)) (is (= (na:as-int network) 4294967295)))) (test netmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:netmask network)) "255.255.0.0"))) (let ((network (na4:make-network-from-cidr "192.168.0.0/18"))) (is (string= (na:as-str (na:netmask network)) "255.255.192.0")))) (test hostmask (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:hostmask network)) "0.0.255.255")))) (test str-network (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str network) "192.168.0.0/16"))) (let ((network (na4:make-network-from-cidr "192.168.0.255/16"))) (is (string= (na:as-str network) "192.168.0.255/16")))) (test broadcast (let ((network (na4:make-network-from-cidr "192.168.0.0/16"))) (is (string= (na:as-str (na:broadcast network)) "192.168.255.255")))) (test loop-network-addresses (let* ((network (na4:make-network-from-cidr "192.168.0.0/16")) (addresses (na:addresses network))) (is (string= (na:as-str (first addresses)) "192.168.0.1")) (is (string= (na:as-str (first (last addresses))) "192.168.255.254"))))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 188, "score": 0.9998778700828552, "start": 171, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 208, "score": 0.9999314546585083, "start": 190, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/c/atc/tests/nonstrict.lisp
ayazhafiz/acl2
0
; C Library ; ; Copyright (C) 2020 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "kestrel/c/atc/atc" :dir :system :ttags ((:quicklisp) (:quicklisp.osicat) (:oslib) (:open-output-channel!))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Some examples to test code generation for non-strict logical operators. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |and| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (and (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |or| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (or (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifand| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (and (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-lt |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifor| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (or (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-ge |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condand| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (and (c::sint-nonzerop (c::sint-le (c::sint-const 0) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (or (c::sint-nonzerop (c::sint-lt |x| (c::sint-const 0))) (c::sint-nonzerop (c::sint-gt |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |notandor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint01 (and (or (and (c::sint-nonzerop (c::sint-le (c::sint-const 10) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 20)))) (and (c::sint-nonzerop (c::sint-le (c::sint-const 100) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 200))))) (not (and (c::sint-nonzerop (c::sint-le (c::sint-const 4) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 6)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (c::atc |and| |or| |ifand| |ifor| |condand| |condor| |notandor| :output-file "nonstrict.c") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #| On macOS or Linux, you can compile and run this code as follows: gcc -o nonstrict nonstrict.c nonstrict-test.c ./nonstrict |#
31567
; C Library ; ; Copyright (C) 2020 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "kestrel/c/atc/atc" :dir :system :ttags ((:quicklisp) (:quicklisp.osicat) (:oslib) (:open-output-channel!))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Some examples to test code generation for non-strict logical operators. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |and| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (and (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |or| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (or (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifand| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (and (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-lt |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifor| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (or (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-ge |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condand| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (and (c::sint-nonzerop (c::sint-le (c::sint-const 0) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (or (c::sint-nonzerop (c::sint-lt |x| (c::sint-const 0))) (c::sint-nonzerop (c::sint-gt |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |notandor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint01 (and (or (and (c::sint-nonzerop (c::sint-le (c::sint-const 10) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 20)))) (and (c::sint-nonzerop (c::sint-le (c::sint-const 100) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 200))))) (not (and (c::sint-nonzerop (c::sint-le (c::sint-const 4) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 6)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (c::atc |and| |or| |ifand| |ifor| |condand| |condor| |notandor| :output-file "nonstrict.c") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #| On macOS or Linux, you can compile and run this code as follows: gcc -o nonstrict nonstrict.c nonstrict-test.c ./nonstrict |#
true
; C Library ; ; Copyright (C) 2020 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "kestrel/c/atc/atc" :dir :system :ttags ((:quicklisp) (:quicklisp.osicat) (:oslib) (:open-output-channel!))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Some examples to test code generation for non-strict logical operators. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |and| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (and (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |or| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (c::sint01 (or (c::sint-nonzerop |x|) (c::sint-nonzerop |y|)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifand| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (and (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-lt |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |ifor| (|x| |y|) (declare (xargs :guard (and (c::sintp |x|) (c::sintp |y|)))) (if (or (c::sint-nonzerop (c::sint-lt |x| |y|)) (c::sint-nonzerop (c::sint-ge |y| (c::sint-const 100)))) |x| |y|)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condand| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (and (c::sint-nonzerop (c::sint-le (c::sint-const 0) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |condor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint-eq |x| (if (or (c::sint-nonzerop (c::sint-lt |x| (c::sint-const 0))) (c::sint-nonzerop (c::sint-gt |x| (c::sint-const 10)))) (c::sint-const 10) (c::sint-const 20)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun |notandor| (|x|) (declare (xargs :guard (c::sintp |x|))) (c::sint01 (and (or (and (c::sint-nonzerop (c::sint-le (c::sint-const 10) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 20)))) (and (c::sint-nonzerop (c::sint-le (c::sint-const 100) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 200))))) (not (and (c::sint-nonzerop (c::sint-le (c::sint-const 4) |x|)) (c::sint-nonzerop (c::sint-le |x| (c::sint-const 6)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (c::atc |and| |or| |ifand| |ifor| |condand| |condor| |notandor| :output-file "nonstrict.c") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #| On macOS or Linux, you can compile and run this code as follows: gcc -o nonstrict nonstrict.c nonstrict-test.c ./nonstrict |#
[ { "context": "ing-from-octets #(1 3 60 188 62)))\n ;; kilian 2008-03-20: the following for-all test failed ", "end": 4543, "score": 0.5909889340400696, "start": 4540, "tag": "NAME", "value": "kil" }, { "context": "()\n;; ((a :accessor foo1-a)))\n\n;; ;; a test from Robert Sedgwick which crashed in earlier\n;; ;; versions (pre 0.2)", "end": 18920, "score": 0.9995371699333191, "start": 18905, "tag": "NAME", "value": "Robert Sedgwick" } ]
src/data/encoding-test.lisp
HanshenWang/bknr-datastore
63
(in-package :bknr.datastore) (5am:def-suite :bknr.datastore) (5am:in-suite :bknr.datastore) (defun files-identical-content-p (path-a path-b) "Are files of PATH-A and PATH-B byte per byte identical?" (with-open-file (in-a path-a :element-type '(unsigned-byte 8)) (with-open-file (in-b path-b :element-type '(unsigned-byte 8)) (loop for byte-a = (read-byte in-a nil nil) for byte-b = (read-byte in-b nil nil) while (or byte-a byte-b) unless (and byte-a byte-b (= byte-a byte-b)) return nil finally (return t))))) (defun congruent-p (a b) "Are lisp value A and B (deeply) congruent?" (bknr.utils:with-temporary-file (path-a) (bknr.utils:with-temporary-file (path-b) (cl-store:store a path-a) (cl-store:store b path-b) (prog1 (files-identical-content-p path-a path-b) (delete-file path-a) (delete-file path-b))))) (defun copy-by-encoding (value) (bknr.utils:with-temporary-file (path) (with-open-file (out path :direction :output :if-exists :supersede :element-type '(unsigned-byte 8)) (encode value out)) (with-open-file (in path :element-type '(unsigned-byte 8)) (decode in)))) (defmacro test-encoding (name value) (let ((options (alexandria:ensure-list name))) (destructuring-bind (name &key skip) options `(5am:test ,name ,(if skip `(5am:skip ,skip) `(5am:is (congruent-p ,value (copy-by-encoding ,value)))))))) (test-encoding list.1 '(1 2 3)) (test-encoding list.len.30 (loop repeat 30 collect 'x)) (test-encoding list.len.254 (loop repeat 254 collect 'x)) (test-encoding list.len.255 (loop repeat 255 collect 'x)) (test-encoding list.len.256 (loop repeat 256 collect 'x)) (test-encoding list.len.257 (loop repeat 257 collect 'x)) (test-encoding list.len.3000 (loop repeat 3000 collect 'x)) (test-encoding improper-list.1 '(1 2 3 4 . 5)) (test-encoding cons.1 '(1 . 2)) ;;; from cl-store :) (test-encoding integer.1 1) (test-encoding integer.2 0) (test-encoding integer.3 23423333333333333333333333423102334) (test-encoding integer.4 -2322993) (test-encoding integer.5 most-positive-fixnum) (test-encoding integer.6 most-negative-fixnum) ;; ratios (test-encoding ratio.1 1/2) (test-encoding ratio.2 234232/23434) (test-encoding ratio.3 -12/2) (test-encoding ratio.4 -6/11) (test-encoding ratio.5 23222/13) ;; complex numbers - currently not supported ;; (test-encoding complex.1 #C(0 1)) ;; (test-encoding complex.2 #C(0.0 1.0)) ;; (test-encoding complex.3 #C(32 -23455)) ;; (test-encoding complex.4 #C(-222.32 2322.21)) ;; (test-encoding complex.5 #C(-111 -1123)) ;; (test-encoding complex.6 #C(-11.2 -34.5)) ;; single-float (test-encoding single-float.1 3244.32) (test-encoding single-float.2 0.12) (test-encoding single-float.3 -233.001) (test-encoding single-float.4 most-positive-single-float) (test-encoding single-float.5 most-negative-single-float) ;; double-float (test-encoding double-float.1 2343.3d0) (test-encoding double-float.2 -1211111.3343d0) (test-encoding double-float.3 99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.4 -99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.5 most-positive-double-float) (test-encoding double-float.6 most-negative-double-float) ;; characters (test-encoding char.1 #\Space) (test-encoding char.2 #\f ) (test-encoding char.3 #\Rubout) (test-encoding char.4 (code-char 255)) (5am:test char.random (5am:for-all ((char (5am:gen-character))) (5am:is (char= char (copy-by-encoding char))))) ;; strings (5am:test string.random (5am:for-all ((string (5am:gen-string))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.random.code-limited (5am:for-all ((string (5am:gen-string :elements (5am:gen-character :code-limit 10000)))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.decode-utf-8 (labels ((decode-string-from-octets (octets) (flexi-streams:with-input-from-sequence (in octets) (bknr.datastore::%decode-string in)))) (5am:is (string-equal "<=>" (decode-string-from-octets #(1 3 60 61 62)))) ;; #\? is the substitution char (string-equal "<?>" (decode-string-from-octets #(1 3 60 188 62))) ;; kilian 2008-03-20: the following for-all test failed on ccl, ;; because the correct utf-8 sequence could produce a char-code ;; above char-code-limit - bknr.datastore::%decode-string should ;; throw an error in this case, but I dont know how to test this ;; (5am:for-all ((octets (5am:gen-buffer))) ;; (5am:finishes (decode-string-from-octets (concatenate 'vector (vector 1 (length octets)) octets)))) )) ;; #+(or (and sbcl sb-unicode) lispworks clisp acl) ;; (progn ;; (test-encoding unicode.1 (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB))) ;; (test-encoding unicode.2 (intern (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB)) ;; :pwgl-test-suite))) ;; vectors (test-encoding vector.1 #(1 2 3 4)) (test-encoding vector.2 (make-array 5 :element-type 'fixnum :initial-contents (list 1 2 3 4 5))) (test-encoding vector.4 #*101101101110) (test-encoding vector.3 (make-array 5 :element-type 'fixnum :fill-pointer 2 :initial-contents (list 1 2 3 4 5))) (test-encoding vector.5 #*) (test-encoding vector.6 #()) ;; arrays (test-encoding array.1 (make-array '(2 2) :initial-contents '((1 2) (3 4)))) (test-encoding array.2 (make-array '(2 2) :initial-contents '((1 1) (1 1)))) (test-encoding array.3 (make-array '(2 2) :element-type 'fixnum :initial-element 3)) (test-encoding (array.3b :skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/31") (make-array '(2 2) :element-type '(mod 10) :initial-element 3)) (test-encoding array.4 (make-array '(2 3 5) :initial-contents '(((1 2 #\f 5 12.0) (#\Space 0 4 1 0) ('d 0 #() 3 -1)) ((0 #\a #\b 4 #\q) (12.0d0 0 '(d) 4 1) (#\Newline 1 7 #\4 #\0))))) ;; (test-encoding array.5 ;; (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; a3)) ;; symbols (test-encoding symbol.1 t) (test-encoding symbol.2 nil) (test-encoding symbol.3 :foo) (test-encoding symbol.4 'bknr.datastore::foo) (test-encoding symbol.5 'make-hash-table) (test-encoding symbol.6 '|foo bar|) (test-encoding symbol.7 'foo\ bar\ baz) ;; (deftest gensym.1 (progn ;; (store (gensym "Foobar") *test-file*) ;; (let ((new (restore *test-file*))) ;; (list (symbol-package new) ;; (mismatch "Foobar" (symbol-name new))))) ;; (nil 6)) ;; This failed in cl-store < 0.5.5 ;; (deftest gensym.2 (let ((x (gensym))) ;; (store (list x x) *test-file*) ;; (let ((new (restore *test-file*))) ;; (eql (car new) (cadr new)))) ;; t) ;; cons (test-encoding cons.1 '(1 2 3)) (test-encoding cons.2 '((1 2 3))) (test-encoding cons.3 '(#\Space 1 1.2 1.3 #(1 2 3))) (test-encoding cons.4 '(1 . 2)) (test-encoding cons.5 '(t . nil)) (test-encoding cons.6 '(1 2 3 . 5)) ;; (deftest cons.7 (let ((list (cons nil nil))) ; '#1=(#1#))) ;; (setf (car list) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq ret (car ret)))) ;; t) ;; hash tables ;; for some reason (make-hash-table) is not equalp ;; to (make-hash-table) with ecl. #-openmcl(test-encoding hash.1 (make-hash-table)) #+openmcl(5am:test hash.1 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) #-openmcl(test-encoding hash.2 (make-hash-table :test #'equal)) #+openmcl(5am:test hash.2 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) ;; (defvar *hash* (let ((in (make-hash-table :test #'equal ;; :rehash-threshold 0.4 :size 20 ;; :rehash-size 40))) ;; (dotimes (x 1000) (setf (gethash (format nil "~R" x) in) x)) ;; in)) ;; (test-encoding hash.3 *hash*) (5am:test hash.3 (5am:skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/29")) ;; ;; packages ;; (test-encoding package.1 (find-package :cl-store)) ;; (defpackage foo ;; (:nicknames foobar) ;; (:use :cl) ;; (:shadow cl:format) ;; (:export bar)) ;; (defun package-restores () ;; (let (( *nuke-existing-packages* t)) ;; (store (find-package :foo) *test-file*) ;; (delete-package :foo) ;; (restore *test-file*) ;; (list (package-name (find-package :foo)) ;; (mapcar #'package-name (package-use-list :foo)) ;; (package-nicknames :foo) ;; (equalp (remove-duplicates (package-shadowing-symbols :foo)) ;; (list (find-symbol "FORMAT" "FOO"))) ;; (equalp (cl-store::external-symbols (find-package :foo)) ;; (make-array 1 :initial-element (find-symbol "BAR" "FOO")))))) ;; ; unfortunately it's difficult to portably test the internal symbols ;; ; in a package so we just assume that it's OK. ;; (deftest package.2 ;; (package-restores) ;; ("FOO" ("COMMON-LISP") ("FOOBAR") t t)) ;; ;; objects (define-persistent-class foo () ((x :update))) (define-persistent-class bar (foo) ((y :update))) ;; (deftest standard-object.1 ;; (let ((val (store (make-instance 'foo :x 3) *test-file*))) ;; (= (get-x val) (get-x (restore *test-file*)))) ;; t) ;; (deftest standard-object.2 ;; (let ((val (store (make-instance 'bar ;; :x (list 1 "foo" 1.0) ;; :y (vector 1 2 3 4)) ;; *test-file*))) ;; (let ((ret (restore *test-file*))) ;; (and (equalp (get-x val) (get-x ret)) ;; (equalp (get-y val) (get-y ret))))) ;; t) ;; (deftest standard-object.3 ;; (let ((*store-class-slots* nil) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (= (get-z (restore *test-file*)) ;; 2)) ;; t) ;; (deftest standard-object.4 ;; (let ((*store-class-slots* t) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (let ((ret (restore *test-file*))) ;; (= (get-z ret ) ;; 9))) ;; t) ;; ;; classes ;; (deftest standard-class.1 (progn (store (find-class 'foo) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.2 (progn (store (find-class 'bar) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.3 (progn (store (find-class 'baz) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; ;; conditions ;; (deftest condition.1 ;; (handler-case (/ 1 0) ;; (division-by-zero (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) 'division-by-zero))) ;; t) ;; (deftest condition.2 ;; (handler-case (car (read-from-string "3")) ;; ;; allegro pre 7.0 signalled a simple-error here ;; ((or type-error simple-error) (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) ;; '(or type-error simple-error)))) ;; t) ;; ;; structure-object ;; (defstruct a ;; a b c) ;; (defstruct (b (:include a)) ;; d e f) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.1 (make-a :a 1 :b 2 :c 3)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.2 (make-b :a 1 :b 2 :c 3 :d 4 :e 5 :f 6)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.3 (make-b :a 1 :b (make-a :a 1 :b 3 :c 2) ;; :c #\Space :d #(1 2 3) :e (list 1 2 3) ;; :f (make-hash-table))) ;; ;; setf test ;; (test-encoding setf.1 (setf (restore *test-file*) 0)) ;; (test-encoding setf.2 (incf (restore *test-file*))) ;; (test-encoding setf.3 (decf (restore *test-file*) 2)) ;; (test-encoding pathname.1 #P"/home/foo") ;; (test-encoding pathname.2 (make-pathname :name "foo")) ;; (test-encoding pathname.3 (make-pathname :name "foo" :type "bar")) ;; ; built-in classes ;; (test-encoding built-in.1 (find-class 'hash-table)) ;; (test-encoding built-in.2 (find-class 'integer)) ;; ;; find-backend tests ;; (deftest find-backend.1 ;; (and (find-backend 'cl-store) t) ;; t) ;; (deftest find-backend.2 ;; (find-backend (gensym)) ;; nil) ;; (deftest find-backend.3 ;; (handler-case (find-backend (gensym) t) ;; (error (c) (and c t)) ;; (:no-error (val) (and val nil))) ;; t) ;; ;; circular objects ;; (defvar circ1 (let ((x (list 1 2 3 4))) ;; (setf (cdr (last x)) x))) ;; (deftest circ.1 (progn (store circ1 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (cddddr x) x))) ;; t) ;; (defvar circ2 (let ((x (list 2 3 4 4 5))) ;; (setf (second x) x))) ;; (deftest circ.2 (progn (store circ2 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (second x) x))) ;; t) ;; (defvar circ3 (let ((x (list (list 1 2 3 4 ) ;; (list 5 6 7 8) ;; 9))) ;; (setf (second x) (car x)) ;; (setf (cdr (last x)) x) ;; x)) ;; (deftest circ.3 (progn (store circ3 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (second x) (car x)) ;; (eql (cdddr x) x)))) ;; t) ;; (defvar circ4 (let ((x (make-hash-table))) ;; (setf (gethash 'first x) (make-hash-table)) ;; (setf (gethash 'second x) (gethash 'first x)) ;; (setf (gethash 'inner (gethash 'first x)) x) ;; x)) ;; (deftest circ.4 (progn (store circ4 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (gethash 'first x) ;; (gethash 'second x)) ;; (eql x ;; (gethash 'inner ;; (gethash 'first x)))))) ;; t) ;; (deftest circ.5 (let ((circ5 (make-instance 'bar))) ;; (setf (get-y circ5) circ5) ;; (store circ5 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql x (get-y x)))) ;; t) ;; (defvar circ6 (let ((y (make-array '(2 2 2) ;; :initial-contents '((("foo" "bar") ;; ("me" "you")) ;; ((5 6) (7 8)))))) ;; (setf (aref y 1 1 1) y) ;; (setf (aref y 0 0 0) (aref y 1 1 1)) ;; y)) ;; (deftest circ.6 (progn (store circ6 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (aref x 1 1 1) x) ;; (eql (aref x 0 0 0) (aref x 1 1 1))))) ;; t) ;; (defvar circ7 (let ((x (make-a))) ;; (setf (a-a x) x))) ;; #+(or sbcl cmu lispworks) ;; (deftest circ.7 (progn (store circ7 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (a-a x) x))) ;; t) ;; (defvar circ.8 (let ((x "foo")) ;; (make-pathname :name x :type x))) ;; ;; clisp apparently creates a copy of the strings in a pathname ;; ;; so a test for eqness is pointless. ;; #-clisp ;; (deftest circ.8 (progn (store circ.8 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (pathname-name x) ;; (pathname-type x)))) ;; t) ;; (deftest circ.9 (let ((val (vector "foo" "bar" "baz" 1 2))) ;; (setf (aref val 3) val) ;; (setf (aref val 4) (aref val 0)) ;; (store val *test-file*) ;; (let ((rest (restore *test-file*))) ;; (and (eql rest (aref rest 3)) ;; (eql (aref rest 4) (aref rest 0))))) ;; t) ;; (deftest circ.10 (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; (setf (aref a3 1) a3) ;; (store a3 *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eql a3 (aref a3 1)))) ;; t) ;; (defvar circ.11 (let ((x (make-hash-table))) ;; (setf (gethash x x) x) ;; x)) ;; (deftest circ.11 (progn (store circ.11 *test-file*) ;; (let ((val (restore *test-file*))) ;; (eql val (gethash val val)))) ;; t) ;; (deftest circ.12 (let ((x (vector 1 2 "foo" 4 5))) ;; (setf (aref x 0) x) ;; (setf (aref x 1) (aref x 2)) ;; (store x *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eql (aref ret 0) ret) ;; (eql (aref ret 1) (aref ret 2))))) ;; t) ;; (defclass foo.1 () ;; ((a :accessor foo1-a))) ;; ;; a test from Robert Sedgwick which crashed in earlier ;; ;; versions (pre 0.2) ;; (deftest circ.13 (let ((foo (make-instance 'foo.1)) ;; (bar (make-instance 'foo.1))) ;; (setf (foo1-a foo) bar) ;; (setf (foo1-a bar) foo) ;; (store (list foo) *test-file*) ;; (let ((ret (car (restore *test-file*)))) ;; (and (eql ret (foo1-a (foo1-a ret))) ;; (eql (foo1-a ret) ;; (foo1-a (foo1-a (foo1-a ret))))))) ;; t) ;; (deftest circ.14 (let ((list '#1=(1 2 3 #1# . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ret)))) ;; t) ;; (deftest circ.15 (let ((list '#1=(1 2 3 #2=(#2#) . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ;; (car (fourth ret)))))) ;; t) ;; ;; this had me confused for a while since what was ;; ;; restored #1=(1 (#1#) #1#) looks nothing like this list, ;; ;; but it turns out that it is correct ;; (deftest circ.16 (let ((list '#1=(1 #2=(#1#) . #2#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (caadr ret)) ;; (eq ret (third ret))))) ;; t) ;; ;; large circular lists ;; (deftest large.1 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq (nthcdr 100000 ret) ret))) ;; t) ;; ;; large dotted lists ;; (test-encoding large.2 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) 'foo) ;; list)) ;; ;; custom storing ;; (defclass random-obj () ((size :accessor size :initarg :size))) ;; (defvar *random-obj-code* (register-code 100 'random-obj)) ;; (defstore-cl-store (obj random-obj buff) ;; (output-type-code *random-obj-code* buff) ;; (store-object (size obj) buff)) ;; (defrestore-cl-store (random-obj buff) ;; (random (restore-object buff))) ;; (deftest custom.1 ;; (progn (store (make-instance 'random-obj :size 5) *test-file* ) ;; (typep (restore *test-file*) '(integer 0 4))) ;; t) ;; (test-encoding function.1 #'restores) ;; (test-encoding function.2 #'car) ;; (test-encoding gfunction.1 #'cl-store:restore) ;; (test-encoding gfunction.2 #'cl-store:store) ;; #-clisp ;; (test-encoding gfunction.3 #'(setf get-y)) ;; (deftest nocirc.1 ;; (let* ((string "FOO") ;; (list `(,string . ,string)) ;; (*check-for-circs* nil)) ;; (store list *test-file*) ;; (let ((res (restore *test-file*))) ;; (and (not (eql (car res) (cdr res))) ;; (string= (car res) (cdr res))))) ;; t) ;; (defstruct st.bar x) ;; (defstruct (st.foo (:conc-name f-) ;; (:constructor fooo (z y x)) ;; (:copier cp-foo) ;; (:include st.bar) ;; (:predicate is-foo) ;; (:print-function (lambda (obj st dep) ;; (declare (ignore dep)) ;; (print-unreadable-object (obj st :type t) ;; (format st "~A" (f-x obj)))))) ;; (y 0 :type integer) (z nil :type simple-string)) ;; #+(or sbcl cmu) ;; (deftest struct-class.1 ;; (let* ((obj (fooo "Z" 2 3)) ;; (string (format nil "~A" obj))) ;; (let ((*nuke-existing-classes* t)) ;; (store (find-class 'st.foo) *test-file*) ;; (fmakunbound 'cp-foo) ;; (fmakunbound 'is-foo) ;; (fmakunbound 'fooo) ;; (fmakunbound 'f-x) ;; (fmakunbound 'f-y) ;; (fmakunbound 'f-z) ;; (restore *test-file*) ;; (let* ((new-obj (cp-foo (fooo "Z" 2 3))) ;; (new-string (format nil "~A" new-obj))) ;; (list (is-foo new-obj) (equalp obj new-obj) ;; (string= new-string string) ;; (f-x new-obj) (f-y new-obj) (f-z new-obj))))) ;; (t t t 3 2 "Z")) ;; (defun run-tests (backend) ;; (with-backend backend ;; (regression-5am:do-tests)) ;; (when (probe-file *test-file*) ;; (ignore-errors (delete-file *test-file*))))
81418
(in-package :bknr.datastore) (5am:def-suite :bknr.datastore) (5am:in-suite :bknr.datastore) (defun files-identical-content-p (path-a path-b) "Are files of PATH-A and PATH-B byte per byte identical?" (with-open-file (in-a path-a :element-type '(unsigned-byte 8)) (with-open-file (in-b path-b :element-type '(unsigned-byte 8)) (loop for byte-a = (read-byte in-a nil nil) for byte-b = (read-byte in-b nil nil) while (or byte-a byte-b) unless (and byte-a byte-b (= byte-a byte-b)) return nil finally (return t))))) (defun congruent-p (a b) "Are lisp value A and B (deeply) congruent?" (bknr.utils:with-temporary-file (path-a) (bknr.utils:with-temporary-file (path-b) (cl-store:store a path-a) (cl-store:store b path-b) (prog1 (files-identical-content-p path-a path-b) (delete-file path-a) (delete-file path-b))))) (defun copy-by-encoding (value) (bknr.utils:with-temporary-file (path) (with-open-file (out path :direction :output :if-exists :supersede :element-type '(unsigned-byte 8)) (encode value out)) (with-open-file (in path :element-type '(unsigned-byte 8)) (decode in)))) (defmacro test-encoding (name value) (let ((options (alexandria:ensure-list name))) (destructuring-bind (name &key skip) options `(5am:test ,name ,(if skip `(5am:skip ,skip) `(5am:is (congruent-p ,value (copy-by-encoding ,value)))))))) (test-encoding list.1 '(1 2 3)) (test-encoding list.len.30 (loop repeat 30 collect 'x)) (test-encoding list.len.254 (loop repeat 254 collect 'x)) (test-encoding list.len.255 (loop repeat 255 collect 'x)) (test-encoding list.len.256 (loop repeat 256 collect 'x)) (test-encoding list.len.257 (loop repeat 257 collect 'x)) (test-encoding list.len.3000 (loop repeat 3000 collect 'x)) (test-encoding improper-list.1 '(1 2 3 4 . 5)) (test-encoding cons.1 '(1 . 2)) ;;; from cl-store :) (test-encoding integer.1 1) (test-encoding integer.2 0) (test-encoding integer.3 23423333333333333333333333423102334) (test-encoding integer.4 -2322993) (test-encoding integer.5 most-positive-fixnum) (test-encoding integer.6 most-negative-fixnum) ;; ratios (test-encoding ratio.1 1/2) (test-encoding ratio.2 234232/23434) (test-encoding ratio.3 -12/2) (test-encoding ratio.4 -6/11) (test-encoding ratio.5 23222/13) ;; complex numbers - currently not supported ;; (test-encoding complex.1 #C(0 1)) ;; (test-encoding complex.2 #C(0.0 1.0)) ;; (test-encoding complex.3 #C(32 -23455)) ;; (test-encoding complex.4 #C(-222.32 2322.21)) ;; (test-encoding complex.5 #C(-111 -1123)) ;; (test-encoding complex.6 #C(-11.2 -34.5)) ;; single-float (test-encoding single-float.1 3244.32) (test-encoding single-float.2 0.12) (test-encoding single-float.3 -233.001) (test-encoding single-float.4 most-positive-single-float) (test-encoding single-float.5 most-negative-single-float) ;; double-float (test-encoding double-float.1 2343.3d0) (test-encoding double-float.2 -1211111.3343d0) (test-encoding double-float.3 99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.4 -99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.5 most-positive-double-float) (test-encoding double-float.6 most-negative-double-float) ;; characters (test-encoding char.1 #\Space) (test-encoding char.2 #\f ) (test-encoding char.3 #\Rubout) (test-encoding char.4 (code-char 255)) (5am:test char.random (5am:for-all ((char (5am:gen-character))) (5am:is (char= char (copy-by-encoding char))))) ;; strings (5am:test string.random (5am:for-all ((string (5am:gen-string))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.random.code-limited (5am:for-all ((string (5am:gen-string :elements (5am:gen-character :code-limit 10000)))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.decode-utf-8 (labels ((decode-string-from-octets (octets) (flexi-streams:with-input-from-sequence (in octets) (bknr.datastore::%decode-string in)))) (5am:is (string-equal "<=>" (decode-string-from-octets #(1 3 60 61 62)))) ;; #\? is the substitution char (string-equal "<?>" (decode-string-from-octets #(1 3 60 188 62))) ;; <NAME>ian 2008-03-20: the following for-all test failed on ccl, ;; because the correct utf-8 sequence could produce a char-code ;; above char-code-limit - bknr.datastore::%decode-string should ;; throw an error in this case, but I dont know how to test this ;; (5am:for-all ((octets (5am:gen-buffer))) ;; (5am:finishes (decode-string-from-octets (concatenate 'vector (vector 1 (length octets)) octets)))) )) ;; #+(or (and sbcl sb-unicode) lispworks clisp acl) ;; (progn ;; (test-encoding unicode.1 (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB))) ;; (test-encoding unicode.2 (intern (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB)) ;; :pwgl-test-suite))) ;; vectors (test-encoding vector.1 #(1 2 3 4)) (test-encoding vector.2 (make-array 5 :element-type 'fixnum :initial-contents (list 1 2 3 4 5))) (test-encoding vector.4 #*101101101110) (test-encoding vector.3 (make-array 5 :element-type 'fixnum :fill-pointer 2 :initial-contents (list 1 2 3 4 5))) (test-encoding vector.5 #*) (test-encoding vector.6 #()) ;; arrays (test-encoding array.1 (make-array '(2 2) :initial-contents '((1 2) (3 4)))) (test-encoding array.2 (make-array '(2 2) :initial-contents '((1 1) (1 1)))) (test-encoding array.3 (make-array '(2 2) :element-type 'fixnum :initial-element 3)) (test-encoding (array.3b :skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/31") (make-array '(2 2) :element-type '(mod 10) :initial-element 3)) (test-encoding array.4 (make-array '(2 3 5) :initial-contents '(((1 2 #\f 5 12.0) (#\Space 0 4 1 0) ('d 0 #() 3 -1)) ((0 #\a #\b 4 #\q) (12.0d0 0 '(d) 4 1) (#\Newline 1 7 #\4 #\0))))) ;; (test-encoding array.5 ;; (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; a3)) ;; symbols (test-encoding symbol.1 t) (test-encoding symbol.2 nil) (test-encoding symbol.3 :foo) (test-encoding symbol.4 'bknr.datastore::foo) (test-encoding symbol.5 'make-hash-table) (test-encoding symbol.6 '|foo bar|) (test-encoding symbol.7 'foo\ bar\ baz) ;; (deftest gensym.1 (progn ;; (store (gensym "Foobar") *test-file*) ;; (let ((new (restore *test-file*))) ;; (list (symbol-package new) ;; (mismatch "Foobar" (symbol-name new))))) ;; (nil 6)) ;; This failed in cl-store < 0.5.5 ;; (deftest gensym.2 (let ((x (gensym))) ;; (store (list x x) *test-file*) ;; (let ((new (restore *test-file*))) ;; (eql (car new) (cadr new)))) ;; t) ;; cons (test-encoding cons.1 '(1 2 3)) (test-encoding cons.2 '((1 2 3))) (test-encoding cons.3 '(#\Space 1 1.2 1.3 #(1 2 3))) (test-encoding cons.4 '(1 . 2)) (test-encoding cons.5 '(t . nil)) (test-encoding cons.6 '(1 2 3 . 5)) ;; (deftest cons.7 (let ((list (cons nil nil))) ; '#1=(#1#))) ;; (setf (car list) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq ret (car ret)))) ;; t) ;; hash tables ;; for some reason (make-hash-table) is not equalp ;; to (make-hash-table) with ecl. #-openmcl(test-encoding hash.1 (make-hash-table)) #+openmcl(5am:test hash.1 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) #-openmcl(test-encoding hash.2 (make-hash-table :test #'equal)) #+openmcl(5am:test hash.2 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) ;; (defvar *hash* (let ((in (make-hash-table :test #'equal ;; :rehash-threshold 0.4 :size 20 ;; :rehash-size 40))) ;; (dotimes (x 1000) (setf (gethash (format nil "~R" x) in) x)) ;; in)) ;; (test-encoding hash.3 *hash*) (5am:test hash.3 (5am:skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/29")) ;; ;; packages ;; (test-encoding package.1 (find-package :cl-store)) ;; (defpackage foo ;; (:nicknames foobar) ;; (:use :cl) ;; (:shadow cl:format) ;; (:export bar)) ;; (defun package-restores () ;; (let (( *nuke-existing-packages* t)) ;; (store (find-package :foo) *test-file*) ;; (delete-package :foo) ;; (restore *test-file*) ;; (list (package-name (find-package :foo)) ;; (mapcar #'package-name (package-use-list :foo)) ;; (package-nicknames :foo) ;; (equalp (remove-duplicates (package-shadowing-symbols :foo)) ;; (list (find-symbol "FORMAT" "FOO"))) ;; (equalp (cl-store::external-symbols (find-package :foo)) ;; (make-array 1 :initial-element (find-symbol "BAR" "FOO")))))) ;; ; unfortunately it's difficult to portably test the internal symbols ;; ; in a package so we just assume that it's OK. ;; (deftest package.2 ;; (package-restores) ;; ("FOO" ("COMMON-LISP") ("FOOBAR") t t)) ;; ;; objects (define-persistent-class foo () ((x :update))) (define-persistent-class bar (foo) ((y :update))) ;; (deftest standard-object.1 ;; (let ((val (store (make-instance 'foo :x 3) *test-file*))) ;; (= (get-x val) (get-x (restore *test-file*)))) ;; t) ;; (deftest standard-object.2 ;; (let ((val (store (make-instance 'bar ;; :x (list 1 "foo" 1.0) ;; :y (vector 1 2 3 4)) ;; *test-file*))) ;; (let ((ret (restore *test-file*))) ;; (and (equalp (get-x val) (get-x ret)) ;; (equalp (get-y val) (get-y ret))))) ;; t) ;; (deftest standard-object.3 ;; (let ((*store-class-slots* nil) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (= (get-z (restore *test-file*)) ;; 2)) ;; t) ;; (deftest standard-object.4 ;; (let ((*store-class-slots* t) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (let ((ret (restore *test-file*))) ;; (= (get-z ret ) ;; 9))) ;; t) ;; ;; classes ;; (deftest standard-class.1 (progn (store (find-class 'foo) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.2 (progn (store (find-class 'bar) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.3 (progn (store (find-class 'baz) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; ;; conditions ;; (deftest condition.1 ;; (handler-case (/ 1 0) ;; (division-by-zero (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) 'division-by-zero))) ;; t) ;; (deftest condition.2 ;; (handler-case (car (read-from-string "3")) ;; ;; allegro pre 7.0 signalled a simple-error here ;; ((or type-error simple-error) (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) ;; '(or type-error simple-error)))) ;; t) ;; ;; structure-object ;; (defstruct a ;; a b c) ;; (defstruct (b (:include a)) ;; d e f) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.1 (make-a :a 1 :b 2 :c 3)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.2 (make-b :a 1 :b 2 :c 3 :d 4 :e 5 :f 6)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.3 (make-b :a 1 :b (make-a :a 1 :b 3 :c 2) ;; :c #\Space :d #(1 2 3) :e (list 1 2 3) ;; :f (make-hash-table))) ;; ;; setf test ;; (test-encoding setf.1 (setf (restore *test-file*) 0)) ;; (test-encoding setf.2 (incf (restore *test-file*))) ;; (test-encoding setf.3 (decf (restore *test-file*) 2)) ;; (test-encoding pathname.1 #P"/home/foo") ;; (test-encoding pathname.2 (make-pathname :name "foo")) ;; (test-encoding pathname.3 (make-pathname :name "foo" :type "bar")) ;; ; built-in classes ;; (test-encoding built-in.1 (find-class 'hash-table)) ;; (test-encoding built-in.2 (find-class 'integer)) ;; ;; find-backend tests ;; (deftest find-backend.1 ;; (and (find-backend 'cl-store) t) ;; t) ;; (deftest find-backend.2 ;; (find-backend (gensym)) ;; nil) ;; (deftest find-backend.3 ;; (handler-case (find-backend (gensym) t) ;; (error (c) (and c t)) ;; (:no-error (val) (and val nil))) ;; t) ;; ;; circular objects ;; (defvar circ1 (let ((x (list 1 2 3 4))) ;; (setf (cdr (last x)) x))) ;; (deftest circ.1 (progn (store circ1 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (cddddr x) x))) ;; t) ;; (defvar circ2 (let ((x (list 2 3 4 4 5))) ;; (setf (second x) x))) ;; (deftest circ.2 (progn (store circ2 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (second x) x))) ;; t) ;; (defvar circ3 (let ((x (list (list 1 2 3 4 ) ;; (list 5 6 7 8) ;; 9))) ;; (setf (second x) (car x)) ;; (setf (cdr (last x)) x) ;; x)) ;; (deftest circ.3 (progn (store circ3 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (second x) (car x)) ;; (eql (cdddr x) x)))) ;; t) ;; (defvar circ4 (let ((x (make-hash-table))) ;; (setf (gethash 'first x) (make-hash-table)) ;; (setf (gethash 'second x) (gethash 'first x)) ;; (setf (gethash 'inner (gethash 'first x)) x) ;; x)) ;; (deftest circ.4 (progn (store circ4 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (gethash 'first x) ;; (gethash 'second x)) ;; (eql x ;; (gethash 'inner ;; (gethash 'first x)))))) ;; t) ;; (deftest circ.5 (let ((circ5 (make-instance 'bar))) ;; (setf (get-y circ5) circ5) ;; (store circ5 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql x (get-y x)))) ;; t) ;; (defvar circ6 (let ((y (make-array '(2 2 2) ;; :initial-contents '((("foo" "bar") ;; ("me" "you")) ;; ((5 6) (7 8)))))) ;; (setf (aref y 1 1 1) y) ;; (setf (aref y 0 0 0) (aref y 1 1 1)) ;; y)) ;; (deftest circ.6 (progn (store circ6 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (aref x 1 1 1) x) ;; (eql (aref x 0 0 0) (aref x 1 1 1))))) ;; t) ;; (defvar circ7 (let ((x (make-a))) ;; (setf (a-a x) x))) ;; #+(or sbcl cmu lispworks) ;; (deftest circ.7 (progn (store circ7 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (a-a x) x))) ;; t) ;; (defvar circ.8 (let ((x "foo")) ;; (make-pathname :name x :type x))) ;; ;; clisp apparently creates a copy of the strings in a pathname ;; ;; so a test for eqness is pointless. ;; #-clisp ;; (deftest circ.8 (progn (store circ.8 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (pathname-name x) ;; (pathname-type x)))) ;; t) ;; (deftest circ.9 (let ((val (vector "foo" "bar" "baz" 1 2))) ;; (setf (aref val 3) val) ;; (setf (aref val 4) (aref val 0)) ;; (store val *test-file*) ;; (let ((rest (restore *test-file*))) ;; (and (eql rest (aref rest 3)) ;; (eql (aref rest 4) (aref rest 0))))) ;; t) ;; (deftest circ.10 (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; (setf (aref a3 1) a3) ;; (store a3 *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eql a3 (aref a3 1)))) ;; t) ;; (defvar circ.11 (let ((x (make-hash-table))) ;; (setf (gethash x x) x) ;; x)) ;; (deftest circ.11 (progn (store circ.11 *test-file*) ;; (let ((val (restore *test-file*))) ;; (eql val (gethash val val)))) ;; t) ;; (deftest circ.12 (let ((x (vector 1 2 "foo" 4 5))) ;; (setf (aref x 0) x) ;; (setf (aref x 1) (aref x 2)) ;; (store x *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eql (aref ret 0) ret) ;; (eql (aref ret 1) (aref ret 2))))) ;; t) ;; (defclass foo.1 () ;; ((a :accessor foo1-a))) ;; ;; a test from <NAME> which crashed in earlier ;; ;; versions (pre 0.2) ;; (deftest circ.13 (let ((foo (make-instance 'foo.1)) ;; (bar (make-instance 'foo.1))) ;; (setf (foo1-a foo) bar) ;; (setf (foo1-a bar) foo) ;; (store (list foo) *test-file*) ;; (let ((ret (car (restore *test-file*)))) ;; (and (eql ret (foo1-a (foo1-a ret))) ;; (eql (foo1-a ret) ;; (foo1-a (foo1-a (foo1-a ret))))))) ;; t) ;; (deftest circ.14 (let ((list '#1=(1 2 3 #1# . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ret)))) ;; t) ;; (deftest circ.15 (let ((list '#1=(1 2 3 #2=(#2#) . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ;; (car (fourth ret)))))) ;; t) ;; ;; this had me confused for a while since what was ;; ;; restored #1=(1 (#1#) #1#) looks nothing like this list, ;; ;; but it turns out that it is correct ;; (deftest circ.16 (let ((list '#1=(1 #2=(#1#) . #2#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (caadr ret)) ;; (eq ret (third ret))))) ;; t) ;; ;; large circular lists ;; (deftest large.1 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq (nthcdr 100000 ret) ret))) ;; t) ;; ;; large dotted lists ;; (test-encoding large.2 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) 'foo) ;; list)) ;; ;; custom storing ;; (defclass random-obj () ((size :accessor size :initarg :size))) ;; (defvar *random-obj-code* (register-code 100 'random-obj)) ;; (defstore-cl-store (obj random-obj buff) ;; (output-type-code *random-obj-code* buff) ;; (store-object (size obj) buff)) ;; (defrestore-cl-store (random-obj buff) ;; (random (restore-object buff))) ;; (deftest custom.1 ;; (progn (store (make-instance 'random-obj :size 5) *test-file* ) ;; (typep (restore *test-file*) '(integer 0 4))) ;; t) ;; (test-encoding function.1 #'restores) ;; (test-encoding function.2 #'car) ;; (test-encoding gfunction.1 #'cl-store:restore) ;; (test-encoding gfunction.2 #'cl-store:store) ;; #-clisp ;; (test-encoding gfunction.3 #'(setf get-y)) ;; (deftest nocirc.1 ;; (let* ((string "FOO") ;; (list `(,string . ,string)) ;; (*check-for-circs* nil)) ;; (store list *test-file*) ;; (let ((res (restore *test-file*))) ;; (and (not (eql (car res) (cdr res))) ;; (string= (car res) (cdr res))))) ;; t) ;; (defstruct st.bar x) ;; (defstruct (st.foo (:conc-name f-) ;; (:constructor fooo (z y x)) ;; (:copier cp-foo) ;; (:include st.bar) ;; (:predicate is-foo) ;; (:print-function (lambda (obj st dep) ;; (declare (ignore dep)) ;; (print-unreadable-object (obj st :type t) ;; (format st "~A" (f-x obj)))))) ;; (y 0 :type integer) (z nil :type simple-string)) ;; #+(or sbcl cmu) ;; (deftest struct-class.1 ;; (let* ((obj (fooo "Z" 2 3)) ;; (string (format nil "~A" obj))) ;; (let ((*nuke-existing-classes* t)) ;; (store (find-class 'st.foo) *test-file*) ;; (fmakunbound 'cp-foo) ;; (fmakunbound 'is-foo) ;; (fmakunbound 'fooo) ;; (fmakunbound 'f-x) ;; (fmakunbound 'f-y) ;; (fmakunbound 'f-z) ;; (restore *test-file*) ;; (let* ((new-obj (cp-foo (fooo "Z" 2 3))) ;; (new-string (format nil "~A" new-obj))) ;; (list (is-foo new-obj) (equalp obj new-obj) ;; (string= new-string string) ;; (f-x new-obj) (f-y new-obj) (f-z new-obj))))) ;; (t t t 3 2 "Z")) ;; (defun run-tests (backend) ;; (with-backend backend ;; (regression-5am:do-tests)) ;; (when (probe-file *test-file*) ;; (ignore-errors (delete-file *test-file*))))
true
(in-package :bknr.datastore) (5am:def-suite :bknr.datastore) (5am:in-suite :bknr.datastore) (defun files-identical-content-p (path-a path-b) "Are files of PATH-A and PATH-B byte per byte identical?" (with-open-file (in-a path-a :element-type '(unsigned-byte 8)) (with-open-file (in-b path-b :element-type '(unsigned-byte 8)) (loop for byte-a = (read-byte in-a nil nil) for byte-b = (read-byte in-b nil nil) while (or byte-a byte-b) unless (and byte-a byte-b (= byte-a byte-b)) return nil finally (return t))))) (defun congruent-p (a b) "Are lisp value A and B (deeply) congruent?" (bknr.utils:with-temporary-file (path-a) (bknr.utils:with-temporary-file (path-b) (cl-store:store a path-a) (cl-store:store b path-b) (prog1 (files-identical-content-p path-a path-b) (delete-file path-a) (delete-file path-b))))) (defun copy-by-encoding (value) (bknr.utils:with-temporary-file (path) (with-open-file (out path :direction :output :if-exists :supersede :element-type '(unsigned-byte 8)) (encode value out)) (with-open-file (in path :element-type '(unsigned-byte 8)) (decode in)))) (defmacro test-encoding (name value) (let ((options (alexandria:ensure-list name))) (destructuring-bind (name &key skip) options `(5am:test ,name ,(if skip `(5am:skip ,skip) `(5am:is (congruent-p ,value (copy-by-encoding ,value)))))))) (test-encoding list.1 '(1 2 3)) (test-encoding list.len.30 (loop repeat 30 collect 'x)) (test-encoding list.len.254 (loop repeat 254 collect 'x)) (test-encoding list.len.255 (loop repeat 255 collect 'x)) (test-encoding list.len.256 (loop repeat 256 collect 'x)) (test-encoding list.len.257 (loop repeat 257 collect 'x)) (test-encoding list.len.3000 (loop repeat 3000 collect 'x)) (test-encoding improper-list.1 '(1 2 3 4 . 5)) (test-encoding cons.1 '(1 . 2)) ;;; from cl-store :) (test-encoding integer.1 1) (test-encoding integer.2 0) (test-encoding integer.3 23423333333333333333333333423102334) (test-encoding integer.4 -2322993) (test-encoding integer.5 most-positive-fixnum) (test-encoding integer.6 most-negative-fixnum) ;; ratios (test-encoding ratio.1 1/2) (test-encoding ratio.2 234232/23434) (test-encoding ratio.3 -12/2) (test-encoding ratio.4 -6/11) (test-encoding ratio.5 23222/13) ;; complex numbers - currently not supported ;; (test-encoding complex.1 #C(0 1)) ;; (test-encoding complex.2 #C(0.0 1.0)) ;; (test-encoding complex.3 #C(32 -23455)) ;; (test-encoding complex.4 #C(-222.32 2322.21)) ;; (test-encoding complex.5 #C(-111 -1123)) ;; (test-encoding complex.6 #C(-11.2 -34.5)) ;; single-float (test-encoding single-float.1 3244.32) (test-encoding single-float.2 0.12) (test-encoding single-float.3 -233.001) (test-encoding single-float.4 most-positive-single-float) (test-encoding single-float.5 most-negative-single-float) ;; double-float (test-encoding double-float.1 2343.3d0) (test-encoding double-float.2 -1211111.3343d0) (test-encoding double-float.3 99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.4 -99999999999123456789012345678222222222222290.0987654321d0) (test-encoding double-float.5 most-positive-double-float) (test-encoding double-float.6 most-negative-double-float) ;; characters (test-encoding char.1 #\Space) (test-encoding char.2 #\f ) (test-encoding char.3 #\Rubout) (test-encoding char.4 (code-char 255)) (5am:test char.random (5am:for-all ((char (5am:gen-character))) (5am:is (char= char (copy-by-encoding char))))) ;; strings (5am:test string.random (5am:for-all ((string (5am:gen-string))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.random.code-limited (5am:for-all ((string (5am:gen-string :elements (5am:gen-character :code-limit 10000)))) (5am:is (string= string (copy-by-encoding string))))) (5am:test string.decode-utf-8 (labels ((decode-string-from-octets (octets) (flexi-streams:with-input-from-sequence (in octets) (bknr.datastore::%decode-string in)))) (5am:is (string-equal "<=>" (decode-string-from-octets #(1 3 60 61 62)))) ;; #\? is the substitution char (string-equal "<?>" (decode-string-from-octets #(1 3 60 188 62))) ;; PI:NAME:<NAME>END_PIian 2008-03-20: the following for-all test failed on ccl, ;; because the correct utf-8 sequence could produce a char-code ;; above char-code-limit - bknr.datastore::%decode-string should ;; throw an error in this case, but I dont know how to test this ;; (5am:for-all ((octets (5am:gen-buffer))) ;; (5am:finishes (decode-string-from-octets (concatenate 'vector (vector 1 (length octets)) octets)))) )) ;; #+(or (and sbcl sb-unicode) lispworks clisp acl) ;; (progn ;; (test-encoding unicode.1 (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB))) ;; (test-encoding unicode.2 (intern (map #-lispworks 'string ;; #+lispworks 'lw:text-string ;; #'code-char (list #X20AC #X3BB)) ;; :pwgl-test-suite))) ;; vectors (test-encoding vector.1 #(1 2 3 4)) (test-encoding vector.2 (make-array 5 :element-type 'fixnum :initial-contents (list 1 2 3 4 5))) (test-encoding vector.4 #*101101101110) (test-encoding vector.3 (make-array 5 :element-type 'fixnum :fill-pointer 2 :initial-contents (list 1 2 3 4 5))) (test-encoding vector.5 #*) (test-encoding vector.6 #()) ;; arrays (test-encoding array.1 (make-array '(2 2) :initial-contents '((1 2) (3 4)))) (test-encoding array.2 (make-array '(2 2) :initial-contents '((1 1) (1 1)))) (test-encoding array.3 (make-array '(2 2) :element-type 'fixnum :initial-element 3)) (test-encoding (array.3b :skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/31") (make-array '(2 2) :element-type '(mod 10) :initial-element 3)) (test-encoding array.4 (make-array '(2 3 5) :initial-contents '(((1 2 #\f 5 12.0) (#\Space 0 4 1 0) ('d 0 #() 3 -1)) ((0 #\a #\b 4 #\q) (12.0d0 0 '(d) 4 1) (#\Newline 1 7 #\4 #\0))))) ;; (test-encoding array.5 ;; (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; a3)) ;; symbols (test-encoding symbol.1 t) (test-encoding symbol.2 nil) (test-encoding symbol.3 :foo) (test-encoding symbol.4 'bknr.datastore::foo) (test-encoding symbol.5 'make-hash-table) (test-encoding symbol.6 '|foo bar|) (test-encoding symbol.7 'foo\ bar\ baz) ;; (deftest gensym.1 (progn ;; (store (gensym "Foobar") *test-file*) ;; (let ((new (restore *test-file*))) ;; (list (symbol-package new) ;; (mismatch "Foobar" (symbol-name new))))) ;; (nil 6)) ;; This failed in cl-store < 0.5.5 ;; (deftest gensym.2 (let ((x (gensym))) ;; (store (list x x) *test-file*) ;; (let ((new (restore *test-file*))) ;; (eql (car new) (cadr new)))) ;; t) ;; cons (test-encoding cons.1 '(1 2 3)) (test-encoding cons.2 '((1 2 3))) (test-encoding cons.3 '(#\Space 1 1.2 1.3 #(1 2 3))) (test-encoding cons.4 '(1 . 2)) (test-encoding cons.5 '(t . nil)) (test-encoding cons.6 '(1 2 3 . 5)) ;; (deftest cons.7 (let ((list (cons nil nil))) ; '#1=(#1#))) ;; (setf (car list) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq ret (car ret)))) ;; t) ;; hash tables ;; for some reason (make-hash-table) is not equalp ;; to (make-hash-table) with ecl. #-openmcl(test-encoding hash.1 (make-hash-table)) #+openmcl(5am:test hash.1 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) #-openmcl(test-encoding hash.2 (make-hash-table :test #'equal)) #+openmcl(5am:test hash.2 (5am:skip "the hash-table-size is not preserved - do we need to fix this?")) ;; (defvar *hash* (let ((in (make-hash-table :test #'equal ;; :rehash-threshold 0.4 :size 20 ;; :rehash-size 40))) ;; (dotimes (x 1000) (setf (gethash (format nil "~R" x) in) x)) ;; in)) ;; (test-encoding hash.3 *hash*) (5am:test hash.3 (5am:skip "will be fixed later - http://trac.common-lisp.net/bknr/ticket/29")) ;; ;; packages ;; (test-encoding package.1 (find-package :cl-store)) ;; (defpackage foo ;; (:nicknames foobar) ;; (:use :cl) ;; (:shadow cl:format) ;; (:export bar)) ;; (defun package-restores () ;; (let (( *nuke-existing-packages* t)) ;; (store (find-package :foo) *test-file*) ;; (delete-package :foo) ;; (restore *test-file*) ;; (list (package-name (find-package :foo)) ;; (mapcar #'package-name (package-use-list :foo)) ;; (package-nicknames :foo) ;; (equalp (remove-duplicates (package-shadowing-symbols :foo)) ;; (list (find-symbol "FORMAT" "FOO"))) ;; (equalp (cl-store::external-symbols (find-package :foo)) ;; (make-array 1 :initial-element (find-symbol "BAR" "FOO")))))) ;; ; unfortunately it's difficult to portably test the internal symbols ;; ; in a package so we just assume that it's OK. ;; (deftest package.2 ;; (package-restores) ;; ("FOO" ("COMMON-LISP") ("FOOBAR") t t)) ;; ;; objects (define-persistent-class foo () ((x :update))) (define-persistent-class bar (foo) ((y :update))) ;; (deftest standard-object.1 ;; (let ((val (store (make-instance 'foo :x 3) *test-file*))) ;; (= (get-x val) (get-x (restore *test-file*)))) ;; t) ;; (deftest standard-object.2 ;; (let ((val (store (make-instance 'bar ;; :x (list 1 "foo" 1.0) ;; :y (vector 1 2 3 4)) ;; *test-file*))) ;; (let ((ret (restore *test-file*))) ;; (and (equalp (get-x val) (get-x ret)) ;; (equalp (get-y val) (get-y ret))))) ;; t) ;; (deftest standard-object.3 ;; (let ((*store-class-slots* nil) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (= (get-z (restore *test-file*)) ;; 2)) ;; t) ;; (deftest standard-object.4 ;; (let ((*store-class-slots* t) ;; (val (make-instance 'baz :z 9))) ;; (store val *test-file*) ;; (make-instance 'baz :z 2) ;; (let ((ret (restore *test-file*))) ;; (= (get-z ret ) ;; 9))) ;; t) ;; ;; classes ;; (deftest standard-class.1 (progn (store (find-class 'foo) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.2 (progn (store (find-class 'bar) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; (deftest standard-class.3 (progn (store (find-class 'baz) *test-file*) ;; (restore *test-file*) ;; t) ;; t) ;; ;; conditions ;; (deftest condition.1 ;; (handler-case (/ 1 0) ;; (division-by-zero (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) 'division-by-zero))) ;; t) ;; (deftest condition.2 ;; (handler-case (car (read-from-string "3")) ;; ;; allegro pre 7.0 signalled a simple-error here ;; ((or type-error simple-error) (c) ;; (store c *test-file*) ;; (typep (restore *test-file*) ;; '(or type-error simple-error)))) ;; t) ;; ;; structure-object ;; (defstruct a ;; a b c) ;; (defstruct (b (:include a)) ;; d e f) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.1 (make-a :a 1 :b 2 :c 3)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.2 (make-b :a 1 :b 2 :c 3 :d 4 :e 5 :f 6)) ;; #+(or sbcl cmu lispworks openmcl) ;; (test-encoding structure-object.3 (make-b :a 1 :b (make-a :a 1 :b 3 :c 2) ;; :c #\Space :d #(1 2 3) :e (list 1 2 3) ;; :f (make-hash-table))) ;; ;; setf test ;; (test-encoding setf.1 (setf (restore *test-file*) 0)) ;; (test-encoding setf.2 (incf (restore *test-file*))) ;; (test-encoding setf.3 (decf (restore *test-file*) 2)) ;; (test-encoding pathname.1 #P"/home/foo") ;; (test-encoding pathname.2 (make-pathname :name "foo")) ;; (test-encoding pathname.3 (make-pathname :name "foo" :type "bar")) ;; ; built-in classes ;; (test-encoding built-in.1 (find-class 'hash-table)) ;; (test-encoding built-in.2 (find-class 'integer)) ;; ;; find-backend tests ;; (deftest find-backend.1 ;; (and (find-backend 'cl-store) t) ;; t) ;; (deftest find-backend.2 ;; (find-backend (gensym)) ;; nil) ;; (deftest find-backend.3 ;; (handler-case (find-backend (gensym) t) ;; (error (c) (and c t)) ;; (:no-error (val) (and val nil))) ;; t) ;; ;; circular objects ;; (defvar circ1 (let ((x (list 1 2 3 4))) ;; (setf (cdr (last x)) x))) ;; (deftest circ.1 (progn (store circ1 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (cddddr x) x))) ;; t) ;; (defvar circ2 (let ((x (list 2 3 4 4 5))) ;; (setf (second x) x))) ;; (deftest circ.2 (progn (store circ2 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (second x) x))) ;; t) ;; (defvar circ3 (let ((x (list (list 1 2 3 4 ) ;; (list 5 6 7 8) ;; 9))) ;; (setf (second x) (car x)) ;; (setf (cdr (last x)) x) ;; x)) ;; (deftest circ.3 (progn (store circ3 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (second x) (car x)) ;; (eql (cdddr x) x)))) ;; t) ;; (defvar circ4 (let ((x (make-hash-table))) ;; (setf (gethash 'first x) (make-hash-table)) ;; (setf (gethash 'second x) (gethash 'first x)) ;; (setf (gethash 'inner (gethash 'first x)) x) ;; x)) ;; (deftest circ.4 (progn (store circ4 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (gethash 'first x) ;; (gethash 'second x)) ;; (eql x ;; (gethash 'inner ;; (gethash 'first x)))))) ;; t) ;; (deftest circ.5 (let ((circ5 (make-instance 'bar))) ;; (setf (get-y circ5) circ5) ;; (store circ5 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql x (get-y x)))) ;; t) ;; (defvar circ6 (let ((y (make-array '(2 2 2) ;; :initial-contents '((("foo" "bar") ;; ("me" "you")) ;; ((5 6) (7 8)))))) ;; (setf (aref y 1 1 1) y) ;; (setf (aref y 0 0 0) (aref y 1 1 1)) ;; y)) ;; (deftest circ.6 (progn (store circ6 *test-file*) ;; (let ((x (restore *test-file*))) ;; (and (eql (aref x 1 1 1) x) ;; (eql (aref x 0 0 0) (aref x 1 1 1))))) ;; t) ;; (defvar circ7 (let ((x (make-a))) ;; (setf (a-a x) x))) ;; #+(or sbcl cmu lispworks) ;; (deftest circ.7 (progn (store circ7 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (a-a x) x))) ;; t) ;; (defvar circ.8 (let ((x "foo")) ;; (make-pathname :name x :type x))) ;; ;; clisp apparently creates a copy of the strings in a pathname ;; ;; so a test for eqness is pointless. ;; #-clisp ;; (deftest circ.8 (progn (store circ.8 *test-file*) ;; (let ((x (restore *test-file*))) ;; (eql (pathname-name x) ;; (pathname-type x)))) ;; t) ;; (deftest circ.9 (let ((val (vector "foo" "bar" "baz" 1 2))) ;; (setf (aref val 3) val) ;; (setf (aref val 4) (aref val 0)) ;; (store val *test-file*) ;; (let ((rest (restore *test-file*))) ;; (and (eql rest (aref rest 3)) ;; (eql (aref rest 4) (aref rest 0))))) ;; t) ;; (deftest circ.10 (let* ((a1 (make-array 5)) ;; (a2 (make-array 4 :displaced-to a1 ;; :displaced-index-offset 1)) ;; (a3 (make-array 2 :displaced-to a2 ;; :displaced-index-offset 2))) ;; (setf (aref a3 1) a3) ;; (store a3 *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eql a3 (aref a3 1)))) ;; t) ;; (defvar circ.11 (let ((x (make-hash-table))) ;; (setf (gethash x x) x) ;; x)) ;; (deftest circ.11 (progn (store circ.11 *test-file*) ;; (let ((val (restore *test-file*))) ;; (eql val (gethash val val)))) ;; t) ;; (deftest circ.12 (let ((x (vector 1 2 "foo" 4 5))) ;; (setf (aref x 0) x) ;; (setf (aref x 1) (aref x 2)) ;; (store x *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eql (aref ret 0) ret) ;; (eql (aref ret 1) (aref ret 2))))) ;; t) ;; (defclass foo.1 () ;; ((a :accessor foo1-a))) ;; ;; a test from PI:NAME:<NAME>END_PI which crashed in earlier ;; ;; versions (pre 0.2) ;; (deftest circ.13 (let ((foo (make-instance 'foo.1)) ;; (bar (make-instance 'foo.1))) ;; (setf (foo1-a foo) bar) ;; (setf (foo1-a bar) foo) ;; (store (list foo) *test-file*) ;; (let ((ret (car (restore *test-file*)))) ;; (and (eql ret (foo1-a (foo1-a ret))) ;; (eql (foo1-a ret) ;; (foo1-a (foo1-a (foo1-a ret))))))) ;; t) ;; (deftest circ.14 (let ((list '#1=(1 2 3 #1# . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ret)))) ;; t) ;; (deftest circ.15 (let ((list '#1=(1 2 3 #2=(#2#) . #1#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (cddddr ret)) ;; (eq (fourth ret) ;; (car (fourth ret)))))) ;; t) ;; ;; this had me confused for a while since what was ;; ;; restored #1=(1 (#1#) #1#) looks nothing like this list, ;; ;; but it turns out that it is correct ;; (deftest circ.16 (let ((list '#1=(1 #2=(#1#) . #2#))) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (and (eq ret (caadr ret)) ;; (eq ret (third ret))))) ;; t) ;; ;; large circular lists ;; (deftest large.1 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) list) ;; (store list *test-file*) ;; (let ((ret (restore *test-file*))) ;; (eq (nthcdr 100000 ret) ret))) ;; t) ;; ;; large dotted lists ;; (test-encoding large.2 (let ((list (make-list 100000))) ;; (setf (cdr (last list)) 'foo) ;; list)) ;; ;; custom storing ;; (defclass random-obj () ((size :accessor size :initarg :size))) ;; (defvar *random-obj-code* (register-code 100 'random-obj)) ;; (defstore-cl-store (obj random-obj buff) ;; (output-type-code *random-obj-code* buff) ;; (store-object (size obj) buff)) ;; (defrestore-cl-store (random-obj buff) ;; (random (restore-object buff))) ;; (deftest custom.1 ;; (progn (store (make-instance 'random-obj :size 5) *test-file* ) ;; (typep (restore *test-file*) '(integer 0 4))) ;; t) ;; (test-encoding function.1 #'restores) ;; (test-encoding function.2 #'car) ;; (test-encoding gfunction.1 #'cl-store:restore) ;; (test-encoding gfunction.2 #'cl-store:store) ;; #-clisp ;; (test-encoding gfunction.3 #'(setf get-y)) ;; (deftest nocirc.1 ;; (let* ((string "FOO") ;; (list `(,string . ,string)) ;; (*check-for-circs* nil)) ;; (store list *test-file*) ;; (let ((res (restore *test-file*))) ;; (and (not (eql (car res) (cdr res))) ;; (string= (car res) (cdr res))))) ;; t) ;; (defstruct st.bar x) ;; (defstruct (st.foo (:conc-name f-) ;; (:constructor fooo (z y x)) ;; (:copier cp-foo) ;; (:include st.bar) ;; (:predicate is-foo) ;; (:print-function (lambda (obj st dep) ;; (declare (ignore dep)) ;; (print-unreadable-object (obj st :type t) ;; (format st "~A" (f-x obj)))))) ;; (y 0 :type integer) (z nil :type simple-string)) ;; #+(or sbcl cmu) ;; (deftest struct-class.1 ;; (let* ((obj (fooo "Z" 2 3)) ;; (string (format nil "~A" obj))) ;; (let ((*nuke-existing-classes* t)) ;; (store (find-class 'st.foo) *test-file*) ;; (fmakunbound 'cp-foo) ;; (fmakunbound 'is-foo) ;; (fmakunbound 'fooo) ;; (fmakunbound 'f-x) ;; (fmakunbound 'f-y) ;; (fmakunbound 'f-z) ;; (restore *test-file*) ;; (let* ((new-obj (cp-foo (fooo "Z" 2 3))) ;; (new-string (format nil "~A" new-obj))) ;; (list (is-foo new-obj) (equalp obj new-obj) ;; (string= new-string string) ;; (f-x new-obj) (f-y new-obj) (f-z new-obj))))) ;; (t t t 3 2 "Z")) ;; (defun run-tests (backend) ;; (with-backend backend ;; (regression-5am:do-tests)) ;; (when (probe-file *test-file*) ;; (ignore-errors (delete-file *test-file*))))
[ { "context": ".0.0\")\n(defparameter *copyright*\n \"Copyright 2018 Pascal Bourguignon\nLicense: Apache 2.0\")\n(load (merge-pathnames \"loa", "end": 594, "score": 0.9998852014541626, "start": 576, "tag": "NAME", "value": "Pascal Bourguignon" } ]
sources-cl/generate-executable.lisp
informatimago/scquery
0
(in-package "COMMON-LISP-USER") (defun say (format-string &rest arguments) (format t "~%;;; ~?~%" format-string arguments) (force-output)) ;;; -------------------------------------------------------------------- ;;; Load quicklisp (say "Loading quicklisp.") (load #P"~/quicklisp/setup.lisp") (setf quicklisp-client:*quickload-verbose* t) ;;; -------------------------------------------------------------------- ;;; Load the application: (defparameter *program-name* "scquery-cl") (defparameter *version* "0.0.0") (defparameter *copyright* "Copyright 2018 Pascal Bourguignon License: Apache 2.0") (load (merge-pathnames "loader.lisp" *load-pathname*)) (ql:quickload :com.informatimago.common-lisp.cesarum) ;;; -------------------------------------------------------------------- ;;; Save the application package. (say "Generating ~A." *program-name*) (shadow 'copy-file) (defun copy-file (source destination) (ensure-directories-exist destination) (say "Copying ~A." destination) (com.informatimago.common-lisp.cesarum.file:copy-file source destination :element-type '(unsigned-byte 8) :if-exists :supersede)) (defun save-program () #+ccl (ccl::save-application ; This doesn't return. *program-name* :toplevel-function (lambda () (handler-case (ccl:quit (let ((result (scquery:main (first ccl:*command-line-argument-list*) (rest ccl:*command-line-argument-list*)))) (finish-output *standard-output*) (finish-output *error-output*) (cond ((typep result '(signed-byte 32)) result) ((null result) 0) (t 1)))) (error (err) (format *error-output* "~%~A~%" err) (finish-output *error-output*) (ccl:quit 1)))) :init-file nil :error-handler :quit :purify t :mode #o755 :prepend-kernel t)) (save-program)
90980
(in-package "COMMON-LISP-USER") (defun say (format-string &rest arguments) (format t "~%;;; ~?~%" format-string arguments) (force-output)) ;;; -------------------------------------------------------------------- ;;; Load quicklisp (say "Loading quicklisp.") (load #P"~/quicklisp/setup.lisp") (setf quicklisp-client:*quickload-verbose* t) ;;; -------------------------------------------------------------------- ;;; Load the application: (defparameter *program-name* "scquery-cl") (defparameter *version* "0.0.0") (defparameter *copyright* "Copyright 2018 <NAME> License: Apache 2.0") (load (merge-pathnames "loader.lisp" *load-pathname*)) (ql:quickload :com.informatimago.common-lisp.cesarum) ;;; -------------------------------------------------------------------- ;;; Save the application package. (say "Generating ~A." *program-name*) (shadow 'copy-file) (defun copy-file (source destination) (ensure-directories-exist destination) (say "Copying ~A." destination) (com.informatimago.common-lisp.cesarum.file:copy-file source destination :element-type '(unsigned-byte 8) :if-exists :supersede)) (defun save-program () #+ccl (ccl::save-application ; This doesn't return. *program-name* :toplevel-function (lambda () (handler-case (ccl:quit (let ((result (scquery:main (first ccl:*command-line-argument-list*) (rest ccl:*command-line-argument-list*)))) (finish-output *standard-output*) (finish-output *error-output*) (cond ((typep result '(signed-byte 32)) result) ((null result) 0) (t 1)))) (error (err) (format *error-output* "~%~A~%" err) (finish-output *error-output*) (ccl:quit 1)))) :init-file nil :error-handler :quit :purify t :mode #o755 :prepend-kernel t)) (save-program)
true
(in-package "COMMON-LISP-USER") (defun say (format-string &rest arguments) (format t "~%;;; ~?~%" format-string arguments) (force-output)) ;;; -------------------------------------------------------------------- ;;; Load quicklisp (say "Loading quicklisp.") (load #P"~/quicklisp/setup.lisp") (setf quicklisp-client:*quickload-verbose* t) ;;; -------------------------------------------------------------------- ;;; Load the application: (defparameter *program-name* "scquery-cl") (defparameter *version* "0.0.0") (defparameter *copyright* "Copyright 2018 PI:NAME:<NAME>END_PI License: Apache 2.0") (load (merge-pathnames "loader.lisp" *load-pathname*)) (ql:quickload :com.informatimago.common-lisp.cesarum) ;;; -------------------------------------------------------------------- ;;; Save the application package. (say "Generating ~A." *program-name*) (shadow 'copy-file) (defun copy-file (source destination) (ensure-directories-exist destination) (say "Copying ~A." destination) (com.informatimago.common-lisp.cesarum.file:copy-file source destination :element-type '(unsigned-byte 8) :if-exists :supersede)) (defun save-program () #+ccl (ccl::save-application ; This doesn't return. *program-name* :toplevel-function (lambda () (handler-case (ccl:quit (let ((result (scquery:main (first ccl:*command-line-argument-list*) (rest ccl:*command-line-argument-list*)))) (finish-output *standard-output*) (finish-output *error-output*) (cond ((typep result '(signed-byte 32)) result) ((null result) 0) (t 1)))) (error (err) (format *error-output* "~%~A~%" err) (finish-output *error-output*) (ccl:quit 1)))) :init-file nil :error-handler :quit :purify t :mode #o755 :prepend-kernel t)) (save-program)
[ { "context": "|\n This file is a part of 3d-matrices\n (c) 2016 Shirakumo http://tymoon.eu ([email protected])\n Author: Ni", "end": 58, "score": 0.8055478930473328, "start": 51, "tag": "NAME", "value": "irakumo" }, { "context": "3d-matrices\n (c) 2016 Shirakumo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n", "end": 95, "score": 0.9998636245727539, "start": 77, "tag": "EMAIL", "value": "[email protected]" }, { "context": "umo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(asdf:defsystem 3d-matri", "end": 120, "score": 0.9998870491981506, "start": 106, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": ".eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(asdf:defsystem 3d-matrices-test\n :version ", "end": 140, "score": 0.9999010562896729, "start": 122, "tag": "EMAIL", "value": "[email protected]" }, { "context": "t\n :version \"1.0.0\"\n :license \"zlib\"\n :author \"Nicolas Hafner <[email protected]>\"\n :maintainer \"Nicolas Hafn", "end": 241, "score": 0.9998895525932312, "start": 227, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": "0.0\"\n :license \"zlib\"\n :author \"Nicolas Hafner <[email protected]>\"\n :maintainer \"Nicolas Hafner <shinmera@tymoon.", "end": 261, "score": 0.999889612197876, "start": 243, "tag": "EMAIL", "value": "[email protected]" }, { "context": "colas Hafner <[email protected]>\"\n :maintainer \"Nicolas Hafner <[email protected]>\"\n :description \"Tests for t", "end": 293, "score": 0.9998903274536133, "start": 279, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": "[email protected]>\"\n :maintainer \"Nicolas Hafner <[email protected]>\"\n :description \"Tests for the 3d-matrices syste", "end": 313, "score": 0.9998761415481567, "start": 295, "tag": "EMAIL", "value": "[email protected]" }, { "context": "sues\"\n :source-control (:git \"https://github.com/Shinmera/3d-matrices.git\")\n :serial T\n :components ((:fi", "end": 537, "score": 0.8385018110275269, "start": 529, "tag": "USERNAME", "value": "Shinmera" } ]
3d-matrices-test.asd
bj-ro/3d-matrices
21
#| This file is a part of 3d-matrices (c) 2016 Shirakumo http://tymoon.eu ([email protected]) Author: Nicolas Hafner <[email protected]> |# (asdf:defsystem 3d-matrices-test :version "1.0.0" :license "zlib" :author "Nicolas Hafner <[email protected]>" :maintainer "Nicolas Hafner <[email protected]>" :description "Tests for the 3d-matrices system." :homepage "https://Shinmera.github.io/3d-matrices/" :bug-tracker "https://github.com/Shinmera/3d-matrices/issues" :source-control (:git "https://github.com/Shinmera/3d-matrices.git") :serial T :components ((:file "test")) :depends-on (:3d-matrices :parachute) :perform (asdf:test-op (op c) (uiop:symbol-call :parachute :test :3d-matrices-test)))
37873
#| This file is a part of 3d-matrices (c) 2016 Sh<NAME> http://tymoon.eu (<EMAIL>) Author: <NAME> <<EMAIL>> |# (asdf:defsystem 3d-matrices-test :version "1.0.0" :license "zlib" :author "<NAME> <<EMAIL>>" :maintainer "<NAME> <<EMAIL>>" :description "Tests for the 3d-matrices system." :homepage "https://Shinmera.github.io/3d-matrices/" :bug-tracker "https://github.com/Shinmera/3d-matrices/issues" :source-control (:git "https://github.com/Shinmera/3d-matrices.git") :serial T :components ((:file "test")) :depends-on (:3d-matrices :parachute) :perform (asdf:test-op (op c) (uiop:symbol-call :parachute :test :3d-matrices-test)))
true
#| This file is a part of 3d-matrices (c) 2016 ShPI:NAME:<NAME>END_PI http://tymoon.eu (PI:EMAIL:<EMAIL>END_PI) Author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> |# (asdf:defsystem 3d-matrices-test :version "1.0.0" :license "zlib" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :maintainer "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :description "Tests for the 3d-matrices system." :homepage "https://Shinmera.github.io/3d-matrices/" :bug-tracker "https://github.com/Shinmera/3d-matrices/issues" :source-control (:git "https://github.com/Shinmera/3d-matrices.git") :serial T :components ((:file "test")) :depends-on (:3d-matrices :parachute) :perform (asdf:test-op (op c) (uiop:symbol-call :parachute :test :3d-matrices-test)))
[ { "context": "is a part of cl-cuda project.\n Copyright (c) 2012 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(d", "end": 81, "score": 0.9998305439949036, "start": 66, "tag": "NAME", "value": "Masayuki Takagi" }, { "context": "da project.\n Copyright (c) 2012 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(defpackage cl-cuda-mi", "end": 101, "score": 0.9999259114265442, "start": 83, "tag": "EMAIL", "value": "[email protected]" } ]
misc/package.lisp
digikar99/cl-cuda
222
#| This file is a part of cl-cuda project. Copyright (c) 2012 Masayuki Takagi ([email protected]) |# (in-package :cl-user) (defpackage cl-cuda-misc (:use :cl) (:export :convert-error-string))
19924
#| This file is a part of cl-cuda project. Copyright (c) 2012 <NAME> (<EMAIL>) |# (in-package :cl-user) (defpackage cl-cuda-misc (:use :cl) (:export :convert-error-string))
true
#| This file is a part of cl-cuda project. Copyright (c) 2012 PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) |# (in-package :cl-user) (defpackage cl-cuda-misc (:use :cl) (:export :convert-error-string))
[ { "context": ";; Demo Program 1 - Lee Mac\n;;\n;; Basic Implementation (no keyboard input)\n;;", "end": 29, "score": 0.9804877042770386, "start": 22, "tag": "NAME", "value": "Lee Mac" }, { "context": " )\n (redraw) (princ)\n)\n\n;; Demo Program 2 - Lee Mac\n;;\n;; Full Implementation (osnap toggle / keyboar", "end": 795, "score": 0.983445405960083, "start": 788, "tag": "NAME", "value": "Lee Mac" }, { "context": " )\n (redraw) (princ)\n)\n\n;; Demo Program 3 - Lee Mac\n;;\n;; Full Implementation with Vector Graphics\n;;", "end": 3682, "score": 0.9856158494949341, "start": 3675, "tag": "NAME", "value": "Lee Mac" }, { "context": " )\n (redraw) (princ)\n)\n\n;; Matrix Transpose - Doug Wilson\n;; Args: m - nxn matrix\n \n(defun trp ( m )\n (a", "end": 7875, "score": 0.9998165369033813, "start": 7864, "tag": "NAME", "value": "Doug Wilson" }, { "context": "'mapcar (cons 'list m))\n)\n \n;; Matrix x Matrix - Vladimir Nesterovsky\n;; Args: m,n - nxn matrices\n \n(defun mxm ( m n )\n", "end": 8001, "score": 0.9998129606246948, "start": 7981, "tag": "NAME", "value": "Vladimir Nesterovsky" }, { "context": "(mxv a r)) m)) (trp n))\n)\n \n;; Matrix x Vector - Vladimir Nesterovsky\n;; Args: m - nxn matrix, v - vector in R^n\n \n(def", "end": 8164, "score": 0.9997952580451965, "start": 8144, "tag": "NAME", "value": "Vladimir Nesterovsky" } ]
Dump folder/GrSnapDemo.lsp
dtgoitia/autolisp
30
;; Demo Program 1 - Lee Mac ;; ;; Basic Implementation (no keyboard input) ;; Prompts the user to pick a point and creates a POINT entity at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test1 ( / *error* grr osf osm ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) ) (princ "\nPick point: ") (while (= 5 (car (setq grr (grread t 15 0)))) (redraw) (osf (cadr grr) osm) ) (if (listp (cadr grr)) (entmake (list '(0 . "POINT") (cons 10 (trans (osf (cadr grr) osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 2 - Lee Mac ;; ;; Full Implementation (osnap toggle / keyboard point input / osnap modifiers) ;; Prompts the user to specify a point and creates a POINT entity at the point specified. ;; ;; Requires GrSnap.lsp (defun c:test2 ( / *error* gr1 gr2 msg osf osm pt1 str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "POINT") (cons 10 (trans (osf gr2 osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 3 - Lee Mac ;; ;; Full Implementation with Vector Graphics ;; Prompts the user to specify the center of a circle and creates a circle with radius 1/20th ;; of the screen height, centered at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test3 ( / *error* ang fac gr1 gr2 inc lst mat msg ocs osf osm pt1 rad str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq fac 20.0 ang 0.0 inc (/ pi 25.0) ) (repeat 50 (setq lst (cons (list (cos ang) (sin ang)) lst) ang (+ ang inc) ) ) (setq lst (cons 1 (apply 'append (mapcar 'list (cons (last lst) lst) lst))) mat (trp (mapcar '(lambda ( x ) (trans x 1 2 t)) '((1.0 0.0) (0.0 1.0) (0.0 0.0)))) ocs (trans '(0.0 0.0 1.0) 1 0 t) osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point for circle: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (setq rad (/ (getvar 'viewsize) fac)) (grvecs lst (append (mapcar 'append (mxm mat (list (list rad 0.0 0.0) (list 0.0 rad 0.0) '(0.0 0.0 1.0) ) ) (mapcar 'list (trans gr2 1 2)) ) '((0.0 0.0 0.0 1.0)) ) ) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "CIRCLE") (cons 010 (trans (osf gr2 osm) 1 ocs)) (cons 040 (/ (getvar 'viewsize) fac)) (cons 210 ocs) ) ) ) (redraw) (princ) ) ;; Matrix Transpose - Doug Wilson ;; Args: m - nxn matrix (defun trp ( m ) (apply 'mapcar (cons 'list m)) ) ;; Matrix x Matrix - Vladimir Nesterovsky ;; Args: m,n - nxn matrices (defun mxm ( m n ) ((lambda ( a ) (mapcar '(lambda ( r ) (mxv a r)) m)) (trp n)) ) ;; Matrix x Vector - Vladimir Nesterovsky ;; Args: m - nxn matrix, v - vector in R^n (defun mxv ( m v ) (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m) ) (vl-load-com) (princ)
53829
;; Demo Program 1 - <NAME> ;; ;; Basic Implementation (no keyboard input) ;; Prompts the user to pick a point and creates a POINT entity at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test1 ( / *error* grr osf osm ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) ) (princ "\nPick point: ") (while (= 5 (car (setq grr (grread t 15 0)))) (redraw) (osf (cadr grr) osm) ) (if (listp (cadr grr)) (entmake (list '(0 . "POINT") (cons 10 (trans (osf (cadr grr) osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 2 - <NAME> ;; ;; Full Implementation (osnap toggle / keyboard point input / osnap modifiers) ;; Prompts the user to specify a point and creates a POINT entity at the point specified. ;; ;; Requires GrSnap.lsp (defun c:test2 ( / *error* gr1 gr2 msg osf osm pt1 str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "POINT") (cons 10 (trans (osf gr2 osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 3 - <NAME> ;; ;; Full Implementation with Vector Graphics ;; Prompts the user to specify the center of a circle and creates a circle with radius 1/20th ;; of the screen height, centered at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test3 ( / *error* ang fac gr1 gr2 inc lst mat msg ocs osf osm pt1 rad str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq fac 20.0 ang 0.0 inc (/ pi 25.0) ) (repeat 50 (setq lst (cons (list (cos ang) (sin ang)) lst) ang (+ ang inc) ) ) (setq lst (cons 1 (apply 'append (mapcar 'list (cons (last lst) lst) lst))) mat (trp (mapcar '(lambda ( x ) (trans x 1 2 t)) '((1.0 0.0) (0.0 1.0) (0.0 0.0)))) ocs (trans '(0.0 0.0 1.0) 1 0 t) osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point for circle: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (setq rad (/ (getvar 'viewsize) fac)) (grvecs lst (append (mapcar 'append (mxm mat (list (list rad 0.0 0.0) (list 0.0 rad 0.0) '(0.0 0.0 1.0) ) ) (mapcar 'list (trans gr2 1 2)) ) '((0.0 0.0 0.0 1.0)) ) ) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "CIRCLE") (cons 010 (trans (osf gr2 osm) 1 ocs)) (cons 040 (/ (getvar 'viewsize) fac)) (cons 210 ocs) ) ) ) (redraw) (princ) ) ;; Matrix Transpose - <NAME> ;; Args: m - nxn matrix (defun trp ( m ) (apply 'mapcar (cons 'list m)) ) ;; Matrix x Matrix - <NAME> ;; Args: m,n - nxn matrices (defun mxm ( m n ) ((lambda ( a ) (mapcar '(lambda ( r ) (mxv a r)) m)) (trp n)) ) ;; Matrix x Vector - <NAME> ;; Args: m - nxn matrix, v - vector in R^n (defun mxv ( m v ) (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m) ) (vl-load-com) (princ)
true
;; Demo Program 1 - PI:NAME:<NAME>END_PI ;; ;; Basic Implementation (no keyboard input) ;; Prompts the user to pick a point and creates a POINT entity at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test1 ( / *error* grr osf osm ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) ) (princ "\nPick point: ") (while (= 5 (car (setq grr (grread t 15 0)))) (redraw) (osf (cadr grr) osm) ) (if (listp (cadr grr)) (entmake (list '(0 . "POINT") (cons 10 (trans (osf (cadr grr) osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 2 - PI:NAME:<NAME>END_PI ;; ;; Full Implementation (osnap toggle / keyboard point input / osnap modifiers) ;; Prompts the user to specify a point and creates a POINT entity at the point specified. ;; ;; Requires GrSnap.lsp (defun c:test2 ( / *error* gr1 gr2 msg osf osm pt1 str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "POINT") (cons 10 (trans (osf gr2 osm) 1 0)))) ) (redraw) (princ) ) ;; Demo Program 3 - PI:NAME:<NAME>END_PI ;; ;; Full Implementation with Vector Graphics ;; Prompts the user to specify the center of a circle and creates a circle with radius 1/20th ;; of the screen height, centered at the selected point. ;; ;; Requires GrSnap.lsp (defun c:test3 ( / *error* ang fac gr1 gr2 inc lst mat msg ocs osf osm pt1 rad str tmp ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (redraw) (princ) ) (setq fac 20.0 ang 0.0 inc (/ pi 25.0) ) (repeat 50 (setq lst (cons (list (cos ang) (sin ang)) lst) ang (+ ang inc) ) ) (setq lst (cons 1 (apply 'append (mapcar 'list (cons (last lst) lst) lst))) mat (trp (mapcar '(lambda ( x ) (trans x 1 2 t)) '((1.0 0.0) (0.0 1.0) (0.0 0.0)))) ocs (trans '(0.0 0.0 1.0) 1 0 t) osf (LM:grsnap:snapfunction) osm (getvar 'osmode) msg "\nSpecify point for circle: " str "" ) (princ msg) (while (progn (setq gr1 (grread t 15 0) gr2 (cadr gr1) gr1 (car gr1) ) (cond ( (or (= 5 gr1) (= 3 gr1)) (redraw) (osf gr2 osm) (setq rad (/ (getvar 'viewsize) fac)) (grvecs lst (append (mapcar 'append (mxm mat (list (list rad 0.0 0.0) (list 0.0 rad 0.0) '(0.0 0.0 1.0) ) ) (mapcar 'list (trans gr2 1 2)) ) '((0.0 0.0 0.0 1.0)) ) ) (= 5 gr1) ) ( (= 2 gr1) (cond ( (= 6 gr2) (if (zerop (logand 16384 (setq osm (setvar 'osmode (boole 6 16384 (getvar 'osmode)))))) (princ "\n<Osnap on>") (princ "\n<Osnap off>") ) (princ msg) ) ( (= 8 gr2) (if (< 0 (strlen str)) (progn (princ "\010\040\010") (setq str (substr str 1 (1- (strlen str)))) ) ) t ) ( (< 32 gr2 127) (setq str (strcat str (princ (chr gr2)))) ) ( (member gr2 '(13 32)) (cond ( (= "" str) nil) ( (setq gr2 (LM:grsnap:parsepoint pt1 str)) (setq osm 16384) nil ) ( (setq tmp (LM:grsnap:snapmode str)) (setq osm tmp str "" ) ) ( (setq str "") (princ (strcat "\n2D / 3D Point Required." msg)) ) ) ) ) ) ) ) ) (if (listp gr2) (entmake (list '(0 . "CIRCLE") (cons 010 (trans (osf gr2 osm) 1 ocs)) (cons 040 (/ (getvar 'viewsize) fac)) (cons 210 ocs) ) ) ) (redraw) (princ) ) ;; Matrix Transpose - PI:NAME:<NAME>END_PI ;; Args: m - nxn matrix (defun trp ( m ) (apply 'mapcar (cons 'list m)) ) ;; Matrix x Matrix - PI:NAME:<NAME>END_PI ;; Args: m,n - nxn matrices (defun mxm ( m n ) ((lambda ( a ) (mapcar '(lambda ( r ) (mxv a r)) m)) (trp n)) ) ;; Matrix x Vector - PI:NAME:<NAME>END_PI ;; Args: m - nxn matrix, v - vector in R^n (defun mxv ( m v ) (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m) ) (vl-load-com) (princ)
[ { "context": "le wrapper of dramka\"\n :version \"0.1\"\n :author \"Scinart O <[email protected]>\"\n :license \"BSD 2-Clause Lic", "end": 102, "score": 0.9998757243156433, "start": 93, "tag": "NAME", "value": "Scinart O" }, { "context": "of dramka\"\n :version \"0.1\"\n :author \"Scinart O <[email protected]>\"\n :license \"BSD 2-Clause License\"\n :depends-on", "end": 121, "score": 0.9999303817749023, "start": 104, "tag": "EMAIL", "value": "[email protected]" } ]
net.asd
scinart/net
1
(asdf:defsystem :net :description "a simple wrapper of dramka" :version "0.1" :author "Scinart O <[email protected]>" :license "BSD 2-Clause License" :depends-on ("drakma" "st-json" "cl-ppcre" "closure-html" "babel" "split-sequence") :components ((:file "net") ))
82982
(asdf:defsystem :net :description "a simple wrapper of dramka" :version "0.1" :author "<NAME> <<EMAIL>>" :license "BSD 2-Clause License" :depends-on ("drakma" "st-json" "cl-ppcre" "closure-html" "babel" "split-sequence") :components ((:file "net") ))
true
(asdf:defsystem :net :description "a simple wrapper of dramka" :version "0.1" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "BSD 2-Clause License" :depends-on ("drakma" "st-json" "cl-ppcre" "closure-html" "babel" "split-sequence") :components ((:file "net") ))
[ { "context": "xamples/sporadic.lisp\n;;;;\n;;;; Copyright (c) 2014 Robert Smith\n\n(in-package #:cl-permutation-examples)\n\n;;; 2448", "end": 69, "score": 0.9993784427642822, "start": 57, "tag": "NAME", "value": "Robert Smith" } ]
examples/sporadic.lisp
LdBeth/cl-permutation
35
;;;; examples/sporadic.lisp ;;;; ;;;; Copyright (c) 2014 Robert Smith (in-package #:cl-permutation-examples) ;;; 244823040 (defun make-mathieu-m25 () (group-from '((16 7 4 17 1 6 11 23 22 10 19 2 14 5 3 8 9 18 20 24 15 21 13 12) (24 21 10 22 9 23 8 7 5 3 18 20 14 13 19 17 16 11 15 12 2 4 6 1))))
37500
;;;; examples/sporadic.lisp ;;;; ;;;; Copyright (c) 2014 <NAME> (in-package #:cl-permutation-examples) ;;; 244823040 (defun make-mathieu-m25 () (group-from '((16 7 4 17 1 6 11 23 22 10 19 2 14 5 3 8 9 18 20 24 15 21 13 12) (24 21 10 22 9 23 8 7 5 3 18 20 14 13 19 17 16 11 15 12 2 4 6 1))))
true
;;;; examples/sporadic.lisp ;;;; ;;;; Copyright (c) 2014 PI:NAME:<NAME>END_PI (in-package #:cl-permutation-examples) ;;; 244823040 (defun make-mathieu-m25 () (group-from '((16 7 4 17 1 6 11 23 22 10 19 2 14 5 3 8 9 18 20 24 15 21 13 12) (24 21 10 22 9 23 8 7 5 3 18 20 14 13 19 17 16 11 15 12 2 4 6 1))))
[ { "context": ";;;; Copyright (c) Frank James 2015 <[email protected]>\r\n;;;; This code is", "end": 30, "score": 0.9998164176940918, "start": 19, "tag": "NAME", "value": "Frank James" }, { "context": ";;;; Copyright (c) Frank James 2015 <[email protected]>\r\n;;;; This code is licensed under the MIT licens", "end": 60, "score": 0.9999218583106995, "start": 37, "tag": "EMAIL", "value": "[email protected]" } ]
programs/nis.lisp
fjames86/frpc
8
;;;; Copyright (c) Frank James 2015 <[email protected]> ;;;; This code is licensed under the MIT license. ;; http://www.revathi.in/symsssss/root/usr/include/rpcsvc/nis.x (defpackage #:nis (:use #:cl #:frpc)) (in-package #:nis) (defconstant +NIS-MAXSTRINGLEN+ 255) (defconstant +NIS-MAXNAMELEN 1024) (defconstant +NIS-MAXATTRNAME 32) (defconstant +NIS-MAXATTRVAL 2048) (defconstant +NIS-MAXCOLUMNS 64) (defconstant +NIS-MAXATTR 16) (defconstant +NIS-MAXPATH 1024) (defconstant +NIS-MAXREPLICAS 128) (defconstant +NIS-MAXLINKS 16) (defxtype* netobj () (:varray* :octet)) (defxtype* nis-name () :string) (defxtype* nis-attr () (:plist :ndx nis-name :val (:varray* :octet))) (defxenum zotypes () (:bogus 0) (:no-obj 1) (:directory 2) (:group 3) (:table 4) (:entry 5) (:link 6) (:private 7)) (defxenum nstype () (:unknown 0) (:nis 1) (:sunyp 2) (:ivy 3) (:dns 4) (:x500 5) (:dnans 6) (:xchs 7) (:cds 8)) (defxtype* oar-mask () (:plist :rights :uint64 :otype zotypes)) (defxtype* endpoint () (:plist uaddr :string family :string proto :string)) (defxstruct nis-server () (name nis-name) (ep (:varray endpoint)) (keytype :uint64) (pkey netobj)) (defxstruct directory-obj () (name nis-name) (type nstype) (servers (:varray nis-server)) (ttl :uint64) (armask (:varray oar-mask))) (defxtype* entry-col () (:plist :flags :uint64 :value (:varray* :octet))) (defxtype* entry-obj () (:plist :type :string :cols (:varray entry-col))) (defxtype* group-obj () (:plist :flags :uint64 :members (:varray nis-name))) (defxtype* link-obj () (:plist :type zotypes :attrs (:varray nis-attr) :name nis-name)) (defxtype* table-col () (:plist :name :string :flags :uint64 :rights :uint64)) (defxstruct table-obj () (type :string) (maxcol :int32) (sep :uint32) (cols (:varray table-col)) (path :string)) (defxunion objdata (zotypes) (:directory-obj directory-obj) (:group-obj group-obj) (:table-obj table-obj) (:entry-obj entry-obj) (:link-obj link-obj) (:private-obj (:varray* :octet)) (:no-obj :void) (:bogus-obj :void) (otherwise :void)) (defxtype* nis-oid () (:list :uint64 :uint64)) (defxstruct nis-object () (oid nis-oid) (name nis-name) (owner nis-name) (group nis-group) (domain nis-name) (access :uint64) (ttl :uint64) (data objdata)) (defxenum nis-error () (:success 0) (:s-success 1) (:notfound 2) (:s-notfound 3) (:cache-expired 4) (:name-unreachable 5) (:unknown-obj 6) (:try-again 7) (:system-error 8) (:chain-broken 9) (:permission 10) (:not-owner 11) (:not-me 12) (:no-memory 13) (:name-exists 14) (:not-master 15) (:invalid-obj 16) (:bad-name 17) (:no-callback 18) (:cbresults 19) (:no-such-name 20) (:not-unique 21) (:ib-mod-error 22) (:no-such-table 23) (:type-mismatch 24) (:link-name-error 25) (:partial 26) (:too-many-attrs 27) (:rpc-error 28) (:bad-attribute 29) (:not-searchable 30) (:cberror 31) (:foreign-ns 32) (:bad-object 33) (:not-same-obj 34) (:mod-fail 35) (:bad-request 36) (:not-empty 37) (:coldstart-err 38) (:resync 39) (:fail 40) (:unavail 41) (:resync 42) (:srvauth 43) (:client-auth 44) (:nofilespace 45) (:noproc 46) (:dumplater 47)) (defxstruct nis-result () (status nis-error) (objects (:varray nis-object)) (cookie netobj) (zticks :uint64) (dticks :uint64) (aticks :uint64) (cticks :uint64)) (defxtype* ns-request () (:plist :name nis-name :object (:optional nis-object))) (defxstruct ib-request () (name nis-name) (srch nis-attr) (flags :uint64) (obj (:optional nis-object)) (host (:optional nis-server)) (buffsize :uint64) (cookie netobj)) (defxtype* ping-args () (:plist :dir nis-name :stamp :uint64)) (defxenum log-entry-t (:log-nop 0) (:add-name 1) (:rem-name 2) (:mod-name-old 3) (:mod-name-new 4) (:add-ibase 5) (:rem-ibase 6) (:mod-ibase 7) (:upd-stamp 8)) (defxstruct log-entry () (time :uint64) (type log-entry-t) (princp nis-name) (name nis-name) (attrs (:varray nis-attr)) (object nis-object)) (defxtype* log-result () (:plist :status nis-error :cookie netobj :entries (:varray log-entry))) (defxtype* cp-result () (:plist :status nis-error :zticks :uint64 :dticks :uint6$)) (defxtype* nis-tag () (:plist :type :uint64 :val :string)) (defxtype* nis-taglist () (:varray nis-tag)) (defxtype* dump-args () (:plist :dir nis-name :time :uint64 :cbhost (:optional nis-server))) (defxtype* fd-args () (:plist :name nis-name :requester nis-name)) (defxstruct fd-result () (status nis-error) (source nis-name) (data (:varray* :octet)) (signature (:varray* :octet))) ;; rpc interfaace (use-rpc-program 100300 3) (defrpc call-null 0 :void :void) (defrpc call-nis-lookup 1 ns-request nis-result) (defrpc call-nis-add 2 ns-request nis-result) (defrpc call-nis-modify 3 ns-request nis-result) (defrpc call-nis-remove 4 ns-request nis-result) (defrpc call-nis-iblist 5 ib-request nis-result) (defrpc call-nis-ibadd 6 ib-request nis-result) (defrpc call-nis-ibmodify 7 ib-request nis-result) (defrpc call-nis-ibremove 8 ib-request nis-result) (defrpc call-nis-ibfirst 9 ib-request nis-result) (defrpc call-nis-ibnext 10 ib-request nis-result) (defrpc call-nis-finddirectory 12 fd-args fd-result) (defrpc call-nis-status 14 nis-taglist nis-taglist) (defrpc call-nis-dumplog 15 dump-args log-result) (defrpc call-nis-dump 16 dump-args log-result) (defrpc call-nis-callback 17 netobj :boolean) (defrpc call-nis-cptime 18 nis-name :uint64) (defrpc call-nis-checkpoint 19 nis-name cp-result) (defrpc call-nis-ping 20 ping-args :void) (defrpc call-nis-servstate 21 nis-taglist nis-taglist) (defrpc call-nis-mkdir 22 nis-name nis-error) (defrpc call-nis-rmdir 23 nis-name nis-error) (defrpc callnis-updkeys 24 nis-name nis-error)
94282
;;;; Copyright (c) <NAME> 2015 <<EMAIL>> ;;;; This code is licensed under the MIT license. ;; http://www.revathi.in/symsssss/root/usr/include/rpcsvc/nis.x (defpackage #:nis (:use #:cl #:frpc)) (in-package #:nis) (defconstant +NIS-MAXSTRINGLEN+ 255) (defconstant +NIS-MAXNAMELEN 1024) (defconstant +NIS-MAXATTRNAME 32) (defconstant +NIS-MAXATTRVAL 2048) (defconstant +NIS-MAXCOLUMNS 64) (defconstant +NIS-MAXATTR 16) (defconstant +NIS-MAXPATH 1024) (defconstant +NIS-MAXREPLICAS 128) (defconstant +NIS-MAXLINKS 16) (defxtype* netobj () (:varray* :octet)) (defxtype* nis-name () :string) (defxtype* nis-attr () (:plist :ndx nis-name :val (:varray* :octet))) (defxenum zotypes () (:bogus 0) (:no-obj 1) (:directory 2) (:group 3) (:table 4) (:entry 5) (:link 6) (:private 7)) (defxenum nstype () (:unknown 0) (:nis 1) (:sunyp 2) (:ivy 3) (:dns 4) (:x500 5) (:dnans 6) (:xchs 7) (:cds 8)) (defxtype* oar-mask () (:plist :rights :uint64 :otype zotypes)) (defxtype* endpoint () (:plist uaddr :string family :string proto :string)) (defxstruct nis-server () (name nis-name) (ep (:varray endpoint)) (keytype :uint64) (pkey netobj)) (defxstruct directory-obj () (name nis-name) (type nstype) (servers (:varray nis-server)) (ttl :uint64) (armask (:varray oar-mask))) (defxtype* entry-col () (:plist :flags :uint64 :value (:varray* :octet))) (defxtype* entry-obj () (:plist :type :string :cols (:varray entry-col))) (defxtype* group-obj () (:plist :flags :uint64 :members (:varray nis-name))) (defxtype* link-obj () (:plist :type zotypes :attrs (:varray nis-attr) :name nis-name)) (defxtype* table-col () (:plist :name :string :flags :uint64 :rights :uint64)) (defxstruct table-obj () (type :string) (maxcol :int32) (sep :uint32) (cols (:varray table-col)) (path :string)) (defxunion objdata (zotypes) (:directory-obj directory-obj) (:group-obj group-obj) (:table-obj table-obj) (:entry-obj entry-obj) (:link-obj link-obj) (:private-obj (:varray* :octet)) (:no-obj :void) (:bogus-obj :void) (otherwise :void)) (defxtype* nis-oid () (:list :uint64 :uint64)) (defxstruct nis-object () (oid nis-oid) (name nis-name) (owner nis-name) (group nis-group) (domain nis-name) (access :uint64) (ttl :uint64) (data objdata)) (defxenum nis-error () (:success 0) (:s-success 1) (:notfound 2) (:s-notfound 3) (:cache-expired 4) (:name-unreachable 5) (:unknown-obj 6) (:try-again 7) (:system-error 8) (:chain-broken 9) (:permission 10) (:not-owner 11) (:not-me 12) (:no-memory 13) (:name-exists 14) (:not-master 15) (:invalid-obj 16) (:bad-name 17) (:no-callback 18) (:cbresults 19) (:no-such-name 20) (:not-unique 21) (:ib-mod-error 22) (:no-such-table 23) (:type-mismatch 24) (:link-name-error 25) (:partial 26) (:too-many-attrs 27) (:rpc-error 28) (:bad-attribute 29) (:not-searchable 30) (:cberror 31) (:foreign-ns 32) (:bad-object 33) (:not-same-obj 34) (:mod-fail 35) (:bad-request 36) (:not-empty 37) (:coldstart-err 38) (:resync 39) (:fail 40) (:unavail 41) (:resync 42) (:srvauth 43) (:client-auth 44) (:nofilespace 45) (:noproc 46) (:dumplater 47)) (defxstruct nis-result () (status nis-error) (objects (:varray nis-object)) (cookie netobj) (zticks :uint64) (dticks :uint64) (aticks :uint64) (cticks :uint64)) (defxtype* ns-request () (:plist :name nis-name :object (:optional nis-object))) (defxstruct ib-request () (name nis-name) (srch nis-attr) (flags :uint64) (obj (:optional nis-object)) (host (:optional nis-server)) (buffsize :uint64) (cookie netobj)) (defxtype* ping-args () (:plist :dir nis-name :stamp :uint64)) (defxenum log-entry-t (:log-nop 0) (:add-name 1) (:rem-name 2) (:mod-name-old 3) (:mod-name-new 4) (:add-ibase 5) (:rem-ibase 6) (:mod-ibase 7) (:upd-stamp 8)) (defxstruct log-entry () (time :uint64) (type log-entry-t) (princp nis-name) (name nis-name) (attrs (:varray nis-attr)) (object nis-object)) (defxtype* log-result () (:plist :status nis-error :cookie netobj :entries (:varray log-entry))) (defxtype* cp-result () (:plist :status nis-error :zticks :uint64 :dticks :uint6$)) (defxtype* nis-tag () (:plist :type :uint64 :val :string)) (defxtype* nis-taglist () (:varray nis-tag)) (defxtype* dump-args () (:plist :dir nis-name :time :uint64 :cbhost (:optional nis-server))) (defxtype* fd-args () (:plist :name nis-name :requester nis-name)) (defxstruct fd-result () (status nis-error) (source nis-name) (data (:varray* :octet)) (signature (:varray* :octet))) ;; rpc interfaace (use-rpc-program 100300 3) (defrpc call-null 0 :void :void) (defrpc call-nis-lookup 1 ns-request nis-result) (defrpc call-nis-add 2 ns-request nis-result) (defrpc call-nis-modify 3 ns-request nis-result) (defrpc call-nis-remove 4 ns-request nis-result) (defrpc call-nis-iblist 5 ib-request nis-result) (defrpc call-nis-ibadd 6 ib-request nis-result) (defrpc call-nis-ibmodify 7 ib-request nis-result) (defrpc call-nis-ibremove 8 ib-request nis-result) (defrpc call-nis-ibfirst 9 ib-request nis-result) (defrpc call-nis-ibnext 10 ib-request nis-result) (defrpc call-nis-finddirectory 12 fd-args fd-result) (defrpc call-nis-status 14 nis-taglist nis-taglist) (defrpc call-nis-dumplog 15 dump-args log-result) (defrpc call-nis-dump 16 dump-args log-result) (defrpc call-nis-callback 17 netobj :boolean) (defrpc call-nis-cptime 18 nis-name :uint64) (defrpc call-nis-checkpoint 19 nis-name cp-result) (defrpc call-nis-ping 20 ping-args :void) (defrpc call-nis-servstate 21 nis-taglist nis-taglist) (defrpc call-nis-mkdir 22 nis-name nis-error) (defrpc call-nis-rmdir 23 nis-name nis-error) (defrpc callnis-updkeys 24 nis-name nis-error)
true
;;;; Copyright (c) PI:NAME:<NAME>END_PI 2015 <PI:EMAIL:<EMAIL>END_PI> ;;;; This code is licensed under the MIT license. ;; http://www.revathi.in/symsssss/root/usr/include/rpcsvc/nis.x (defpackage #:nis (:use #:cl #:frpc)) (in-package #:nis) (defconstant +NIS-MAXSTRINGLEN+ 255) (defconstant +NIS-MAXNAMELEN 1024) (defconstant +NIS-MAXATTRNAME 32) (defconstant +NIS-MAXATTRVAL 2048) (defconstant +NIS-MAXCOLUMNS 64) (defconstant +NIS-MAXATTR 16) (defconstant +NIS-MAXPATH 1024) (defconstant +NIS-MAXREPLICAS 128) (defconstant +NIS-MAXLINKS 16) (defxtype* netobj () (:varray* :octet)) (defxtype* nis-name () :string) (defxtype* nis-attr () (:plist :ndx nis-name :val (:varray* :octet))) (defxenum zotypes () (:bogus 0) (:no-obj 1) (:directory 2) (:group 3) (:table 4) (:entry 5) (:link 6) (:private 7)) (defxenum nstype () (:unknown 0) (:nis 1) (:sunyp 2) (:ivy 3) (:dns 4) (:x500 5) (:dnans 6) (:xchs 7) (:cds 8)) (defxtype* oar-mask () (:plist :rights :uint64 :otype zotypes)) (defxtype* endpoint () (:plist uaddr :string family :string proto :string)) (defxstruct nis-server () (name nis-name) (ep (:varray endpoint)) (keytype :uint64) (pkey netobj)) (defxstruct directory-obj () (name nis-name) (type nstype) (servers (:varray nis-server)) (ttl :uint64) (armask (:varray oar-mask))) (defxtype* entry-col () (:plist :flags :uint64 :value (:varray* :octet))) (defxtype* entry-obj () (:plist :type :string :cols (:varray entry-col))) (defxtype* group-obj () (:plist :flags :uint64 :members (:varray nis-name))) (defxtype* link-obj () (:plist :type zotypes :attrs (:varray nis-attr) :name nis-name)) (defxtype* table-col () (:plist :name :string :flags :uint64 :rights :uint64)) (defxstruct table-obj () (type :string) (maxcol :int32) (sep :uint32) (cols (:varray table-col)) (path :string)) (defxunion objdata (zotypes) (:directory-obj directory-obj) (:group-obj group-obj) (:table-obj table-obj) (:entry-obj entry-obj) (:link-obj link-obj) (:private-obj (:varray* :octet)) (:no-obj :void) (:bogus-obj :void) (otherwise :void)) (defxtype* nis-oid () (:list :uint64 :uint64)) (defxstruct nis-object () (oid nis-oid) (name nis-name) (owner nis-name) (group nis-group) (domain nis-name) (access :uint64) (ttl :uint64) (data objdata)) (defxenum nis-error () (:success 0) (:s-success 1) (:notfound 2) (:s-notfound 3) (:cache-expired 4) (:name-unreachable 5) (:unknown-obj 6) (:try-again 7) (:system-error 8) (:chain-broken 9) (:permission 10) (:not-owner 11) (:not-me 12) (:no-memory 13) (:name-exists 14) (:not-master 15) (:invalid-obj 16) (:bad-name 17) (:no-callback 18) (:cbresults 19) (:no-such-name 20) (:not-unique 21) (:ib-mod-error 22) (:no-such-table 23) (:type-mismatch 24) (:link-name-error 25) (:partial 26) (:too-many-attrs 27) (:rpc-error 28) (:bad-attribute 29) (:not-searchable 30) (:cberror 31) (:foreign-ns 32) (:bad-object 33) (:not-same-obj 34) (:mod-fail 35) (:bad-request 36) (:not-empty 37) (:coldstart-err 38) (:resync 39) (:fail 40) (:unavail 41) (:resync 42) (:srvauth 43) (:client-auth 44) (:nofilespace 45) (:noproc 46) (:dumplater 47)) (defxstruct nis-result () (status nis-error) (objects (:varray nis-object)) (cookie netobj) (zticks :uint64) (dticks :uint64) (aticks :uint64) (cticks :uint64)) (defxtype* ns-request () (:plist :name nis-name :object (:optional nis-object))) (defxstruct ib-request () (name nis-name) (srch nis-attr) (flags :uint64) (obj (:optional nis-object)) (host (:optional nis-server)) (buffsize :uint64) (cookie netobj)) (defxtype* ping-args () (:plist :dir nis-name :stamp :uint64)) (defxenum log-entry-t (:log-nop 0) (:add-name 1) (:rem-name 2) (:mod-name-old 3) (:mod-name-new 4) (:add-ibase 5) (:rem-ibase 6) (:mod-ibase 7) (:upd-stamp 8)) (defxstruct log-entry () (time :uint64) (type log-entry-t) (princp nis-name) (name nis-name) (attrs (:varray nis-attr)) (object nis-object)) (defxtype* log-result () (:plist :status nis-error :cookie netobj :entries (:varray log-entry))) (defxtype* cp-result () (:plist :status nis-error :zticks :uint64 :dticks :uint6$)) (defxtype* nis-tag () (:plist :type :uint64 :val :string)) (defxtype* nis-taglist () (:varray nis-tag)) (defxtype* dump-args () (:plist :dir nis-name :time :uint64 :cbhost (:optional nis-server))) (defxtype* fd-args () (:plist :name nis-name :requester nis-name)) (defxstruct fd-result () (status nis-error) (source nis-name) (data (:varray* :octet)) (signature (:varray* :octet))) ;; rpc interfaace (use-rpc-program 100300 3) (defrpc call-null 0 :void :void) (defrpc call-nis-lookup 1 ns-request nis-result) (defrpc call-nis-add 2 ns-request nis-result) (defrpc call-nis-modify 3 ns-request nis-result) (defrpc call-nis-remove 4 ns-request nis-result) (defrpc call-nis-iblist 5 ib-request nis-result) (defrpc call-nis-ibadd 6 ib-request nis-result) (defrpc call-nis-ibmodify 7 ib-request nis-result) (defrpc call-nis-ibremove 8 ib-request nis-result) (defrpc call-nis-ibfirst 9 ib-request nis-result) (defrpc call-nis-ibnext 10 ib-request nis-result) (defrpc call-nis-finddirectory 12 fd-args fd-result) (defrpc call-nis-status 14 nis-taglist nis-taglist) (defrpc call-nis-dumplog 15 dump-args log-result) (defrpc call-nis-dump 16 dump-args log-result) (defrpc call-nis-callback 17 netobj :boolean) (defrpc call-nis-cptime 18 nis-name :uint64) (defrpc call-nis-checkpoint 19 nis-name cp-result) (defrpc call-nis-ping 20 ping-args :void) (defrpc call-nis-servstate 21 nis-taglist nis-taglist) (defrpc call-nis-mkdir 22 nis-name nis-error) (defrpc call-nis-rmdir 23 nis-name nis-error) (defrpc callnis-updkeys 24 nis-name nis-error)
[ { "context": " ;;;;;\n;;; Copyright (c) 1984,1987 by William Schelter,University of Texas ;;;;;\n;;; All rights re", "end": 356, "score": 0.9998839497566223, "start": 340, "tag": "NAME", "value": "William Schelter" } ]
maxima/src/maxima/src/mopers.lisp
nilqed/spadlib
1
;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The data in this file contains enhancments. ;;;;; ;;; ;;;;; ;;; Copyright (c) 1984,1987 by William Schelter,University of Texas ;;;;; ;;; All rights reserved ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1980 Massachusetts Institute of Technology ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :maxima) (macsyma-module mopers macro) ;; This file is the compile-time half of the OPERS package, an interface to the ;; Maxima general representaton simplifier. When new expressions are being ;; created, the macros in this file or the functions in NOPERS should be called ;; rather than the entrypoints in SIMP such as SIMPLIFYA or SIMPLUS. ;; The basic functions are ADD, SUB, MUL, DIV, POWER, NCMUL, NCPOWER, INV. ;; Each of these functions assume that their arguments are simplified. Some ;; functions will have a "*" adjoined to the end of the name (as in ADD*). ;; These do not assume that their arguments are simplified. The above ;; functions are the only entrypoints to this package. ;; The functions ADD2, MUL2, and MUL3 are for use internal to this package ;; and should not be called externally. ;; I have added the macro DEFGRAD as an interface to the $DERIVATIVE function ;; for use by macsyma programers who want to do a bit of lisp programming. -GJC (defmacro =0 (x) `(equal ,x 0)) (defmacro =1 (x) `(equal ,x 1)) ;; Addition -- call ADD with simplified operands, ;; ADD* with unsimplified operands. (defun add (&rest terms) (if (= (length terms) 2) (apply #'add2 terms) (apply #'addn `(,terms t)))) (define-compiler-macro add (&rest terms) (if (= (length terms) 2) `(add2 ,@terms) `(addn (list ,@terms) t))) (defun add* (&rest terms) (if (= (length terms) 2) (apply #'add2* terms) (apply #'addn `(,terms nil)))) (define-compiler-macro add* (&rest terms) (if (= (length terms) 2) `(add2* ,@terms) `(addn (list ,@terms) nil))) ;; Multiplication -- call MUL or NCMUL with simplified operands, ;; MUL* or NCMUL* with unsimplified operands. (defun mul (&rest factors) (cond ((= (length factors) 2) (apply #'mul2 factors)) ((= (length factors) 3) (apply #'mul3 factors)) (t (apply #'muln `(,factors t))))) (define-compiler-macro mul (&rest factors) (cond ((= (length factors) 2) `(mul2 ,@factors)) ((= (length factors) 3) `(mul3 ,@factors)) (t `(muln (list ,@factors) t)))) (defun mul* (&rest factors) (if (= (length factors) 2) (apply #'mul2* factors) (apply #'muln `(,factors nil)))) (define-compiler-macro mul* (&rest factors) (if (= (length factors) 2) `(mul2* ,@factors) `(muln (list ,@factors) nil))) (defmacro inv (x) `(power ,x -1)) (defmacro inv* (x) `(power* ,x -1)) (defmacro ncmul (&rest factors) (if (= (length factors) 2) `(ncmul2 ,@factors) `(ncmuln (list ,@factors) t))) ;; (TAKE '(%TAN) X) = tan(x) ;; This syntax really loses. Not only does this syntax lose, but this macro ;; has to look like a subr. Otherwise, the definition would look like ;; (DEFMACRO TAKE ((NIL (OPERATOR)) . ARGS) ...) ;; (TAKE A B) --> (SIMPLIFYA (LIST A B) T) ;; (TAKE '(%SIN) A) --> (SIMP-%SIN (LIST '(%SIN) A) 1 T) (defmacro take (operator &rest args) ; Cutting out the code which bypasses the simplifier. ; (let ((simplifier (and (not (atom operator)) ; (eq (car operator) 'quote) ; (cdr (assoc (caadr operator) '((%atan . simp-%atan) ; (%tan . simp-%tan) ; (%log . simpln) ; (mabs . simpabs) ; (%sin . simp-%sin) ; (%cos . simp-%cos) ; ($atan2 . simpatan2)) :test #'eq))))) ; (if simplifier ; `(,simplifier (list ,operator ,@args) 1 t) `(simplifya (list ,operator ,@args) t)) ;; take* does not assume that the arguments are simplified. (defmacro take* (operator &rest args) `(simplifya (list ,operator ,@args) nil)) (declaim (inline simplify)) (defun simplify (x) (simplifya x nil)) ;; A hand-made DEFSTRUCT for dealing with the Maxima MDO structure. ;; Used in GRAM, etc. for storing/retrieving from DO structures. (defmacro make-mdo () '(list (list 'mdo) nil nil nil nil nil nil nil)) (defmacro mdo-op (x) `(car (car ,x))) (defmacro mdo-for (x) `(second ,x)) (defmacro mdo-from (x) `(third ,x)) (defmacro mdo-step (x) `(fourth ,x)) (defmacro mdo-next (x) `(fifth ,x)) (defmacro mdo-thru (x) `(sixth ,x)) (defmacro mdo-unless (x) `(seventh ,x)) (defmacro mdo-body (x) `(eighth ,x)) (defmacro defgrad (name arguments &body body) `(defprop ,name (,arguments ,@body) grad))
65093
;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The data in this file contains enhancments. ;;;;; ;;; ;;;;; ;;; Copyright (c) 1984,1987 by <NAME>,University of Texas ;;;;; ;;; All rights reserved ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1980 Massachusetts Institute of Technology ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :maxima) (macsyma-module mopers macro) ;; This file is the compile-time half of the OPERS package, an interface to the ;; Maxima general representaton simplifier. When new expressions are being ;; created, the macros in this file or the functions in NOPERS should be called ;; rather than the entrypoints in SIMP such as SIMPLIFYA or SIMPLUS. ;; The basic functions are ADD, SUB, MUL, DIV, POWER, NCMUL, NCPOWER, INV. ;; Each of these functions assume that their arguments are simplified. Some ;; functions will have a "*" adjoined to the end of the name (as in ADD*). ;; These do not assume that their arguments are simplified. The above ;; functions are the only entrypoints to this package. ;; The functions ADD2, MUL2, and MUL3 are for use internal to this package ;; and should not be called externally. ;; I have added the macro DEFGRAD as an interface to the $DERIVATIVE function ;; for use by macsyma programers who want to do a bit of lisp programming. -GJC (defmacro =0 (x) `(equal ,x 0)) (defmacro =1 (x) `(equal ,x 1)) ;; Addition -- call ADD with simplified operands, ;; ADD* with unsimplified operands. (defun add (&rest terms) (if (= (length terms) 2) (apply #'add2 terms) (apply #'addn `(,terms t)))) (define-compiler-macro add (&rest terms) (if (= (length terms) 2) `(add2 ,@terms) `(addn (list ,@terms) t))) (defun add* (&rest terms) (if (= (length terms) 2) (apply #'add2* terms) (apply #'addn `(,terms nil)))) (define-compiler-macro add* (&rest terms) (if (= (length terms) 2) `(add2* ,@terms) `(addn (list ,@terms) nil))) ;; Multiplication -- call MUL or NCMUL with simplified operands, ;; MUL* or NCMUL* with unsimplified operands. (defun mul (&rest factors) (cond ((= (length factors) 2) (apply #'mul2 factors)) ((= (length factors) 3) (apply #'mul3 factors)) (t (apply #'muln `(,factors t))))) (define-compiler-macro mul (&rest factors) (cond ((= (length factors) 2) `(mul2 ,@factors)) ((= (length factors) 3) `(mul3 ,@factors)) (t `(muln (list ,@factors) t)))) (defun mul* (&rest factors) (if (= (length factors) 2) (apply #'mul2* factors) (apply #'muln `(,factors nil)))) (define-compiler-macro mul* (&rest factors) (if (= (length factors) 2) `(mul2* ,@factors) `(muln (list ,@factors) nil))) (defmacro inv (x) `(power ,x -1)) (defmacro inv* (x) `(power* ,x -1)) (defmacro ncmul (&rest factors) (if (= (length factors) 2) `(ncmul2 ,@factors) `(ncmuln (list ,@factors) t))) ;; (TAKE '(%TAN) X) = tan(x) ;; This syntax really loses. Not only does this syntax lose, but this macro ;; has to look like a subr. Otherwise, the definition would look like ;; (DEFMACRO TAKE ((NIL (OPERATOR)) . ARGS) ...) ;; (TAKE A B) --> (SIMPLIFYA (LIST A B) T) ;; (TAKE '(%SIN) A) --> (SIMP-%SIN (LIST '(%SIN) A) 1 T) (defmacro take (operator &rest args) ; Cutting out the code which bypasses the simplifier. ; (let ((simplifier (and (not (atom operator)) ; (eq (car operator) 'quote) ; (cdr (assoc (caadr operator) '((%atan . simp-%atan) ; (%tan . simp-%tan) ; (%log . simpln) ; (mabs . simpabs) ; (%sin . simp-%sin) ; (%cos . simp-%cos) ; ($atan2 . simpatan2)) :test #'eq))))) ; (if simplifier ; `(,simplifier (list ,operator ,@args) 1 t) `(simplifya (list ,operator ,@args) t)) ;; take* does not assume that the arguments are simplified. (defmacro take* (operator &rest args) `(simplifya (list ,operator ,@args) nil)) (declaim (inline simplify)) (defun simplify (x) (simplifya x nil)) ;; A hand-made DEFSTRUCT for dealing with the Maxima MDO structure. ;; Used in GRAM, etc. for storing/retrieving from DO structures. (defmacro make-mdo () '(list (list 'mdo) nil nil nil nil nil nil nil)) (defmacro mdo-op (x) `(car (car ,x))) (defmacro mdo-for (x) `(second ,x)) (defmacro mdo-from (x) `(third ,x)) (defmacro mdo-step (x) `(fourth ,x)) (defmacro mdo-next (x) `(fifth ,x)) (defmacro mdo-thru (x) `(sixth ,x)) (defmacro mdo-unless (x) `(seventh ,x)) (defmacro mdo-body (x) `(eighth ,x)) (defmacro defgrad (name arguments &body body) `(defprop ,name (,arguments ,@body) grad))
true
;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The data in this file contains enhancments. ;;;;; ;;; ;;;;; ;;; Copyright (c) 1984,1987 by PI:NAME:<NAME>END_PI,University of Texas ;;;;; ;;; All rights reserved ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1980 Massachusetts Institute of Technology ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :maxima) (macsyma-module mopers macro) ;; This file is the compile-time half of the OPERS package, an interface to the ;; Maxima general representaton simplifier. When new expressions are being ;; created, the macros in this file or the functions in NOPERS should be called ;; rather than the entrypoints in SIMP such as SIMPLIFYA or SIMPLUS. ;; The basic functions are ADD, SUB, MUL, DIV, POWER, NCMUL, NCPOWER, INV. ;; Each of these functions assume that their arguments are simplified. Some ;; functions will have a "*" adjoined to the end of the name (as in ADD*). ;; These do not assume that their arguments are simplified. The above ;; functions are the only entrypoints to this package. ;; The functions ADD2, MUL2, and MUL3 are for use internal to this package ;; and should not be called externally. ;; I have added the macro DEFGRAD as an interface to the $DERIVATIVE function ;; for use by macsyma programers who want to do a bit of lisp programming. -GJC (defmacro =0 (x) `(equal ,x 0)) (defmacro =1 (x) `(equal ,x 1)) ;; Addition -- call ADD with simplified operands, ;; ADD* with unsimplified operands. (defun add (&rest terms) (if (= (length terms) 2) (apply #'add2 terms) (apply #'addn `(,terms t)))) (define-compiler-macro add (&rest terms) (if (= (length terms) 2) `(add2 ,@terms) `(addn (list ,@terms) t))) (defun add* (&rest terms) (if (= (length terms) 2) (apply #'add2* terms) (apply #'addn `(,terms nil)))) (define-compiler-macro add* (&rest terms) (if (= (length terms) 2) `(add2* ,@terms) `(addn (list ,@terms) nil))) ;; Multiplication -- call MUL or NCMUL with simplified operands, ;; MUL* or NCMUL* with unsimplified operands. (defun mul (&rest factors) (cond ((= (length factors) 2) (apply #'mul2 factors)) ((= (length factors) 3) (apply #'mul3 factors)) (t (apply #'muln `(,factors t))))) (define-compiler-macro mul (&rest factors) (cond ((= (length factors) 2) `(mul2 ,@factors)) ((= (length factors) 3) `(mul3 ,@factors)) (t `(muln (list ,@factors) t)))) (defun mul* (&rest factors) (if (= (length factors) 2) (apply #'mul2* factors) (apply #'muln `(,factors nil)))) (define-compiler-macro mul* (&rest factors) (if (= (length factors) 2) `(mul2* ,@factors) `(muln (list ,@factors) nil))) (defmacro inv (x) `(power ,x -1)) (defmacro inv* (x) `(power* ,x -1)) (defmacro ncmul (&rest factors) (if (= (length factors) 2) `(ncmul2 ,@factors) `(ncmuln (list ,@factors) t))) ;; (TAKE '(%TAN) X) = tan(x) ;; This syntax really loses. Not only does this syntax lose, but this macro ;; has to look like a subr. Otherwise, the definition would look like ;; (DEFMACRO TAKE ((NIL (OPERATOR)) . ARGS) ...) ;; (TAKE A B) --> (SIMPLIFYA (LIST A B) T) ;; (TAKE '(%SIN) A) --> (SIMP-%SIN (LIST '(%SIN) A) 1 T) (defmacro take (operator &rest args) ; Cutting out the code which bypasses the simplifier. ; (let ((simplifier (and (not (atom operator)) ; (eq (car operator) 'quote) ; (cdr (assoc (caadr operator) '((%atan . simp-%atan) ; (%tan . simp-%tan) ; (%log . simpln) ; (mabs . simpabs) ; (%sin . simp-%sin) ; (%cos . simp-%cos) ; ($atan2 . simpatan2)) :test #'eq))))) ; (if simplifier ; `(,simplifier (list ,operator ,@args) 1 t) `(simplifya (list ,operator ,@args) t)) ;; take* does not assume that the arguments are simplified. (defmacro take* (operator &rest args) `(simplifya (list ,operator ,@args) nil)) (declaim (inline simplify)) (defun simplify (x) (simplifya x nil)) ;; A hand-made DEFSTRUCT for dealing with the Maxima MDO structure. ;; Used in GRAM, etc. for storing/retrieving from DO structures. (defmacro make-mdo () '(list (list 'mdo) nil nil nil nil nil nil nil)) (defmacro mdo-op (x) `(car (car ,x))) (defmacro mdo-for (x) `(second ,x)) (defmacro mdo-from (x) `(third ,x)) (defmacro mdo-step (x) `(fourth ,x)) (defmacro mdo-next (x) `(fifth ,x)) (defmacro mdo-thru (x) `(sixth ,x)) (defmacro mdo-unless (x) `(seventh ,x)) (defmacro mdo-body (x) `(eighth ,x)) (defmacro defgrad (name arguments &body body) `(defprop ,name (,arguments ,@body) grad))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(%in", "end": 1356, "score": 0.999567985534668, "start": 1345, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(%interactive)\n\n(defsecti", "end": 1377, "score": 0.9999348521232605, "start": 1358, "tag": "EMAIL", "value": "[email protected]" } ]
books/projects/milawa/ACL2/bootstrap/level2/basic.lisp
mayankmanj/acl2
305
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "MILAWA") (%interactive) (defsection build.axiom (%autoadmit build.axiom) (local (%enable default build.axiom)) (%autoprove build.axiom-under-iff) (%autoprove logic.method-of-build.axiom) (%autoprove logic.conclusion-of-build.axiom) (%autoprove logic.subproofs-of-build.axiom) (%autoprove logic.extras-of-build.axiom) (%autoprove forcing-logic.appealp-of-build.axiom) (local (%disable default build.axiom)) (%autoprove forcing-logic.proofp-of-build.axiom (%enable default logic.axiom-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.axiom a))))) (defsection build.theorem (%autoadmit build.theorem) (local (%enable default build.theorem)) (%autoprove build.theorem-under-iff) (%autoprove logic.method-of-build.theorem) (%autoprove logic.conclusion-of-build.theorem) (%autoprove logic.subproofs-of-build.theorem) (%autoprove logic.extras-of-build.theorem) (%autoprove forcing-logic.appealp-of-build.theorem) (local (%disable default build.theorem)) (%autoprove forcing-logic.proofp-of-build.theorem (%enable default logic.theorem-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.theorem a))))) (defsection build.propositional-schema (%autoadmit build.propositional-schema) (local (%enable default build.propositional-schema)) (%autoprove build.propositional-schema-under-iff) (%autoprove logic.method-of-build.propositional-schema) (%autoprove logic.conclusion-of-build.propositional-schema) (%autoprove logic.subproofs-of-build.propositional-schema) (%autoprove logic.extras-of-build.propositional-schema) (%autoprove forcing-logic.appealp-of-build.propositional-schema) (local (%disable default build.propositional-schema)) (%autoprove forcing-logic.proofp-of-build.propositional-schema (%enable default logic.appeal-step-okp logic.propositional-schema-okp) (%restrict default definition-of-logic.proofp (equal x '(build.propositional-schema a))))) (defsection build.cut (%autoadmit build.cut) (local (%enable default build.cut)) (%autoprove build.cut-under-iff) (%autoprove logic.method-of-build.cut) (%autoprove logic.conclusion-of-cut) ;; BOZO wrong name, should be build.cut (%autoprove logic.subproofs-of-build.cut) (%autoprove logic.extras-of-build.cut) (%autoprove forcing-logic.appealp-of-build.cut) (local (%disable default build.cut)) (%autoprove forcing-logic.proofp-of-build.cut (%enable default logic.appeal-step-okp logic.cut-okp) (%restrict default definition-of-logic.proofp (equal x '(build.cut x y))))) (defsection build.contraction (%autoadmit build.contraction) (local (%enable default build.contraction)) (%autoprove build.contraction-under-iff) (%autoprove logic.method-of-build.contraction) (%autoprove logic.conclusion-of-build.contraction) (%autoprove logic.subproofs-of-build.contraction) (%autoprove logic.extras-of-build.contraction) (%autoprove forcing-logic.appealp-of-build.contraction) (local (%disable default build.contraction)) (%autoprove forcing-logic.proofp-of-build.contraction (%enable default logic.appeal-step-okp logic.contraction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.contraction x))))) (defsection build.expansion (%autoadmit build.expansion) (local (%enable default build.expansion)) (%autoprove build.expansion-under-iff) (%autoprove logic.method-of-build.expansion) (%autoprove logic.conclusion-of-build.expansion) (%autoprove logic.subproofs-of-build.expansion) (%autoprove logic.extras-of-build.expansion) (%autoprove forcing-logic.appealp-of-build.expansion) (local (%disable default build.expansion)) (%autoprove forcing-logic.proofp-of-build.expansion (%enable default logic.appeal-step-okp logic.expansion-okp) (%restrict default definition-of-logic.proofp (equal x '(build.expansion a x))))) (defsection build.associativity (%autoadmit build.associativity) (local (%enable default build.associativity)) (%autoprove build.associativity-under-iff) (%autoprove logic.method-of-build.associativity) (%autoprove logic.conclusion-of-build.associativity) (%autoprove logic.subproofs-of-build.associativity) (%autoprove logic.extras-of-build.associativity) (%autoprove forcing-logic.appealp-of-build.associativity) (local (%disable default build.associativity)) (%autoprove forcing-logic.proofp-of-build.associativity (%enable default logic.appeal-step-okp logic.associativity-okp) (%restrict default definition-of-logic.proofp (equal x '(build.associativity x))))) (defsection build.instantiation (%autoadmit build.instantiation) (local (%enable default build.instantiation)) (%autoprove build.instantiation-under-iff) (%autoprove logic.method-of-build.instantiation) (%autoprove logic.conclusion-of-build.instantiation) (%autoprove logic.subproofs-of-build.instantiation) (%autoprove logic.extras-of-build.instantiation) (%autoprove forcing-logic.appealp-of-build.instantiation) (%autoprove forcing-logic.proofp-of-build.instantiation (%enable default logic.appeal-step-okp logic.instantiation-okp) (%restrict default definition-of-logic.proofp (equal x '(logic.appeal 'instantiation (logic.substitute-formula (logic.conclusion x) sigma) (cons x 'nil) sigma))))) (defsection build.functional-equality (%autoadmit build.functional-equality) (local (%enable default build.functional-equality)) (%autoprove build.functional-equality-under-iff) (%autoprove logic.method-of-build.functional-equality) (%autoprove logic.conclusion-of-build.functional-equality) (%autoprove logic.subproofs-of-build.functional-equality) (%autoprove logic.extras-of-build.functional-equality) (%autoprove forcing-logic.appealp-of-build.functional-equality) (local (%disable default build.functional-equality)) (%autoprove forcing-logic.proofp-of-build.functional-equality (%enable default logic.appeal-step-okp logic.functional-equality-okp) (%restrict default definition-of-logic.proofp (equal x '(build.functional-equality fn ti si))))) (defsection build.beta-reduction (%autoadmit build.beta-reduction) (local (%enable default build.beta-reduction)) (%autoprove build.beta-reduction-under-iff) (%autoprove logic.method-of-build.beta-reduction) (%autoprove logic.conclusion-of-build.beta-reduction) (%autoprove logic.subproofs-of-build.beta-reduction) (%autoprove logic.extras-of-build.beta-reduction) (%autoprove forcing-logic.appealp-of-build.beta-reduction) (local (%disable default build.beta-reduction)) (%autoprove forcing-logic.proofp-of-build.beta-reduction (%enable default logic.appeal-step-okp logic.beta-reduction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.beta-reduction formals body actuals))))) (defsection build.base-eval (%autoadmit build.base-eval) (local (%enable default build.base-eval)) (%autoprove build.base-eval-under-iff) (%autoprove logic.method-of-build.base-eval) (%autoprove logic.conclusion-of-build.base-eval) (%autoprove logic.subproofs-of-build.base-eval) (%autoprove logic.extras-of-build.base-eval) (%autoprove forcing-logic.appealp-of-build.base-eval) (local (%disable default build.base-eval)) (%autoprove forcing-logic.proofp-of-build.base-eval (%enable default logic.appeal-step-okp logic.base-eval-okp) (%restrict default definition-of-logic.proofp (equal x '(build.base-eval a))))) (defsection build.instantiation-list (%autoadmit build.instantiation-list) (%autoprove build.instantiation-list-when-not-consp (%restrict default build.instantiation-list (equal x 'x))) (%autoprove build.instantiation-list-of-cons (%restrict default build.instantiation-list (equal x '(cons a x)))) (%autoprove forcing-logic.appeal-listp-of-build.instantiation-list (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-build.instantiation-list (%cdr-induction x)) ;; BOZO next theorem is misnamed, should be proof-listp (%autoprove forcing-logic.proofp-of-build.instantiation-list (%cdr-induction x))) (defsection build.induction (%autoadmit build.induction) (local (%enable default build.induction)) (%autoprove build.induction-under-iff) (%autoprove logic.method-of-build.induction) (%autoprove logic.conclusion-of-build.induction) (%autoprove logic.subproofs-of-build.induction) (%autoprove logic.extras-of-build.induction) (%autoprove forcing-logic.appealp-of-build.induction) (local (%disable default build.induction)) (%autoprove forcing-logic.proofp-of-build.induction (%enable default logic.appeal-step-okp logic.induction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.induction f m qs all-sigmas proofs)))))
76112
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "MILAWA") (%interactive) (defsection build.axiom (%autoadmit build.axiom) (local (%enable default build.axiom)) (%autoprove build.axiom-under-iff) (%autoprove logic.method-of-build.axiom) (%autoprove logic.conclusion-of-build.axiom) (%autoprove logic.subproofs-of-build.axiom) (%autoprove logic.extras-of-build.axiom) (%autoprove forcing-logic.appealp-of-build.axiom) (local (%disable default build.axiom)) (%autoprove forcing-logic.proofp-of-build.axiom (%enable default logic.axiom-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.axiom a))))) (defsection build.theorem (%autoadmit build.theorem) (local (%enable default build.theorem)) (%autoprove build.theorem-under-iff) (%autoprove logic.method-of-build.theorem) (%autoprove logic.conclusion-of-build.theorem) (%autoprove logic.subproofs-of-build.theorem) (%autoprove logic.extras-of-build.theorem) (%autoprove forcing-logic.appealp-of-build.theorem) (local (%disable default build.theorem)) (%autoprove forcing-logic.proofp-of-build.theorem (%enable default logic.theorem-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.theorem a))))) (defsection build.propositional-schema (%autoadmit build.propositional-schema) (local (%enable default build.propositional-schema)) (%autoprove build.propositional-schema-under-iff) (%autoprove logic.method-of-build.propositional-schema) (%autoprove logic.conclusion-of-build.propositional-schema) (%autoprove logic.subproofs-of-build.propositional-schema) (%autoprove logic.extras-of-build.propositional-schema) (%autoprove forcing-logic.appealp-of-build.propositional-schema) (local (%disable default build.propositional-schema)) (%autoprove forcing-logic.proofp-of-build.propositional-schema (%enable default logic.appeal-step-okp logic.propositional-schema-okp) (%restrict default definition-of-logic.proofp (equal x '(build.propositional-schema a))))) (defsection build.cut (%autoadmit build.cut) (local (%enable default build.cut)) (%autoprove build.cut-under-iff) (%autoprove logic.method-of-build.cut) (%autoprove logic.conclusion-of-cut) ;; BOZO wrong name, should be build.cut (%autoprove logic.subproofs-of-build.cut) (%autoprove logic.extras-of-build.cut) (%autoprove forcing-logic.appealp-of-build.cut) (local (%disable default build.cut)) (%autoprove forcing-logic.proofp-of-build.cut (%enable default logic.appeal-step-okp logic.cut-okp) (%restrict default definition-of-logic.proofp (equal x '(build.cut x y))))) (defsection build.contraction (%autoadmit build.contraction) (local (%enable default build.contraction)) (%autoprove build.contraction-under-iff) (%autoprove logic.method-of-build.contraction) (%autoprove logic.conclusion-of-build.contraction) (%autoprove logic.subproofs-of-build.contraction) (%autoprove logic.extras-of-build.contraction) (%autoprove forcing-logic.appealp-of-build.contraction) (local (%disable default build.contraction)) (%autoprove forcing-logic.proofp-of-build.contraction (%enable default logic.appeal-step-okp logic.contraction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.contraction x))))) (defsection build.expansion (%autoadmit build.expansion) (local (%enable default build.expansion)) (%autoprove build.expansion-under-iff) (%autoprove logic.method-of-build.expansion) (%autoprove logic.conclusion-of-build.expansion) (%autoprove logic.subproofs-of-build.expansion) (%autoprove logic.extras-of-build.expansion) (%autoprove forcing-logic.appealp-of-build.expansion) (local (%disable default build.expansion)) (%autoprove forcing-logic.proofp-of-build.expansion (%enable default logic.appeal-step-okp logic.expansion-okp) (%restrict default definition-of-logic.proofp (equal x '(build.expansion a x))))) (defsection build.associativity (%autoadmit build.associativity) (local (%enable default build.associativity)) (%autoprove build.associativity-under-iff) (%autoprove logic.method-of-build.associativity) (%autoprove logic.conclusion-of-build.associativity) (%autoprove logic.subproofs-of-build.associativity) (%autoprove logic.extras-of-build.associativity) (%autoprove forcing-logic.appealp-of-build.associativity) (local (%disable default build.associativity)) (%autoprove forcing-logic.proofp-of-build.associativity (%enable default logic.appeal-step-okp logic.associativity-okp) (%restrict default definition-of-logic.proofp (equal x '(build.associativity x))))) (defsection build.instantiation (%autoadmit build.instantiation) (local (%enable default build.instantiation)) (%autoprove build.instantiation-under-iff) (%autoprove logic.method-of-build.instantiation) (%autoprove logic.conclusion-of-build.instantiation) (%autoprove logic.subproofs-of-build.instantiation) (%autoprove logic.extras-of-build.instantiation) (%autoprove forcing-logic.appealp-of-build.instantiation) (%autoprove forcing-logic.proofp-of-build.instantiation (%enable default logic.appeal-step-okp logic.instantiation-okp) (%restrict default definition-of-logic.proofp (equal x '(logic.appeal 'instantiation (logic.substitute-formula (logic.conclusion x) sigma) (cons x 'nil) sigma))))) (defsection build.functional-equality (%autoadmit build.functional-equality) (local (%enable default build.functional-equality)) (%autoprove build.functional-equality-under-iff) (%autoprove logic.method-of-build.functional-equality) (%autoprove logic.conclusion-of-build.functional-equality) (%autoprove logic.subproofs-of-build.functional-equality) (%autoprove logic.extras-of-build.functional-equality) (%autoprove forcing-logic.appealp-of-build.functional-equality) (local (%disable default build.functional-equality)) (%autoprove forcing-logic.proofp-of-build.functional-equality (%enable default logic.appeal-step-okp logic.functional-equality-okp) (%restrict default definition-of-logic.proofp (equal x '(build.functional-equality fn ti si))))) (defsection build.beta-reduction (%autoadmit build.beta-reduction) (local (%enable default build.beta-reduction)) (%autoprove build.beta-reduction-under-iff) (%autoprove logic.method-of-build.beta-reduction) (%autoprove logic.conclusion-of-build.beta-reduction) (%autoprove logic.subproofs-of-build.beta-reduction) (%autoprove logic.extras-of-build.beta-reduction) (%autoprove forcing-logic.appealp-of-build.beta-reduction) (local (%disable default build.beta-reduction)) (%autoprove forcing-logic.proofp-of-build.beta-reduction (%enable default logic.appeal-step-okp logic.beta-reduction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.beta-reduction formals body actuals))))) (defsection build.base-eval (%autoadmit build.base-eval) (local (%enable default build.base-eval)) (%autoprove build.base-eval-under-iff) (%autoprove logic.method-of-build.base-eval) (%autoprove logic.conclusion-of-build.base-eval) (%autoprove logic.subproofs-of-build.base-eval) (%autoprove logic.extras-of-build.base-eval) (%autoprove forcing-logic.appealp-of-build.base-eval) (local (%disable default build.base-eval)) (%autoprove forcing-logic.proofp-of-build.base-eval (%enable default logic.appeal-step-okp logic.base-eval-okp) (%restrict default definition-of-logic.proofp (equal x '(build.base-eval a))))) (defsection build.instantiation-list (%autoadmit build.instantiation-list) (%autoprove build.instantiation-list-when-not-consp (%restrict default build.instantiation-list (equal x 'x))) (%autoprove build.instantiation-list-of-cons (%restrict default build.instantiation-list (equal x '(cons a x)))) (%autoprove forcing-logic.appeal-listp-of-build.instantiation-list (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-build.instantiation-list (%cdr-induction x)) ;; BOZO next theorem is misnamed, should be proof-listp (%autoprove forcing-logic.proofp-of-build.instantiation-list (%cdr-induction x))) (defsection build.induction (%autoadmit build.induction) (local (%enable default build.induction)) (%autoprove build.induction-under-iff) (%autoprove logic.method-of-build.induction) (%autoprove logic.conclusion-of-build.induction) (%autoprove logic.subproofs-of-build.induction) (%autoprove logic.extras-of-build.induction) (%autoprove forcing-logic.appealp-of-build.induction) (local (%disable default build.induction)) (%autoprove forcing-logic.proofp-of-build.induction (%enable default logic.appeal-step-okp logic.induction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.induction f m qs all-sigmas proofs)))))
true
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "MILAWA") (%interactive) (defsection build.axiom (%autoadmit build.axiom) (local (%enable default build.axiom)) (%autoprove build.axiom-under-iff) (%autoprove logic.method-of-build.axiom) (%autoprove logic.conclusion-of-build.axiom) (%autoprove logic.subproofs-of-build.axiom) (%autoprove logic.extras-of-build.axiom) (%autoprove forcing-logic.appealp-of-build.axiom) (local (%disable default build.axiom)) (%autoprove forcing-logic.proofp-of-build.axiom (%enable default logic.axiom-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.axiom a))))) (defsection build.theorem (%autoadmit build.theorem) (local (%enable default build.theorem)) (%autoprove build.theorem-under-iff) (%autoprove logic.method-of-build.theorem) (%autoprove logic.conclusion-of-build.theorem) (%autoprove logic.subproofs-of-build.theorem) (%autoprove logic.extras-of-build.theorem) (%autoprove forcing-logic.appealp-of-build.theorem) (local (%disable default build.theorem)) (%autoprove forcing-logic.proofp-of-build.theorem (%enable default logic.theorem-okp logic.appeal-step-okp) (%restrict default definition-of-logic.proofp (equal x '(build.theorem a))))) (defsection build.propositional-schema (%autoadmit build.propositional-schema) (local (%enable default build.propositional-schema)) (%autoprove build.propositional-schema-under-iff) (%autoprove logic.method-of-build.propositional-schema) (%autoprove logic.conclusion-of-build.propositional-schema) (%autoprove logic.subproofs-of-build.propositional-schema) (%autoprove logic.extras-of-build.propositional-schema) (%autoprove forcing-logic.appealp-of-build.propositional-schema) (local (%disable default build.propositional-schema)) (%autoprove forcing-logic.proofp-of-build.propositional-schema (%enable default logic.appeal-step-okp logic.propositional-schema-okp) (%restrict default definition-of-logic.proofp (equal x '(build.propositional-schema a))))) (defsection build.cut (%autoadmit build.cut) (local (%enable default build.cut)) (%autoprove build.cut-under-iff) (%autoprove logic.method-of-build.cut) (%autoprove logic.conclusion-of-cut) ;; BOZO wrong name, should be build.cut (%autoprove logic.subproofs-of-build.cut) (%autoprove logic.extras-of-build.cut) (%autoprove forcing-logic.appealp-of-build.cut) (local (%disable default build.cut)) (%autoprove forcing-logic.proofp-of-build.cut (%enable default logic.appeal-step-okp logic.cut-okp) (%restrict default definition-of-logic.proofp (equal x '(build.cut x y))))) (defsection build.contraction (%autoadmit build.contraction) (local (%enable default build.contraction)) (%autoprove build.contraction-under-iff) (%autoprove logic.method-of-build.contraction) (%autoprove logic.conclusion-of-build.contraction) (%autoprove logic.subproofs-of-build.contraction) (%autoprove logic.extras-of-build.contraction) (%autoprove forcing-logic.appealp-of-build.contraction) (local (%disable default build.contraction)) (%autoprove forcing-logic.proofp-of-build.contraction (%enable default logic.appeal-step-okp logic.contraction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.contraction x))))) (defsection build.expansion (%autoadmit build.expansion) (local (%enable default build.expansion)) (%autoprove build.expansion-under-iff) (%autoprove logic.method-of-build.expansion) (%autoprove logic.conclusion-of-build.expansion) (%autoprove logic.subproofs-of-build.expansion) (%autoprove logic.extras-of-build.expansion) (%autoprove forcing-logic.appealp-of-build.expansion) (local (%disable default build.expansion)) (%autoprove forcing-logic.proofp-of-build.expansion (%enable default logic.appeal-step-okp logic.expansion-okp) (%restrict default definition-of-logic.proofp (equal x '(build.expansion a x))))) (defsection build.associativity (%autoadmit build.associativity) (local (%enable default build.associativity)) (%autoprove build.associativity-under-iff) (%autoprove logic.method-of-build.associativity) (%autoprove logic.conclusion-of-build.associativity) (%autoprove logic.subproofs-of-build.associativity) (%autoprove logic.extras-of-build.associativity) (%autoprove forcing-logic.appealp-of-build.associativity) (local (%disable default build.associativity)) (%autoprove forcing-logic.proofp-of-build.associativity (%enable default logic.appeal-step-okp logic.associativity-okp) (%restrict default definition-of-logic.proofp (equal x '(build.associativity x))))) (defsection build.instantiation (%autoadmit build.instantiation) (local (%enable default build.instantiation)) (%autoprove build.instantiation-under-iff) (%autoprove logic.method-of-build.instantiation) (%autoprove logic.conclusion-of-build.instantiation) (%autoprove logic.subproofs-of-build.instantiation) (%autoprove logic.extras-of-build.instantiation) (%autoprove forcing-logic.appealp-of-build.instantiation) (%autoprove forcing-logic.proofp-of-build.instantiation (%enable default logic.appeal-step-okp logic.instantiation-okp) (%restrict default definition-of-logic.proofp (equal x '(logic.appeal 'instantiation (logic.substitute-formula (logic.conclusion x) sigma) (cons x 'nil) sigma))))) (defsection build.functional-equality (%autoadmit build.functional-equality) (local (%enable default build.functional-equality)) (%autoprove build.functional-equality-under-iff) (%autoprove logic.method-of-build.functional-equality) (%autoprove logic.conclusion-of-build.functional-equality) (%autoprove logic.subproofs-of-build.functional-equality) (%autoprove logic.extras-of-build.functional-equality) (%autoprove forcing-logic.appealp-of-build.functional-equality) (local (%disable default build.functional-equality)) (%autoprove forcing-logic.proofp-of-build.functional-equality (%enable default logic.appeal-step-okp logic.functional-equality-okp) (%restrict default definition-of-logic.proofp (equal x '(build.functional-equality fn ti si))))) (defsection build.beta-reduction (%autoadmit build.beta-reduction) (local (%enable default build.beta-reduction)) (%autoprove build.beta-reduction-under-iff) (%autoprove logic.method-of-build.beta-reduction) (%autoprove logic.conclusion-of-build.beta-reduction) (%autoprove logic.subproofs-of-build.beta-reduction) (%autoprove logic.extras-of-build.beta-reduction) (%autoprove forcing-logic.appealp-of-build.beta-reduction) (local (%disable default build.beta-reduction)) (%autoprove forcing-logic.proofp-of-build.beta-reduction (%enable default logic.appeal-step-okp logic.beta-reduction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.beta-reduction formals body actuals))))) (defsection build.base-eval (%autoadmit build.base-eval) (local (%enable default build.base-eval)) (%autoprove build.base-eval-under-iff) (%autoprove logic.method-of-build.base-eval) (%autoprove logic.conclusion-of-build.base-eval) (%autoprove logic.subproofs-of-build.base-eval) (%autoprove logic.extras-of-build.base-eval) (%autoprove forcing-logic.appealp-of-build.base-eval) (local (%disable default build.base-eval)) (%autoprove forcing-logic.proofp-of-build.base-eval (%enable default logic.appeal-step-okp logic.base-eval-okp) (%restrict default definition-of-logic.proofp (equal x '(build.base-eval a))))) (defsection build.instantiation-list (%autoadmit build.instantiation-list) (%autoprove build.instantiation-list-when-not-consp (%restrict default build.instantiation-list (equal x 'x))) (%autoprove build.instantiation-list-of-cons (%restrict default build.instantiation-list (equal x '(cons a x)))) (%autoprove forcing-logic.appeal-listp-of-build.instantiation-list (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-build.instantiation-list (%cdr-induction x)) ;; BOZO next theorem is misnamed, should be proof-listp (%autoprove forcing-logic.proofp-of-build.instantiation-list (%cdr-induction x))) (defsection build.induction (%autoadmit build.induction) (local (%enable default build.induction)) (%autoprove build.induction-under-iff) (%autoprove logic.method-of-build.induction) (%autoprove logic.conclusion-of-build.induction) (%autoprove logic.subproofs-of-build.induction) (%autoprove logic.extras-of-build.induction) (%autoprove forcing-logic.appealp-of-build.induction) (local (%disable default build.induction)) (%autoprove forcing-logic.proofp-of-build.induction (%enable default logic.appeal-step-okp logic.induction-okp) (%restrict default definition-of-logic.proofp (equal x '(build.induction f m qs all-sigmas proofs)))))
[ { "context": "(in-package :lispmake)\n\n;; lispmake, written by Matthew Veety, et al.\n;; (c) Matthew Veety 2012-2021. Under BSD", "end": 61, "score": 0.9998880624771118, "start": 48, "tag": "NAME", "value": "Matthew Veety" }, { "context": " lispmake, written by Matthew Veety, et al.\n;; (c) Matthew Veety 2012-2021. Under BSD License.\n\n#+ccl (defvar *lis", "end": 90, "score": 0.9998843669891357, "start": 77, "tag": "NAME", "value": "Matthew Veety" } ]
lisp-specific.lisp
mveety/lispmake
0
(in-package :lispmake) ;; lispmake, written by Matthew Veety, et al. ;; (c) Matthew Veety 2012-2021. Under BSD License. #+ccl (defvar *lisp-type* 'ccl) #+sbcl (defvar *lisp-type* 'sbcl) #+clisp (defvar *lisp-type* 'clisp) #-(or ccl sbcl clisp) (lm-error "lisp-specific.lisp" "unable to support this lisp") (defun buildexe (outstream fname package toplevel &optional (lisp 'default)) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (or (not lisp) (equal lisp 'default)) (setf lisp *lisp-type*)) (if *debugging* (lm-debug "buildexe" "generating output")) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (and package toplevel) (progn (format outstream "#+sbcl (sb-ext:save-lisp-and-die \"~A\" :executable t :toplevel #'~A:~A)~%" (car fname) (car package) (car toplevel)) (format outstream "#+ccl (ccl:save-application ~A :toplevel-function #'~A:~A :prepend-kernel t)~%" (car fname) (car package) (car toplevel)) (format outstream "#+clisp (ext:saveinitmem ~A :init-function #'~A:~A :executable t :norc t)~%" (car fname) (car package) (car toplevel))))) (defun pl-compile-file-pregen () (if (not (equal *compile-files* nil)) (dolist (x *compile-files*) (format t "(compile-file \"~A\" :output-file \"~A\" :verbose t)~%" x (concatenate 'string x ".fasl"))))) (defun pl-compile-file (args) (if (not (equal (length args) 1)) (lm-error "pl-compile-file" "args length incorrect") (setf *compile-files* (append *compile-files* args)))) (defun disable-debugger () #+sbcl (setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t "lispmake: crash: please report the below~%") (print c) (terpri) (terpri) (sb-ext:exit))) #-sbcl (format t "lispmake: warning: lispmake does not support debugger handling in this lisp~%") nil) (defun run-build-process () (if (not (equal *lisp-executable* nil)) (let ((fname (output-fname))) #+sbcl (sb-ext:run-program *lisp-executable* (list "--noinform" "--load" fname) :output *standard-output*) #+ccl (ccl:run-program *lisp-executable* (list "--load" fname) :output *standard-output*) #-(or sbcl ccl) (format t "lispmake: warning: building not supported in this lisp~%")))) (defun pl-lisp-executable (args) (if (not (equal args nil)) (if (equal *lisp-executable* nil) (setf *lisp-executable* (car args))) (lm-error "pl-lisp-executable" "args must be a string"))) (defun run-executable (exec-file &rest arguments) #+sbcl (sb-ext:run-program exec-file arguments :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%")) (defun oth-run-executable (exec-file arguments-list) #+sbcl (sb-ext:run-program exec-file arguments-list :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%"))
36821
(in-package :lispmake) ;; lispmake, written by <NAME>, et al. ;; (c) <NAME> 2012-2021. Under BSD License. #+ccl (defvar *lisp-type* 'ccl) #+sbcl (defvar *lisp-type* 'sbcl) #+clisp (defvar *lisp-type* 'clisp) #-(or ccl sbcl clisp) (lm-error "lisp-specific.lisp" "unable to support this lisp") (defun buildexe (outstream fname package toplevel &optional (lisp 'default)) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (or (not lisp) (equal lisp 'default)) (setf lisp *lisp-type*)) (if *debugging* (lm-debug "buildexe" "generating output")) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (and package toplevel) (progn (format outstream "#+sbcl (sb-ext:save-lisp-and-die \"~A\" :executable t :toplevel #'~A:~A)~%" (car fname) (car package) (car toplevel)) (format outstream "#+ccl (ccl:save-application ~A :toplevel-function #'~A:~A :prepend-kernel t)~%" (car fname) (car package) (car toplevel)) (format outstream "#+clisp (ext:saveinitmem ~A :init-function #'~A:~A :executable t :norc t)~%" (car fname) (car package) (car toplevel))))) (defun pl-compile-file-pregen () (if (not (equal *compile-files* nil)) (dolist (x *compile-files*) (format t "(compile-file \"~A\" :output-file \"~A\" :verbose t)~%" x (concatenate 'string x ".fasl"))))) (defun pl-compile-file (args) (if (not (equal (length args) 1)) (lm-error "pl-compile-file" "args length incorrect") (setf *compile-files* (append *compile-files* args)))) (defun disable-debugger () #+sbcl (setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t "lispmake: crash: please report the below~%") (print c) (terpri) (terpri) (sb-ext:exit))) #-sbcl (format t "lispmake: warning: lispmake does not support debugger handling in this lisp~%") nil) (defun run-build-process () (if (not (equal *lisp-executable* nil)) (let ((fname (output-fname))) #+sbcl (sb-ext:run-program *lisp-executable* (list "--noinform" "--load" fname) :output *standard-output*) #+ccl (ccl:run-program *lisp-executable* (list "--load" fname) :output *standard-output*) #-(or sbcl ccl) (format t "lispmake: warning: building not supported in this lisp~%")))) (defun pl-lisp-executable (args) (if (not (equal args nil)) (if (equal *lisp-executable* nil) (setf *lisp-executable* (car args))) (lm-error "pl-lisp-executable" "args must be a string"))) (defun run-executable (exec-file &rest arguments) #+sbcl (sb-ext:run-program exec-file arguments :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%")) (defun oth-run-executable (exec-file arguments-list) #+sbcl (sb-ext:run-program exec-file arguments-list :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%"))
true
(in-package :lispmake) ;; lispmake, written by PI:NAME:<NAME>END_PI, et al. ;; (c) PI:NAME:<NAME>END_PI 2012-2021. Under BSD License. #+ccl (defvar *lisp-type* 'ccl) #+sbcl (defvar *lisp-type* 'sbcl) #+clisp (defvar *lisp-type* 'clisp) #-(or ccl sbcl clisp) (lm-error "lisp-specific.lisp" "unable to support this lisp") (defun buildexe (outstream fname package toplevel &optional (lisp 'default)) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (or (not lisp) (equal lisp 'default)) (setf lisp *lisp-type*)) (if *debugging* (lm-debug "buildexe" "generating output")) (if *debugging* (format t "lispmake: debug: lisp=~A~%" lisp)) (if (and package toplevel) (progn (format outstream "#+sbcl (sb-ext:save-lisp-and-die \"~A\" :executable t :toplevel #'~A:~A)~%" (car fname) (car package) (car toplevel)) (format outstream "#+ccl (ccl:save-application ~A :toplevel-function #'~A:~A :prepend-kernel t)~%" (car fname) (car package) (car toplevel)) (format outstream "#+clisp (ext:saveinitmem ~A :init-function #'~A:~A :executable t :norc t)~%" (car fname) (car package) (car toplevel))))) (defun pl-compile-file-pregen () (if (not (equal *compile-files* nil)) (dolist (x *compile-files*) (format t "(compile-file \"~A\" :output-file \"~A\" :verbose t)~%" x (concatenate 'string x ".fasl"))))) (defun pl-compile-file (args) (if (not (equal (length args) 1)) (lm-error "pl-compile-file" "args length incorrect") (setf *compile-files* (append *compile-files* args)))) (defun disable-debugger () #+sbcl (setf *debugger-hook* (lambda (c h) (declare (ignore h)) (format t "lispmake: crash: please report the below~%") (print c) (terpri) (terpri) (sb-ext:exit))) #-sbcl (format t "lispmake: warning: lispmake does not support debugger handling in this lisp~%") nil) (defun run-build-process () (if (not (equal *lisp-executable* nil)) (let ((fname (output-fname))) #+sbcl (sb-ext:run-program *lisp-executable* (list "--noinform" "--load" fname) :output *standard-output*) #+ccl (ccl:run-program *lisp-executable* (list "--load" fname) :output *standard-output*) #-(or sbcl ccl) (format t "lispmake: warning: building not supported in this lisp~%")))) (defun pl-lisp-executable (args) (if (not (equal args nil)) (if (equal *lisp-executable* nil) (setf *lisp-executable* (car args))) (lm-error "pl-lisp-executable" "args must be a string"))) (defun run-executable (exec-file &rest arguments) #+sbcl (sb-ext:run-program exec-file arguments :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%")) (defun oth-run-executable (exec-file arguments-list) #+sbcl (sb-ext:run-program exec-file arguments-list :output *standard-output*) #-sbcl (format t "lispmake: warning: unable to run external executables~%"))
[ { "context": "onrecursive.lisp\n;;;;\n;;;; Copyright (c) 2013-2015 Robert Smith\n\n(ql:quickload :macroexpand-dammit)\n\n;;; Single b", "end": 85, "score": 0.9993071556091309, "start": 73, "tag": "NAME", "value": "Robert Smith" } ]
symbol-macrolet-nonrecursive.lisp
stylewarning/lisp-random
56
;;;; symbol-macrolet-nonrecursive.lisp ;;;; ;;;; Copyright (c) 2013-2015 Robert Smith (ql:quickload :macroexpand-dammit) ;;; Single binding example for the general idea of how the more ;;; general version works. #+#:ignore (defmacro symbol-macrolet-1 ((x y) &body body) (let ((gx (gensym (format nil "~A-" x)))) `(let ((,gx ,x)) (symbol-macrolet ((,x (symbol-macrolet ((,x ,gx)) ,y))) ,@body)))) #+#:old-way (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in an AST-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform (recursive) substitutions of itself inside of the bindings. This means that if a binding refers to itself, the same symbol must be bound in the lexical environment at runtime. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(let (,@(mapcar #'list gxs xs)) (symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body)))) ;;; This version does *not* require a lexical binding of the ;;; variables. (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in a lexically-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform recursive substitutions of itself inside of the bindings. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(symbol-macrolet (,@(mapcar (lambda (x gx) `(,gx ,x)) xs gxs)) ,(macroexpand-dammit:macroexpand-dammit `(symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body) env))))
11049
;;;; symbol-macrolet-nonrecursive.lisp ;;;; ;;;; Copyright (c) 2013-2015 <NAME> (ql:quickload :macroexpand-dammit) ;;; Single binding example for the general idea of how the more ;;; general version works. #+#:ignore (defmacro symbol-macrolet-1 ((x y) &body body) (let ((gx (gensym (format nil "~A-" x)))) `(let ((,gx ,x)) (symbol-macrolet ((,x (symbol-macrolet ((,x ,gx)) ,y))) ,@body)))) #+#:old-way (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in an AST-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform (recursive) substitutions of itself inside of the bindings. This means that if a binding refers to itself, the same symbol must be bound in the lexical environment at runtime. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(let (,@(mapcar #'list gxs xs)) (symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body)))) ;;; This version does *not* require a lexical binding of the ;;; variables. (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in a lexically-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform recursive substitutions of itself inside of the bindings. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(symbol-macrolet (,@(mapcar (lambda (x gx) `(,gx ,x)) xs gxs)) ,(macroexpand-dammit:macroexpand-dammit `(symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body) env))))
true
;;;; symbol-macrolet-nonrecursive.lisp ;;;; ;;;; Copyright (c) 2013-2015 PI:NAME:<NAME>END_PI (ql:quickload :macroexpand-dammit) ;;; Single binding example for the general idea of how the more ;;; general version works. #+#:ignore (defmacro symbol-macrolet-1 ((x y) &body body) (let ((gx (gensym (format nil "~A-" x)))) `(let ((,gx ,x)) (symbol-macrolet ((,x (symbol-macrolet ((,x ,gx)) ,y))) ,@body)))) #+#:old-way (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in an AST-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform (recursive) substitutions of itself inside of the bindings. This means that if a binding refers to itself, the same symbol must be bound in the lexical environment at runtime. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(let (,@(mapcar #'list gxs xs)) (symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body)))) ;;; This version does *not* require a lexical binding of the ;;; variables. (defmacro symbol-macrolet-1 ((&rest macro-bindings) &body body &environment env) "Similar to SYMBOL-MACROLET, SYMBOL-MACROLET-1 will substitute (in a lexically-aware fashion) the symbols provided in the first element of each of the MACRO-BINDINGS with the second element of each of the MACRO-BINDINGS in the body BODY. However, unlike SYMBOL-MACROLET, SYMBOL-MACROLET-1 will not perform recursive substitutions of itself inside of the bindings. Example: (let ((x #(1 2 3))) (symbol-macrolet-1 ((x (aref x 1))) (list x 'x (let ((x 1)) x)))) ==> (2 X 1) " (let* ((xs (mapcar #'car macro-bindings)) (ys (mapcar #'cadr macro-bindings)) (gxs (mapcar (lambda (x) (gensym (format nil "~A-" x))) xs))) `(symbol-macrolet (,@(mapcar (lambda (x gx) `(,gx ,x)) xs gxs)) ,(macroexpand-dammit:macroexpand-dammit `(symbol-macrolet (,@(mapcar (lambda (x gx y) `(,x (symbol-macrolet ((,x ,gx)) ,y))) xs gxs ys)) ,@body) env))))
[ { "context": ";;; Copyright (c) 2016 Gheorghe Lisca <[email protected]>\n;;; All rights reserved.", "end": 37, "score": 0.9998835921287537, "start": 23, "tag": "NAME", "value": "Gheorghe Lisca" }, { "context": ";;; Copyright (c) 2016 Gheorghe Lisca <[email protected]>\n;;; All rights reserved.\n;;;\n;;; Redistribution ", "end": 61, "score": 0.9999261498451233, "start": 39, "tag": "EMAIL", "value": "[email protected]" } ]
kitchen_context/lisp/stove-table-frames.lisp
code-iai/cram_popcorn_demo
0
;;; Copyright (c) 2016 Gheorghe Lisca <[email protected]> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; * Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; * Neither the name of Gheorghe Lisca nor the names of his ;;; partners may be used to endorse or promote products derived from ;;; this software without specific prior written permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ;;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;;; POSSIBILITY OF SUCH DAMAGE. ;;; (in-package :kitchen-context) ;;stove table frame names (defparameter *stove-table-initial-location-frame-name* "stove_table_initial_location_frame") (defparameter *stove-table-frame-name* "stove_table_frame") (defparameter *stove-table-away-center-frame-name* "stove_table_away_center_frame") (defparameter *stove-table-away-left-frame-name* "stove_table_away_left_frame") (defparameter *stove-table-away-right-frame-name* "stove_table_away_right_frame") (defparameter *stove-table-close-to-center-frame-name* "stove_table_close_to_center_frame") (defparameter *stove-table-close-to-left-frame-name* "stove_table_close_to_left_frame") (defparameter *stove-table-close-to-right-frame-name* "stove_table_close_to_right_frame") (defparameter *stove-cooking-plate-frame-name* "stove_cooking_plate_frame") (defparameter *stove-cooking-plate-left-frame-name* "stove_cooking_plate_left_frame") (defparameter *stove-cooking-plate-right-frame-name* "stove_cooking_plate_right_frame") (defparameter *stove-over-cooking-plate-left-frame-name* "stove_over_cooking_plate_left_frame") (defparameter *stove-over-cooking-plate-right-frame-name* "stove_over_cooking_plate_right_frame") (defparameter *stove-region-left-frame-name* "stove_region_left_frame") (defparameter *stove-region-right-frame-name* "stove_region_right_frame") (defparameter *stove-over-region-left-frame-name* "stove_over_region_left_frame") (defparameter *stove-over-region-right-frame-name* "stove_over_region_right_frame") (defparameter *stove-region-left-corner-frame-name* "stove_region_left_corner_frame") (defparameter *stove-region-left-corner-2-frame-name* "stove_region_left_corner_2_frame") (defparameter *stove-region-right-corner-frame-name* "stove_region_right_corner_frame") (defparameter *stove-over-region-left-corner-frame-name* "stove_over_region_left_corner_frame") (defparameter *stove-over-region-right-corner-frame-name* "stove_over_region_right_corner_frame") ;;stove knob frame names (defparameter *stove-knob-pregrasping-on-frame-name* "stove_knob_pregrasping_on_frame") (defparameter *stove-knob-pregrasping-off-frame-name* "stove_knob_pregrasping_off_frame") (defparameter *stove-knob-grasping-on-frame-name* "stove_knob_grasping_on_frame") (defparameter *stove-knob-grasping-off-frame-name* "stove_knob_grasping_off_frame") (defparameter *stove-knob-on-frame-name* "stove_knob_on_frame") (defparameter *stove-knob-off-frame-name* "stove_knob_off_frame") (defparameter *stove-knob-initial-location-frame-name* "stove_knob_initial_location_frame") (defparameter *stove-knob-on-object-frame-name* "stove_knob_on_object_frame") (defparameter *stove-knob-off-object-frame-name* "stove_knob_off_object_frame") ;;stove drawers opening position names (defparameter *stove-open-drawer-left-frame-name* "stove_open_drawer_left_frame") (defparameter *stove-open-drawer-right-frame-name* "stove_open_drawer_right_frame") (defparameter *stove-table-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id "map" :child-frame-id *stove-table-initial-location-frame-name* :translation (cl-transforms:make-3d-vector 0.68 -0.05 0.05) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-initial-location-frame-name* :child-frame-id *stove-table-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-center-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-left-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-right-frame-name* :translation (cl-transforms:make-3d-vector -1.0 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-center-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-left-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-right-frame-name* :translation (cl-transforms:make-3d-vector -0.8 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-cooking-plate-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.69) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.16 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector -0.15 -0.04 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-left-frame-name* :child-frame-id *stove-over-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-right-frame-name* :child-frame-id *stove-over-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0465 0.6075 0.3608) :rotation (cl-transforms:normalize (cl-transforms:make-quaternion -0.1902 0.1989 0.0102 -0.9613)))) (defparameter *stove-over-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.18 0.60 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-2-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-2-frame-name* :translation (cl-transforms:make-3d-vector 0.08 0.40 -0.03) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-knob-initial-location-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.22 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-on-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-off-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-pregrasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-pregrasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-grasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-grasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0 )))) (defparameter *stove-open-drawer-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-left-frame-name* :translation (cl-transforms:make-3d-vector -0.43 0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-open-drawer-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-right-frame-name* :translation (cl-transforms:make-3d-vector -0.48 -0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defun publish-stove-table-frames () (cl-transforms-stamped:start-publishing-transforms-static-globaly *stove-table-initial-location-frame* *stove-table-frame* *stove-table-away-center-frame* *stove-table-away-left-frame* *stove-table-away-right-frame* *stove-table-close-to-center-frame* *stove-table-close-to-left-frame* *stove-table-close-to-right-frame* *stove-cooking-plate-frame* *stove-cooking-plate-left-frame* *stove-cooking-plate-right-frame* *stove-over-cooking-plate-left-frame* *stove-over-cooking-plate-right-frame* *stove-region-left-frame* *stove-region-right-frame* *stove-over-region-left-frame* *stove-over-region-right-frame* *stove-region-left-corner-frame* *stove-region-left-corner-2-frame* *stove-region-right-corner-frame* *stove-over-region-left-corner-frame* *stove-over-region-right-corner-frame* *stove-knob-pregrasping-on-frame* *stove-knob-pregrasping-off-frame* *stove-knob-grasping-on-frame* *stove-knob-grasping-off-frame* *stove-knob-on-frame* *stove-knob-off-frame* *stove-knob-initial-location-frame* *stove-knob-on-object-frame* *stove-knob-off-object-frame* *stove-open-drawer-left-frame* *stove-open-drawer-right-frame*))
63516
;;; Copyright (c) 2016 <NAME> <<EMAIL>> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; * Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; * Neither the name of Gheorghe Lisca nor the names of his ;;; partners may be used to endorse or promote products derived from ;;; this software without specific prior written permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ;;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;;; POSSIBILITY OF SUCH DAMAGE. ;;; (in-package :kitchen-context) ;;stove table frame names (defparameter *stove-table-initial-location-frame-name* "stove_table_initial_location_frame") (defparameter *stove-table-frame-name* "stove_table_frame") (defparameter *stove-table-away-center-frame-name* "stove_table_away_center_frame") (defparameter *stove-table-away-left-frame-name* "stove_table_away_left_frame") (defparameter *stove-table-away-right-frame-name* "stove_table_away_right_frame") (defparameter *stove-table-close-to-center-frame-name* "stove_table_close_to_center_frame") (defparameter *stove-table-close-to-left-frame-name* "stove_table_close_to_left_frame") (defparameter *stove-table-close-to-right-frame-name* "stove_table_close_to_right_frame") (defparameter *stove-cooking-plate-frame-name* "stove_cooking_plate_frame") (defparameter *stove-cooking-plate-left-frame-name* "stove_cooking_plate_left_frame") (defparameter *stove-cooking-plate-right-frame-name* "stove_cooking_plate_right_frame") (defparameter *stove-over-cooking-plate-left-frame-name* "stove_over_cooking_plate_left_frame") (defparameter *stove-over-cooking-plate-right-frame-name* "stove_over_cooking_plate_right_frame") (defparameter *stove-region-left-frame-name* "stove_region_left_frame") (defparameter *stove-region-right-frame-name* "stove_region_right_frame") (defparameter *stove-over-region-left-frame-name* "stove_over_region_left_frame") (defparameter *stove-over-region-right-frame-name* "stove_over_region_right_frame") (defparameter *stove-region-left-corner-frame-name* "stove_region_left_corner_frame") (defparameter *stove-region-left-corner-2-frame-name* "stove_region_left_corner_2_frame") (defparameter *stove-region-right-corner-frame-name* "stove_region_right_corner_frame") (defparameter *stove-over-region-left-corner-frame-name* "stove_over_region_left_corner_frame") (defparameter *stove-over-region-right-corner-frame-name* "stove_over_region_right_corner_frame") ;;stove knob frame names (defparameter *stove-knob-pregrasping-on-frame-name* "stove_knob_pregrasping_on_frame") (defparameter *stove-knob-pregrasping-off-frame-name* "stove_knob_pregrasping_off_frame") (defparameter *stove-knob-grasping-on-frame-name* "stove_knob_grasping_on_frame") (defparameter *stove-knob-grasping-off-frame-name* "stove_knob_grasping_off_frame") (defparameter *stove-knob-on-frame-name* "stove_knob_on_frame") (defparameter *stove-knob-off-frame-name* "stove_knob_off_frame") (defparameter *stove-knob-initial-location-frame-name* "stove_knob_initial_location_frame") (defparameter *stove-knob-on-object-frame-name* "stove_knob_on_object_frame") (defparameter *stove-knob-off-object-frame-name* "stove_knob_off_object_frame") ;;stove drawers opening position names (defparameter *stove-open-drawer-left-frame-name* "stove_open_drawer_left_frame") (defparameter *stove-open-drawer-right-frame-name* "stove_open_drawer_right_frame") (defparameter *stove-table-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id "map" :child-frame-id *stove-table-initial-location-frame-name* :translation (cl-transforms:make-3d-vector 0.68 -0.05 0.05) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-initial-location-frame-name* :child-frame-id *stove-table-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-center-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-left-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-right-frame-name* :translation (cl-transforms:make-3d-vector -1.0 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-center-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-left-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-right-frame-name* :translation (cl-transforms:make-3d-vector -0.8 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-cooking-plate-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.69) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.16 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector -0.15 -0.04 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-left-frame-name* :child-frame-id *stove-over-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-right-frame-name* :child-frame-id *stove-over-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0465 0.6075 0.3608) :rotation (cl-transforms:normalize (cl-transforms:make-quaternion -0.1902 0.1989 0.0102 -0.9613)))) (defparameter *stove-over-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.18 0.60 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-2-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-2-frame-name* :translation (cl-transforms:make-3d-vector 0.08 0.40 -0.03) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-knob-initial-location-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.22 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-on-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-off-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-pregrasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-pregrasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-grasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-grasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0 )))) (defparameter *stove-open-drawer-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-left-frame-name* :translation (cl-transforms:make-3d-vector -0.43 0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-open-drawer-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-right-frame-name* :translation (cl-transforms:make-3d-vector -0.48 -0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defun publish-stove-table-frames () (cl-transforms-stamped:start-publishing-transforms-static-globaly *stove-table-initial-location-frame* *stove-table-frame* *stove-table-away-center-frame* *stove-table-away-left-frame* *stove-table-away-right-frame* *stove-table-close-to-center-frame* *stove-table-close-to-left-frame* *stove-table-close-to-right-frame* *stove-cooking-plate-frame* *stove-cooking-plate-left-frame* *stove-cooking-plate-right-frame* *stove-over-cooking-plate-left-frame* *stove-over-cooking-plate-right-frame* *stove-region-left-frame* *stove-region-right-frame* *stove-over-region-left-frame* *stove-over-region-right-frame* *stove-region-left-corner-frame* *stove-region-left-corner-2-frame* *stove-region-right-corner-frame* *stove-over-region-left-corner-frame* *stove-over-region-right-corner-frame* *stove-knob-pregrasping-on-frame* *stove-knob-pregrasping-off-frame* *stove-knob-grasping-on-frame* *stove-knob-grasping-off-frame* *stove-knob-on-frame* *stove-knob-off-frame* *stove-knob-initial-location-frame* *stove-knob-on-object-frame* *stove-knob-off-object-frame* *stove-open-drawer-left-frame* *stove-open-drawer-right-frame*))
true
;;; Copyright (c) 2016 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; * Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; * Neither the name of Gheorghe Lisca nor the names of his ;;; partners may be used to endorse or promote products derived from ;;; this software without specific prior written permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ;;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;;; POSSIBILITY OF SUCH DAMAGE. ;;; (in-package :kitchen-context) ;;stove table frame names (defparameter *stove-table-initial-location-frame-name* "stove_table_initial_location_frame") (defparameter *stove-table-frame-name* "stove_table_frame") (defparameter *stove-table-away-center-frame-name* "stove_table_away_center_frame") (defparameter *stove-table-away-left-frame-name* "stove_table_away_left_frame") (defparameter *stove-table-away-right-frame-name* "stove_table_away_right_frame") (defparameter *stove-table-close-to-center-frame-name* "stove_table_close_to_center_frame") (defparameter *stove-table-close-to-left-frame-name* "stove_table_close_to_left_frame") (defparameter *stove-table-close-to-right-frame-name* "stove_table_close_to_right_frame") (defparameter *stove-cooking-plate-frame-name* "stove_cooking_plate_frame") (defparameter *stove-cooking-plate-left-frame-name* "stove_cooking_plate_left_frame") (defparameter *stove-cooking-plate-right-frame-name* "stove_cooking_plate_right_frame") (defparameter *stove-over-cooking-plate-left-frame-name* "stove_over_cooking_plate_left_frame") (defparameter *stove-over-cooking-plate-right-frame-name* "stove_over_cooking_plate_right_frame") (defparameter *stove-region-left-frame-name* "stove_region_left_frame") (defparameter *stove-region-right-frame-name* "stove_region_right_frame") (defparameter *stove-over-region-left-frame-name* "stove_over_region_left_frame") (defparameter *stove-over-region-right-frame-name* "stove_over_region_right_frame") (defparameter *stove-region-left-corner-frame-name* "stove_region_left_corner_frame") (defparameter *stove-region-left-corner-2-frame-name* "stove_region_left_corner_2_frame") (defparameter *stove-region-right-corner-frame-name* "stove_region_right_corner_frame") (defparameter *stove-over-region-left-corner-frame-name* "stove_over_region_left_corner_frame") (defparameter *stove-over-region-right-corner-frame-name* "stove_over_region_right_corner_frame") ;;stove knob frame names (defparameter *stove-knob-pregrasping-on-frame-name* "stove_knob_pregrasping_on_frame") (defparameter *stove-knob-pregrasping-off-frame-name* "stove_knob_pregrasping_off_frame") (defparameter *stove-knob-grasping-on-frame-name* "stove_knob_grasping_on_frame") (defparameter *stove-knob-grasping-off-frame-name* "stove_knob_grasping_off_frame") (defparameter *stove-knob-on-frame-name* "stove_knob_on_frame") (defparameter *stove-knob-off-frame-name* "stove_knob_off_frame") (defparameter *stove-knob-initial-location-frame-name* "stove_knob_initial_location_frame") (defparameter *stove-knob-on-object-frame-name* "stove_knob_on_object_frame") (defparameter *stove-knob-off-object-frame-name* "stove_knob_off_object_frame") ;;stove drawers opening position names (defparameter *stove-open-drawer-left-frame-name* "stove_open_drawer_left_frame") (defparameter *stove-open-drawer-right-frame-name* "stove_open_drawer_right_frame") (defparameter *stove-table-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id "map" :child-frame-id *stove-table-initial-location-frame-name* :translation (cl-transforms:make-3d-vector 0.68 -0.05 0.05) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-initial-location-frame-name* :child-frame-id *stove-table-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-center-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-left-frame-name* :translation (cl-transforms:make-3d-vector -1.0 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-away-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-away-right-frame-name* :translation (cl-transforms:make-3d-vector -1.0 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-center-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-center-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-left-frame-name* :translation (cl-transforms:make-3d-vector -0.8 0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-table-close-to-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-table-close-to-right-frame-name* :translation (cl-transforms:make-3d-vector -0.8 -0.5 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-cooking-plate-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.69) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.16 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector -0.15 -0.04 -0.01) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-left-frame-name* :child-frame-id *stove-over-cooking-plate-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-cooking-plate-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-right-frame-name* :child-frame-id *stove-over-cooking-plate-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.30) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-frame-name* :translation (cl-transforms:make-3d-vector 0.0465 0.6075 0.3608) :rotation (cl-transforms:normalize (cl-transforms:make-quaternion -0.1902 0.1989 0.0102 -0.9613)))) (defparameter *stove-over-region-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-frame-name* :translation (cl-transforms:make-3d-vector 0.0 -0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.18 0.60 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-left-corner-2-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-left-corner-2-frame-name* :translation (cl-transforms:make-3d-vector 0.08 0.40 -0.03) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.00) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-left-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-left-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.15 0.55 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-over-region-right-corner-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-over-region-right-corner-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.47 0.15) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-initial-location-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-cooking-plate-frame-name* :child-frame-id *stove-knob-initial-location-frame-name* :translation (cl-transforms:make-3d-vector -0.22 -0.22 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-on-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-off-object-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-object-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-knob-pregrasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-pregrasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-pregrasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.05) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-grasping-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0)))) (defparameter *stove-knob-grasping-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-grasping-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-on-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-on-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ -3.14 2.0)))) (defparameter *stove-knob-off-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-knob-initial-location-frame-name* :child-frame-id *stove-knob-off-frame-name* :translation (cl-transforms:make-3d-vector 0.0 0.0 0.0) :rotation (cl-transforms:euler->quaternion ; :ax (/ 3.14 2.0) :ay (/ 3.14 2.0) :az (/ 3.14 2.0 )))) (defparameter *stove-open-drawer-left-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-left-frame-name* :translation (cl-transforms:make-3d-vector -0.43 0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defparameter *stove-open-drawer-right-frame* (make-instance 'cl-transforms-stamped:transform-stamped :stamp 0.0 :frame-id *stove-table-frame-name* :child-frame-id *stove-open-drawer-right-frame-name* :translation (cl-transforms:make-3d-vector -0.48 -0.52 0.47) :rotation (cl-transforms:make-identity-rotation))) (defun publish-stove-table-frames () (cl-transforms-stamped:start-publishing-transforms-static-globaly *stove-table-initial-location-frame* *stove-table-frame* *stove-table-away-center-frame* *stove-table-away-left-frame* *stove-table-away-right-frame* *stove-table-close-to-center-frame* *stove-table-close-to-left-frame* *stove-table-close-to-right-frame* *stove-cooking-plate-frame* *stove-cooking-plate-left-frame* *stove-cooking-plate-right-frame* *stove-over-cooking-plate-left-frame* *stove-over-cooking-plate-right-frame* *stove-region-left-frame* *stove-region-right-frame* *stove-over-region-left-frame* *stove-over-region-right-frame* *stove-region-left-corner-frame* *stove-region-left-corner-2-frame* *stove-region-right-corner-frame* *stove-over-region-left-corner-frame* *stove-over-region-right-corner-frame* *stove-knob-pregrasping-on-frame* *stove-knob-pregrasping-off-frame* *stove-knob-grasping-on-frame* *stove-knob-grasping-off-frame* *stove-knob-on-frame* *stove-knob-off-frame* *stove-knob-initial-location-frame* *stove-knob-on-object-frame* *stove-knob-off-object-frame* *stove-open-drawer-left-frame* *stove-open-drawer-right-frame*))
[ { "context": "(world-arbitrator world)\n ;; Let us thank Scott Lembcke, who had to hunt bugs down and code solutions\n ", "end": 2323, "score": 0.9933720231056213, "start": 2310, "tag": "NAME", "value": "Scott Lembcke" } ]
src/world.lisp
death/squirl
0
;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*- (in-package :squirl) (defvar *contact-persistence* 3) ;;; These names can be better (defparameter *default-iterations* 10) (defparameter *default-elastic-iterations* 0) (defparameter *initial-cell-size* 100d0) (defparameter *initial-count* 1000) (defparameter *initial-array-length* 4) (defgeneric collide (actor1 actor2 arbiter) (:method ((actor1 t) (actor2 t) (arbiter t)) t)) (defstruct (world (:constructor %make-world (&key iterations elastic-iterations gravity damping collision-callback))) ;; Number of iterations to use in the impulse solver to solve contacts. (iterations *default-iterations* :type fixnum) ;; Number of iterations to use in the impulse solver to solve elastic collisions. (elastic-iterations *default-elastic-iterations* :type fixnum) ;; Default gravity to supply when integrating rigid body motions. (gravity +zero-vector+ :type vec) ;; Default damping to supply when integrating rigid body motions. (damping 1d0 :type double-float) ;; Internal slots (timestamp 0 :type fixnum) ; Time stamp, incremented on every call to WORLD-STEP ;; Static and active shape spatial hashes (static-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) (active-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) ;; Static and active bodies (static-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) (active-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Active arbiters for the impulse solver. (arbiters (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Persistent contact set. (contact-set (make-hash-set 0 #'arbiter-shapes-equal) :type hash-set) ;; Constraints in the system. (constraints (make-adjustable-vector *initial-array-length*) :type (vector t)) arbitrator ;; Collision callback (collision-callback #'collide)) (defun make-world (&rest keys) (declare (dynamic-extent keys)) (let* ((world (apply #'%make-world keys)) (contact-set (world-contact-set world)) (timestamp (world-timestamp world)) (arbiters (world-arbiters world))) (setf (world-arbitrator world) ;; Let us thank Scott Lembcke, who had to hunt bugs down and code solutions ;; in C, while we can simply port said solutions into CL. (lambda (shape1 shape2) ;; This is a kludge. It might break on new shape types. (when (or (and (poly-p shape1) (circle-p shape2)) (and (poly-p shape1) (segment-p shape2))) (rotatef shape1 shape2)) (when (collision-possible-p shape1 shape2) (let ((contacts (collide-shapes shape1 shape2))) (when contacts (let ((arbiter (ensure-arbiter shape1 shape2 contact-set timestamp))) ;; This is also a kludge... got any better ideas? (setf (arbiter-shape-a arbiter) shape1 (arbiter-shape-b arbiter) shape2) (vector-push-extend arbiter arbiters) (arbiter-inject arbiter contacts))))))) world)) (define-print-object (world) (format t "Iterations: ~a, Elastic iterations: ~a, Gravity: ~a, Body count: ~a" (world-iterations world) (world-elastic-iterations world) (world-gravity world) (+ (length (world-active-bodies world)) (length (world-static-bodies world))))) (defmacro defcollision (&body args) (multiple-value-bind (qualifiers lambda-list body) (parse-defmethod args) (destructuring-bind (arg-a arg-b arbiter) lambda-list (flet ((parse-specialized-arg (arg) (etypecase arg (symbol (values arg t)) (list (destructuring-bind (arg-name specializer) arg (values arg-name specializer)))))) (multiple-value-bind (actor-a spec-a) (parse-specialized-arg arg-a) (multiple-value-bind (actor-b spec-b) (parse-specialized-arg arg-b) (with-gensyms (cnm-sym nmp-sym) (if (equal spec-a spec-b) `(defmethod collide ,@qualifiers ,lambda-list ,@body) `(flet ((handler (,actor-a ,actor-b ,arbiter ,cnm-sym ,nmp-sym) (declare (ignorable ,actor-a ,actor-b ,arbiter)) ,@(pop-declarations body) (flet ((call-next-method (&rest cnm-args) (apply ,cnm-sym cnm-args)) (next-method-p () (funcall ,nmp-sym))) (declare (ignorable #'call-next-method #'next-method-p)) ,@body))) (defmethod collide ,@qualifiers (,arg-a ,arg-b ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p)) (defmethod collide ,@qualifiers (,arg-b ,arg-a ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p))))))))))) ;;; ;;; Body, Shape, and Joint Management ;;; (defun world-add-shape (world shape) (assert (shape-body shape)) (let ((is-static (staticp (shape-body shape)))) (when is-static (shape-cache-data shape)) (world-hash-insert (if is-static (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape) (shape-bbox shape)))) (defun world-add-body (world body) (let ((bodies (if (staticp body) (world-static-bodies world) (world-active-bodies world)))) (assert (not (find body bodies))) (vector-push-extend body bodies) (dolist (shape (body-shapes body)) (world-add-shape world shape)) (setf (body-world body) world) body)) (defun world-add-constraint (world constraint) (assert (not (find constraint (world-constraints world)))) (vector-push-extend constraint (world-constraints world)) constraint) (defun shape-removal-arbiter-reject (world shape) (delete-iff (world-arbiters world) (lambda (arbiter) (and (not (eq shape (arbiter-shape-a arbiter))) (not (eq shape (arbiter-shape-b arbiter))))))) (defun world-remove-shape (world shape) (world-hash-remove (if (staticp (shape-body shape)) (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape)) (shape-removal-arbiter-reject world shape)) (defun world-remove-body (world body) (map nil (lambda (shape) (world-remove-shape world shape)) (body-shapes body)) (if (staticp body) ; Needs more macrolet (deletef (world-static-bodies world) body) (deletef (world-active-bodies world) body))) (defun world-remove-constraint (world constraint) (deletef (world-constraints world) constraint)) ;;; ;;; Point Query Functions ;;; (defun world-point-query (function world point) (flet ((query-point-and-shape (point shape) (when (point-inside-shape-p shape point) (funcall function shape)))) (world-hash-point-query #'query-point-and-shape (world-active-shapes world) point) (world-hash-point-query #'query-point-and-shape (world-static-shapes world) point))) ;;; Unlike the C version, this actually returns the -first- shape ;;; encountered which matches the layers, groups, and point. It ;;; uses a functional RETURN-FROM rather than the pointer juggling ;;; from the C version, for speed and clarity. (defun world-point-query-first (world point) (world-point-query (lambda (shape) (return-from world-point-query-first shape)) world point)) ;;; ;;; Body Convenience Functions ;;; (defun map-world (function world) "Calls FUNCTION on each body in WORLD" (map nil function (world-static-bodies world)) (map nil function (world-active-bodies world))) (defun world-bodies (world) (concatenate 'vector (world-static-bodies world) (world-active-bodies world))) ;;; ;;; Segment Query Functions ;;; (defun world-shape-segment-query (function world start end &aux collisionp) (flet ((query-shape (shape) (prog1 1.0 (when (segment-intersects-shape-p shape start end) (when function (funcall function shape 0d0 +zero-vector+)) (setf collisionp t))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) collisionp)) (defun world-shape-segment-query-first (world start end &aux first-shape min-ratio first-normal) (flet ((query-shape (shape) (multiple-value-bind (hitp ratio normal) (segment-intersects-shape-p shape start end) (when (and hitp (< ratio min-ratio)) (setf first-shape shape min-ratio ratio first-normal normal))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) (values first-shape min-ratio first-normal))) ;;; ;;; World Hash Management ;;; (defun resize-world-static-hash (world dimension count) (resize-world-hash (world-static-shapes world) (float dimension 1d0) count) (rehash-world-hash (world-static-shapes world))) (defun resize-world-active-hash (world dimension count) (resize-world-hash (world-active-shapes world) (float dimension 1d0) count)) (defun rehash-world-static-data (world) (map-world-hash #'shape-cache-data (world-static-shapes world)) (rehash-world-hash (world-static-shapes world))) ;;; ;;; Collision Detection Functions ;;; (defun collision-possible-p (shape1 shape2) (and (not (eq (shape-body shape1) (shape-body shape2))) (bbox-intersects-p (shape-bbox shape1) (shape-bbox shape2)))) ;;; ;;; Arbiter Frobbing Functions ;;; (defun filter-world-arbiters (world) "Filter arbiter list based on collisions." (delete-iff (world-arbiters world) (lambda (arbiter) (let ((a (body-actor (shape-body (arbiter-shape-a arbiter)))) (b (body-actor (shape-body (arbiter-shape-b arbiter))))) (when (or a b) (not (funcall (world-collision-callback world) a b arbiter))))))) (defun flush-arbiters (world) "Flush outdated arbiters." (let ((timestamp (world-timestamp world)) (contact-set (world-contact-set world)) (arbiters (world-arbiters world))) (hash-set-delete-if (lambda (arbiter) (> (- timestamp (arbiter-stamp arbiter)) *contact-persistence*)) contact-set) (setf (fill-pointer arbiters) 0))) (defun ensure-arbiter (shape1 shape2 hash-set timestamp) (let* ((hash (hash-pair (shape-id shape1) (shape-id shape2))) (arbiter (hash-set-find-if (lambda (arbiter) (arbiter-has-shapes-p arbiter shape1 shape2)) hash-set hash))) (if arbiter (prog1 arbiter (setf (arbiter-stamp arbiter) timestamp)) (hash-set-insert hash-set hash (make-arbiter nil shape1 shape2 timestamp))))) ;;; ;;; All-Important WORLD-STEP Function ;;; (defun resolve-collisions (world) "Resolves collisions between objects in WORLD." (let ((active-shapes (world-active-shapes world)) (static-shapes (world-static-shapes world)) (arbitrator (world-arbitrator world))) (map-world-hash #'shape-cache-data active-shapes) ; Pre-cache BBoxen ;; Detect collisions between active and static shapes. (map-world-hash (lambda (shape) (world-hash-query arbitrator static-shapes shape (shape-bbox shape))) active-shapes) ;; This seems to be detecting collisions between active shapes. (world-hash-query-rehash arbitrator active-shapes)) (filter-world-arbiters world)) (defun prestep-world (world dt dt-inv) (let ((arbiters (world-arbiters world)) (constraints (world-constraints world))) ;; Prestep the arbiters (do-vector (arbiter arbiters) (arbiter-prestep arbiter dt-inv)) ;; Prestep the constraints (do-vector (constraint constraints) (pre-step constraint dt dt-inv)))) (defun apply-elastic-impulses (world) (let ((elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop repeat elastic-iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter t)) (map nil #'apply-impulse constraints)))) (defun integrate-velocities (world dt &aux (damping (expt (/ (world-damping world)) (- dt)))) (let ((active-bodies (world-active-bodies world)) (arbiters (world-arbiters world)) (gravity (world-gravity world))) ;; Apply gravity forces. (do-vector (body active-bodies) (body-update-velocity body gravity damping dt)) ;; Apply cached arbiter impulses. (map nil #'arbiter-apply-cached-impulse arbiters))) (defun solve-impulses (world) "Run the impulse solver, using the old-style elastic solver if elastic iterations are disabled" (let ((iterations (world-iterations world)) (elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop with old-style-p = (zerop elastic-iterations) repeat iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter old-style-p)) (do-vector (constraint constraints) (apply-impulse constraint))))) (defun world-step (world timestep) "Step the physical state of WORLD by DT seconds." (assert (not (zerop timestep)) (world) "Cannot step ~A by 0" world) (let* ((dt (float timestep 0d0)) (dt-inv (/ dt)) (active-bodies (world-active-bodies world))) (flush-arbiters world) (do-vector (body active-bodies) (body-update-position body dt)) ; Integrate positions (resolve-collisions world) (prestep-world world dt dt-inv) (apply-elastic-impulses world) (integrate-velocities world dt) (solve-impulses world) (incf (world-timestamp world))))
43121
;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*- (in-package :squirl) (defvar *contact-persistence* 3) ;;; These names can be better (defparameter *default-iterations* 10) (defparameter *default-elastic-iterations* 0) (defparameter *initial-cell-size* 100d0) (defparameter *initial-count* 1000) (defparameter *initial-array-length* 4) (defgeneric collide (actor1 actor2 arbiter) (:method ((actor1 t) (actor2 t) (arbiter t)) t)) (defstruct (world (:constructor %make-world (&key iterations elastic-iterations gravity damping collision-callback))) ;; Number of iterations to use in the impulse solver to solve contacts. (iterations *default-iterations* :type fixnum) ;; Number of iterations to use in the impulse solver to solve elastic collisions. (elastic-iterations *default-elastic-iterations* :type fixnum) ;; Default gravity to supply when integrating rigid body motions. (gravity +zero-vector+ :type vec) ;; Default damping to supply when integrating rigid body motions. (damping 1d0 :type double-float) ;; Internal slots (timestamp 0 :type fixnum) ; Time stamp, incremented on every call to WORLD-STEP ;; Static and active shape spatial hashes (static-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) (active-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) ;; Static and active bodies (static-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) (active-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Active arbiters for the impulse solver. (arbiters (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Persistent contact set. (contact-set (make-hash-set 0 #'arbiter-shapes-equal) :type hash-set) ;; Constraints in the system. (constraints (make-adjustable-vector *initial-array-length*) :type (vector t)) arbitrator ;; Collision callback (collision-callback #'collide)) (defun make-world (&rest keys) (declare (dynamic-extent keys)) (let* ((world (apply #'%make-world keys)) (contact-set (world-contact-set world)) (timestamp (world-timestamp world)) (arbiters (world-arbiters world))) (setf (world-arbitrator world) ;; Let us thank <NAME>, who had to hunt bugs down and code solutions ;; in C, while we can simply port said solutions into CL. (lambda (shape1 shape2) ;; This is a kludge. It might break on new shape types. (when (or (and (poly-p shape1) (circle-p shape2)) (and (poly-p shape1) (segment-p shape2))) (rotatef shape1 shape2)) (when (collision-possible-p shape1 shape2) (let ((contacts (collide-shapes shape1 shape2))) (when contacts (let ((arbiter (ensure-arbiter shape1 shape2 contact-set timestamp))) ;; This is also a kludge... got any better ideas? (setf (arbiter-shape-a arbiter) shape1 (arbiter-shape-b arbiter) shape2) (vector-push-extend arbiter arbiters) (arbiter-inject arbiter contacts))))))) world)) (define-print-object (world) (format t "Iterations: ~a, Elastic iterations: ~a, Gravity: ~a, Body count: ~a" (world-iterations world) (world-elastic-iterations world) (world-gravity world) (+ (length (world-active-bodies world)) (length (world-static-bodies world))))) (defmacro defcollision (&body args) (multiple-value-bind (qualifiers lambda-list body) (parse-defmethod args) (destructuring-bind (arg-a arg-b arbiter) lambda-list (flet ((parse-specialized-arg (arg) (etypecase arg (symbol (values arg t)) (list (destructuring-bind (arg-name specializer) arg (values arg-name specializer)))))) (multiple-value-bind (actor-a spec-a) (parse-specialized-arg arg-a) (multiple-value-bind (actor-b spec-b) (parse-specialized-arg arg-b) (with-gensyms (cnm-sym nmp-sym) (if (equal spec-a spec-b) `(defmethod collide ,@qualifiers ,lambda-list ,@body) `(flet ((handler (,actor-a ,actor-b ,arbiter ,cnm-sym ,nmp-sym) (declare (ignorable ,actor-a ,actor-b ,arbiter)) ,@(pop-declarations body) (flet ((call-next-method (&rest cnm-args) (apply ,cnm-sym cnm-args)) (next-method-p () (funcall ,nmp-sym))) (declare (ignorable #'call-next-method #'next-method-p)) ,@body))) (defmethod collide ,@qualifiers (,arg-a ,arg-b ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p)) (defmethod collide ,@qualifiers (,arg-b ,arg-a ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p))))))))))) ;;; ;;; Body, Shape, and Joint Management ;;; (defun world-add-shape (world shape) (assert (shape-body shape)) (let ((is-static (staticp (shape-body shape)))) (when is-static (shape-cache-data shape)) (world-hash-insert (if is-static (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape) (shape-bbox shape)))) (defun world-add-body (world body) (let ((bodies (if (staticp body) (world-static-bodies world) (world-active-bodies world)))) (assert (not (find body bodies))) (vector-push-extend body bodies) (dolist (shape (body-shapes body)) (world-add-shape world shape)) (setf (body-world body) world) body)) (defun world-add-constraint (world constraint) (assert (not (find constraint (world-constraints world)))) (vector-push-extend constraint (world-constraints world)) constraint) (defun shape-removal-arbiter-reject (world shape) (delete-iff (world-arbiters world) (lambda (arbiter) (and (not (eq shape (arbiter-shape-a arbiter))) (not (eq shape (arbiter-shape-b arbiter))))))) (defun world-remove-shape (world shape) (world-hash-remove (if (staticp (shape-body shape)) (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape)) (shape-removal-arbiter-reject world shape)) (defun world-remove-body (world body) (map nil (lambda (shape) (world-remove-shape world shape)) (body-shapes body)) (if (staticp body) ; Needs more macrolet (deletef (world-static-bodies world) body) (deletef (world-active-bodies world) body))) (defun world-remove-constraint (world constraint) (deletef (world-constraints world) constraint)) ;;; ;;; Point Query Functions ;;; (defun world-point-query (function world point) (flet ((query-point-and-shape (point shape) (when (point-inside-shape-p shape point) (funcall function shape)))) (world-hash-point-query #'query-point-and-shape (world-active-shapes world) point) (world-hash-point-query #'query-point-and-shape (world-static-shapes world) point))) ;;; Unlike the C version, this actually returns the -first- shape ;;; encountered which matches the layers, groups, and point. It ;;; uses a functional RETURN-FROM rather than the pointer juggling ;;; from the C version, for speed and clarity. (defun world-point-query-first (world point) (world-point-query (lambda (shape) (return-from world-point-query-first shape)) world point)) ;;; ;;; Body Convenience Functions ;;; (defun map-world (function world) "Calls FUNCTION on each body in WORLD" (map nil function (world-static-bodies world)) (map nil function (world-active-bodies world))) (defun world-bodies (world) (concatenate 'vector (world-static-bodies world) (world-active-bodies world))) ;;; ;;; Segment Query Functions ;;; (defun world-shape-segment-query (function world start end &aux collisionp) (flet ((query-shape (shape) (prog1 1.0 (when (segment-intersects-shape-p shape start end) (when function (funcall function shape 0d0 +zero-vector+)) (setf collisionp t))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) collisionp)) (defun world-shape-segment-query-first (world start end &aux first-shape min-ratio first-normal) (flet ((query-shape (shape) (multiple-value-bind (hitp ratio normal) (segment-intersects-shape-p shape start end) (when (and hitp (< ratio min-ratio)) (setf first-shape shape min-ratio ratio first-normal normal))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) (values first-shape min-ratio first-normal))) ;;; ;;; World Hash Management ;;; (defun resize-world-static-hash (world dimension count) (resize-world-hash (world-static-shapes world) (float dimension 1d0) count) (rehash-world-hash (world-static-shapes world))) (defun resize-world-active-hash (world dimension count) (resize-world-hash (world-active-shapes world) (float dimension 1d0) count)) (defun rehash-world-static-data (world) (map-world-hash #'shape-cache-data (world-static-shapes world)) (rehash-world-hash (world-static-shapes world))) ;;; ;;; Collision Detection Functions ;;; (defun collision-possible-p (shape1 shape2) (and (not (eq (shape-body shape1) (shape-body shape2))) (bbox-intersects-p (shape-bbox shape1) (shape-bbox shape2)))) ;;; ;;; Arbiter Frobbing Functions ;;; (defun filter-world-arbiters (world) "Filter arbiter list based on collisions." (delete-iff (world-arbiters world) (lambda (arbiter) (let ((a (body-actor (shape-body (arbiter-shape-a arbiter)))) (b (body-actor (shape-body (arbiter-shape-b arbiter))))) (when (or a b) (not (funcall (world-collision-callback world) a b arbiter))))))) (defun flush-arbiters (world) "Flush outdated arbiters." (let ((timestamp (world-timestamp world)) (contact-set (world-contact-set world)) (arbiters (world-arbiters world))) (hash-set-delete-if (lambda (arbiter) (> (- timestamp (arbiter-stamp arbiter)) *contact-persistence*)) contact-set) (setf (fill-pointer arbiters) 0))) (defun ensure-arbiter (shape1 shape2 hash-set timestamp) (let* ((hash (hash-pair (shape-id shape1) (shape-id shape2))) (arbiter (hash-set-find-if (lambda (arbiter) (arbiter-has-shapes-p arbiter shape1 shape2)) hash-set hash))) (if arbiter (prog1 arbiter (setf (arbiter-stamp arbiter) timestamp)) (hash-set-insert hash-set hash (make-arbiter nil shape1 shape2 timestamp))))) ;;; ;;; All-Important WORLD-STEP Function ;;; (defun resolve-collisions (world) "Resolves collisions between objects in WORLD." (let ((active-shapes (world-active-shapes world)) (static-shapes (world-static-shapes world)) (arbitrator (world-arbitrator world))) (map-world-hash #'shape-cache-data active-shapes) ; Pre-cache BBoxen ;; Detect collisions between active and static shapes. (map-world-hash (lambda (shape) (world-hash-query arbitrator static-shapes shape (shape-bbox shape))) active-shapes) ;; This seems to be detecting collisions between active shapes. (world-hash-query-rehash arbitrator active-shapes)) (filter-world-arbiters world)) (defun prestep-world (world dt dt-inv) (let ((arbiters (world-arbiters world)) (constraints (world-constraints world))) ;; Prestep the arbiters (do-vector (arbiter arbiters) (arbiter-prestep arbiter dt-inv)) ;; Prestep the constraints (do-vector (constraint constraints) (pre-step constraint dt dt-inv)))) (defun apply-elastic-impulses (world) (let ((elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop repeat elastic-iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter t)) (map nil #'apply-impulse constraints)))) (defun integrate-velocities (world dt &aux (damping (expt (/ (world-damping world)) (- dt)))) (let ((active-bodies (world-active-bodies world)) (arbiters (world-arbiters world)) (gravity (world-gravity world))) ;; Apply gravity forces. (do-vector (body active-bodies) (body-update-velocity body gravity damping dt)) ;; Apply cached arbiter impulses. (map nil #'arbiter-apply-cached-impulse arbiters))) (defun solve-impulses (world) "Run the impulse solver, using the old-style elastic solver if elastic iterations are disabled" (let ((iterations (world-iterations world)) (elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop with old-style-p = (zerop elastic-iterations) repeat iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter old-style-p)) (do-vector (constraint constraints) (apply-impulse constraint))))) (defun world-step (world timestep) "Step the physical state of WORLD by DT seconds." (assert (not (zerop timestep)) (world) "Cannot step ~A by 0" world) (let* ((dt (float timestep 0d0)) (dt-inv (/ dt)) (active-bodies (world-active-bodies world))) (flush-arbiters world) (do-vector (body active-bodies) (body-update-position body dt)) ; Integrate positions (resolve-collisions world) (prestep-world world dt dt-inv) (apply-elastic-impulses world) (integrate-velocities world dt) (solve-impulses world) (incf (world-timestamp world))))
true
;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*- (in-package :squirl) (defvar *contact-persistence* 3) ;;; These names can be better (defparameter *default-iterations* 10) (defparameter *default-elastic-iterations* 0) (defparameter *initial-cell-size* 100d0) (defparameter *initial-count* 1000) (defparameter *initial-array-length* 4) (defgeneric collide (actor1 actor2 arbiter) (:method ((actor1 t) (actor2 t) (arbiter t)) t)) (defstruct (world (:constructor %make-world (&key iterations elastic-iterations gravity damping collision-callback))) ;; Number of iterations to use in the impulse solver to solve contacts. (iterations *default-iterations* :type fixnum) ;; Number of iterations to use in the impulse solver to solve elastic collisions. (elastic-iterations *default-elastic-iterations* :type fixnum) ;; Default gravity to supply when integrating rigid body motions. (gravity +zero-vector+ :type vec) ;; Default damping to supply when integrating rigid body motions. (damping 1d0 :type double-float) ;; Internal slots (timestamp 0 :type fixnum) ; Time stamp, incremented on every call to WORLD-STEP ;; Static and active shape spatial hashes (static-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) (active-shapes (make-world-hash *initial-cell-size* *initial-count*) :type world-hash) ;; Static and active bodies (static-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) (active-bodies (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Active arbiters for the impulse solver. (arbiters (make-adjustable-vector *initial-array-length*) :type (vector t)) ;; Persistent contact set. (contact-set (make-hash-set 0 #'arbiter-shapes-equal) :type hash-set) ;; Constraints in the system. (constraints (make-adjustable-vector *initial-array-length*) :type (vector t)) arbitrator ;; Collision callback (collision-callback #'collide)) (defun make-world (&rest keys) (declare (dynamic-extent keys)) (let* ((world (apply #'%make-world keys)) (contact-set (world-contact-set world)) (timestamp (world-timestamp world)) (arbiters (world-arbiters world))) (setf (world-arbitrator world) ;; Let us thank PI:NAME:<NAME>END_PI, who had to hunt bugs down and code solutions ;; in C, while we can simply port said solutions into CL. (lambda (shape1 shape2) ;; This is a kludge. It might break on new shape types. (when (or (and (poly-p shape1) (circle-p shape2)) (and (poly-p shape1) (segment-p shape2))) (rotatef shape1 shape2)) (when (collision-possible-p shape1 shape2) (let ((contacts (collide-shapes shape1 shape2))) (when contacts (let ((arbiter (ensure-arbiter shape1 shape2 contact-set timestamp))) ;; This is also a kludge... got any better ideas? (setf (arbiter-shape-a arbiter) shape1 (arbiter-shape-b arbiter) shape2) (vector-push-extend arbiter arbiters) (arbiter-inject arbiter contacts))))))) world)) (define-print-object (world) (format t "Iterations: ~a, Elastic iterations: ~a, Gravity: ~a, Body count: ~a" (world-iterations world) (world-elastic-iterations world) (world-gravity world) (+ (length (world-active-bodies world)) (length (world-static-bodies world))))) (defmacro defcollision (&body args) (multiple-value-bind (qualifiers lambda-list body) (parse-defmethod args) (destructuring-bind (arg-a arg-b arbiter) lambda-list (flet ((parse-specialized-arg (arg) (etypecase arg (symbol (values arg t)) (list (destructuring-bind (arg-name specializer) arg (values arg-name specializer)))))) (multiple-value-bind (actor-a spec-a) (parse-specialized-arg arg-a) (multiple-value-bind (actor-b spec-b) (parse-specialized-arg arg-b) (with-gensyms (cnm-sym nmp-sym) (if (equal spec-a spec-b) `(defmethod collide ,@qualifiers ,lambda-list ,@body) `(flet ((handler (,actor-a ,actor-b ,arbiter ,cnm-sym ,nmp-sym) (declare (ignorable ,actor-a ,actor-b ,arbiter)) ,@(pop-declarations body) (flet ((call-next-method (&rest cnm-args) (apply ,cnm-sym cnm-args)) (next-method-p () (funcall ,nmp-sym))) (declare (ignorable #'call-next-method #'next-method-p)) ,@body))) (defmethod collide ,@qualifiers (,arg-a ,arg-b ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p)) (defmethod collide ,@qualifiers (,arg-b ,arg-a ,arbiter) (handler ,actor-a ,actor-b ,arbiter #'call-next-method #'next-method-p))))))))))) ;;; ;;; Body, Shape, and Joint Management ;;; (defun world-add-shape (world shape) (assert (shape-body shape)) (let ((is-static (staticp (shape-body shape)))) (when is-static (shape-cache-data shape)) (world-hash-insert (if is-static (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape) (shape-bbox shape)))) (defun world-add-body (world body) (let ((bodies (if (staticp body) (world-static-bodies world) (world-active-bodies world)))) (assert (not (find body bodies))) (vector-push-extend body bodies) (dolist (shape (body-shapes body)) (world-add-shape world shape)) (setf (body-world body) world) body)) (defun world-add-constraint (world constraint) (assert (not (find constraint (world-constraints world)))) (vector-push-extend constraint (world-constraints world)) constraint) (defun shape-removal-arbiter-reject (world shape) (delete-iff (world-arbiters world) (lambda (arbiter) (and (not (eq shape (arbiter-shape-a arbiter))) (not (eq shape (arbiter-shape-b arbiter))))))) (defun world-remove-shape (world shape) (world-hash-remove (if (staticp (shape-body shape)) (world-static-shapes world) (world-active-shapes world)) shape (shape-id shape)) (shape-removal-arbiter-reject world shape)) (defun world-remove-body (world body) (map nil (lambda (shape) (world-remove-shape world shape)) (body-shapes body)) (if (staticp body) ; Needs more macrolet (deletef (world-static-bodies world) body) (deletef (world-active-bodies world) body))) (defun world-remove-constraint (world constraint) (deletef (world-constraints world) constraint)) ;;; ;;; Point Query Functions ;;; (defun world-point-query (function world point) (flet ((query-point-and-shape (point shape) (when (point-inside-shape-p shape point) (funcall function shape)))) (world-hash-point-query #'query-point-and-shape (world-active-shapes world) point) (world-hash-point-query #'query-point-and-shape (world-static-shapes world) point))) ;;; Unlike the C version, this actually returns the -first- shape ;;; encountered which matches the layers, groups, and point. It ;;; uses a functional RETURN-FROM rather than the pointer juggling ;;; from the C version, for speed and clarity. (defun world-point-query-first (world point) (world-point-query (lambda (shape) (return-from world-point-query-first shape)) world point)) ;;; ;;; Body Convenience Functions ;;; (defun map-world (function world) "Calls FUNCTION on each body in WORLD" (map nil function (world-static-bodies world)) (map nil function (world-active-bodies world))) (defun world-bodies (world) (concatenate 'vector (world-static-bodies world) (world-active-bodies world))) ;;; ;;; Segment Query Functions ;;; (defun world-shape-segment-query (function world start end &aux collisionp) (flet ((query-shape (shape) (prog1 1.0 (when (segment-intersects-shape-p shape start end) (when function (funcall function shape 0d0 +zero-vector+)) (setf collisionp t))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) collisionp)) (defun world-shape-segment-query-first (world start end &aux first-shape min-ratio first-normal) (flet ((query-shape (shape) (multiple-value-bind (hitp ratio normal) (segment-intersects-shape-p shape start end) (when (and hitp (< ratio min-ratio)) (setf first-shape shape min-ratio ratio first-normal normal))))) (world-hash-query-segment #'query-shape (world-static-shapes world) start end) (world-hash-query-segment #'query-shape (world-active-shapes world) start end) (values first-shape min-ratio first-normal))) ;;; ;;; World Hash Management ;;; (defun resize-world-static-hash (world dimension count) (resize-world-hash (world-static-shapes world) (float dimension 1d0) count) (rehash-world-hash (world-static-shapes world))) (defun resize-world-active-hash (world dimension count) (resize-world-hash (world-active-shapes world) (float dimension 1d0) count)) (defun rehash-world-static-data (world) (map-world-hash #'shape-cache-data (world-static-shapes world)) (rehash-world-hash (world-static-shapes world))) ;;; ;;; Collision Detection Functions ;;; (defun collision-possible-p (shape1 shape2) (and (not (eq (shape-body shape1) (shape-body shape2))) (bbox-intersects-p (shape-bbox shape1) (shape-bbox shape2)))) ;;; ;;; Arbiter Frobbing Functions ;;; (defun filter-world-arbiters (world) "Filter arbiter list based on collisions." (delete-iff (world-arbiters world) (lambda (arbiter) (let ((a (body-actor (shape-body (arbiter-shape-a arbiter)))) (b (body-actor (shape-body (arbiter-shape-b arbiter))))) (when (or a b) (not (funcall (world-collision-callback world) a b arbiter))))))) (defun flush-arbiters (world) "Flush outdated arbiters." (let ((timestamp (world-timestamp world)) (contact-set (world-contact-set world)) (arbiters (world-arbiters world))) (hash-set-delete-if (lambda (arbiter) (> (- timestamp (arbiter-stamp arbiter)) *contact-persistence*)) contact-set) (setf (fill-pointer arbiters) 0))) (defun ensure-arbiter (shape1 shape2 hash-set timestamp) (let* ((hash (hash-pair (shape-id shape1) (shape-id shape2))) (arbiter (hash-set-find-if (lambda (arbiter) (arbiter-has-shapes-p arbiter shape1 shape2)) hash-set hash))) (if arbiter (prog1 arbiter (setf (arbiter-stamp arbiter) timestamp)) (hash-set-insert hash-set hash (make-arbiter nil shape1 shape2 timestamp))))) ;;; ;;; All-Important WORLD-STEP Function ;;; (defun resolve-collisions (world) "Resolves collisions between objects in WORLD." (let ((active-shapes (world-active-shapes world)) (static-shapes (world-static-shapes world)) (arbitrator (world-arbitrator world))) (map-world-hash #'shape-cache-data active-shapes) ; Pre-cache BBoxen ;; Detect collisions between active and static shapes. (map-world-hash (lambda (shape) (world-hash-query arbitrator static-shapes shape (shape-bbox shape))) active-shapes) ;; This seems to be detecting collisions between active shapes. (world-hash-query-rehash arbitrator active-shapes)) (filter-world-arbiters world)) (defun prestep-world (world dt dt-inv) (let ((arbiters (world-arbiters world)) (constraints (world-constraints world))) ;; Prestep the arbiters (do-vector (arbiter arbiters) (arbiter-prestep arbiter dt-inv)) ;; Prestep the constraints (do-vector (constraint constraints) (pre-step constraint dt dt-inv)))) (defun apply-elastic-impulses (world) (let ((elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop repeat elastic-iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter t)) (map nil #'apply-impulse constraints)))) (defun integrate-velocities (world dt &aux (damping (expt (/ (world-damping world)) (- dt)))) (let ((active-bodies (world-active-bodies world)) (arbiters (world-arbiters world)) (gravity (world-gravity world))) ;; Apply gravity forces. (do-vector (body active-bodies) (body-update-velocity body gravity damping dt)) ;; Apply cached arbiter impulses. (map nil #'arbiter-apply-cached-impulse arbiters))) (defun solve-impulses (world) "Run the impulse solver, using the old-style elastic solver if elastic iterations are disabled" (let ((iterations (world-iterations world)) (elastic-iterations (world-elastic-iterations world)) (arbiters (world-arbiters world)) (constraints (world-constraints world))) (loop with old-style-p = (zerop elastic-iterations) repeat iterations do (do-vector (arbiter arbiters) (arbiter-apply-impulse arbiter old-style-p)) (do-vector (constraint constraints) (apply-impulse constraint))))) (defun world-step (world timestep) "Step the physical state of WORLD by DT seconds." (assert (not (zerop timestep)) (world) "Cannot step ~A by 0" world) (let* ((dt (float timestep 0d0)) (dt-inv (/ dt)) (active-bodies (world-active-bodies world))) (flush-arbiters world) (do-vector (body active-bodies) (body-update-position body dt)) ; Integrate positions (resolve-collisions world) (prestep-world world dt dt-inv) (apply-elastic-impulses world) (integrate-velocities world dt) (solve-impulses world) (incf (world-timestamp world))))
[ { "context": "ode: LISP; Package: CCL -*-\n;;;\n;;; Copyright 2010 Clozure Associates\n;;;\n;;; Licensed under the Apache License, Versio", "end": 76, "score": 0.978924572467804, "start": 58, "tag": "NAME", "value": "Clozure Associates" }, { "context": "n to compute dominance\n;; immediate dominators per Cooper, Harvey, Kennedy.\n(defmethod cg-compute ((stage (", "end": 16328, "score": 0.7676029205322266, "start": 16322, "tag": "NAME", "value": "Cooper" }, { "context": "pute dominance\n;; immediate dominators per Cooper, Harvey, Kennedy.\n(defmethod cg-compute ((stage (eql :idoms)) &aux", "end": 16345, "score": 0.9122743010520935, "start": 16330, "tag": "NAME", "value": "Harvey, Kennedy" } ]
library/dominance.lisp
digikar99/ccl
732
;;;-*-Mode: LISP; Package: CCL -*- ;;; ;;; Copyright 2010 Clozure Associates ;;; ;;; Licensed under the Apache License, Version 2.0 (the "License"); ;;; you may not use this file except in compliance with the License. ;;; You may obtain a copy of the License at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0 ;;; ;;; Unless required by applicable law or agreed to in writing, software ;;; distributed under the License is distributed on an "AS IS" BASIS, ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;;; See the License for the specific language governing permissions and ;;; limitations under the License. (in-package "CCL") ;(setq *print-array* nil) ;(setq *print-simple-bit-vector* nil) #+:linuxx8664-target (progn (export '(idom-heap-utilization)) #| (open-core "home:core.28209") (idom-heap-utilization :unit nil :sort :size) |# (defconstant half-fixnum-shift (ash (integer-length most-positive-fixnum) -1)) (defconstant half-fixnum-mask (1- (ash 1 half-fixnum-shift))) (defstruct (core-graph (:include core-info) (:conc-name "CG.") (:constructor %cons-cg)) (heap-base 0 :type fixnum) (heap-end 0 :type fixnum) (stage nil) ;; indication of what has been computed and what hasn't, so can restart. (head-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) (ptrs-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) ;; Nodes after eliminating single-entry and leaf objects (nodes #() :type simple-vector) ;; map postorder-idx -> dnode (revnodes #() :type simple-vector) ;; map dnode -> postorder-idx (roots () :type list) (predecessors #() :type simple-vector) ;; postorder-idx -> list of postorder indices of predecessors (node-doms #() :type simple-vector) ;; postorder-idx of node -> postorder-idx of its immediate dominator (idoms #() :type simple-vector) ;; sequence of postorder indices of immediate dominators (revidoms #() :type simple-vector) ;; map dnode -> index in idoms (logsizes #() :type simple-vector) ;; corresponding sequence of logical sizes (including all owned objects) (physizes #() :type simple-vector) ;; corresponding sequence of physical sizes (including all owned objects) ) (setq *core-info-class* 'core-graph) (defparameter *cg-stages* '(nil :objects :leaves :postorder :predecessors :idoms :idom-sizes t)) (defmethod cg-compute :before (stage &aux (cg (current-core))) (assert (memq stage *cg-stages*)) (check-type cg core-graph) (when (eql (cg.heap-base cg) 0) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (setf (cg.heap-base cg) (core-q area-ptr target::area.low)) (setf (cg.heap-end cg) (core-q area-ptr target::area.active)))) ;; ensure have all the prereqs (loop for undone = (cdr (memq (cg.stage cg) *cg-stages*)) while (memq stage (cdr undone)) do (format t "~&Computing ~a" (car undone)) do (cg-compute (car undone)))) (defmethod cg-compute :after (stage &aux (cg (current-core))) (setf (cg.stage cg) stage)) (defmethod cg-compute ((stage (eql t))) ;; before method does all the work nil) (declaim (inline core-node-p)) (defun core-node-p (ptr) (or (core-consp ptr) (core-uvector-p ptr))) (declaim (inline dnode addr)) (defun dnode (base n) (the fixnum (ash (%i- n base) (- target::dnode-shift)))) (defun addr (base n) (%i+ base (ash (the fixnum n) target::dnode-shift))) (defun tagged-ptr (ptr) (let ((header (core-q ptr))) (cond ((uvheader-p header) (let ((subtag (uvheader-typecode header))) (+ ptr (cond ((eq subtag target::subtag-symbol) target::fulltag-symbol) ((eq subtag target::subtag-function) target::fulltag-function) (t target::fulltag-misc)))) ) (t (+ ptr target::fulltag-cons))))) (defun core-physsize (obj) ;; (assert (core-node-p obj)) (if (core-consp obj) target::dnode-size (logandc2 (+ (uvheader-byte-size (core-uvheader obj)) target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (defun core-object-sizes (obj) (let ((fulltag (logand obj target::fulltagmask))) (if (eq fulltag target::fulltag-cons) (values target::dnode-size target::dnode-size) (if (%i<= target::fulltag-misc fulltag) (let* ((header (core-uvheader obj)) (logsize (uvheader-byte-size header)) ;; total including header and alignment. (total (logandc2 (+ logsize target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (values logsize total)))))) (defun link-range (ptr) (declare (fixnum ptr)) (let* ((addr (logandc2 ptr target::fulltagmask)) (header (core-q addr)) (end addr)) (declare (fixnum addr end)) (if (uvheader-p header) (let ((subtag (%ilogand header target::fulltagmask))) (declare (fixnum subtag)) (when (or (eq subtag target::fulltag-nodeheader-0) (eq subtag target::fulltag-nodeheader-1)) (incf addr target::node-size) (setq end (+ addr (ash (uvheader-size header) target::word-shift))) (when (eql (uvheader-typecode header) target::subtag-function) (incf addr (ash (core-l addr) target::word-shift))))) (setq end (+ addr target::dnode-size))) (values addr end))) (defmethod cg-compute ((stage (eql :objects)) &aux (cg (current-core))) "Compute incoming pointer counts" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (ptrs (make-array ndnodes :element-type 'bit :initial-element 0)) (head (make-array ndnodes :element-type 'bit :initial-element 0))) (declare (fixnum base ndnodes) (type simple-bit-vector ptrs head)) (map-core-region base high (lambda (obj) (multiple-value-bind (start end) (link-range obj) (loop for addr from start below end by target::node-size as ptr = (core-q addr) do (when (and (<= base ptr) (< ptr high) (core-node-p ptr)) (let ((dnode (dnode base ptr))) (setf (aref head dnode) (aref ptrs dnode)) (setf (aref ptrs dnode) 1))))) ;; Mark that have an object even if there are no refs to it. (let ((dnode (dnode base obj))) (when (eql (aref ptrs dnode) 0) (setf (aref head dnode) 1))))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it) ;; head = 1, ptrs = 0 -- root object (no pointers to it) ;; head = 1, ptrs = 1 -- multiple-entry object (setf (cg.head-p cg) head) (setf (cg.ptrs-p cg) ptrs) cg)) (defmethod cg-compute ((stage (eql :leaves)) &aux (cg (current-core))) "Mark leaf nodes (nodes with no outgoing pointers)" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ptrs (cg.ptrs-p cg)) (head (cg.head-p cg))) (declare (fixnum base high)) (loop for dn upfrom 0 for h bit across head for p bit across ptrs do (unless (and (eql h 0) (eql p 0)) (unless (multiple-value-bind (start end) (link-range (addr base dn)) (loop for addr from start below end by target::node-size as val = (core-q addr) thereis (and (<= base val) (< val high) (core-node-p val)))) (setf (aref head dn) 0) (setf (aref ptrs dn) 0)))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) or a leaf ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it), not leaf ;; head = 1, ptrs = 0 -- root object (no pointers to it), not leaf ;; head = 1, ptrs = 1 -- multiple-entry object, not leaf cg)) (defun collect-root-dnodes (cg) (let ((head (cg.head-p cg)) (ptrs (cg.ptrs-p cg))) (loop for dn = (position 1 head) then (position 1 head :start (1+ dn)) while dn when (eql (aref ptrs dn) 0) collect dn))) (defmethod cg-compute ((stage (eql :postorder)) &aux (cg (current-core))) (let* ((roots (collect-root-dnodes cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (halo-roots ()) (n (count 1 head)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (seen (make-array ndnodes :element-type 'bit :initial-element 0)) (nodes (make-array n)) (node-count 0)) (assert (< ndnodes (ash 1 half-fixnum-shift))) (flet ((dfs (root-dn) (setf (aref seen root-dn) 1) (let ((path (multiple-value-bind (start end) (link-range (addr base root-dn)) (list (list* start end root-dn))))) (loop (destructuring-bind (start end . pred-dn) (car path) (incf (caar path) target::node-size) (if (eql start end) (progn (when (eql (aref head pred-dn) 1) (setf (aref nodes node-count) pred-dn) (incf node-count)) (setq path (cdr path)) (when (null path) (return))) (let ((next (core-q start))) (when (and (<= base next) (< next high) (core-node-p next)) (let ((next-dn (dnode base next))) (if (eql (aref ptrs next-dn) 0) ;; root or leaf -- ignore leaf (when (eql (aref head next-dn) 1) ;; previously assumed halo root #+debug (warn "REASSIGNING HALO ROOT ~s -> ~d" (assq next-dn halo-roots) node-count) (assert (eql (aref seen next-dn) 1)) (setf (aref ptrs next-dn) 1) ;; not actually a root after all. Shift the region containing ;; nodes from previous handling of next-dn to the end, as if ;; just walked it right now. (destructuring-bind (start . end) (cdr (assq next-dn halo-roots)) (shift-vector-region nodes start end node-count)) (setq halo-roots (delete next-dn halo-roots :key 'car))) ;; non-leaf non-root (when (eq (aref seen next-dn) 0) (setf (aref seen next-dn) 1) (multiple-value-bind (start end) (link-range next) (push (list* start end next-dn) path))))))))))))) (map nil #'dfs roots) ;; Map through "halo" roots (loop until (eql (length nodes) node-count) as circ = (loop for nd = (position 1 head) then (position 1 head :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd) do (when (null circ) ;; Must have some cycles consisting of just single-entry nodes, since we caught all other ones (setq circ (loop for nd = (position 1 ptrs) then (position 1 ptrs :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd)) #+debug (progn (format t "~&Breaking a SINGLE-NODE CYCLE at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (setf (aref head circ) 1)) do (let ((start node-count)) #+debug (progn (format t "~&Breaking out a HALO ROOT at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (dfs circ) ;; This just makes it faster to find these in the dfs, it gets undone below. (setf (aref ptrs circ) 0) (push (list* circ start node-count) halo-roots)))) (setq roots (nconc (mapcar (lambda (x &aux (dn (car x))) (setf (aref ptrs dn) 1) dn) halo-roots) roots)) (setf (cg.roots cg) roots) (setf (cg.nodes cg) nodes) cg)) (defun shift-vector-region (vector start mid end) ;; move the interval from START to MID to after the interval from MID to END. (loop as n2 = (- end mid) as n1 = (- mid start) while (and (> n2 0) (> n1 0)) do (if (< n1 n2) (loop for i from start below mid do (rotatef (aref vector i) (aref vector (+ i n1))) finally (setq start mid mid (+ mid n1))) (loop for i from mid below end do (rotatef (aref vector i) (aref vector (- i n1))) finally (setq start (+ start n2)))))) (declaim (inline make-rev-map)) (defun make-rev-map (arr &optional (fn 'identity)) (let* ((n (length arr)) (revarr (make-array n))) (loop for i from 0 below n as dn = (funcall fn (aref arr i)) do (setf (aref revarr i) (+ (ash i half-fixnum-shift) dn))) ;; [pidx ,, dn] (sort revarr #'< :key (lambda (i.d) (logand i.d half-fixnum-mask))))) (defun index-for-dnode (revnodes dn) (declare (type simple-vector revnodes) (fixnum dn) (optimize (speed 3) (safety 0))) (let ((low 0) (high (length revnodes))) (declare (fixnum low high) ) (loop (when (eq low high) (return nil)) (let* ((half (ash (%i+ high low) -1)) (val (%ilogand2 (%svref revnodes half) half-fixnum-mask))) (declare (fixnum half val)) (when (eq val dn) (return (the fixnum (ash (the fixnum (%svref revnodes half)) (- half-fixnum-shift))))) (if (< val dn) (setq low (1+ half)) (setq high half)))))) (defmacro do-pointers ((child-var addr) &body body) (let ((path (gensym)) (start (gensym)) (end (gensym))) ` (macrolet ((descend-pointers (child) `(multiple-value-bind (start end) (link-range ,child) (push (cons start end) ,',path)))) (let ((,path nil)) (descend-pointers ,addr) (loop (destructuring-bind (,start . ,end) (car ,path) (incf (caar ,path) target::node-size) (if (eq ,start ,end) (unless (setq ,path (cdr ,path)) (return)) (let ((,child-var (core-q ,start))) (when (core-node-p ,child-var) ,@body))))))))) (defmethod cg-compute ((stage (eql :predecessors)) &aux (cg (current-core))) (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (roots (cg.roots cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (nodes (cg.nodes cg)) ;; pidx -> dn (n (length nodes)) (revnodes (make-rev-map nodes)) ;; dn -> pidx (predecessors (make-array (1+ n) :initial-element 0))) (flet ((record-predecessor (dn pred-i) (let* ((i (index-for-dnode revnodes dn)) (old (aref predecessors i))) (cond ((eql old 0) (setf (aref predecessors i) (1+ pred-i))) ((fixnump old) (if (eql (logandc2 old half-fixnum-mask) 0) (setf (aref predecessors i) (+ (ash old half-fixnum-shift) pred-i)) ;; could do more here, but most cases are covered by the 2-elt optimization (setf (aref predecessors i) (list pred-i (logand old half-fixnum-mask) (1- (ash old (- half-fixnum-shift))))))) (t (setf (aref predecessors i) (cons pred-i old))))))) (loop for dn across nodes as dn-idx upfrom 0 do (ASSERT (eql dn-idx (index-for-dnode revnodes dn))) do (do-pointers (next (addr base dn)) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (when (eq (aref ptrs next-dn) 1) ;; non-leaf (if (eql (aref head next-dn) 1) ;; stop at head node (record-predecessor next-dn dn-idx) (descend-pointers next))))))) ;; Pretend there is one single root node which is the predecessor of all our roots. (loop for root-dn in roots do (record-predecessor root-dn n))) (setf (cg.revnodes cg) revnodes) (setf (cg.predecessors cg) predecessors) cg)) (defun predecessor-list (predecessors i) (let ((p (aref predecessors i))) (cond ((eql p 0) '()) ((fixnump p) (let ((p1 (logand p half-fixnum-mask))) (if (eql p p1) (list (1- p1)) (list p1 (1- (ash p (- half-fixnum-shift))))))) (t p)))) ;;; Ok, now on to compute dominance ;; immediate dominators per Cooper, Harvey, Kennedy. (defmethod cg-compute ((stage (eql :idoms)) &aux (cg (current-core))) (let* ((predecessors (cg.predecessors cg)) (root-idx (1- (length predecessors))) (doms (make-array (1+ root-idx) :initial-element nil))) (flet ((intersect (i1 i2) (when (and i1 i2) (loop until (eq i1 i2) do (loop while (< i1 i2) do (setq i1 (aref doms i1))) do (loop while (< i2 i1) do (setq i2 (aref doms i2))))) (or i1 i2)) (preds (i) (predecessor-list predecessors i))) (declare (inline intersect preds)) (setf (aref doms root-idx) root-idx) (loop for changed = 0 do (loop for i from (1- root-idx) downto 0 do (let ((new-idom nil)) (loop for p in (preds i) do (when (aref doms p) (setq new-idom (intersect p new-idom)))) (unless (eql new-idom (aref doms i)) (setf (aref doms i) new-idom) (incf changed)))) DO (progn #+debug (format t "~&Finished loop, changed=~d~%" changed)) while (> changed 0))) (setf (cg.node-doms cg) doms) (setf (cg.idoms cg) (sort (delete root-idx (remove-duplicates doms)) #'<)) (let ((nodes (cg.nodes cg))) (setf (cg.revidoms cg) (make-rev-map (cg.idoms cg) (lambda (ni) (aref nodes ni))))) cg)) (defmethod cg-compute ((stage (eql :idom-sizes)) &aux (cg (current-core))) (let* ((nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (logsizes (make-array nidoms)) (physizes (make-array nidoms))) ;; Any object that's not an idom is only reachable by one idom, ;; so don't need to reinit SEEN bits between iterations. (setf (cg.idoms cg) idom-nodes) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (multiple-value-bind (this-logsize this-physsize) (core-object-sizes next) (incf logsize this-logsize) (incf physsize this-physsize)) (descend-pointers next))))) (setf (aref logsizes i) logsize) (setf (aref physizes i) physsize)))) (setf (cg.logsizes cg) logsizes) (setf (cg.physizes cg) physizes) cg)) (defun idom-set-heap-range (area) (check-type area (member :tenured :dynamic)) (multiple-value-bind (base end) (cond ((eq area :tenured) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (values (core-q area-ptr target::area.low) (core-q area-ptr target::area.active)))) ((eq area :dynamic) (let* ((newest (core-q (core-q (kernel-global-address 'all-areas)) target::area.succ)) (oldest (core-q (kernel-global-address 'tenured-area)))) (assert (loop for this = newest then older as older = (core-q this target::area.succ) until (eql this oldest) always (eql (core-q this target::area.low) (core-q older target::area.active)))) (values (core-q oldest target::area.low) (core-q newest target::area.active))))) (let ((cg (current-core))) (unless (and (eq base (cg.heap-base cg)) (eq end (cg.heap-end cg))) (setf (cg.stage cg) nil) (setf (cg.heap-base cg) base) (setf (cg.heap-end cg) end))))) (defun report-idom-heap-utilization (type-infos &key unit sort threshold) (let ((data (loop for type being the hash-key of type-infos using (hash-value info) collect (cons (core-type-string type) info)))) (report-heap-utilization data :unit unit :sort sort :stream *standard-output* :threshold threshold))) (defun idom-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured)) (idom-set-heap-range area) (cg-compute t) (loop with cg = (current-core) with nodes = (cg.nodes cg) with type-infos = (make-hash-table :test 'eql) with base = (cg.heap-base cg) for idx across (cg.idoms cg) for logsz across (cg.logsizes cg) for physz across (cg.physizes cg) as type = (core-object-type-key (tagged-ptr (addr base (aref nodes idx)))) as info = (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))) do (incf (car info)) do (incf (cadr info) logsz) do (incf (caddr info) physz) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))) (defun idom-frontier-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured) (test nil)) ;; Compute the heap utilization WITHIN selected idom trees, aggregated. (idom-set-heap-range area) (cg-compute :idoms) (let* ((cg (current-core)) (nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (type-infos (make-hash-table :test 'eql))) (flet ((record (ptr) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (let* ((type (core-object-type-key ptr)) (info (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))))) (incf (car info)) (incf (cadr info) logsize) (incf (caddr info) physsize))))) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (when (or (null test) (funcall test ptr)) ;; Ok, idom of interest. Walk its subgraph (record ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (record next) (descend-pointers next))))))) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))))) )
37486
;;;-*-Mode: LISP; Package: CCL -*- ;;; ;;; Copyright 2010 <NAME> ;;; ;;; Licensed under the Apache License, Version 2.0 (the "License"); ;;; you may not use this file except in compliance with the License. ;;; You may obtain a copy of the License at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0 ;;; ;;; Unless required by applicable law or agreed to in writing, software ;;; distributed under the License is distributed on an "AS IS" BASIS, ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;;; See the License for the specific language governing permissions and ;;; limitations under the License. (in-package "CCL") ;(setq *print-array* nil) ;(setq *print-simple-bit-vector* nil) #+:linuxx8664-target (progn (export '(idom-heap-utilization)) #| (open-core "home:core.28209") (idom-heap-utilization :unit nil :sort :size) |# (defconstant half-fixnum-shift (ash (integer-length most-positive-fixnum) -1)) (defconstant half-fixnum-mask (1- (ash 1 half-fixnum-shift))) (defstruct (core-graph (:include core-info) (:conc-name "CG.") (:constructor %cons-cg)) (heap-base 0 :type fixnum) (heap-end 0 :type fixnum) (stage nil) ;; indication of what has been computed and what hasn't, so can restart. (head-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) (ptrs-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) ;; Nodes after eliminating single-entry and leaf objects (nodes #() :type simple-vector) ;; map postorder-idx -> dnode (revnodes #() :type simple-vector) ;; map dnode -> postorder-idx (roots () :type list) (predecessors #() :type simple-vector) ;; postorder-idx -> list of postorder indices of predecessors (node-doms #() :type simple-vector) ;; postorder-idx of node -> postorder-idx of its immediate dominator (idoms #() :type simple-vector) ;; sequence of postorder indices of immediate dominators (revidoms #() :type simple-vector) ;; map dnode -> index in idoms (logsizes #() :type simple-vector) ;; corresponding sequence of logical sizes (including all owned objects) (physizes #() :type simple-vector) ;; corresponding sequence of physical sizes (including all owned objects) ) (setq *core-info-class* 'core-graph) (defparameter *cg-stages* '(nil :objects :leaves :postorder :predecessors :idoms :idom-sizes t)) (defmethod cg-compute :before (stage &aux (cg (current-core))) (assert (memq stage *cg-stages*)) (check-type cg core-graph) (when (eql (cg.heap-base cg) 0) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (setf (cg.heap-base cg) (core-q area-ptr target::area.low)) (setf (cg.heap-end cg) (core-q area-ptr target::area.active)))) ;; ensure have all the prereqs (loop for undone = (cdr (memq (cg.stage cg) *cg-stages*)) while (memq stage (cdr undone)) do (format t "~&Computing ~a" (car undone)) do (cg-compute (car undone)))) (defmethod cg-compute :after (stage &aux (cg (current-core))) (setf (cg.stage cg) stage)) (defmethod cg-compute ((stage (eql t))) ;; before method does all the work nil) (declaim (inline core-node-p)) (defun core-node-p (ptr) (or (core-consp ptr) (core-uvector-p ptr))) (declaim (inline dnode addr)) (defun dnode (base n) (the fixnum (ash (%i- n base) (- target::dnode-shift)))) (defun addr (base n) (%i+ base (ash (the fixnum n) target::dnode-shift))) (defun tagged-ptr (ptr) (let ((header (core-q ptr))) (cond ((uvheader-p header) (let ((subtag (uvheader-typecode header))) (+ ptr (cond ((eq subtag target::subtag-symbol) target::fulltag-symbol) ((eq subtag target::subtag-function) target::fulltag-function) (t target::fulltag-misc)))) ) (t (+ ptr target::fulltag-cons))))) (defun core-physsize (obj) ;; (assert (core-node-p obj)) (if (core-consp obj) target::dnode-size (logandc2 (+ (uvheader-byte-size (core-uvheader obj)) target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (defun core-object-sizes (obj) (let ((fulltag (logand obj target::fulltagmask))) (if (eq fulltag target::fulltag-cons) (values target::dnode-size target::dnode-size) (if (%i<= target::fulltag-misc fulltag) (let* ((header (core-uvheader obj)) (logsize (uvheader-byte-size header)) ;; total including header and alignment. (total (logandc2 (+ logsize target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (values logsize total)))))) (defun link-range (ptr) (declare (fixnum ptr)) (let* ((addr (logandc2 ptr target::fulltagmask)) (header (core-q addr)) (end addr)) (declare (fixnum addr end)) (if (uvheader-p header) (let ((subtag (%ilogand header target::fulltagmask))) (declare (fixnum subtag)) (when (or (eq subtag target::fulltag-nodeheader-0) (eq subtag target::fulltag-nodeheader-1)) (incf addr target::node-size) (setq end (+ addr (ash (uvheader-size header) target::word-shift))) (when (eql (uvheader-typecode header) target::subtag-function) (incf addr (ash (core-l addr) target::word-shift))))) (setq end (+ addr target::dnode-size))) (values addr end))) (defmethod cg-compute ((stage (eql :objects)) &aux (cg (current-core))) "Compute incoming pointer counts" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (ptrs (make-array ndnodes :element-type 'bit :initial-element 0)) (head (make-array ndnodes :element-type 'bit :initial-element 0))) (declare (fixnum base ndnodes) (type simple-bit-vector ptrs head)) (map-core-region base high (lambda (obj) (multiple-value-bind (start end) (link-range obj) (loop for addr from start below end by target::node-size as ptr = (core-q addr) do (when (and (<= base ptr) (< ptr high) (core-node-p ptr)) (let ((dnode (dnode base ptr))) (setf (aref head dnode) (aref ptrs dnode)) (setf (aref ptrs dnode) 1))))) ;; Mark that have an object even if there are no refs to it. (let ((dnode (dnode base obj))) (when (eql (aref ptrs dnode) 0) (setf (aref head dnode) 1))))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it) ;; head = 1, ptrs = 0 -- root object (no pointers to it) ;; head = 1, ptrs = 1 -- multiple-entry object (setf (cg.head-p cg) head) (setf (cg.ptrs-p cg) ptrs) cg)) (defmethod cg-compute ((stage (eql :leaves)) &aux (cg (current-core))) "Mark leaf nodes (nodes with no outgoing pointers)" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ptrs (cg.ptrs-p cg)) (head (cg.head-p cg))) (declare (fixnum base high)) (loop for dn upfrom 0 for h bit across head for p bit across ptrs do (unless (and (eql h 0) (eql p 0)) (unless (multiple-value-bind (start end) (link-range (addr base dn)) (loop for addr from start below end by target::node-size as val = (core-q addr) thereis (and (<= base val) (< val high) (core-node-p val)))) (setf (aref head dn) 0) (setf (aref ptrs dn) 0)))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) or a leaf ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it), not leaf ;; head = 1, ptrs = 0 -- root object (no pointers to it), not leaf ;; head = 1, ptrs = 1 -- multiple-entry object, not leaf cg)) (defun collect-root-dnodes (cg) (let ((head (cg.head-p cg)) (ptrs (cg.ptrs-p cg))) (loop for dn = (position 1 head) then (position 1 head :start (1+ dn)) while dn when (eql (aref ptrs dn) 0) collect dn))) (defmethod cg-compute ((stage (eql :postorder)) &aux (cg (current-core))) (let* ((roots (collect-root-dnodes cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (halo-roots ()) (n (count 1 head)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (seen (make-array ndnodes :element-type 'bit :initial-element 0)) (nodes (make-array n)) (node-count 0)) (assert (< ndnodes (ash 1 half-fixnum-shift))) (flet ((dfs (root-dn) (setf (aref seen root-dn) 1) (let ((path (multiple-value-bind (start end) (link-range (addr base root-dn)) (list (list* start end root-dn))))) (loop (destructuring-bind (start end . pred-dn) (car path) (incf (caar path) target::node-size) (if (eql start end) (progn (when (eql (aref head pred-dn) 1) (setf (aref nodes node-count) pred-dn) (incf node-count)) (setq path (cdr path)) (when (null path) (return))) (let ((next (core-q start))) (when (and (<= base next) (< next high) (core-node-p next)) (let ((next-dn (dnode base next))) (if (eql (aref ptrs next-dn) 0) ;; root or leaf -- ignore leaf (when (eql (aref head next-dn) 1) ;; previously assumed halo root #+debug (warn "REASSIGNING HALO ROOT ~s -> ~d" (assq next-dn halo-roots) node-count) (assert (eql (aref seen next-dn) 1)) (setf (aref ptrs next-dn) 1) ;; not actually a root after all. Shift the region containing ;; nodes from previous handling of next-dn to the end, as if ;; just walked it right now. (destructuring-bind (start . end) (cdr (assq next-dn halo-roots)) (shift-vector-region nodes start end node-count)) (setq halo-roots (delete next-dn halo-roots :key 'car))) ;; non-leaf non-root (when (eq (aref seen next-dn) 0) (setf (aref seen next-dn) 1) (multiple-value-bind (start end) (link-range next) (push (list* start end next-dn) path))))))))))))) (map nil #'dfs roots) ;; Map through "halo" roots (loop until (eql (length nodes) node-count) as circ = (loop for nd = (position 1 head) then (position 1 head :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd) do (when (null circ) ;; Must have some cycles consisting of just single-entry nodes, since we caught all other ones (setq circ (loop for nd = (position 1 ptrs) then (position 1 ptrs :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd)) #+debug (progn (format t "~&Breaking a SINGLE-NODE CYCLE at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (setf (aref head circ) 1)) do (let ((start node-count)) #+debug (progn (format t "~&Breaking out a HALO ROOT at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (dfs circ) ;; This just makes it faster to find these in the dfs, it gets undone below. (setf (aref ptrs circ) 0) (push (list* circ start node-count) halo-roots)))) (setq roots (nconc (mapcar (lambda (x &aux (dn (car x))) (setf (aref ptrs dn) 1) dn) halo-roots) roots)) (setf (cg.roots cg) roots) (setf (cg.nodes cg) nodes) cg)) (defun shift-vector-region (vector start mid end) ;; move the interval from START to MID to after the interval from MID to END. (loop as n2 = (- end mid) as n1 = (- mid start) while (and (> n2 0) (> n1 0)) do (if (< n1 n2) (loop for i from start below mid do (rotatef (aref vector i) (aref vector (+ i n1))) finally (setq start mid mid (+ mid n1))) (loop for i from mid below end do (rotatef (aref vector i) (aref vector (- i n1))) finally (setq start (+ start n2)))))) (declaim (inline make-rev-map)) (defun make-rev-map (arr &optional (fn 'identity)) (let* ((n (length arr)) (revarr (make-array n))) (loop for i from 0 below n as dn = (funcall fn (aref arr i)) do (setf (aref revarr i) (+ (ash i half-fixnum-shift) dn))) ;; [pidx ,, dn] (sort revarr #'< :key (lambda (i.d) (logand i.d half-fixnum-mask))))) (defun index-for-dnode (revnodes dn) (declare (type simple-vector revnodes) (fixnum dn) (optimize (speed 3) (safety 0))) (let ((low 0) (high (length revnodes))) (declare (fixnum low high) ) (loop (when (eq low high) (return nil)) (let* ((half (ash (%i+ high low) -1)) (val (%ilogand2 (%svref revnodes half) half-fixnum-mask))) (declare (fixnum half val)) (when (eq val dn) (return (the fixnum (ash (the fixnum (%svref revnodes half)) (- half-fixnum-shift))))) (if (< val dn) (setq low (1+ half)) (setq high half)))))) (defmacro do-pointers ((child-var addr) &body body) (let ((path (gensym)) (start (gensym)) (end (gensym))) ` (macrolet ((descend-pointers (child) `(multiple-value-bind (start end) (link-range ,child) (push (cons start end) ,',path)))) (let ((,path nil)) (descend-pointers ,addr) (loop (destructuring-bind (,start . ,end) (car ,path) (incf (caar ,path) target::node-size) (if (eq ,start ,end) (unless (setq ,path (cdr ,path)) (return)) (let ((,child-var (core-q ,start))) (when (core-node-p ,child-var) ,@body))))))))) (defmethod cg-compute ((stage (eql :predecessors)) &aux (cg (current-core))) (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (roots (cg.roots cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (nodes (cg.nodes cg)) ;; pidx -> dn (n (length nodes)) (revnodes (make-rev-map nodes)) ;; dn -> pidx (predecessors (make-array (1+ n) :initial-element 0))) (flet ((record-predecessor (dn pred-i) (let* ((i (index-for-dnode revnodes dn)) (old (aref predecessors i))) (cond ((eql old 0) (setf (aref predecessors i) (1+ pred-i))) ((fixnump old) (if (eql (logandc2 old half-fixnum-mask) 0) (setf (aref predecessors i) (+ (ash old half-fixnum-shift) pred-i)) ;; could do more here, but most cases are covered by the 2-elt optimization (setf (aref predecessors i) (list pred-i (logand old half-fixnum-mask) (1- (ash old (- half-fixnum-shift))))))) (t (setf (aref predecessors i) (cons pred-i old))))))) (loop for dn across nodes as dn-idx upfrom 0 do (ASSERT (eql dn-idx (index-for-dnode revnodes dn))) do (do-pointers (next (addr base dn)) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (when (eq (aref ptrs next-dn) 1) ;; non-leaf (if (eql (aref head next-dn) 1) ;; stop at head node (record-predecessor next-dn dn-idx) (descend-pointers next))))))) ;; Pretend there is one single root node which is the predecessor of all our roots. (loop for root-dn in roots do (record-predecessor root-dn n))) (setf (cg.revnodes cg) revnodes) (setf (cg.predecessors cg) predecessors) cg)) (defun predecessor-list (predecessors i) (let ((p (aref predecessors i))) (cond ((eql p 0) '()) ((fixnump p) (let ((p1 (logand p half-fixnum-mask))) (if (eql p p1) (list (1- p1)) (list p1 (1- (ash p (- half-fixnum-shift))))))) (t p)))) ;;; Ok, now on to compute dominance ;; immediate dominators per <NAME>, <NAME>. (defmethod cg-compute ((stage (eql :idoms)) &aux (cg (current-core))) (let* ((predecessors (cg.predecessors cg)) (root-idx (1- (length predecessors))) (doms (make-array (1+ root-idx) :initial-element nil))) (flet ((intersect (i1 i2) (when (and i1 i2) (loop until (eq i1 i2) do (loop while (< i1 i2) do (setq i1 (aref doms i1))) do (loop while (< i2 i1) do (setq i2 (aref doms i2))))) (or i1 i2)) (preds (i) (predecessor-list predecessors i))) (declare (inline intersect preds)) (setf (aref doms root-idx) root-idx) (loop for changed = 0 do (loop for i from (1- root-idx) downto 0 do (let ((new-idom nil)) (loop for p in (preds i) do (when (aref doms p) (setq new-idom (intersect p new-idom)))) (unless (eql new-idom (aref doms i)) (setf (aref doms i) new-idom) (incf changed)))) DO (progn #+debug (format t "~&Finished loop, changed=~d~%" changed)) while (> changed 0))) (setf (cg.node-doms cg) doms) (setf (cg.idoms cg) (sort (delete root-idx (remove-duplicates doms)) #'<)) (let ((nodes (cg.nodes cg))) (setf (cg.revidoms cg) (make-rev-map (cg.idoms cg) (lambda (ni) (aref nodes ni))))) cg)) (defmethod cg-compute ((stage (eql :idom-sizes)) &aux (cg (current-core))) (let* ((nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (logsizes (make-array nidoms)) (physizes (make-array nidoms))) ;; Any object that's not an idom is only reachable by one idom, ;; so don't need to reinit SEEN bits between iterations. (setf (cg.idoms cg) idom-nodes) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (multiple-value-bind (this-logsize this-physsize) (core-object-sizes next) (incf logsize this-logsize) (incf physsize this-physsize)) (descend-pointers next))))) (setf (aref logsizes i) logsize) (setf (aref physizes i) physsize)))) (setf (cg.logsizes cg) logsizes) (setf (cg.physizes cg) physizes) cg)) (defun idom-set-heap-range (area) (check-type area (member :tenured :dynamic)) (multiple-value-bind (base end) (cond ((eq area :tenured) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (values (core-q area-ptr target::area.low) (core-q area-ptr target::area.active)))) ((eq area :dynamic) (let* ((newest (core-q (core-q (kernel-global-address 'all-areas)) target::area.succ)) (oldest (core-q (kernel-global-address 'tenured-area)))) (assert (loop for this = newest then older as older = (core-q this target::area.succ) until (eql this oldest) always (eql (core-q this target::area.low) (core-q older target::area.active)))) (values (core-q oldest target::area.low) (core-q newest target::area.active))))) (let ((cg (current-core))) (unless (and (eq base (cg.heap-base cg)) (eq end (cg.heap-end cg))) (setf (cg.stage cg) nil) (setf (cg.heap-base cg) base) (setf (cg.heap-end cg) end))))) (defun report-idom-heap-utilization (type-infos &key unit sort threshold) (let ((data (loop for type being the hash-key of type-infos using (hash-value info) collect (cons (core-type-string type) info)))) (report-heap-utilization data :unit unit :sort sort :stream *standard-output* :threshold threshold))) (defun idom-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured)) (idom-set-heap-range area) (cg-compute t) (loop with cg = (current-core) with nodes = (cg.nodes cg) with type-infos = (make-hash-table :test 'eql) with base = (cg.heap-base cg) for idx across (cg.idoms cg) for logsz across (cg.logsizes cg) for physz across (cg.physizes cg) as type = (core-object-type-key (tagged-ptr (addr base (aref nodes idx)))) as info = (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))) do (incf (car info)) do (incf (cadr info) logsz) do (incf (caddr info) physz) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))) (defun idom-frontier-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured) (test nil)) ;; Compute the heap utilization WITHIN selected idom trees, aggregated. (idom-set-heap-range area) (cg-compute :idoms) (let* ((cg (current-core)) (nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (type-infos (make-hash-table :test 'eql))) (flet ((record (ptr) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (let* ((type (core-object-type-key ptr)) (info (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))))) (incf (car info)) (incf (cadr info) logsize) (incf (caddr info) physsize))))) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (when (or (null test) (funcall test ptr)) ;; Ok, idom of interest. Walk its subgraph (record ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (record next) (descend-pointers next))))))) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))))) )
true
;;;-*-Mode: LISP; Package: CCL -*- ;;; ;;; Copyright 2010 PI:NAME:<NAME>END_PI ;;; ;;; Licensed under the Apache License, Version 2.0 (the "License"); ;;; you may not use this file except in compliance with the License. ;;; You may obtain a copy of the License at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0 ;;; ;;; Unless required by applicable law or agreed to in writing, software ;;; distributed under the License is distributed on an "AS IS" BASIS, ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ;;; See the License for the specific language governing permissions and ;;; limitations under the License. (in-package "CCL") ;(setq *print-array* nil) ;(setq *print-simple-bit-vector* nil) #+:linuxx8664-target (progn (export '(idom-heap-utilization)) #| (open-core "home:core.28209") (idom-heap-utilization :unit nil :sort :size) |# (defconstant half-fixnum-shift (ash (integer-length most-positive-fixnum) -1)) (defconstant half-fixnum-mask (1- (ash 1 half-fixnum-shift))) (defstruct (core-graph (:include core-info) (:conc-name "CG.") (:constructor %cons-cg)) (heap-base 0 :type fixnum) (heap-end 0 :type fixnum) (stage nil) ;; indication of what has been computed and what hasn't, so can restart. (head-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) (ptrs-p #.(make-array 0 :element-type 'bit) :type simple-bit-vector) ;; Nodes after eliminating single-entry and leaf objects (nodes #() :type simple-vector) ;; map postorder-idx -> dnode (revnodes #() :type simple-vector) ;; map dnode -> postorder-idx (roots () :type list) (predecessors #() :type simple-vector) ;; postorder-idx -> list of postorder indices of predecessors (node-doms #() :type simple-vector) ;; postorder-idx of node -> postorder-idx of its immediate dominator (idoms #() :type simple-vector) ;; sequence of postorder indices of immediate dominators (revidoms #() :type simple-vector) ;; map dnode -> index in idoms (logsizes #() :type simple-vector) ;; corresponding sequence of logical sizes (including all owned objects) (physizes #() :type simple-vector) ;; corresponding sequence of physical sizes (including all owned objects) ) (setq *core-info-class* 'core-graph) (defparameter *cg-stages* '(nil :objects :leaves :postorder :predecessors :idoms :idom-sizes t)) (defmethod cg-compute :before (stage &aux (cg (current-core))) (assert (memq stage *cg-stages*)) (check-type cg core-graph) (when (eql (cg.heap-base cg) 0) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (setf (cg.heap-base cg) (core-q area-ptr target::area.low)) (setf (cg.heap-end cg) (core-q area-ptr target::area.active)))) ;; ensure have all the prereqs (loop for undone = (cdr (memq (cg.stage cg) *cg-stages*)) while (memq stage (cdr undone)) do (format t "~&Computing ~a" (car undone)) do (cg-compute (car undone)))) (defmethod cg-compute :after (stage &aux (cg (current-core))) (setf (cg.stage cg) stage)) (defmethod cg-compute ((stage (eql t))) ;; before method does all the work nil) (declaim (inline core-node-p)) (defun core-node-p (ptr) (or (core-consp ptr) (core-uvector-p ptr))) (declaim (inline dnode addr)) (defun dnode (base n) (the fixnum (ash (%i- n base) (- target::dnode-shift)))) (defun addr (base n) (%i+ base (ash (the fixnum n) target::dnode-shift))) (defun tagged-ptr (ptr) (let ((header (core-q ptr))) (cond ((uvheader-p header) (let ((subtag (uvheader-typecode header))) (+ ptr (cond ((eq subtag target::subtag-symbol) target::fulltag-symbol) ((eq subtag target::subtag-function) target::fulltag-function) (t target::fulltag-misc)))) ) (t (+ ptr target::fulltag-cons))))) (defun core-physsize (obj) ;; (assert (core-node-p obj)) (if (core-consp obj) target::dnode-size (logandc2 (+ (uvheader-byte-size (core-uvheader obj)) target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (defun core-object-sizes (obj) (let ((fulltag (logand obj target::fulltagmask))) (if (eq fulltag target::fulltag-cons) (values target::dnode-size target::dnode-size) (if (%i<= target::fulltag-misc fulltag) (let* ((header (core-uvheader obj)) (logsize (uvheader-byte-size header)) ;; total including header and alignment. (total (logandc2 (+ logsize target::node-size (1- target::dnode-size)) (1- target::dnode-size)))) (values logsize total)))))) (defun link-range (ptr) (declare (fixnum ptr)) (let* ((addr (logandc2 ptr target::fulltagmask)) (header (core-q addr)) (end addr)) (declare (fixnum addr end)) (if (uvheader-p header) (let ((subtag (%ilogand header target::fulltagmask))) (declare (fixnum subtag)) (when (or (eq subtag target::fulltag-nodeheader-0) (eq subtag target::fulltag-nodeheader-1)) (incf addr target::node-size) (setq end (+ addr (ash (uvheader-size header) target::word-shift))) (when (eql (uvheader-typecode header) target::subtag-function) (incf addr (ash (core-l addr) target::word-shift))))) (setq end (+ addr target::dnode-size))) (values addr end))) (defmethod cg-compute ((stage (eql :objects)) &aux (cg (current-core))) "Compute incoming pointer counts" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (ptrs (make-array ndnodes :element-type 'bit :initial-element 0)) (head (make-array ndnodes :element-type 'bit :initial-element 0))) (declare (fixnum base ndnodes) (type simple-bit-vector ptrs head)) (map-core-region base high (lambda (obj) (multiple-value-bind (start end) (link-range obj) (loop for addr from start below end by target::node-size as ptr = (core-q addr) do (when (and (<= base ptr) (< ptr high) (core-node-p ptr)) (let ((dnode (dnode base ptr))) (setf (aref head dnode) (aref ptrs dnode)) (setf (aref ptrs dnode) 1))))) ;; Mark that have an object even if there are no refs to it. (let ((dnode (dnode base obj))) (when (eql (aref ptrs dnode) 0) (setf (aref head dnode) 1))))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it) ;; head = 1, ptrs = 0 -- root object (no pointers to it) ;; head = 1, ptrs = 1 -- multiple-entry object (setf (cg.head-p cg) head) (setf (cg.ptrs-p cg) ptrs) cg)) (defmethod cg-compute ((stage (eql :leaves)) &aux (cg (current-core))) "Mark leaf nodes (nodes with no outgoing pointers)" (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (ptrs (cg.ptrs-p cg)) (head (cg.head-p cg))) (declare (fixnum base high)) (loop for dn upfrom 0 for h bit across head for p bit across ptrs do (unless (and (eql h 0) (eql p 0)) (unless (multiple-value-bind (start end) (link-range (addr base dn)) (loop for addr from start below end by target::node-size as val = (core-q addr) thereis (and (<= base val) (< val high) (core-node-p val)))) (setf (aref head dn) 0) (setf (aref ptrs dn) 0)))) ;; head = 0, ptrs = 0 -- not an object (internal dnode) or a leaf ;; head = 0, ptrs = 1 -- single-entry object (exactly one pointer to it), not leaf ;; head = 1, ptrs = 0 -- root object (no pointers to it), not leaf ;; head = 1, ptrs = 1 -- multiple-entry object, not leaf cg)) (defun collect-root-dnodes (cg) (let ((head (cg.head-p cg)) (ptrs (cg.ptrs-p cg))) (loop for dn = (position 1 head) then (position 1 head :start (1+ dn)) while dn when (eql (aref ptrs dn) 0) collect dn))) (defmethod cg-compute ((stage (eql :postorder)) &aux (cg (current-core))) (let* ((roots (collect-root-dnodes cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (halo-roots ()) (n (count 1 head)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (ndnodes (dnode base high)) (seen (make-array ndnodes :element-type 'bit :initial-element 0)) (nodes (make-array n)) (node-count 0)) (assert (< ndnodes (ash 1 half-fixnum-shift))) (flet ((dfs (root-dn) (setf (aref seen root-dn) 1) (let ((path (multiple-value-bind (start end) (link-range (addr base root-dn)) (list (list* start end root-dn))))) (loop (destructuring-bind (start end . pred-dn) (car path) (incf (caar path) target::node-size) (if (eql start end) (progn (when (eql (aref head pred-dn) 1) (setf (aref nodes node-count) pred-dn) (incf node-count)) (setq path (cdr path)) (when (null path) (return))) (let ((next (core-q start))) (when (and (<= base next) (< next high) (core-node-p next)) (let ((next-dn (dnode base next))) (if (eql (aref ptrs next-dn) 0) ;; root or leaf -- ignore leaf (when (eql (aref head next-dn) 1) ;; previously assumed halo root #+debug (warn "REASSIGNING HALO ROOT ~s -> ~d" (assq next-dn halo-roots) node-count) (assert (eql (aref seen next-dn) 1)) (setf (aref ptrs next-dn) 1) ;; not actually a root after all. Shift the region containing ;; nodes from previous handling of next-dn to the end, as if ;; just walked it right now. (destructuring-bind (start . end) (cdr (assq next-dn halo-roots)) (shift-vector-region nodes start end node-count)) (setq halo-roots (delete next-dn halo-roots :key 'car))) ;; non-leaf non-root (when (eq (aref seen next-dn) 0) (setf (aref seen next-dn) 1) (multiple-value-bind (start end) (link-range next) (push (list* start end next-dn) path))))))))))))) (map nil #'dfs roots) ;; Map through "halo" roots (loop until (eql (length nodes) node-count) as circ = (loop for nd = (position 1 head) then (position 1 head :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd) do (when (null circ) ;; Must have some cycles consisting of just single-entry nodes, since we caught all other ones (setq circ (loop for nd = (position 1 ptrs) then (position 1 ptrs :start (1+ nd)) while nd when (eql (aref seen nd) 0) return nd)) #+debug (progn (format t "~&Breaking a SINGLE-NODE CYCLE at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (setf (aref head circ) 1)) do (let ((start node-count)) #+debug (progn (format t "~&Breaking out a HALO ROOT at ") (core-print (tagged-ptr (addr (cg.heap-base cg) circ)))) (dfs circ) ;; This just makes it faster to find these in the dfs, it gets undone below. (setf (aref ptrs circ) 0) (push (list* circ start node-count) halo-roots)))) (setq roots (nconc (mapcar (lambda (x &aux (dn (car x))) (setf (aref ptrs dn) 1) dn) halo-roots) roots)) (setf (cg.roots cg) roots) (setf (cg.nodes cg) nodes) cg)) (defun shift-vector-region (vector start mid end) ;; move the interval from START to MID to after the interval from MID to END. (loop as n2 = (- end mid) as n1 = (- mid start) while (and (> n2 0) (> n1 0)) do (if (< n1 n2) (loop for i from start below mid do (rotatef (aref vector i) (aref vector (+ i n1))) finally (setq start mid mid (+ mid n1))) (loop for i from mid below end do (rotatef (aref vector i) (aref vector (- i n1))) finally (setq start (+ start n2)))))) (declaim (inline make-rev-map)) (defun make-rev-map (arr &optional (fn 'identity)) (let* ((n (length arr)) (revarr (make-array n))) (loop for i from 0 below n as dn = (funcall fn (aref arr i)) do (setf (aref revarr i) (+ (ash i half-fixnum-shift) dn))) ;; [pidx ,, dn] (sort revarr #'< :key (lambda (i.d) (logand i.d half-fixnum-mask))))) (defun index-for-dnode (revnodes dn) (declare (type simple-vector revnodes) (fixnum dn) (optimize (speed 3) (safety 0))) (let ((low 0) (high (length revnodes))) (declare (fixnum low high) ) (loop (when (eq low high) (return nil)) (let* ((half (ash (%i+ high low) -1)) (val (%ilogand2 (%svref revnodes half) half-fixnum-mask))) (declare (fixnum half val)) (when (eq val dn) (return (the fixnum (ash (the fixnum (%svref revnodes half)) (- half-fixnum-shift))))) (if (< val dn) (setq low (1+ half)) (setq high half)))))) (defmacro do-pointers ((child-var addr) &body body) (let ((path (gensym)) (start (gensym)) (end (gensym))) ` (macrolet ((descend-pointers (child) `(multiple-value-bind (start end) (link-range ,child) (push (cons start end) ,',path)))) (let ((,path nil)) (descend-pointers ,addr) (loop (destructuring-bind (,start . ,end) (car ,path) (incf (caar ,path) target::node-size) (if (eq ,start ,end) (unless (setq ,path (cdr ,path)) (return)) (let ((,child-var (core-q ,start))) (when (core-node-p ,child-var) ,@body))))))))) (defmethod cg-compute ((stage (eql :predecessors)) &aux (cg (current-core))) (let* ((base (cg.heap-base cg)) (high (cg.heap-end cg)) (roots (cg.roots cg)) (head (cg.head-p cg)) (ptrs (cg.ptrs-p cg)) (nodes (cg.nodes cg)) ;; pidx -> dn (n (length nodes)) (revnodes (make-rev-map nodes)) ;; dn -> pidx (predecessors (make-array (1+ n) :initial-element 0))) (flet ((record-predecessor (dn pred-i) (let* ((i (index-for-dnode revnodes dn)) (old (aref predecessors i))) (cond ((eql old 0) (setf (aref predecessors i) (1+ pred-i))) ((fixnump old) (if (eql (logandc2 old half-fixnum-mask) 0) (setf (aref predecessors i) (+ (ash old half-fixnum-shift) pred-i)) ;; could do more here, but most cases are covered by the 2-elt optimization (setf (aref predecessors i) (list pred-i (logand old half-fixnum-mask) (1- (ash old (- half-fixnum-shift))))))) (t (setf (aref predecessors i) (cons pred-i old))))))) (loop for dn across nodes as dn-idx upfrom 0 do (ASSERT (eql dn-idx (index-for-dnode revnodes dn))) do (do-pointers (next (addr base dn)) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (when (eq (aref ptrs next-dn) 1) ;; non-leaf (if (eql (aref head next-dn) 1) ;; stop at head node (record-predecessor next-dn dn-idx) (descend-pointers next))))))) ;; Pretend there is one single root node which is the predecessor of all our roots. (loop for root-dn in roots do (record-predecessor root-dn n))) (setf (cg.revnodes cg) revnodes) (setf (cg.predecessors cg) predecessors) cg)) (defun predecessor-list (predecessors i) (let ((p (aref predecessors i))) (cond ((eql p 0) '()) ((fixnump p) (let ((p1 (logand p half-fixnum-mask))) (if (eql p p1) (list (1- p1)) (list p1 (1- (ash p (- half-fixnum-shift))))))) (t p)))) ;;; Ok, now on to compute dominance ;; immediate dominators per PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI. (defmethod cg-compute ((stage (eql :idoms)) &aux (cg (current-core))) (let* ((predecessors (cg.predecessors cg)) (root-idx (1- (length predecessors))) (doms (make-array (1+ root-idx) :initial-element nil))) (flet ((intersect (i1 i2) (when (and i1 i2) (loop until (eq i1 i2) do (loop while (< i1 i2) do (setq i1 (aref doms i1))) do (loop while (< i2 i1) do (setq i2 (aref doms i2))))) (or i1 i2)) (preds (i) (predecessor-list predecessors i))) (declare (inline intersect preds)) (setf (aref doms root-idx) root-idx) (loop for changed = 0 do (loop for i from (1- root-idx) downto 0 do (let ((new-idom nil)) (loop for p in (preds i) do (when (aref doms p) (setq new-idom (intersect p new-idom)))) (unless (eql new-idom (aref doms i)) (setf (aref doms i) new-idom) (incf changed)))) DO (progn #+debug (format t "~&Finished loop, changed=~d~%" changed)) while (> changed 0))) (setf (cg.node-doms cg) doms) (setf (cg.idoms cg) (sort (delete root-idx (remove-duplicates doms)) #'<)) (let ((nodes (cg.nodes cg))) (setf (cg.revidoms cg) (make-rev-map (cg.idoms cg) (lambda (ni) (aref nodes ni))))) cg)) (defmethod cg-compute ((stage (eql :idom-sizes)) &aux (cg (current-core))) (let* ((nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (logsizes (make-array nidoms)) (physizes (make-array nidoms))) ;; Any object that's not an idom is only reachable by one idom, ;; so don't need to reinit SEEN bits between iterations. (setf (cg.idoms cg) idom-nodes) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (multiple-value-bind (this-logsize this-physsize) (core-object-sizes next) (incf logsize this-logsize) (incf physsize this-physsize)) (descend-pointers next))))) (setf (aref logsizes i) logsize) (setf (aref physizes i) physsize)))) (setf (cg.logsizes cg) logsizes) (setf (cg.physizes cg) physizes) cg)) (defun idom-set-heap-range (area) (check-type area (member :tenured :dynamic)) (multiple-value-bind (base end) (cond ((eq area :tenured) (let ((area-ptr (core-q (kernel-global-address 'tenured-area)))) (values (core-q area-ptr target::area.low) (core-q area-ptr target::area.active)))) ((eq area :dynamic) (let* ((newest (core-q (core-q (kernel-global-address 'all-areas)) target::area.succ)) (oldest (core-q (kernel-global-address 'tenured-area)))) (assert (loop for this = newest then older as older = (core-q this target::area.succ) until (eql this oldest) always (eql (core-q this target::area.low) (core-q older target::area.active)))) (values (core-q oldest target::area.low) (core-q newest target::area.active))))) (let ((cg (current-core))) (unless (and (eq base (cg.heap-base cg)) (eq end (cg.heap-end cg))) (setf (cg.stage cg) nil) (setf (cg.heap-base cg) base) (setf (cg.heap-end cg) end))))) (defun report-idom-heap-utilization (type-infos &key unit sort threshold) (let ((data (loop for type being the hash-key of type-infos using (hash-value info) collect (cons (core-type-string type) info)))) (report-heap-utilization data :unit unit :sort sort :stream *standard-output* :threshold threshold))) (defun idom-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured)) (idom-set-heap-range area) (cg-compute t) (loop with cg = (current-core) with nodes = (cg.nodes cg) with type-infos = (make-hash-table :test 'eql) with base = (cg.heap-base cg) for idx across (cg.idoms cg) for logsz across (cg.logsizes cg) for physz across (cg.physizes cg) as type = (core-object-type-key (tagged-ptr (addr base (aref nodes idx)))) as info = (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))) do (incf (car info)) do (incf (cadr info) logsz) do (incf (caddr info) physz) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))) (defun idom-frontier-heap-utilization (&key unit (sort :size) (threshold 0.01) (area :tenured) (test nil)) ;; Compute the heap utilization WITHIN selected idom trees, aggregated. (idom-set-heap-range area) (cg-compute :idoms) (let* ((cg (current-core)) (nodes (cg.nodes cg)) (idom-nodes (cg.idoms cg)) (idom-revnodes (cg.revidoms cg)) (seen (make-array (length (cg.head-p cg)) :element-type 'bit :initial-element 0)) (base (cg.heap-base cg)) (high (cg.heap-end cg)) (nidoms (length idom-nodes)) (type-infos (make-hash-table :test 'eql))) (flet ((record (ptr) (multiple-value-bind (logsize physsize) (core-object-sizes ptr) (let* ((type (core-object-type-key ptr)) (info (or (gethash type type-infos) (setf (gethash type type-infos) (list 0 0 0))))) (incf (car info)) (incf (cadr info) logsize) (incf (caddr info) physsize))))) (loop for i from 0 below nidoms as idom = (aref idom-nodes i) do (let* ((dn (aref nodes idom)) (addr (addr base dn)) (ptr (tagged-ptr addr))) (when (or (null test) (funcall test ptr)) ;; Ok, idom of interest. Walk its subgraph (record ptr) (do-pointers (next addr) (when (and (<= base next) (< next high)) (let ((next-dn (dnode base next))) (unless (or (index-for-dnode idom-revnodes next-dn) (eql (aref seen next-dn) 1)) (setf (aref seen next-dn) 1) (record next) (descend-pointers next))))))) finally (report-idom-heap-utilization type-infos :unit unit :sort sort :threshold threshold))))) )
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"ACL2\")\n\n\n;; ", "end": 1398, "score": 0.9998640418052673, "start": 1388, "tag": "NAME", "value": "Sol Swords" }, { "context": "IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"ACL2\")\n\n\n;; Defines a function tha", "end": 1420, "score": 0.999930739402771, "start": 1400, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/misc/stobj-swap.lisp
ragerdl/acl2-defthm-rc2
1
; Centaur Miscellaneous Books ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Sol Swords <[email protected]> (in-package "ACL2") ;; Defines a function that swaps the contents of two (congruent) stobjs. ;; Logically, just return one and the other. ;; Defines a function called swap-stobj1. Stobj2 should be another stobj ;; declared congruent to stobj1. ;; Implementation note: ACL2 sometimes assumes that the stobj returned by a ;; form is the same object (i.e. pointer) as the corresponding stobj that was ;; input to that form. E.g., stobj-let has an optimization that assumes stobj ;; fields that are updated do not actually need to be reinstalled in the stobj ;; that they came from -- it'll just be the same pointer, so reinstalling them ;; would be no-ops. This has the consequence that we can't just do (in the raw ;; Lisp executable version of our swap) what we say we're doing in the non-exec ;; version, namely, return the pointers, just swapped. (defmacro def-stobj-swap (stobj1 stobj2) (let* ((swap-nx (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S-NX") stobj1)) (swap (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S") stobj1))) `(progn (make-event (if (eq (congruent-stobj-rep ',stobj1 (w state)) (congruent-stobj-rep ',stobj2 (w state))) '(value-triple :invisible) (er hard? 'def-stobj-swap "The two stobjs must be declared congruent to define a swapping function.~%"))) (defun-nx ,swap-nx (,stobj1 ,stobj2) (declare (Xargs :stobjs (,stobj1 ,stobj2))) (mv ,stobj2 ,stobj1)) (defun ,swap (,stobj1 ,stobj2) (declare (xargs :stobjs (,stobj1 ,stobj2))) (mv-let (,stobj1 ,stobj2) (,swap-nx ,stobj1 ,stobj2) (mv ,stobj1 ,stobj2))) (defttag ,swap) (progn! (set-raw-mode t) (defun ,swap (,stobj1 ,stobj2) (let* ((bound (1- (length ,stobj1)))) (loop for i from 0 to bound do (psetf (svref i ,stobj1) (svref i ,stobj2) (svref i ,stobj2) (svref i ,stobj1))) (mv ,stobj1 ,stobj2)))))))
41668
; Centaur Miscellaneous Books ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "ACL2") ;; Defines a function that swaps the contents of two (congruent) stobjs. ;; Logically, just return one and the other. ;; Defines a function called swap-stobj1. Stobj2 should be another stobj ;; declared congruent to stobj1. ;; Implementation note: ACL2 sometimes assumes that the stobj returned by a ;; form is the same object (i.e. pointer) as the corresponding stobj that was ;; input to that form. E.g., stobj-let has an optimization that assumes stobj ;; fields that are updated do not actually need to be reinstalled in the stobj ;; that they came from -- it'll just be the same pointer, so reinstalling them ;; would be no-ops. This has the consequence that we can't just do (in the raw ;; Lisp executable version of our swap) what we say we're doing in the non-exec ;; version, namely, return the pointers, just swapped. (defmacro def-stobj-swap (stobj1 stobj2) (let* ((swap-nx (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S-NX") stobj1)) (swap (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S") stobj1))) `(progn (make-event (if (eq (congruent-stobj-rep ',stobj1 (w state)) (congruent-stobj-rep ',stobj2 (w state))) '(value-triple :invisible) (er hard? 'def-stobj-swap "The two stobjs must be declared congruent to define a swapping function.~%"))) (defun-nx ,swap-nx (,stobj1 ,stobj2) (declare (Xargs :stobjs (,stobj1 ,stobj2))) (mv ,stobj2 ,stobj1)) (defun ,swap (,stobj1 ,stobj2) (declare (xargs :stobjs (,stobj1 ,stobj2))) (mv-let (,stobj1 ,stobj2) (,swap-nx ,stobj1 ,stobj2) (mv ,stobj1 ,stobj2))) (defttag ,swap) (progn! (set-raw-mode t) (defun ,swap (,stobj1 ,stobj2) (let* ((bound (1- (length ,stobj1)))) (loop for i from 0 to bound do (psetf (svref i ,stobj1) (svref i ,stobj2) (svref i ,stobj2) (svref i ,stobj1))) (mv ,stobj1 ,stobj2)))))))
true
; Centaur Miscellaneous Books ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "ACL2") ;; Defines a function that swaps the contents of two (congruent) stobjs. ;; Logically, just return one and the other. ;; Defines a function called swap-stobj1. Stobj2 should be another stobj ;; declared congruent to stobj1. ;; Implementation note: ACL2 sometimes assumes that the stobj returned by a ;; form is the same object (i.e. pointer) as the corresponding stobj that was ;; input to that form. E.g., stobj-let has an optimization that assumes stobj ;; fields that are updated do not actually need to be reinstalled in the stobj ;; that they came from -- it'll just be the same pointer, so reinstalling them ;; would be no-ops. This has the consequence that we can't just do (in the raw ;; Lisp executable version of our swap) what we say we're doing in the non-exec ;; version, namely, return the pointers, just swapped. (defmacro def-stobj-swap (stobj1 stobj2) (let* ((swap-nx (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S-NX") stobj1)) (swap (intern-in-package-of-symbol (concatenate 'string "SWAP-" (symbol-name stobj1) "S") stobj1))) `(progn (make-event (if (eq (congruent-stobj-rep ',stobj1 (w state)) (congruent-stobj-rep ',stobj2 (w state))) '(value-triple :invisible) (er hard? 'def-stobj-swap "The two stobjs must be declared congruent to define a swapping function.~%"))) (defun-nx ,swap-nx (,stobj1 ,stobj2) (declare (Xargs :stobjs (,stobj1 ,stobj2))) (mv ,stobj2 ,stobj1)) (defun ,swap (,stobj1 ,stobj2) (declare (xargs :stobjs (,stobj1 ,stobj2))) (mv-let (,stobj1 ,stobj2) (,swap-nx ,stobj1 ,stobj2) (mv ,stobj1 ,stobj2))) (defttag ,swap) (progn! (set-raw-mode t) (defun ,swap (,stobj1 ,stobj2) (let* ((bound (1- (length ,stobj1)))) (loop for i from 0 to bound do (psetf (svref i ,stobj1) (svref i ,stobj2) (svref i ,stobj2) (svref i ,stobj1))) (mv ,stobj1 ,stobj2)))))))
[ { "context": "ile base64)\n (delete-file base64))))\n\n#+nil\n\"U28/PHA+VGhpcyA0LCA1LCA2LCA3LCA4LCA5LCB6LCB7LCB8LCB9IHRlc3RzIEJhc2U2NCBlbmNv\nZGVyLiBTaG93IG1lOiBALCBBLCBCLCBDLCBELCBFLCBGLCBHLCBILCBJLCBKLCBLLCBMLCBNLCBO\nLCBPLCBQLCBRLCBSLCBTLCBULCBVLCBWLCBXLCBYLCBZLCBaLCBbLCBcLCBdLCBeLCBfLCBgLCBh\nLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuLCBvLCBwLCBxLCByLCBzLg==\"\n\n;;;\n(defun detect-c", "end": 6119, "score": 0.996418833732605, "start": 5840, "tag": "KEY", "value": "U28/PHA+VGhpcyA0LCA1LCA2LCA3LCA4LCA5LCB6LCB7LCB8LCB9IHRlc3RzIEJhc2U2NCBlbmNv\nZGVyLiBTaG93IG1lOiBALCBBLCBCLCBDLCBELCBFLCBGLCBHLCBILCBJLCBKLCBLLCBMLCBNLCBO\nLCBPLCBQLCBRLCBSLCBTLCBULCBVLCBWLCBXLCBYLCBZLCBaLCBbLCBcLCBdLCBeLCBfLCBgLCBh\nLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBt" } ]
src/crud/crud.lisp
mcclung/sucle
97
(defpackage #:crud (:use :cl) (:export #:crud-create #:crud-read #:crud-update #:crud-delete #:use-crud-from-path #:detect-crud-from-path #:make-crud-from-path #:call-with-transaction)) (in-package #:crud) ;;CRUD implementation for map from lisp_obj -> lisp_obj ;;create, read, update, delete ;;- slqlite database ;;- pile of files (defclass crud () ((path :initarg :path :accessor path))) (defparameter *implementation* nil) (defgeneric crud_create (lisp-object data crud)) (defgeneric crud_read (lisp-object crud)) (defgeneric crud_update (lisp-object data crud)) (defgeneric crud_delete (lisp-object crud)) (defun crud-create (lisp-object data) (crud_create lisp-object data *implementation*)) (defun crud-read (lisp-object) (crud_read lisp-object *implementation*)) (defun crud-update (lisp-object data) (crud_update lisp-object data *implementation*)) (defun crud-delete (lisp-object) (crud_delete lisp-object *implementation*)) ;;world loading code below? (defun convert-object-to-filename (&optional (obj '(0 1 2 'obj :cl))) (with-output-to-string (str) ;;FIXME::what about circular data structures? (sucle-serialize::safer-write obj str))) (defclass crud-sqlite (crud) ()) (defmethod crud_create (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_create_sqlite name data))) (defmethod crud_read (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_read_sqlite name))) (defmethod crud_update (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_update_sqlite name data))) (defmethod crud_delete (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_delete_sqlite name))) ;;;;SQLITE + sucle-serialize (defmacro with-open-sqlite-database (&body body) `(let ((database::*database* (path *implementation*))) (database::with-open-database2 ,@body))) (defun crud_create_sqlite (lisp-object data) ;;FIXME:update creates a row regardless, so update ;;is the real create. (crud_update_sqlite lisp-object data)) (defun crud_read_sqlite (lisp-object) (let* ((file-name (convert-object-to-filename lisp-object)) (stuff (with-open-sqlite-database (database::retreive file-name)))) (when stuff (sucle-serialize::decode-zlib-conspack-payload stuff)))) (defun crud_update_sqlite (lisp-object data) (with-open-sqlite-database (database::add (convert-object-to-filename lisp-object) (sucle-serialize::encode-zlib-conspack-payload data)))) (defun crud_delete_sqlite (lisp-object) (with-open-sqlite-database (database::delete-entry (convert-object-to-filename lisp-object)))) ;;;;sucle-serialize (defclass crud-file-pile (crud) ()) (defparameter *path* nil) (defmethod crud_create (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_create_file-pile name data))) (defmethod crud_read (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_read_file-pile name))) (defmethod crud_update (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_update_file-pile name data))) (defmethod crud_delete (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_delete_file-pile name))) ;;[FIXME]:can possibly create filenames that are illegal. ;;use base64 instead? how to mix the two? ;; (defparameter *base-64-string* "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_") (defun string-base64 (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-encode string))) (defun base64-string (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-decode string))) (defun commentify (&optional (string "test")) (concatenate 'string ";" string)) (defun un-commentify (&optional (string ";test")) (subseq string 1 (length string))) (defparameter *junk* '(4/5 "foo/bar.../baz" 3)) ;;FIXME: 'check-' functions get highlighted red in emacs (defun %check-safe-string (lispobj &optional (directory "") &aux (pathname (convert-object-to-filename lispobj)) (path (merge-pathnames pathname directory)) (base64-path (merge-pathnames (commentify (string-base64 pathname)) directory))) ;;FIXME::This probably won't work on windows. ;;https://stackoverflow.com/questions/4814040/allowed-characters-in-filename ;;Check that they both point to files in same directory ;;If they are, then it is safe (if (equal (pathname-directory base64-path) (pathname-directory path)) (values path base64-path) (values nil base64-path))) (defun crud_create_file-pile (lisp-object data) (crud_update_file-pile lisp-object data)) (defun crud_read_file-pile (lisp-object &aux (path *path*)) (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) ;;if both are valid, prefer the base64 one. ;;if only base64 is valid, just use that. (sucle-serialize:load (cond (file-path (if (probe-file base64) base64 file-path)) (t base64))))) (defun crud_update_file-pile (lisp-object data &aux (path *path*)) (ensure-directories-exist (uiop:pathname-directory-pathname path)) ;;Don't use the old format, just the base64 one. (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (declare (ignore file-path)) (sucle-serialize:save base64 data))) (defun crud_delete_file-pile (lisp-object &aux (path *path*)) ;;Delete the base64 version, and the regular version, if they exist. ;;FIXME:reads from the disk, slow? FIXME: use OPTIMIZE rather than FIXME? (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (when (and file-path (probe-file file-path)) (delete-file file-path)) (when (probe-file base64) (delete-file base64)))) #+nil "U28/PHA+VGhpcyA0LCA1LCA2LCA3LCA4LCA5LCB6LCB7LCB8LCB9IHRlc3RzIEJhc2U2NCBlbmNv ZGVyLiBTaG93IG1lOiBALCBBLCBCLCBDLCBELCBFLCBGLCBHLCBILCBJLCBKLCBLLCBMLCBNLCBO LCBPLCBQLCBRLCBSLCBTLCBULCBVLCBWLCBXLCBYLCBZLCBaLCBbLCBcLCBdLCBeLCBfLCBgLCBh LCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuLCBvLCBwLCBxLCByLCBzLg==" ;;; (defun detect-crud-from-path (path) (if (uiop:file-pathname-p path) ;;A sqlite database is a singular file. 'crud-sqlite 'crud-file-pile)) (defun make-crud-from-path (path) (make-instance (detect-crud-from-path path) :path path)) (defun use-crud-from-path (path) (setf *implementation* (make-crud-from-path path))) (defvar *transacation-happening*) (defun call-with-transaction (fun) (flet ((thing () (funcall fun))) (cond ((typep crud::*implementation* 'crud::crud-sqlite) ;;FIXME::this references sqlite? (with-open-sqlite-database (if (boundp '*transacation-happening*) (thing) (let ((*transacation-happening* t)) (sqlite:with-transaction database::*db* (thing)))))) (t (thing)))))
19583
(defpackage #:crud (:use :cl) (:export #:crud-create #:crud-read #:crud-update #:crud-delete #:use-crud-from-path #:detect-crud-from-path #:make-crud-from-path #:call-with-transaction)) (in-package #:crud) ;;CRUD implementation for map from lisp_obj -> lisp_obj ;;create, read, update, delete ;;- slqlite database ;;- pile of files (defclass crud () ((path :initarg :path :accessor path))) (defparameter *implementation* nil) (defgeneric crud_create (lisp-object data crud)) (defgeneric crud_read (lisp-object crud)) (defgeneric crud_update (lisp-object data crud)) (defgeneric crud_delete (lisp-object crud)) (defun crud-create (lisp-object data) (crud_create lisp-object data *implementation*)) (defun crud-read (lisp-object) (crud_read lisp-object *implementation*)) (defun crud-update (lisp-object data) (crud_update lisp-object data *implementation*)) (defun crud-delete (lisp-object) (crud_delete lisp-object *implementation*)) ;;world loading code below? (defun convert-object-to-filename (&optional (obj '(0 1 2 'obj :cl))) (with-output-to-string (str) ;;FIXME::what about circular data structures? (sucle-serialize::safer-write obj str))) (defclass crud-sqlite (crud) ()) (defmethod crud_create (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_create_sqlite name data))) (defmethod crud_read (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_read_sqlite name))) (defmethod crud_update (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_update_sqlite name data))) (defmethod crud_delete (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_delete_sqlite name))) ;;;;SQLITE + sucle-serialize (defmacro with-open-sqlite-database (&body body) `(let ((database::*database* (path *implementation*))) (database::with-open-database2 ,@body))) (defun crud_create_sqlite (lisp-object data) ;;FIXME:update creates a row regardless, so update ;;is the real create. (crud_update_sqlite lisp-object data)) (defun crud_read_sqlite (lisp-object) (let* ((file-name (convert-object-to-filename lisp-object)) (stuff (with-open-sqlite-database (database::retreive file-name)))) (when stuff (sucle-serialize::decode-zlib-conspack-payload stuff)))) (defun crud_update_sqlite (lisp-object data) (with-open-sqlite-database (database::add (convert-object-to-filename lisp-object) (sucle-serialize::encode-zlib-conspack-payload data)))) (defun crud_delete_sqlite (lisp-object) (with-open-sqlite-database (database::delete-entry (convert-object-to-filename lisp-object)))) ;;;;sucle-serialize (defclass crud-file-pile (crud) ()) (defparameter *path* nil) (defmethod crud_create (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_create_file-pile name data))) (defmethod crud_read (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_read_file-pile name))) (defmethod crud_update (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_update_file-pile name data))) (defmethod crud_delete (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_delete_file-pile name))) ;;[FIXME]:can possibly create filenames that are illegal. ;;use base64 instead? how to mix the two? ;; (defparameter *base-64-string* "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_") (defun string-base64 (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-encode string))) (defun base64-string (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-decode string))) (defun commentify (&optional (string "test")) (concatenate 'string ";" string)) (defun un-commentify (&optional (string ";test")) (subseq string 1 (length string))) (defparameter *junk* '(4/5 "foo/bar.../baz" 3)) ;;FIXME: 'check-' functions get highlighted red in emacs (defun %check-safe-string (lispobj &optional (directory "") &aux (pathname (convert-object-to-filename lispobj)) (path (merge-pathnames pathname directory)) (base64-path (merge-pathnames (commentify (string-base64 pathname)) directory))) ;;FIXME::This probably won't work on windows. ;;https://stackoverflow.com/questions/4814040/allowed-characters-in-filename ;;Check that they both point to files in same directory ;;If they are, then it is safe (if (equal (pathname-directory base64-path) (pathname-directory path)) (values path base64-path) (values nil base64-path))) (defun crud_create_file-pile (lisp-object data) (crud_update_file-pile lisp-object data)) (defun crud_read_file-pile (lisp-object &aux (path *path*)) (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) ;;if both are valid, prefer the base64 one. ;;if only base64 is valid, just use that. (sucle-serialize:load (cond (file-path (if (probe-file base64) base64 file-path)) (t base64))))) (defun crud_update_file-pile (lisp-object data &aux (path *path*)) (ensure-directories-exist (uiop:pathname-directory-pathname path)) ;;Don't use the old format, just the base64 one. (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (declare (ignore file-path)) (sucle-serialize:save base64 data))) (defun crud_delete_file-pile (lisp-object &aux (path *path*)) ;;Delete the base64 version, and the regular version, if they exist. ;;FIXME:reads from the disk, slow? FIXME: use OPTIMIZE rather than FIXME? (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (when (and file-path (probe-file file-path)) (delete-file file-path)) (when (probe-file base64) (delete-file base64)))) #+nil "<KEY>LCBuLCBvLCBwLCBxLCByLCBzLg==" ;;; (defun detect-crud-from-path (path) (if (uiop:file-pathname-p path) ;;A sqlite database is a singular file. 'crud-sqlite 'crud-file-pile)) (defun make-crud-from-path (path) (make-instance (detect-crud-from-path path) :path path)) (defun use-crud-from-path (path) (setf *implementation* (make-crud-from-path path))) (defvar *transacation-happening*) (defun call-with-transaction (fun) (flet ((thing () (funcall fun))) (cond ((typep crud::*implementation* 'crud::crud-sqlite) ;;FIXME::this references sqlite? (with-open-sqlite-database (if (boundp '*transacation-happening*) (thing) (let ((*transacation-happening* t)) (sqlite:with-transaction database::*db* (thing)))))) (t (thing)))))
true
(defpackage #:crud (:use :cl) (:export #:crud-create #:crud-read #:crud-update #:crud-delete #:use-crud-from-path #:detect-crud-from-path #:make-crud-from-path #:call-with-transaction)) (in-package #:crud) ;;CRUD implementation for map from lisp_obj -> lisp_obj ;;create, read, update, delete ;;- slqlite database ;;- pile of files (defclass crud () ((path :initarg :path :accessor path))) (defparameter *implementation* nil) (defgeneric crud_create (lisp-object data crud)) (defgeneric crud_read (lisp-object crud)) (defgeneric crud_update (lisp-object data crud)) (defgeneric crud_delete (lisp-object crud)) (defun crud-create (lisp-object data) (crud_create lisp-object data *implementation*)) (defun crud-read (lisp-object) (crud_read lisp-object *implementation*)) (defun crud-update (lisp-object data) (crud_update lisp-object data *implementation*)) (defun crud-delete (lisp-object) (crud_delete lisp-object *implementation*)) ;;world loading code below? (defun convert-object-to-filename (&optional (obj '(0 1 2 'obj :cl))) (with-output-to-string (str) ;;FIXME::what about circular data structures? (sucle-serialize::safer-write obj str))) (defclass crud-sqlite (crud) ()) (defmethod crud_create (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_create_sqlite name data))) (defmethod crud_read (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_read_sqlite name))) (defmethod crud_update (name data (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_update_sqlite name data))) (defmethod crud_delete (name (impl crud-sqlite)) (let ((database::*database* (path impl))) (crud_delete_sqlite name))) ;;;;SQLITE + sucle-serialize (defmacro with-open-sqlite-database (&body body) `(let ((database::*database* (path *implementation*))) (database::with-open-database2 ,@body))) (defun crud_create_sqlite (lisp-object data) ;;FIXME:update creates a row regardless, so update ;;is the real create. (crud_update_sqlite lisp-object data)) (defun crud_read_sqlite (lisp-object) (let* ((file-name (convert-object-to-filename lisp-object)) (stuff (with-open-sqlite-database (database::retreive file-name)))) (when stuff (sucle-serialize::decode-zlib-conspack-payload stuff)))) (defun crud_update_sqlite (lisp-object data) (with-open-sqlite-database (database::add (convert-object-to-filename lisp-object) (sucle-serialize::encode-zlib-conspack-payload data)))) (defun crud_delete_sqlite (lisp-object) (with-open-sqlite-database (database::delete-entry (convert-object-to-filename lisp-object)))) ;;;;sucle-serialize (defclass crud-file-pile (crud) ()) (defparameter *path* nil) (defmethod crud_create (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_create_file-pile name data))) (defmethod crud_read (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_read_file-pile name))) (defmethod crud_update (name data (impl crud-file-pile)) (let ((*path* (path impl))) (crud_update_file-pile name data))) (defmethod crud_delete (name (impl crud-file-pile)) (let ((*path* (path impl))) (crud_delete_file-pile name))) ;;[FIXME]:can possibly create filenames that are illegal. ;;use base64 instead? how to mix the two? ;; (defparameter *base-64-string* "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_") (defun string-base64 (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-encode string))) (defun base64-string (string) (let ((base64::*base64* *base-64-string*)) (base64:base64-decode string))) (defun commentify (&optional (string "test")) (concatenate 'string ";" string)) (defun un-commentify (&optional (string ";test")) (subseq string 1 (length string))) (defparameter *junk* '(4/5 "foo/bar.../baz" 3)) ;;FIXME: 'check-' functions get highlighted red in emacs (defun %check-safe-string (lispobj &optional (directory "") &aux (pathname (convert-object-to-filename lispobj)) (path (merge-pathnames pathname directory)) (base64-path (merge-pathnames (commentify (string-base64 pathname)) directory))) ;;FIXME::This probably won't work on windows. ;;https://stackoverflow.com/questions/4814040/allowed-characters-in-filename ;;Check that they both point to files in same directory ;;If they are, then it is safe (if (equal (pathname-directory base64-path) (pathname-directory path)) (values path base64-path) (values nil base64-path))) (defun crud_create_file-pile (lisp-object data) (crud_update_file-pile lisp-object data)) (defun crud_read_file-pile (lisp-object &aux (path *path*)) (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) ;;if both are valid, prefer the base64 one. ;;if only base64 is valid, just use that. (sucle-serialize:load (cond (file-path (if (probe-file base64) base64 file-path)) (t base64))))) (defun crud_update_file-pile (lisp-object data &aux (path *path*)) (ensure-directories-exist (uiop:pathname-directory-pathname path)) ;;Don't use the old format, just the base64 one. (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (declare (ignore file-path)) (sucle-serialize:save base64 data))) (defun crud_delete_file-pile (lisp-object &aux (path *path*)) ;;Delete the base64 version, and the regular version, if they exist. ;;FIXME:reads from the disk, slow? FIXME: use OPTIMIZE rather than FIXME? (multiple-value-bind (file-path base64) (%check-safe-string lisp-object path) (when (and file-path (probe-file file-path)) (delete-file file-path)) (when (probe-file base64) (delete-file base64)))) #+nil "PI:KEY:<KEY>END_PILCBuLCBvLCBwLCBxLCByLCBzLg==" ;;; (defun detect-crud-from-path (path) (if (uiop:file-pathname-p path) ;;A sqlite database is a singular file. 'crud-sqlite 'crud-file-pile)) (defun make-crud-from-path (path) (make-instance (detect-crud-from-path path) :path path)) (defun use-crud-from-path (path) (setf *implementation* (make-crud-from-path path))) (defvar *transacation-happening*) (defun call-with-transaction (fun) (flet ((thing () (funcall fun))) (cond ((typep crud::*implementation* 'crud::crud-sqlite) ;;FIXME::this references sqlite? (with-open-sqlite-database (if (boundp '*transacation-happening*) (thing) (let ((*transacation-happening* t)) (sqlite:with-transaction database::*db* (thing)))))) (t (thing)))))
[ { "context": "(defsystem cl-yaml\n :author \"Fernando Borretti <[email protected]>\"\n :maintainer \"Fernando Bo", "end": 47, "score": 0.9998621344566345, "start": 30, "tag": "NAME", "value": "Fernando Borretti" }, { "context": "(defsystem cl-yaml\n :author \"Fernando Borretti <[email protected]>\"\n :maintainer \"Fernando Borretti <eudoxiahp@gma", "end": 68, "score": 0.9999049305915833, "start": 49, "tag": "EMAIL", "value": "[email protected]" }, { "context": "do Borretti <[email protected]>\"\n :maintainer \"Fernando Borretti <[email protected]>\"\n :license \"MIT\"\n :versio", "end": 103, "score": 0.9998622536659241, "start": 86, "tag": "NAME", "value": "Fernando Borretti" }, { "context": "[email protected]>\"\n :maintainer \"Fernando Borretti <[email protected]>\"\n :license \"MIT\"\n :version \"0.1\"\n :homepage \"", "end": 124, "score": 0.9998911619186401, "start": 105, "tag": "EMAIL", "value": "[email protected]" }, { "context": "\n :version \"0.1\"\n :homepage \"https://github.com/eudoxia0/cl-yaml\"\n :bug-tracker \"https://github.com/eudox", "end": 201, "score": 0.8376081585884094, "start": 193, "tag": "USERNAME", "value": "eudoxia0" }, { "context": "oxia0/cl-yaml\"\n :bug-tracker \"https://github.com/eudoxia0/cl-yaml/issues\"\n :source-control (:git \"git@gith", "end": 254, "score": 0.9190680384635925, "start": 246, "tag": "USERNAME", "value": "eudoxia0" }, { "context": "eudoxia0/cl-yaml/issues\"\n :source-control (:git \"[email protected]:eudoxia0/cl-yaml.git\")\n :depends-on (:cl-libyaml", "end": 310, "score": 0.9943746328353882, "start": 296, "tag": "EMAIL", "value": "[email protected]" }, { "context": "/issues\"\n :source-control (:git \"[email protected]:eudoxia0/cl-yaml.git\")\n :depends-on (:cl-libyaml\n ", "end": 319, "score": 0.8886452913284302, "start": 312, "tag": "USERNAME", "value": "udoxia0" } ]
dependencies/cl-yaml-latest/cl-yaml.asd
nlamirault/qi
79
(defsystem cl-yaml :author "Fernando Borretti <[email protected]>" :maintainer "Fernando Borretti <[email protected]>" :license "MIT" :version "0.1" :homepage "https://github.com/eudoxia0/cl-yaml" :bug-tracker "https://github.com/eudoxia0/cl-yaml/issues" :source-control (:git "[email protected]:eudoxia0/cl-yaml.git") :depends-on (:cl-libyaml :alexandria :cl-ppcre :parse-number) :components ((:module "src" :serial t :components ((:file "error") (:file "float") (:file "scalar") (:file "parser") (:file "emitter") (:file "yaml")))) :description "A YAML parser and emitter." :long-description #.(uiop:read-file-string (uiop:subpathname *load-pathname* "README.md")) :in-order-to ((test-op (test-op cl-yaml-test))))
27137
(defsystem cl-yaml :author "<NAME> <<EMAIL>>" :maintainer "<NAME> <<EMAIL>>" :license "MIT" :version "0.1" :homepage "https://github.com/eudoxia0/cl-yaml" :bug-tracker "https://github.com/eudoxia0/cl-yaml/issues" :source-control (:git "<EMAIL>:eudoxia0/cl-yaml.git") :depends-on (:cl-libyaml :alexandria :cl-ppcre :parse-number) :components ((:module "src" :serial t :components ((:file "error") (:file "float") (:file "scalar") (:file "parser") (:file "emitter") (:file "yaml")))) :description "A YAML parser and emitter." :long-description #.(uiop:read-file-string (uiop:subpathname *load-pathname* "README.md")) :in-order-to ((test-op (test-op cl-yaml-test))))
true
(defsystem cl-yaml :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :maintainer "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "MIT" :version "0.1" :homepage "https://github.com/eudoxia0/cl-yaml" :bug-tracker "https://github.com/eudoxia0/cl-yaml/issues" :source-control (:git "PI:EMAIL:<EMAIL>END_PI:eudoxia0/cl-yaml.git") :depends-on (:cl-libyaml :alexandria :cl-ppcre :parse-number) :components ((:module "src" :serial t :components ((:file "error") (:file "float") (:file "scalar") (:file "parser") (:file "emitter") (:file "yaml")))) :description "A YAML parser and emitter." :long-description #.(uiop:read-file-string (uiop:subpathname *load-pathname* "README.md")) :in-order-to ((test-op (test-op cl-yaml-test))))
[ { "context": "s of 4676 Admiralty Way, Suite ;\n; 1001, Marina del Rey, CA 90292 is the copyright holder in the ", "end": 1457, "score": 0.9998359680175781, "start": 1443, "tag": "NAME", "value": "Marina del Rey" } ]
platform/site-lisp/loom4.0/abox/worlds.lisp
TeamSPoon/CYC_JRTL_with_CommonLisp_OLD
10
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: LOOM; Base: 10. -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Copyright (c) 1988, 1995, 1999, 2003 University of Southern California ; ; All rights reserved. ; ; ; ; LICENSE ; ; ; ; 1) The "SOFTWARE", below, refers to the LOOM software (in either ; ; source-code, or binary form) and a "work based on the SOFTWARE" ; ; means a work based on either the SOFTWARE, on part of the SOFTWARE, ; ; or on any derivative work of the SOFTWARE under copyright law: ; ; that is, a work containing all or a portion of the SOFTWARE ; ; either verbatim or with modifications. Each licensee is ; ; addressed as "you" or "LICENSEE". ; ; ; ; 2) The University of Southern California on behalf of its Information ; ; Sciences Institute having an address of 4676 Admiralty Way, Suite ; ; 1001, Marina del Rey, CA 90292 is the copyright holder in the ; ; SOFTWARE. The copyright holder reserve all rights except those ; ; expressly granted to the LICENSEE herein and U.S. Government ; ; license rights. ; ; ; ; 3) A copy or copies of the SOFTWARE may be given to others, if you ; ; meet the following conditions: ; ; ; ; a) Copies in source code must include the copyright notice and this ; ; license. ; ; ; ; b) Copies in binary form must include the copyright notice and ; ; this license in the documentation and/or other materials ; ; provided with the copy. ; ; ; ; 4) All advertising materials, journal articles and documentation ; ; mentioning features derived from or use of the SOFTWARE must ; ; display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html)." ; ; ; ; In the event that the product being advertised includes an intact ; ; distribution (with copyright and license included) then this ; ; clause is waived. ; ; ; ; 5) You are encouraged to package modifications to the SOFTWARE ; ; separately, as patches to the SOFTWARE. ; ; ; ; 6) If you modify a copy or copies of the SOFTWARE or any portion of ; ; it, thus forming a work based on the SOFTWARE, and give a copy or ; ; copies of such work to others, either in source code or binary ; ; form, you must meet the following conditions: ; ; ; ; a) The SOFTWARE must carry prominent notices stating that you ; ; changed specified portions of the SOFTWARE. ; ; ; ; b) The SOFTWARE must display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM Project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html) to ; ; which the U.S. Government retains certain rights." ; ; ; ; 7) LICENSEE AGREES THAT THE EXPORT OF GOODS AND/OR TECHNICAL DATA FROM ; ; THE UNITED STATES MAY REQUIRE SOME FORM OF EXPORT CONTROL LICENSE ; ; FROM THE U.S. GOVERNMENT AND THAT FAILURE TO OBTAIN SUCH EXPORT ; ; CONTROL LICENSE MAY RESULT IN CRIMINAL LIABILITY UNDER U.S. LAW. ; ; ; ; 8) Portions of the SOFTWARE resulted from work developed under a ; ; U.S. Government contract and are subject to the following license: ; ; the Government is granted for itself and others acting on its ; ; behalf a paid-up, nonexclusive, irrevocable worldwide license in ; ; this SOFTWARE to reproduce, prepare derivative works, and perform ; ; publicly and display publicly. ; ; ; ; 9) The SOFTWARE was prepared, in part, as an account of work sponsored ; ; by an agency of the United States Government. Neither the United ; ; States, nor the University of Southern California, nor any of their ; ; employees, makes any warranty express or implied, or assumes any ; ; legal liability or responsibility for the accuracy, completeness, ; ; or usefulness of any information, apparatus, product, or process ; ; disclosed, or represents that its use would not infringe privately ; ; owned rights. ; ; ; ; 10) IN NO EVENT WILL THE UNITED STATES OR THE UNIVERSITY OF SOUTHERN ; ; CALIFORNIA BE LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, INCIDENTAL, ; ; SPECIAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM EXERCISE OF THIS ; ; LICENSE AGREEMENT OR THE USE OF THE SOFTWARE. ; ; ; ; 11) THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF SOUTHERN CALIFORNIA ; ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS ; ; FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE UNIVERSITY OF ; ; SOUTHERN CALIFORNIA MAKES NO REPRESENTATION THAT THE SOFTWARE, ; ; MODIFICATIONS, ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT ; ; INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY ; ; RIGHT. ; ; ; ; END OF LICENSE ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; WORLDS.LISP (ABOX) ;;; Functions for manipulating worlds (in-package "LOOM") (export '( change-world spawn-world join-worlds destroy-world find-world list-world with-world)) ;; ;;;;;; World-sensitive referencing of instances ;; #+CLTL2 (declaim (inline intern-instance-in-world unintern-instance-in-world)) #-CLTL2(proclaim '(inline intern-instance-in-world unintern-instance-in-world)) (defun intern-instance-in-world (instance world) ;; Enter "instance" into the local name space of "world", ;; keyed on its identifier; ;; Called by "create-loom-instance"; (let ((ids (multiple-identifiers instance))) (if ids (loop for id in ids do (setf (gethash id (local-instance-space world)) instance)) (setf (gethash (identifier instance) (local-instance-space world)) instance)) (clear-get-instance-cache) )) ;; Forward references for ;;;;;; World-sensitive evaluation of instance identifiers ;; (defmacro get-instance-in-*world* (instance &key mergeable-instance-p-test) ;; Return the top-level version of "instance in the current world; (cond ((eq mergeable-instance-p-test t) `(get-mergeable-instance-in-world ,instance *world*)) (mergeable-instance-p-test `(when mergeable-instance-p-test `(get-mergeable-instance-in-world ,instance *world*))) (t `(get-instance-in-world ,instance *world*))) ) #+CLTL2 (declaim (inline eval-instance-id-in-world eval-instance-id-in-*world*)) #-CLTL2 (proclaim '(inline eval-instance-id-in-world eval-instance-id-in-*world*)) (defun eval-instance-id-in-world (identifier world) ;; Search for the top-most instance matching "identifier", starting ;; from world "world"; (loop for table in (all-instance-spaces-of-world world) do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-world matchingInstance)))) ) (defun eval-instance-id-in-*world* (identifier) ;; Searches for an instance matching "identifier", starting ;; from the current world; (loop for table in *current-instance-space-list* do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-*world* matchingInstance)))) ) ;; TO BE RENAMED "get-most-lifted-instance": (defun get-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; CAUTION: Assumes "instance" belongs to "world", or to one of its ;; ancestors, or to one of its descendants; ;; Short cut: "instance" is current for "world" if it is not shadowed, ;; and if "world" has no children; ;; TO DO: FIGURE OUT IF THE ASSUMPTION THAT "instance" IS NOT DEFINED ;; ONLY IN SIBLING WORLDS OF "world" IS VALID (THE ABOX QUERY SYNTAX ;; SOMEWHAT ENFORCES THE PRESENT ASSUMPTION); (if (and (mergeable-instance-p instance) (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) #+CLTL2 (declaim (inline get-mergeable-instance-in-world)) #-CLTL2 (proclaim '(inline get-mergeable-instance-in-world)) (defun get-mergeable-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; Assumes that "instance" is mergeable (and hence avoids that check); ;; See "get-instance-in-world" for further comments; (if (and (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) (defmacro get-set-in-*world* (set) ;; Return a copy of "set" for which all members are in the ;; current world; `(get-set-in-world ,set *world*) ) (defun get-set-in-world (set world) ;; Scan "set" to see if some of its members are shadowed ;; from the vantage point of "world"; ;; If so, return a list of the top-most instances; ;; If not, return the original set (to save CONSes); ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (when (and set (mergeable-instance-p (first set))) (let ((mightBelongToChildWorldP (child-worlds world))) (if (null (rest set)) (let ((member (first set)) shadowingMember) (when (or mightBelongToChildWorldP (shadowed-p member)) (setq shadowingMember (eval-instance-id-in-world (identifier member) world)) ;; note: forgotten member sets "set" to be nil: (setq set (when shadowingMember (list shadowingMember))))) (when (loop for member in set thereis (shadowed-p member)) ;; compute set of top-most fillers (setq set (loop for member in set collect (if (or mightBelongToChildWorldP (shadowed-p member)) (eval-instance-id-in-world (identifier member) world) member))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)))))) set ) (defun copy-set-in-*world* (set) ;; Called by "retract-role-filler"; ;; Return a copy of "set" with any shadowed instances replaced by ;; top-level instances in the current world; ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (if (not (typep (car set) 'DB-INSTANCE)) (copy-list set) (progn (setq set (loop for member in set collect (cond ((shadowed-p member) (eval-instance-id-in-*world* (identifier member))) (t member)))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)) set)) ) ;; ;;;;;; More up-front world macros ;; (defmacro map-world (mappingFunction world) ;; Iterate over instances in "world", and apply "mappingFunction" ;; to each one; (let ((body (reparameterized-body-of-lambda-expr mappingFunction 'key 'value))) `(flet ((mappingFn (key value) (declare (ignore key)) ,@body)) (maphash (function mappingFn) (local-instance-space ,world))) )) (defmacro womp&coerce-to-*world* (instance &key mergeable-instance-p-test) ;; Helping macro for "with-world" and "retract-role-filler"; ;; Verify that instance is a real Loom instance, and make sure that merge ;; pointers have been followed; ;; Then, return the current copy of that instance in *world*; ;; CAUTION: "instance" may be evaluated multiple times by this macro; (let ((body `(let ((newInstance (womp-merge-pointers ,instance :mergeable-instance-p-test t))) (if (and *world* ;; test for possiblitity that merge replaced (mergeable) ;; skolem with (unmergeable) constant: (or (eq ,instance newInstance) (mergeable-instance-p newInstance))) (get-instance-in-*world* newInstance :mergeable-instance-p-test t) newInstance)))) (if (eq mergeable-instance-p-test t) body `(when ,(or mergeable-instance-p-test `(mergeable-instance-p ,instance)) ,body)) )) ;; ;;;;;; "with-world" ;; (defun destroy-world (world) ;; Dummy Function (declare (ignore world)) (grumble "Calling obsolete function DESTROY-WORLD") nil) (eval-when (load eval compile) ; (:compile-toplevel :load-toplevel :execute) (defun conditionally-destroy-incoherent-world (catchResult world) ;; Helping function for "with-world" macro; ;; If the world "world" has become incoherent and *destroy-incoherent-worlds-p* ;; is non-nil, then destroy it; (when (and (eq catchResult :incoherent) *destroy-incoherent-worlds-p*) (case *destroy-incoherent-worlds-p* (:break (trace-values "ABOUT TO DESTROY WORLD" world) (destroy-world world)) (otherwise ;; destroying the world also removes all of its instances from match queues (destroy-world world)))) )) (defmacro with-world (world vars &body code) "Switch the current world to `world', reevaluate the bindings for `vars' to point to instances in that world, evaluate `code' with that world, possibly destroy `world' if it becomes incoherent, and then return to the previous world." (once-only (world) `(let ((savedWorld *world*) catchResult) (change-world ,world) (let (,@(loop for var in vars collect `(,var (LOOM::womp&coerce-to-*world* ,var))) *exitIncoherentWorldP*) (declare (special *exitIncoherentWorldP*)) (setq catchResult (catch 'incoherent-world-catcher ,@code)) (conditionally-destroy-incoherent-world catchResult ,world)) (change-world savedWorld) catchResult) )) ;;; Top-level world functions (defun change-world (world) ;; Reset the variables *current-name-spaces*, *current-evaluate-id-fns*, ;; *world*, and (possibly) *context* to access the ;; world "world"; ;; If "world" equals NIL, reset look-up functions to operate from ;; the current context; (when (eq *world* world) (return-from change-world nil)) (when (neq (context-of-world world) *context*) (change-context (context-of-world world))) (integrity-check (eq (caar *current-name-spaces*) :instances)) (setf (cdar *current-name-spaces*) (local-instance-space world)) (setf *current-instance-space-list* (all-instance-spaces-of-world world)) (when (null *world*) (setf (cdar *current-evaluate-id-fns*) #'lookup-instance-in-*world*)) (clear-get-instance-cache) (with-speed (setq *monotonic-mode-p* (test-bit-flags (context-flag world) :context-flag :monotonic))) (setq *world* world) ) (defmethod spawn-world ((parentWorld WORLD) &key monotonic-p) ;; Create a new world with parent "parentWorld"; ;; Link the new world to "parentWorld"; ;; Initialize its look-up function; ;; TO DO: RECYCLE WORLDS: (let ((newWorld (help-spawn-world parentWorld nil))) (initialize-world newWorld) (with-speed (if (or (test-bit-flags (context-flag parentWorld) :context-flag :monotonic) monotonic-p) (set-bit-flags (context-flag newWorld) :context-flag :monotonic) (clear-bit-flags (context-flag newWorld) :context-flag :monotonic))) newWorld )) (defun join-worlds (world1 world2 &key skip-topology-checks-p) "Create and return a new world that has `world1' and `world2' as its parents. `skip-topology-checks-p' eliminates checks that the worlds belong to a common context and that neither world is an ancestor of the other. Return NIL if joined world contains an incoherent instance." ;; Search for any instances with identical identifiers that are ;; represented by different objects in "world1" and "world2", and ;; for each one, lift a copy into the new world, and merge facts ;; from the previous world copies into the new copy; ;; Semi-tricky: A breadth-first search for instances to be joined relies ;; on the breadth-firstness of the slot "all-instance-spaces", i.e., we ;; always find top-level versions of instances before finding shadowed ones; ;; POSSIBLE BUG: WHAT HAPPENS IF WE COPY AN INSTANCE THAT HASN'T BEEN ;; MATCHED? (let ((savedWorld *world*) joinWorld visitedIdentifiers result) (labels ((has-as-ancestor-world-p (w1 w2) (member (local-instance-space w2) (all-instance-spaces-of-world w1))) (lift&join (identifier instance2) (let ((instance1 (eval-instance-id-in-world identifier world1)) joinInstance) #L:trace-worlds (trace-values "join-worlds:" joinWorld instance1 instance2) (when (and instance1 (neq instance1 instance2) (world instance1) (not (has-as-ancestor-world-p (world instance2) (world instance1)))) (setq joinInstance instance1) (copy-instance instance2 :copy-into joinInstance :join-worlds-p t))))) (unless skip-topology-checks-p (when (neq (context-of-world world1) (context-of-world world2)) (warn "Can't join worlds from different contexts") (return-from join-worlds nil)) (when (has-as-ancestor-world-p world1 world2) (return-from join-worlds world1)) (when (has-as-ancestor-world-p world2 world1) (return-from join-worlds world2))) (setq joinWorld (help-spawn-world world1 world2)) (initialize-world joinWorld) (change-world joinWorld) (setq result (with-world joinWorld () (loop for space2 in (all-instance-spaces-of-world world2) unless (member space2 (all-instance-spaces-of-world world1)) do (maphash #'(lambda (identifier instance2) (unless (member identifier visitedIdentifiers) (push identifier visitedIdentifiers) (lift&join identifier instance2))) space2)))) (change-world savedWorld) ;; Handle situation where an incoherent world is detected here. (and (neq result :incoherent) joinWorld)))) ;(defun destroy-world (world) ; ;; Destroy world "world" together with all of its descendant ; ;; worlds; ; (loop for child in (child-worlds world) ; do (destroy-world child)) ; (destroy-one-world world) ) ;(defun destroy-one-world (world) ; ;; Helping function for "destroy-world"; ; ;; Detach "world" from its parent; ; ;; Change the current world to "world", and destroy all instances in "world"; ; ;; Reset the current world; ; ;; Note: Lifting of skolems that merge with constants can introduce ; ;; constants into a world's symbol tables. The "mergeable-instance-p" ; ;; test below guard's against this possibility; ; ;; TO DO: WHEN WE ADD CONCEPT INDICES FOR WORLDS, ADD CODE TO RECYCLE THESE ; ;; INDICES; ; (flet ((smashed-instance-p ; (instance) ; (eq (db-type instance) :smashed))) ; (let ((savedWorld *world*) ; (parents (parent-worlds world)) ; smashedInstances) ; ;; change the current world, and destroy world instances: ; (change-world world) ; (map-world ;; mark instances as :smashed ; (lambda (key self) ; (when (mergeable-instance-p self) ; (destroy-world-instance self) ; (setf (db-type self) :smashed) ; (push self smashedInstances))) ; world) ; (loop for i from 0 to $ACT-ON-Q$ ;; eliminate smashed instances from match queues ; do ; (setf (aref *match-queues* i) ; (delete-if ; (function smashed-instance-p) ; (aref *match-queues* i)))) ; ;; note: can't discard instances until after :smashed marks serve their function ; (loop for i in smashedInstances ; do (discard-instance i)) ; erased :smashed mark ; ;; now eliminate the world: ; (if (null parents) ; ;; unlink world from context ; (delf (root-worlds (context-of-world world)) world) ; ;; unlink world from parents ; (loop for p in parents ; do (delf (child-worlds p) world))) ; (discard-world world) ; ;; reset current world: ; (change-world ; (if (eq world savedWorld) NIL savedWorld)) ))) ;(defun destroy-worlds-of-context (&optional context) ; ;; Destroy all worlds in "context"; ; (loop for w in (root-worlds (or context *context*)) ; do (destroy-world w)) ; (change-world nil)) ;(defun find-world (number &key context) ; ;; Return the world identified by "number"; ; ;; If "context" is supplied, search that context; otherwise ; ;; search all contexts, beginning with the current one; ; (let (result) ; (labels ((search-worlds ; (context) ; (loop for rootWorld in (root-worlds context) ; when (search-child-worlds rootWorld) ; return rootWorld)) ; (search-child-worlds ; (world) ; (if (= (world-number world) number) ; (setq result world) ; (loop for childWorld in (child-worlds world) ; when (search-child-worlds childWorld) ; return childWorld)))) ; (if context ; (search-worlds context) ; (or (search-worlds *context*) ; (loop for cxt in (list-contexts) ; unless (eq cxt *context*) ; do (search-worlds cxt)))) ; result ))) (defun list-world (&optional (world *world*)) ;; Return a list of the instances in "world"; ;; If "world" is nil, list the instances in the current ;; context; (if world (delete nil (list-of (local-instance-space world) :also-coerce-hash-table t)) (list-context :partitions :instances)) ) (defun change-to-world-of-instance (instance) ;; Insure that the current world matches the world that "instance" ;; belongs to (declare (ignore instance)) ; Make a NO-OP ; (let ((worldOfInstance (world-for-updating (modification-summary instance)))) ; (when (neq *world* worldOfInstance) ; (change-world worldOfInstance)) ) ) ;; ;;;;;; Low-level world functions ;; (defun create-world () ;; Return a brand new world; (or (pop *recycled-worlds*) (make-instance 'WORLD)) ) (defun discard-world (world) ;; Clear "world" and recycle it; (clrhash (local-instance-space world)) ; help garbage collector a bit (clear-slots world ( parent-worlds primary-parent child-worlds context-of-world local-instance-space all-instance-spaces-of-world world-number world-is-incoherent-p)) (push world *recycled-worlds*) ) (defun create-world-instance () ;; Return a brand new world; (or (pop *recycled-world-instances*) (make-instance 'WORLD-INSTANCE)) ) (defmethod discard-instance ((instance WORLD-INSTANCE)) ;; Clear slots in "instance" and recycle it; (clear-instance-slots instance) (setf (world instance) nil) (setf (primary-parent-instance instance) nil) (push instance *recycled-world-instances*) ) ;; ;;;;;; World-sensitive evaluation of instance identifiers ;; (defun lookup-instance-in-*world* (identifier) ;; Non-inline version of "eval-instance-id-in-*world*"; ;; Called by "change-world"; (eval-instance-id-in-*world* identifier) ) (defmacro eval-in-world (world &body body) ;; Perform world-sensitive evaluation of the forms in "body"; `(let ((savedContext *context*) (savedWorld *world*)) (change-world ,world) ,@body (if savedWorld (change-world savedWorld) (change-context savedContext))) ) ;; ;;;;;; world creation and initialization functions ;; (defun help-spawn-world (primaryParent otherParent) ;; Helping function for by "WORLD.spawn-world" and "join-worlds"; ;; Create a new world with primary parent "primaryParent", and ;; optionally, with a second parent "otherParent"; (let ((newWorld (create-world))) (addf (child-worlds primaryParent) newWorld) (if otherParent (progn (addf (child-worlds otherParent) newWorld) (setf (parent-worlds newWorld) (list primaryParent otherParent))) (setf (parent-worlds newWorld) (list primaryParent))) (setf (primary-parent newWorld) primaryParent) (setf (context-of-world newWorld) (context-of-world primaryParent)) newWorld )) ;; STUB TO REPLACE COMMENTED OUT VERSION: (defun initialize-world (world) (declare (ignore world))) ;(defun initialize-world (world) ; ;; Number "world", and compute the list of instance-spaces for ; ;; the world "world"; ; ;; Called by "XXX.spawn-world" and "join-worlds"; ; (setf (world-number world) (incf *world-counter*)) ; (setf (all-instance-spaces-of-world world) ; (if (null (parent-worlds world)) ; (cons (local-instance-space world) ; (all-instance-spaces ; (context-of-world world))) ; (compute-all-instance-spaces world))) ) (defun compute-all-instance-spaces (world) ;; Computation of "all-instance-spaces" when "world" has multiple parents; ;; Compute a breadth-first left-to-right list of instance spaces for "world" ;; and its ancestor worlds; Assumes that the "all-instance-spaces" ;; for the parent worlds have already been computed; ;; Note: This algorithm was inspire by that used in "compute-precedence-list" ;; in the KBCLASSES files; (flet ((right-prepend (list1 list2) (let (reversedList1Survivors) (loop for item in list1 when (not (member item list2)) do (push item reversedList1Survivors)) (loop for item in reversedList1Survivors do (push item list2)) list2))) (let* ((parents (parent-worlds world)) (spaceList (all-instance-spaces-of-world (car (last parents))))) (when (cdr parents) (loop for tail on parents while (cdr tail) do (setq spaceList (right-prepend (all-instance-spaces-of-world (car tail)) spaceList)))) (cons (local-instance-space world) spaceList) ))) (defun unintern-instance-in-world (instance world) ;; Enter a nil entry into the local name space of "world", ;; keyed on the identifier of "instance"; ;; Called by "forget-all-about"; (let ((multipleIds (multiple-identifiers instance))) (if multipleIds (loop for id in multipleIds do (setf (gethash id (local-instance-space world)) nil)) (setf (gethash (identifier instance) (local-instance-space world)) nil)) (clear-get-instance-cache) )) (defmacro trapping-incoherence-p () ;; Return t if occurrences of incoherence are being trapped ;; (presumably by a "with-world"); `(and *world* (boundp '*exitIncoherentWorldP*))) (defun throw-if-incoherent-world (instance) ;; Quickly abort the computation within incoherent world; (declare (special *exitIncoherentWorldP*)) (when (trapping-incoherence-p) (setq *exitIncoherentWorldP* instance) #L:trace-merge (trace-values "incoherent world" instance *world*) (throw 'incoherent-world-catcher :incoherent)) ) #| TO DO: DIFFERENTIAL ROLE FILLERS FOR WORLDS: WRITE "WORLD.db-slot-value" CODE FILL IN SLOT "primary-parent-instance" CHANGE "shadowed-p" LOGIC SO INSTANCE CAN BE SHADOWED FROM ABOVE OR BELOW |#
9660
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: LOOM; Base: 10. -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Copyright (c) 1988, 1995, 1999, 2003 University of Southern California ; ; All rights reserved. ; ; ; ; LICENSE ; ; ; ; 1) The "SOFTWARE", below, refers to the LOOM software (in either ; ; source-code, or binary form) and a "work based on the SOFTWARE" ; ; means a work based on either the SOFTWARE, on part of the SOFTWARE, ; ; or on any derivative work of the SOFTWARE under copyright law: ; ; that is, a work containing all or a portion of the SOFTWARE ; ; either verbatim or with modifications. Each licensee is ; ; addressed as "you" or "LICENSEE". ; ; ; ; 2) The University of Southern California on behalf of its Information ; ; Sciences Institute having an address of 4676 Admiralty Way, Suite ; ; 1001, <NAME>, CA 90292 is the copyright holder in the ; ; SOFTWARE. The copyright holder reserve all rights except those ; ; expressly granted to the LICENSEE herein and U.S. Government ; ; license rights. ; ; ; ; 3) A copy or copies of the SOFTWARE may be given to others, if you ; ; meet the following conditions: ; ; ; ; a) Copies in source code must include the copyright notice and this ; ; license. ; ; ; ; b) Copies in binary form must include the copyright notice and ; ; this license in the documentation and/or other materials ; ; provided with the copy. ; ; ; ; 4) All advertising materials, journal articles and documentation ; ; mentioning features derived from or use of the SOFTWARE must ; ; display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html)." ; ; ; ; In the event that the product being advertised includes an intact ; ; distribution (with copyright and license included) then this ; ; clause is waived. ; ; ; ; 5) You are encouraged to package modifications to the SOFTWARE ; ; separately, as patches to the SOFTWARE. ; ; ; ; 6) If you modify a copy or copies of the SOFTWARE or any portion of ; ; it, thus forming a work based on the SOFTWARE, and give a copy or ; ; copies of such work to others, either in source code or binary ; ; form, you must meet the following conditions: ; ; ; ; a) The SOFTWARE must carry prominent notices stating that you ; ; changed specified portions of the SOFTWARE. ; ; ; ; b) The SOFTWARE must display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM Project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html) to ; ; which the U.S. Government retains certain rights." ; ; ; ; 7) LICENSEE AGREES THAT THE EXPORT OF GOODS AND/OR TECHNICAL DATA FROM ; ; THE UNITED STATES MAY REQUIRE SOME FORM OF EXPORT CONTROL LICENSE ; ; FROM THE U.S. GOVERNMENT AND THAT FAILURE TO OBTAIN SUCH EXPORT ; ; CONTROL LICENSE MAY RESULT IN CRIMINAL LIABILITY UNDER U.S. LAW. ; ; ; ; 8) Portions of the SOFTWARE resulted from work developed under a ; ; U.S. Government contract and are subject to the following license: ; ; the Government is granted for itself and others acting on its ; ; behalf a paid-up, nonexclusive, irrevocable worldwide license in ; ; this SOFTWARE to reproduce, prepare derivative works, and perform ; ; publicly and display publicly. ; ; ; ; 9) The SOFTWARE was prepared, in part, as an account of work sponsored ; ; by an agency of the United States Government. Neither the United ; ; States, nor the University of Southern California, nor any of their ; ; employees, makes any warranty express or implied, or assumes any ; ; legal liability or responsibility for the accuracy, completeness, ; ; or usefulness of any information, apparatus, product, or process ; ; disclosed, or represents that its use would not infringe privately ; ; owned rights. ; ; ; ; 10) IN NO EVENT WILL THE UNITED STATES OR THE UNIVERSITY OF SOUTHERN ; ; CALIFORNIA BE LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, INCIDENTAL, ; ; SPECIAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM EXERCISE OF THIS ; ; LICENSE AGREEMENT OR THE USE OF THE SOFTWARE. ; ; ; ; 11) THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF SOUTHERN CALIFORNIA ; ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS ; ; FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE UNIVERSITY OF ; ; SOUTHERN CALIFORNIA MAKES NO REPRESENTATION THAT THE SOFTWARE, ; ; MODIFICATIONS, ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT ; ; INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY ; ; RIGHT. ; ; ; ; END OF LICENSE ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; WORLDS.LISP (ABOX) ;;; Functions for manipulating worlds (in-package "LOOM") (export '( change-world spawn-world join-worlds destroy-world find-world list-world with-world)) ;; ;;;;;; World-sensitive referencing of instances ;; #+CLTL2 (declaim (inline intern-instance-in-world unintern-instance-in-world)) #-CLTL2(proclaim '(inline intern-instance-in-world unintern-instance-in-world)) (defun intern-instance-in-world (instance world) ;; Enter "instance" into the local name space of "world", ;; keyed on its identifier; ;; Called by "create-loom-instance"; (let ((ids (multiple-identifiers instance))) (if ids (loop for id in ids do (setf (gethash id (local-instance-space world)) instance)) (setf (gethash (identifier instance) (local-instance-space world)) instance)) (clear-get-instance-cache) )) ;; Forward references for ;;;;;; World-sensitive evaluation of instance identifiers ;; (defmacro get-instance-in-*world* (instance &key mergeable-instance-p-test) ;; Return the top-level version of "instance in the current world; (cond ((eq mergeable-instance-p-test t) `(get-mergeable-instance-in-world ,instance *world*)) (mergeable-instance-p-test `(when mergeable-instance-p-test `(get-mergeable-instance-in-world ,instance *world*))) (t `(get-instance-in-world ,instance *world*))) ) #+CLTL2 (declaim (inline eval-instance-id-in-world eval-instance-id-in-*world*)) #-CLTL2 (proclaim '(inline eval-instance-id-in-world eval-instance-id-in-*world*)) (defun eval-instance-id-in-world (identifier world) ;; Search for the top-most instance matching "identifier", starting ;; from world "world"; (loop for table in (all-instance-spaces-of-world world) do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-world matchingInstance)))) ) (defun eval-instance-id-in-*world* (identifier) ;; Searches for an instance matching "identifier", starting ;; from the current world; (loop for table in *current-instance-space-list* do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-*world* matchingInstance)))) ) ;; TO BE RENAMED "get-most-lifted-instance": (defun get-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; CAUTION: Assumes "instance" belongs to "world", or to one of its ;; ancestors, or to one of its descendants; ;; Short cut: "instance" is current for "world" if it is not shadowed, ;; and if "world" has no children; ;; TO DO: FIGURE OUT IF THE ASSUMPTION THAT "instance" IS NOT DEFINED ;; ONLY IN SIBLING WORLDS OF "world" IS VALID (THE ABOX QUERY SYNTAX ;; SOMEWHAT ENFORCES THE PRESENT ASSUMPTION); (if (and (mergeable-instance-p instance) (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) #+CLTL2 (declaim (inline get-mergeable-instance-in-world)) #-CLTL2 (proclaim '(inline get-mergeable-instance-in-world)) (defun get-mergeable-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; Assumes that "instance" is mergeable (and hence avoids that check); ;; See "get-instance-in-world" for further comments; (if (and (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) (defmacro get-set-in-*world* (set) ;; Return a copy of "set" for which all members are in the ;; current world; `(get-set-in-world ,set *world*) ) (defun get-set-in-world (set world) ;; Scan "set" to see if some of its members are shadowed ;; from the vantage point of "world"; ;; If so, return a list of the top-most instances; ;; If not, return the original set (to save CONSes); ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (when (and set (mergeable-instance-p (first set))) (let ((mightBelongToChildWorldP (child-worlds world))) (if (null (rest set)) (let ((member (first set)) shadowingMember) (when (or mightBelongToChildWorldP (shadowed-p member)) (setq shadowingMember (eval-instance-id-in-world (identifier member) world)) ;; note: forgotten member sets "set" to be nil: (setq set (when shadowingMember (list shadowingMember))))) (when (loop for member in set thereis (shadowed-p member)) ;; compute set of top-most fillers (setq set (loop for member in set collect (if (or mightBelongToChildWorldP (shadowed-p member)) (eval-instance-id-in-world (identifier member) world) member))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)))))) set ) (defun copy-set-in-*world* (set) ;; Called by "retract-role-filler"; ;; Return a copy of "set" with any shadowed instances replaced by ;; top-level instances in the current world; ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (if (not (typep (car set) 'DB-INSTANCE)) (copy-list set) (progn (setq set (loop for member in set collect (cond ((shadowed-p member) (eval-instance-id-in-*world* (identifier member))) (t member)))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)) set)) ) ;; ;;;;;; More up-front world macros ;; (defmacro map-world (mappingFunction world) ;; Iterate over instances in "world", and apply "mappingFunction" ;; to each one; (let ((body (reparameterized-body-of-lambda-expr mappingFunction 'key 'value))) `(flet ((mappingFn (key value) (declare (ignore key)) ,@body)) (maphash (function mappingFn) (local-instance-space ,world))) )) (defmacro womp&coerce-to-*world* (instance &key mergeable-instance-p-test) ;; Helping macro for "with-world" and "retract-role-filler"; ;; Verify that instance is a real Loom instance, and make sure that merge ;; pointers have been followed; ;; Then, return the current copy of that instance in *world*; ;; CAUTION: "instance" may be evaluated multiple times by this macro; (let ((body `(let ((newInstance (womp-merge-pointers ,instance :mergeable-instance-p-test t))) (if (and *world* ;; test for possiblitity that merge replaced (mergeable) ;; skolem with (unmergeable) constant: (or (eq ,instance newInstance) (mergeable-instance-p newInstance))) (get-instance-in-*world* newInstance :mergeable-instance-p-test t) newInstance)))) (if (eq mergeable-instance-p-test t) body `(when ,(or mergeable-instance-p-test `(mergeable-instance-p ,instance)) ,body)) )) ;; ;;;;;; "with-world" ;; (defun destroy-world (world) ;; Dummy Function (declare (ignore world)) (grumble "Calling obsolete function DESTROY-WORLD") nil) (eval-when (load eval compile) ; (:compile-toplevel :load-toplevel :execute) (defun conditionally-destroy-incoherent-world (catchResult world) ;; Helping function for "with-world" macro; ;; If the world "world" has become incoherent and *destroy-incoherent-worlds-p* ;; is non-nil, then destroy it; (when (and (eq catchResult :incoherent) *destroy-incoherent-worlds-p*) (case *destroy-incoherent-worlds-p* (:break (trace-values "ABOUT TO DESTROY WORLD" world) (destroy-world world)) (otherwise ;; destroying the world also removes all of its instances from match queues (destroy-world world)))) )) (defmacro with-world (world vars &body code) "Switch the current world to `world', reevaluate the bindings for `vars' to point to instances in that world, evaluate `code' with that world, possibly destroy `world' if it becomes incoherent, and then return to the previous world." (once-only (world) `(let ((savedWorld *world*) catchResult) (change-world ,world) (let (,@(loop for var in vars collect `(,var (LOOM::womp&coerce-to-*world* ,var))) *exitIncoherentWorldP*) (declare (special *exitIncoherentWorldP*)) (setq catchResult (catch 'incoherent-world-catcher ,@code)) (conditionally-destroy-incoherent-world catchResult ,world)) (change-world savedWorld) catchResult) )) ;;; Top-level world functions (defun change-world (world) ;; Reset the variables *current-name-spaces*, *current-evaluate-id-fns*, ;; *world*, and (possibly) *context* to access the ;; world "world"; ;; If "world" equals NIL, reset look-up functions to operate from ;; the current context; (when (eq *world* world) (return-from change-world nil)) (when (neq (context-of-world world) *context*) (change-context (context-of-world world))) (integrity-check (eq (caar *current-name-spaces*) :instances)) (setf (cdar *current-name-spaces*) (local-instance-space world)) (setf *current-instance-space-list* (all-instance-spaces-of-world world)) (when (null *world*) (setf (cdar *current-evaluate-id-fns*) #'lookup-instance-in-*world*)) (clear-get-instance-cache) (with-speed (setq *monotonic-mode-p* (test-bit-flags (context-flag world) :context-flag :monotonic))) (setq *world* world) ) (defmethod spawn-world ((parentWorld WORLD) &key monotonic-p) ;; Create a new world with parent "parentWorld"; ;; Link the new world to "parentWorld"; ;; Initialize its look-up function; ;; TO DO: RECYCLE WORLDS: (let ((newWorld (help-spawn-world parentWorld nil))) (initialize-world newWorld) (with-speed (if (or (test-bit-flags (context-flag parentWorld) :context-flag :monotonic) monotonic-p) (set-bit-flags (context-flag newWorld) :context-flag :monotonic) (clear-bit-flags (context-flag newWorld) :context-flag :monotonic))) newWorld )) (defun join-worlds (world1 world2 &key skip-topology-checks-p) "Create and return a new world that has `world1' and `world2' as its parents. `skip-topology-checks-p' eliminates checks that the worlds belong to a common context and that neither world is an ancestor of the other. Return NIL if joined world contains an incoherent instance." ;; Search for any instances with identical identifiers that are ;; represented by different objects in "world1" and "world2", and ;; for each one, lift a copy into the new world, and merge facts ;; from the previous world copies into the new copy; ;; Semi-tricky: A breadth-first search for instances to be joined relies ;; on the breadth-firstness of the slot "all-instance-spaces", i.e., we ;; always find top-level versions of instances before finding shadowed ones; ;; POSSIBLE BUG: WHAT HAPPENS IF WE COPY AN INSTANCE THAT HASN'T BEEN ;; MATCHED? (let ((savedWorld *world*) joinWorld visitedIdentifiers result) (labels ((has-as-ancestor-world-p (w1 w2) (member (local-instance-space w2) (all-instance-spaces-of-world w1))) (lift&join (identifier instance2) (let ((instance1 (eval-instance-id-in-world identifier world1)) joinInstance) #L:trace-worlds (trace-values "join-worlds:" joinWorld instance1 instance2) (when (and instance1 (neq instance1 instance2) (world instance1) (not (has-as-ancestor-world-p (world instance2) (world instance1)))) (setq joinInstance instance1) (copy-instance instance2 :copy-into joinInstance :join-worlds-p t))))) (unless skip-topology-checks-p (when (neq (context-of-world world1) (context-of-world world2)) (warn "Can't join worlds from different contexts") (return-from join-worlds nil)) (when (has-as-ancestor-world-p world1 world2) (return-from join-worlds world1)) (when (has-as-ancestor-world-p world2 world1) (return-from join-worlds world2))) (setq joinWorld (help-spawn-world world1 world2)) (initialize-world joinWorld) (change-world joinWorld) (setq result (with-world joinWorld () (loop for space2 in (all-instance-spaces-of-world world2) unless (member space2 (all-instance-spaces-of-world world1)) do (maphash #'(lambda (identifier instance2) (unless (member identifier visitedIdentifiers) (push identifier visitedIdentifiers) (lift&join identifier instance2))) space2)))) (change-world savedWorld) ;; Handle situation where an incoherent world is detected here. (and (neq result :incoherent) joinWorld)))) ;(defun destroy-world (world) ; ;; Destroy world "world" together with all of its descendant ; ;; worlds; ; (loop for child in (child-worlds world) ; do (destroy-world child)) ; (destroy-one-world world) ) ;(defun destroy-one-world (world) ; ;; Helping function for "destroy-world"; ; ;; Detach "world" from its parent; ; ;; Change the current world to "world", and destroy all instances in "world"; ; ;; Reset the current world; ; ;; Note: Lifting of skolems that merge with constants can introduce ; ;; constants into a world's symbol tables. The "mergeable-instance-p" ; ;; test below guard's against this possibility; ; ;; TO DO: WHEN WE ADD CONCEPT INDICES FOR WORLDS, ADD CODE TO RECYCLE THESE ; ;; INDICES; ; (flet ((smashed-instance-p ; (instance) ; (eq (db-type instance) :smashed))) ; (let ((savedWorld *world*) ; (parents (parent-worlds world)) ; smashedInstances) ; ;; change the current world, and destroy world instances: ; (change-world world) ; (map-world ;; mark instances as :smashed ; (lambda (key self) ; (when (mergeable-instance-p self) ; (destroy-world-instance self) ; (setf (db-type self) :smashed) ; (push self smashedInstances))) ; world) ; (loop for i from 0 to $ACT-ON-Q$ ;; eliminate smashed instances from match queues ; do ; (setf (aref *match-queues* i) ; (delete-if ; (function smashed-instance-p) ; (aref *match-queues* i)))) ; ;; note: can't discard instances until after :smashed marks serve their function ; (loop for i in smashedInstances ; do (discard-instance i)) ; erased :smashed mark ; ;; now eliminate the world: ; (if (null parents) ; ;; unlink world from context ; (delf (root-worlds (context-of-world world)) world) ; ;; unlink world from parents ; (loop for p in parents ; do (delf (child-worlds p) world))) ; (discard-world world) ; ;; reset current world: ; (change-world ; (if (eq world savedWorld) NIL savedWorld)) ))) ;(defun destroy-worlds-of-context (&optional context) ; ;; Destroy all worlds in "context"; ; (loop for w in (root-worlds (or context *context*)) ; do (destroy-world w)) ; (change-world nil)) ;(defun find-world (number &key context) ; ;; Return the world identified by "number"; ; ;; If "context" is supplied, search that context; otherwise ; ;; search all contexts, beginning with the current one; ; (let (result) ; (labels ((search-worlds ; (context) ; (loop for rootWorld in (root-worlds context) ; when (search-child-worlds rootWorld) ; return rootWorld)) ; (search-child-worlds ; (world) ; (if (= (world-number world) number) ; (setq result world) ; (loop for childWorld in (child-worlds world) ; when (search-child-worlds childWorld) ; return childWorld)))) ; (if context ; (search-worlds context) ; (or (search-worlds *context*) ; (loop for cxt in (list-contexts) ; unless (eq cxt *context*) ; do (search-worlds cxt)))) ; result ))) (defun list-world (&optional (world *world*)) ;; Return a list of the instances in "world"; ;; If "world" is nil, list the instances in the current ;; context; (if world (delete nil (list-of (local-instance-space world) :also-coerce-hash-table t)) (list-context :partitions :instances)) ) (defun change-to-world-of-instance (instance) ;; Insure that the current world matches the world that "instance" ;; belongs to (declare (ignore instance)) ; Make a NO-OP ; (let ((worldOfInstance (world-for-updating (modification-summary instance)))) ; (when (neq *world* worldOfInstance) ; (change-world worldOfInstance)) ) ) ;; ;;;;;; Low-level world functions ;; (defun create-world () ;; Return a brand new world; (or (pop *recycled-worlds*) (make-instance 'WORLD)) ) (defun discard-world (world) ;; Clear "world" and recycle it; (clrhash (local-instance-space world)) ; help garbage collector a bit (clear-slots world ( parent-worlds primary-parent child-worlds context-of-world local-instance-space all-instance-spaces-of-world world-number world-is-incoherent-p)) (push world *recycled-worlds*) ) (defun create-world-instance () ;; Return a brand new world; (or (pop *recycled-world-instances*) (make-instance 'WORLD-INSTANCE)) ) (defmethod discard-instance ((instance WORLD-INSTANCE)) ;; Clear slots in "instance" and recycle it; (clear-instance-slots instance) (setf (world instance) nil) (setf (primary-parent-instance instance) nil) (push instance *recycled-world-instances*) ) ;; ;;;;;; World-sensitive evaluation of instance identifiers ;; (defun lookup-instance-in-*world* (identifier) ;; Non-inline version of "eval-instance-id-in-*world*"; ;; Called by "change-world"; (eval-instance-id-in-*world* identifier) ) (defmacro eval-in-world (world &body body) ;; Perform world-sensitive evaluation of the forms in "body"; `(let ((savedContext *context*) (savedWorld *world*)) (change-world ,world) ,@body (if savedWorld (change-world savedWorld) (change-context savedContext))) ) ;; ;;;;;; world creation and initialization functions ;; (defun help-spawn-world (primaryParent otherParent) ;; Helping function for by "WORLD.spawn-world" and "join-worlds"; ;; Create a new world with primary parent "primaryParent", and ;; optionally, with a second parent "otherParent"; (let ((newWorld (create-world))) (addf (child-worlds primaryParent) newWorld) (if otherParent (progn (addf (child-worlds otherParent) newWorld) (setf (parent-worlds newWorld) (list primaryParent otherParent))) (setf (parent-worlds newWorld) (list primaryParent))) (setf (primary-parent newWorld) primaryParent) (setf (context-of-world newWorld) (context-of-world primaryParent)) newWorld )) ;; STUB TO REPLACE COMMENTED OUT VERSION: (defun initialize-world (world) (declare (ignore world))) ;(defun initialize-world (world) ; ;; Number "world", and compute the list of instance-spaces for ; ;; the world "world"; ; ;; Called by "XXX.spawn-world" and "join-worlds"; ; (setf (world-number world) (incf *world-counter*)) ; (setf (all-instance-spaces-of-world world) ; (if (null (parent-worlds world)) ; (cons (local-instance-space world) ; (all-instance-spaces ; (context-of-world world))) ; (compute-all-instance-spaces world))) ) (defun compute-all-instance-spaces (world) ;; Computation of "all-instance-spaces" when "world" has multiple parents; ;; Compute a breadth-first left-to-right list of instance spaces for "world" ;; and its ancestor worlds; Assumes that the "all-instance-spaces" ;; for the parent worlds have already been computed; ;; Note: This algorithm was inspire by that used in "compute-precedence-list" ;; in the KBCLASSES files; (flet ((right-prepend (list1 list2) (let (reversedList1Survivors) (loop for item in list1 when (not (member item list2)) do (push item reversedList1Survivors)) (loop for item in reversedList1Survivors do (push item list2)) list2))) (let* ((parents (parent-worlds world)) (spaceList (all-instance-spaces-of-world (car (last parents))))) (when (cdr parents) (loop for tail on parents while (cdr tail) do (setq spaceList (right-prepend (all-instance-spaces-of-world (car tail)) spaceList)))) (cons (local-instance-space world) spaceList) ))) (defun unintern-instance-in-world (instance world) ;; Enter a nil entry into the local name space of "world", ;; keyed on the identifier of "instance"; ;; Called by "forget-all-about"; (let ((multipleIds (multiple-identifiers instance))) (if multipleIds (loop for id in multipleIds do (setf (gethash id (local-instance-space world)) nil)) (setf (gethash (identifier instance) (local-instance-space world)) nil)) (clear-get-instance-cache) )) (defmacro trapping-incoherence-p () ;; Return t if occurrences of incoherence are being trapped ;; (presumably by a "with-world"); `(and *world* (boundp '*exitIncoherentWorldP*))) (defun throw-if-incoherent-world (instance) ;; Quickly abort the computation within incoherent world; (declare (special *exitIncoherentWorldP*)) (when (trapping-incoherence-p) (setq *exitIncoherentWorldP* instance) #L:trace-merge (trace-values "incoherent world" instance *world*) (throw 'incoherent-world-catcher :incoherent)) ) #| TO DO: DIFFERENTIAL ROLE FILLERS FOR WORLDS: WRITE "WORLD.db-slot-value" CODE FILL IN SLOT "primary-parent-instance" CHANGE "shadowed-p" LOGIC SO INSTANCE CAN BE SHADOWED FROM ABOVE OR BELOW |#
true
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: LOOM; Base: 10. -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Copyright (c) 1988, 1995, 1999, 2003 University of Southern California ; ; All rights reserved. ; ; ; ; LICENSE ; ; ; ; 1) The "SOFTWARE", below, refers to the LOOM software (in either ; ; source-code, or binary form) and a "work based on the SOFTWARE" ; ; means a work based on either the SOFTWARE, on part of the SOFTWARE, ; ; or on any derivative work of the SOFTWARE under copyright law: ; ; that is, a work containing all or a portion of the SOFTWARE ; ; either verbatim or with modifications. Each licensee is ; ; addressed as "you" or "LICENSEE". ; ; ; ; 2) The University of Southern California on behalf of its Information ; ; Sciences Institute having an address of 4676 Admiralty Way, Suite ; ; 1001, PI:NAME:<NAME>END_PI, CA 90292 is the copyright holder in the ; ; SOFTWARE. The copyright holder reserve all rights except those ; ; expressly granted to the LICENSEE herein and U.S. Government ; ; license rights. ; ; ; ; 3) A copy or copies of the SOFTWARE may be given to others, if you ; ; meet the following conditions: ; ; ; ; a) Copies in source code must include the copyright notice and this ; ; license. ; ; ; ; b) Copies in binary form must include the copyright notice and ; ; this license in the documentation and/or other materials ; ; provided with the copy. ; ; ; ; 4) All advertising materials, journal articles and documentation ; ; mentioning features derived from or use of the SOFTWARE must ; ; display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html)." ; ; ; ; In the event that the product being advertised includes an intact ; ; distribution (with copyright and license included) then this ; ; clause is waived. ; ; ; ; 5) You are encouraged to package modifications to the SOFTWARE ; ; separately, as patches to the SOFTWARE. ; ; ; ; 6) If you modify a copy or copies of the SOFTWARE or any portion of ; ; it, thus forming a work based on the SOFTWARE, and give a copy or ; ; copies of such work to others, either in source code or binary ; ; form, you must meet the following conditions: ; ; ; ; a) The SOFTWARE must carry prominent notices stating that you ; ; changed specified portions of the SOFTWARE. ; ; ; ; b) The SOFTWARE must display the following acknowledgement: ; ; ; ; "This product includes software developed by and/or derived from ; ; the LOOM Project (http://www.isi.edu/isd/LOOM/LOOM-HOME.html) to ; ; which the U.S. Government retains certain rights." ; ; ; ; 7) LICENSEE AGREES THAT THE EXPORT OF GOODS AND/OR TECHNICAL DATA FROM ; ; THE UNITED STATES MAY REQUIRE SOME FORM OF EXPORT CONTROL LICENSE ; ; FROM THE U.S. GOVERNMENT AND THAT FAILURE TO OBTAIN SUCH EXPORT ; ; CONTROL LICENSE MAY RESULT IN CRIMINAL LIABILITY UNDER U.S. LAW. ; ; ; ; 8) Portions of the SOFTWARE resulted from work developed under a ; ; U.S. Government contract and are subject to the following license: ; ; the Government is granted for itself and others acting on its ; ; behalf a paid-up, nonexclusive, irrevocable worldwide license in ; ; this SOFTWARE to reproduce, prepare derivative works, and perform ; ; publicly and display publicly. ; ; ; ; 9) The SOFTWARE was prepared, in part, as an account of work sponsored ; ; by an agency of the United States Government. Neither the United ; ; States, nor the University of Southern California, nor any of their ; ; employees, makes any warranty express or implied, or assumes any ; ; legal liability or responsibility for the accuracy, completeness, ; ; or usefulness of any information, apparatus, product, or process ; ; disclosed, or represents that its use would not infringe privately ; ; owned rights. ; ; ; ; 10) IN NO EVENT WILL THE UNITED STATES OR THE UNIVERSITY OF SOUTHERN ; ; CALIFORNIA BE LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, INCIDENTAL, ; ; SPECIAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM EXERCISE OF THIS ; ; LICENSE AGREEMENT OR THE USE OF THE SOFTWARE. ; ; ; ; 11) THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF SOUTHERN CALIFORNIA ; ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS ; ; FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE UNIVERSITY OF ; ; SOUTHERN CALIFORNIA MAKES NO REPRESENTATION THAT THE SOFTWARE, ; ; MODIFICATIONS, ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT ; ; INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY ; ; RIGHT. ; ; ; ; END OF LICENSE ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; WORLDS.LISP (ABOX) ;;; Functions for manipulating worlds (in-package "LOOM") (export '( change-world spawn-world join-worlds destroy-world find-world list-world with-world)) ;; ;;;;;; World-sensitive referencing of instances ;; #+CLTL2 (declaim (inline intern-instance-in-world unintern-instance-in-world)) #-CLTL2(proclaim '(inline intern-instance-in-world unintern-instance-in-world)) (defun intern-instance-in-world (instance world) ;; Enter "instance" into the local name space of "world", ;; keyed on its identifier; ;; Called by "create-loom-instance"; (let ((ids (multiple-identifiers instance))) (if ids (loop for id in ids do (setf (gethash id (local-instance-space world)) instance)) (setf (gethash (identifier instance) (local-instance-space world)) instance)) (clear-get-instance-cache) )) ;; Forward references for ;;;;;; World-sensitive evaluation of instance identifiers ;; (defmacro get-instance-in-*world* (instance &key mergeable-instance-p-test) ;; Return the top-level version of "instance in the current world; (cond ((eq mergeable-instance-p-test t) `(get-mergeable-instance-in-world ,instance *world*)) (mergeable-instance-p-test `(when mergeable-instance-p-test `(get-mergeable-instance-in-world ,instance *world*))) (t `(get-instance-in-world ,instance *world*))) ) #+CLTL2 (declaim (inline eval-instance-id-in-world eval-instance-id-in-*world*)) #-CLTL2 (proclaim '(inline eval-instance-id-in-world eval-instance-id-in-*world*)) (defun eval-instance-id-in-world (identifier world) ;; Search for the top-most instance matching "identifier", starting ;; from world "world"; (loop for table in (all-instance-spaces-of-world world) do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-world matchingInstance)))) ) (defun eval-instance-id-in-*world* (identifier) ;; Searches for an instance matching "identifier", starting ;; from the current world; (loop for table in *current-instance-space-list* do (multiple-value-bind (matchingInstance entryExistsP) (gethash identifier table) (when entryExistsP (return-from eval-instance-id-in-*world* matchingInstance)))) ) ;; TO BE RENAMED "get-most-lifted-instance": (defun get-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; CAUTION: Assumes "instance" belongs to "world", or to one of its ;; ancestors, or to one of its descendants; ;; Short cut: "instance" is current for "world" if it is not shadowed, ;; and if "world" has no children; ;; TO DO: FIGURE OUT IF THE ASSUMPTION THAT "instance" IS NOT DEFINED ;; ONLY IN SIBLING WORLDS OF "world" IS VALID (THE ABOX QUERY SYNTAX ;; SOMEWHAT ENFORCES THE PRESENT ASSUMPTION); (if (and (mergeable-instance-p instance) (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) #+CLTL2 (declaim (inline get-mergeable-instance-in-world)) #-CLTL2 (proclaim '(inline get-mergeable-instance-in-world)) (defun get-mergeable-instance-in-world (instance world) ;; Return the top-level version of "instance" in world "world"; ;; Assumes that "instance" is mergeable (and hence avoids that check); ;; See "get-instance-in-world" for further comments; (if (and (or (shadowed-p instance) (child-worlds world))) (eval-instance-id-in-world (identifier instance) world) instance) ) (defmacro get-set-in-*world* (set) ;; Return a copy of "set" for which all members are in the ;; current world; `(get-set-in-world ,set *world*) ) (defun get-set-in-world (set world) ;; Scan "set" to see if some of its members are shadowed ;; from the vantage point of "world"; ;; If so, return a list of the top-most instances; ;; If not, return the original set (to save CONSes); ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (when (and set (mergeable-instance-p (first set))) (let ((mightBelongToChildWorldP (child-worlds world))) (if (null (rest set)) (let ((member (first set)) shadowingMember) (when (or mightBelongToChildWorldP (shadowed-p member)) (setq shadowingMember (eval-instance-id-in-world (identifier member) world)) ;; note: forgotten member sets "set" to be nil: (setq set (when shadowingMember (list shadowingMember))))) (when (loop for member in set thereis (shadowed-p member)) ;; compute set of top-most fillers (setq set (loop for member in set collect (if (or mightBelongToChildWorldP (shadowed-p member)) (eval-instance-id-in-world (identifier member) world) member))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)))))) set ) (defun copy-set-in-*world* (set) ;; Called by "retract-role-filler"; ;; Return a copy of "set" with any shadowed instances replaced by ;; top-level instances in the current world; ;; CAUTION: Breaks if db-instances and literals both occur in "set"; (if (not (typep (car set) 'DB-INSTANCE)) (copy-list set) (progn (setq set (loop for member in set collect (cond ((shadowed-p member) (eval-instance-id-in-*world* (identifier member))) (t member)))) (when (member nil set) ; detect case when filler has been forgotten; (delf set nil)) set)) ) ;; ;;;;;; More up-front world macros ;; (defmacro map-world (mappingFunction world) ;; Iterate over instances in "world", and apply "mappingFunction" ;; to each one; (let ((body (reparameterized-body-of-lambda-expr mappingFunction 'key 'value))) `(flet ((mappingFn (key value) (declare (ignore key)) ,@body)) (maphash (function mappingFn) (local-instance-space ,world))) )) (defmacro womp&coerce-to-*world* (instance &key mergeable-instance-p-test) ;; Helping macro for "with-world" and "retract-role-filler"; ;; Verify that instance is a real Loom instance, and make sure that merge ;; pointers have been followed; ;; Then, return the current copy of that instance in *world*; ;; CAUTION: "instance" may be evaluated multiple times by this macro; (let ((body `(let ((newInstance (womp-merge-pointers ,instance :mergeable-instance-p-test t))) (if (and *world* ;; test for possiblitity that merge replaced (mergeable) ;; skolem with (unmergeable) constant: (or (eq ,instance newInstance) (mergeable-instance-p newInstance))) (get-instance-in-*world* newInstance :mergeable-instance-p-test t) newInstance)))) (if (eq mergeable-instance-p-test t) body `(when ,(or mergeable-instance-p-test `(mergeable-instance-p ,instance)) ,body)) )) ;; ;;;;;; "with-world" ;; (defun destroy-world (world) ;; Dummy Function (declare (ignore world)) (grumble "Calling obsolete function DESTROY-WORLD") nil) (eval-when (load eval compile) ; (:compile-toplevel :load-toplevel :execute) (defun conditionally-destroy-incoherent-world (catchResult world) ;; Helping function for "with-world" macro; ;; If the world "world" has become incoherent and *destroy-incoherent-worlds-p* ;; is non-nil, then destroy it; (when (and (eq catchResult :incoherent) *destroy-incoherent-worlds-p*) (case *destroy-incoherent-worlds-p* (:break (trace-values "ABOUT TO DESTROY WORLD" world) (destroy-world world)) (otherwise ;; destroying the world also removes all of its instances from match queues (destroy-world world)))) )) (defmacro with-world (world vars &body code) "Switch the current world to `world', reevaluate the bindings for `vars' to point to instances in that world, evaluate `code' with that world, possibly destroy `world' if it becomes incoherent, and then return to the previous world." (once-only (world) `(let ((savedWorld *world*) catchResult) (change-world ,world) (let (,@(loop for var in vars collect `(,var (LOOM::womp&coerce-to-*world* ,var))) *exitIncoherentWorldP*) (declare (special *exitIncoherentWorldP*)) (setq catchResult (catch 'incoherent-world-catcher ,@code)) (conditionally-destroy-incoherent-world catchResult ,world)) (change-world savedWorld) catchResult) )) ;;; Top-level world functions (defun change-world (world) ;; Reset the variables *current-name-spaces*, *current-evaluate-id-fns*, ;; *world*, and (possibly) *context* to access the ;; world "world"; ;; If "world" equals NIL, reset look-up functions to operate from ;; the current context; (when (eq *world* world) (return-from change-world nil)) (when (neq (context-of-world world) *context*) (change-context (context-of-world world))) (integrity-check (eq (caar *current-name-spaces*) :instances)) (setf (cdar *current-name-spaces*) (local-instance-space world)) (setf *current-instance-space-list* (all-instance-spaces-of-world world)) (when (null *world*) (setf (cdar *current-evaluate-id-fns*) #'lookup-instance-in-*world*)) (clear-get-instance-cache) (with-speed (setq *monotonic-mode-p* (test-bit-flags (context-flag world) :context-flag :monotonic))) (setq *world* world) ) (defmethod spawn-world ((parentWorld WORLD) &key monotonic-p) ;; Create a new world with parent "parentWorld"; ;; Link the new world to "parentWorld"; ;; Initialize its look-up function; ;; TO DO: RECYCLE WORLDS: (let ((newWorld (help-spawn-world parentWorld nil))) (initialize-world newWorld) (with-speed (if (or (test-bit-flags (context-flag parentWorld) :context-flag :monotonic) monotonic-p) (set-bit-flags (context-flag newWorld) :context-flag :monotonic) (clear-bit-flags (context-flag newWorld) :context-flag :monotonic))) newWorld )) (defun join-worlds (world1 world2 &key skip-topology-checks-p) "Create and return a new world that has `world1' and `world2' as its parents. `skip-topology-checks-p' eliminates checks that the worlds belong to a common context and that neither world is an ancestor of the other. Return NIL if joined world contains an incoherent instance." ;; Search for any instances with identical identifiers that are ;; represented by different objects in "world1" and "world2", and ;; for each one, lift a copy into the new world, and merge facts ;; from the previous world copies into the new copy; ;; Semi-tricky: A breadth-first search for instances to be joined relies ;; on the breadth-firstness of the slot "all-instance-spaces", i.e., we ;; always find top-level versions of instances before finding shadowed ones; ;; POSSIBLE BUG: WHAT HAPPENS IF WE COPY AN INSTANCE THAT HASN'T BEEN ;; MATCHED? (let ((savedWorld *world*) joinWorld visitedIdentifiers result) (labels ((has-as-ancestor-world-p (w1 w2) (member (local-instance-space w2) (all-instance-spaces-of-world w1))) (lift&join (identifier instance2) (let ((instance1 (eval-instance-id-in-world identifier world1)) joinInstance) #L:trace-worlds (trace-values "join-worlds:" joinWorld instance1 instance2) (when (and instance1 (neq instance1 instance2) (world instance1) (not (has-as-ancestor-world-p (world instance2) (world instance1)))) (setq joinInstance instance1) (copy-instance instance2 :copy-into joinInstance :join-worlds-p t))))) (unless skip-topology-checks-p (when (neq (context-of-world world1) (context-of-world world2)) (warn "Can't join worlds from different contexts") (return-from join-worlds nil)) (when (has-as-ancestor-world-p world1 world2) (return-from join-worlds world1)) (when (has-as-ancestor-world-p world2 world1) (return-from join-worlds world2))) (setq joinWorld (help-spawn-world world1 world2)) (initialize-world joinWorld) (change-world joinWorld) (setq result (with-world joinWorld () (loop for space2 in (all-instance-spaces-of-world world2) unless (member space2 (all-instance-spaces-of-world world1)) do (maphash #'(lambda (identifier instance2) (unless (member identifier visitedIdentifiers) (push identifier visitedIdentifiers) (lift&join identifier instance2))) space2)))) (change-world savedWorld) ;; Handle situation where an incoherent world is detected here. (and (neq result :incoherent) joinWorld)))) ;(defun destroy-world (world) ; ;; Destroy world "world" together with all of its descendant ; ;; worlds; ; (loop for child in (child-worlds world) ; do (destroy-world child)) ; (destroy-one-world world) ) ;(defun destroy-one-world (world) ; ;; Helping function for "destroy-world"; ; ;; Detach "world" from its parent; ; ;; Change the current world to "world", and destroy all instances in "world"; ; ;; Reset the current world; ; ;; Note: Lifting of skolems that merge with constants can introduce ; ;; constants into a world's symbol tables. The "mergeable-instance-p" ; ;; test below guard's against this possibility; ; ;; TO DO: WHEN WE ADD CONCEPT INDICES FOR WORLDS, ADD CODE TO RECYCLE THESE ; ;; INDICES; ; (flet ((smashed-instance-p ; (instance) ; (eq (db-type instance) :smashed))) ; (let ((savedWorld *world*) ; (parents (parent-worlds world)) ; smashedInstances) ; ;; change the current world, and destroy world instances: ; (change-world world) ; (map-world ;; mark instances as :smashed ; (lambda (key self) ; (when (mergeable-instance-p self) ; (destroy-world-instance self) ; (setf (db-type self) :smashed) ; (push self smashedInstances))) ; world) ; (loop for i from 0 to $ACT-ON-Q$ ;; eliminate smashed instances from match queues ; do ; (setf (aref *match-queues* i) ; (delete-if ; (function smashed-instance-p) ; (aref *match-queues* i)))) ; ;; note: can't discard instances until after :smashed marks serve their function ; (loop for i in smashedInstances ; do (discard-instance i)) ; erased :smashed mark ; ;; now eliminate the world: ; (if (null parents) ; ;; unlink world from context ; (delf (root-worlds (context-of-world world)) world) ; ;; unlink world from parents ; (loop for p in parents ; do (delf (child-worlds p) world))) ; (discard-world world) ; ;; reset current world: ; (change-world ; (if (eq world savedWorld) NIL savedWorld)) ))) ;(defun destroy-worlds-of-context (&optional context) ; ;; Destroy all worlds in "context"; ; (loop for w in (root-worlds (or context *context*)) ; do (destroy-world w)) ; (change-world nil)) ;(defun find-world (number &key context) ; ;; Return the world identified by "number"; ; ;; If "context" is supplied, search that context; otherwise ; ;; search all contexts, beginning with the current one; ; (let (result) ; (labels ((search-worlds ; (context) ; (loop for rootWorld in (root-worlds context) ; when (search-child-worlds rootWorld) ; return rootWorld)) ; (search-child-worlds ; (world) ; (if (= (world-number world) number) ; (setq result world) ; (loop for childWorld in (child-worlds world) ; when (search-child-worlds childWorld) ; return childWorld)))) ; (if context ; (search-worlds context) ; (or (search-worlds *context*) ; (loop for cxt in (list-contexts) ; unless (eq cxt *context*) ; do (search-worlds cxt)))) ; result ))) (defun list-world (&optional (world *world*)) ;; Return a list of the instances in "world"; ;; If "world" is nil, list the instances in the current ;; context; (if world (delete nil (list-of (local-instance-space world) :also-coerce-hash-table t)) (list-context :partitions :instances)) ) (defun change-to-world-of-instance (instance) ;; Insure that the current world matches the world that "instance" ;; belongs to (declare (ignore instance)) ; Make a NO-OP ; (let ((worldOfInstance (world-for-updating (modification-summary instance)))) ; (when (neq *world* worldOfInstance) ; (change-world worldOfInstance)) ) ) ;; ;;;;;; Low-level world functions ;; (defun create-world () ;; Return a brand new world; (or (pop *recycled-worlds*) (make-instance 'WORLD)) ) (defun discard-world (world) ;; Clear "world" and recycle it; (clrhash (local-instance-space world)) ; help garbage collector a bit (clear-slots world ( parent-worlds primary-parent child-worlds context-of-world local-instance-space all-instance-spaces-of-world world-number world-is-incoherent-p)) (push world *recycled-worlds*) ) (defun create-world-instance () ;; Return a brand new world; (or (pop *recycled-world-instances*) (make-instance 'WORLD-INSTANCE)) ) (defmethod discard-instance ((instance WORLD-INSTANCE)) ;; Clear slots in "instance" and recycle it; (clear-instance-slots instance) (setf (world instance) nil) (setf (primary-parent-instance instance) nil) (push instance *recycled-world-instances*) ) ;; ;;;;;; World-sensitive evaluation of instance identifiers ;; (defun lookup-instance-in-*world* (identifier) ;; Non-inline version of "eval-instance-id-in-*world*"; ;; Called by "change-world"; (eval-instance-id-in-*world* identifier) ) (defmacro eval-in-world (world &body body) ;; Perform world-sensitive evaluation of the forms in "body"; `(let ((savedContext *context*) (savedWorld *world*)) (change-world ,world) ,@body (if savedWorld (change-world savedWorld) (change-context savedContext))) ) ;; ;;;;;; world creation and initialization functions ;; (defun help-spawn-world (primaryParent otherParent) ;; Helping function for by "WORLD.spawn-world" and "join-worlds"; ;; Create a new world with primary parent "primaryParent", and ;; optionally, with a second parent "otherParent"; (let ((newWorld (create-world))) (addf (child-worlds primaryParent) newWorld) (if otherParent (progn (addf (child-worlds otherParent) newWorld) (setf (parent-worlds newWorld) (list primaryParent otherParent))) (setf (parent-worlds newWorld) (list primaryParent))) (setf (primary-parent newWorld) primaryParent) (setf (context-of-world newWorld) (context-of-world primaryParent)) newWorld )) ;; STUB TO REPLACE COMMENTED OUT VERSION: (defun initialize-world (world) (declare (ignore world))) ;(defun initialize-world (world) ; ;; Number "world", and compute the list of instance-spaces for ; ;; the world "world"; ; ;; Called by "XXX.spawn-world" and "join-worlds"; ; (setf (world-number world) (incf *world-counter*)) ; (setf (all-instance-spaces-of-world world) ; (if (null (parent-worlds world)) ; (cons (local-instance-space world) ; (all-instance-spaces ; (context-of-world world))) ; (compute-all-instance-spaces world))) ) (defun compute-all-instance-spaces (world) ;; Computation of "all-instance-spaces" when "world" has multiple parents; ;; Compute a breadth-first left-to-right list of instance spaces for "world" ;; and its ancestor worlds; Assumes that the "all-instance-spaces" ;; for the parent worlds have already been computed; ;; Note: This algorithm was inspire by that used in "compute-precedence-list" ;; in the KBCLASSES files; (flet ((right-prepend (list1 list2) (let (reversedList1Survivors) (loop for item in list1 when (not (member item list2)) do (push item reversedList1Survivors)) (loop for item in reversedList1Survivors do (push item list2)) list2))) (let* ((parents (parent-worlds world)) (spaceList (all-instance-spaces-of-world (car (last parents))))) (when (cdr parents) (loop for tail on parents while (cdr tail) do (setq spaceList (right-prepend (all-instance-spaces-of-world (car tail)) spaceList)))) (cons (local-instance-space world) spaceList) ))) (defun unintern-instance-in-world (instance world) ;; Enter a nil entry into the local name space of "world", ;; keyed on the identifier of "instance"; ;; Called by "forget-all-about"; (let ((multipleIds (multiple-identifiers instance))) (if multipleIds (loop for id in multipleIds do (setf (gethash id (local-instance-space world)) nil)) (setf (gethash (identifier instance) (local-instance-space world)) nil)) (clear-get-instance-cache) )) (defmacro trapping-incoherence-p () ;; Return t if occurrences of incoherence are being trapped ;; (presumably by a "with-world"); `(and *world* (boundp '*exitIncoherentWorldP*))) (defun throw-if-incoherent-world (instance) ;; Quickly abort the computation within incoherent world; (declare (special *exitIncoherentWorldP*)) (when (trapping-incoherence-p) (setq *exitIncoherentWorldP* instance) #L:trace-merge (trace-values "incoherent world" instance *world*) (throw 'incoherent-world-catcher :incoherent)) ) #| TO DO: DIFFERENTIAL ROLE FILLERS FOR WORLDS: WRITE "WORLD.db-slot-value" CODE FILL IN SLOT "primary-parent-instance" CHANGE "shadowed-p" LOGIC SO INSTANCE CAN BE SHADOWED FROM ABOVE OR BELOW |#
[ { "context": "ense. See the file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;", "end": 178, "score": 0.9997520446777344, "start": 168, "tag": "NAME", "value": "Eric Smith" }, { "context": " file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 202, "score": 0.9999278783798218, "start": 180, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/zcash/lift-zcash-r1cs.lisp
mayankmanj/acl2
0
; A Zcash-specific version of lift-r1cs ; ; Copyright (C) 2020-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ZCASH") (include-book "kestrel/axe/r1cs/lift-r1cs" :dir :system) ;; A thin wrapper around lift-r1cs that sets the prime and the package for Zcash. ;; If the VARS are keywords (which is common), they get converted to the ZCASH package. (acl2::defmacrodoc lift-zcash-r1cs (name-of-defconst vars constraints &key (rules ':auto) (extra-rules 'nil) (remove-rules 'nil) (monitor 'nil) (memoizep 'nil) (count-hits 'nil) (print 'nil)) `(r1cs::lift-r1cs ,name-of-defconst ,vars ,constraints ;; This is (zcash::jubjub-q): 52435875175126190479447740508185965837690552500527637822603658699938581184513 :package "ZCASH" :rules ,rules :extra-rules ,extra-rules :remove-rules ,remove-rules :monitor ,monitor :memoizep ,memoizep :count-hits ,count-hits :print ,print) :parents (zcash r1cs::lift-r1cs r1cs::r1cs-verification-with-axe) :short "A tool to lift a zcash R1CS" :description "This tool is a wrapper for @(tsee r1cs::lift-r1cs) that sets the prime to @(tsee jubjub-q) and sets the package to @('ZCASH'). See also @(tsee r1cs::r1cs-verification-with-axe)." :args ((name-of-defconst "The name of the defconst (a symbol) that will be created to hold the DAG. This name should start and end with @('*').") (vars "A form that evaluates to the variables of the R1CS.") (constraints "A form that evaluates to the constraints of the R1CS.") (rules "Either :auto, or a form that evaluates to a list of symbols. If the latter, the given rules replace the default rules used for lifting.") (extra-rules "Rules to be added to the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (remove-rules "Rules to be removed from the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (monitor "Rules to monitor during rewriting. A form that evaluates to a list of symbols") (memoizep "Whether to perform memoization during rewriting. A boolean. This may actually slow down the lifting process.") (count-hits "Whether to count rule hits during rewriting (may cause rewriting to be somewhat slower). A boolean.") (print "Axe print argument") ;todo: document ))
42490
; A Zcash-specific version of lift-r1cs ; ; Copyright (C) 2020-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ZCASH") (include-book "kestrel/axe/r1cs/lift-r1cs" :dir :system) ;; A thin wrapper around lift-r1cs that sets the prime and the package for Zcash. ;; If the VARS are keywords (which is common), they get converted to the ZCASH package. (acl2::defmacrodoc lift-zcash-r1cs (name-of-defconst vars constraints &key (rules ':auto) (extra-rules 'nil) (remove-rules 'nil) (monitor 'nil) (memoizep 'nil) (count-hits 'nil) (print 'nil)) `(r1cs::lift-r1cs ,name-of-defconst ,vars ,constraints ;; This is (zcash::jubjub-q): 52435875175126190479447740508185965837690552500527637822603658699938581184513 :package "ZCASH" :rules ,rules :extra-rules ,extra-rules :remove-rules ,remove-rules :monitor ,monitor :memoizep ,memoizep :count-hits ,count-hits :print ,print) :parents (zcash r1cs::lift-r1cs r1cs::r1cs-verification-with-axe) :short "A tool to lift a zcash R1CS" :description "This tool is a wrapper for @(tsee r1cs::lift-r1cs) that sets the prime to @(tsee jubjub-q) and sets the package to @('ZCASH'). See also @(tsee r1cs::r1cs-verification-with-axe)." :args ((name-of-defconst "The name of the defconst (a symbol) that will be created to hold the DAG. This name should start and end with @('*').") (vars "A form that evaluates to the variables of the R1CS.") (constraints "A form that evaluates to the constraints of the R1CS.") (rules "Either :auto, or a form that evaluates to a list of symbols. If the latter, the given rules replace the default rules used for lifting.") (extra-rules "Rules to be added to the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (remove-rules "Rules to be removed from the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (monitor "Rules to monitor during rewriting. A form that evaluates to a list of symbols") (memoizep "Whether to perform memoization during rewriting. A boolean. This may actually slow down the lifting process.") (count-hits "Whether to count rule hits during rewriting (may cause rewriting to be somewhat slower). A boolean.") (print "Axe print argument") ;todo: document ))
true
; A Zcash-specific version of lift-r1cs ; ; Copyright (C) 2020-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ZCASH") (include-book "kestrel/axe/r1cs/lift-r1cs" :dir :system) ;; A thin wrapper around lift-r1cs that sets the prime and the package for Zcash. ;; If the VARS are keywords (which is common), they get converted to the ZCASH package. (acl2::defmacrodoc lift-zcash-r1cs (name-of-defconst vars constraints &key (rules ':auto) (extra-rules 'nil) (remove-rules 'nil) (monitor 'nil) (memoizep 'nil) (count-hits 'nil) (print 'nil)) `(r1cs::lift-r1cs ,name-of-defconst ,vars ,constraints ;; This is (zcash::jubjub-q): 52435875175126190479447740508185965837690552500527637822603658699938581184513 :package "ZCASH" :rules ,rules :extra-rules ,extra-rules :remove-rules ,remove-rules :monitor ,monitor :memoizep ,memoizep :count-hits ,count-hits :print ,print) :parents (zcash r1cs::lift-r1cs r1cs::r1cs-verification-with-axe) :short "A tool to lift a zcash R1CS" :description "This tool is a wrapper for @(tsee r1cs::lift-r1cs) that sets the prime to @(tsee jubjub-q) and sets the package to @('ZCASH'). See also @(tsee r1cs::r1cs-verification-with-axe)." :args ((name-of-defconst "The name of the defconst (a symbol) that will be created to hold the DAG. This name should start and end with @('*').") (vars "A form that evaluates to the variables of the R1CS.") (constraints "A form that evaluates to the constraints of the R1CS.") (rules "Either :auto, or a form that evaluates to a list of symbols. If the latter, the given rules replace the default rules used for lifting.") (extra-rules "Rules to be added to the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (remove-rules "Rules to be removed from the default rule set used for lifting. A form that evaluates to a list of symbols. May be non-@('nil') only when @('rules') is @(':auto').") (monitor "Rules to monitor during rewriting. A form that evaluates to a list of symbols") (memoizep "Whether to perform memoization during rewriting. A boolean. This may actually slow down the lifting process.") (count-hits "Whether to count rule hits during rewriting (may cause rewriting to be somewhat slower). A boolean.") (print "Axe print argument") ;todo: document ))
[ { "context": "rt of trial\n (c) 2017 Shirakumo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n", "end": 89, "score": 0.999922513961792, "start": 71, "tag": "EMAIL", "value": "[email protected]" }, { "context": "umo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:org.shirak", "end": 114, "score": 0.9998936057090759, "start": 100, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": ".eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:org.shirakumo.fraf.trial.ui)\n\n", "end": 134, "score": 0.9999299645423889, "start": 116, "tag": "EMAIL", "value": "[email protected]" } ]
ui/layout.lisp
pupcraft/trial
0
#| This file is a part of trial (c) 2017 Shirakumo http://tymoon.eu ([email protected]) Author: Nicolas Hafner <[email protected]> |# (in-package #:org.shirakumo.fraf.trial.ui) (defclass layout () ()) (defmethod apply-layout :around ((layout layout) (pane pane)) (when (/= 0 (length (objects pane))) (call-next-method))) (defclass horizontal-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout horizontal-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-width e))))) (loop for e across children for x = left then (+ x w) for w = (* scale (preferred-width e) total-width) for h = (* (preferred-height e) total-height) do (vsetf (the vec4 (extent e)) x (ecase alignment (:top top) (:center (+ top (/ (- total-height h) 2))) (:bottom (+ top (- total-height h)))) w h) (note-extent-change e NIL))))) (defclass vertical-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout vertical-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-height e))))) (loop for e across children for w = (* (preferred-width e) total-width) for h = (* scale (preferred-height e) total-height) for y = (+ top total-height (- h)) then (- y h) do (vsetf (the vec4 (extent e)) (ecase alignment (:left left) (:center (+ left (/ (- total-width w) 2))) (:right (+ left (- total-width w)))) y w h) (note-extent-change e NIL)))))
63367
#| This file is a part of trial (c) 2017 Shirakumo http://tymoon.eu (<EMAIL>) Author: <NAME> <<EMAIL>> |# (in-package #:org.shirakumo.fraf.trial.ui) (defclass layout () ()) (defmethod apply-layout :around ((layout layout) (pane pane)) (when (/= 0 (length (objects pane))) (call-next-method))) (defclass horizontal-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout horizontal-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-width e))))) (loop for e across children for x = left then (+ x w) for w = (* scale (preferred-width e) total-width) for h = (* (preferred-height e) total-height) do (vsetf (the vec4 (extent e)) x (ecase alignment (:top top) (:center (+ top (/ (- total-height h) 2))) (:bottom (+ top (- total-height h)))) w h) (note-extent-change e NIL))))) (defclass vertical-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout vertical-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-height e))))) (loop for e across children for w = (* (preferred-width e) total-width) for h = (* scale (preferred-height e) total-height) for y = (+ top total-height (- h)) then (- y h) do (vsetf (the vec4 (extent e)) (ecase alignment (:left left) (:center (+ left (/ (- total-width w) 2))) (:right (+ left (- total-width w)))) y w h) (note-extent-change e NIL)))))
true
#| This file is a part of trial (c) 2017 Shirakumo http://tymoon.eu (PI:EMAIL:<EMAIL>END_PI) Author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> |# (in-package #:org.shirakumo.fraf.trial.ui) (defclass layout () ()) (defmethod apply-layout :around ((layout layout) (pane pane)) (when (/= 0 (length (objects pane))) (call-next-method))) (defclass horizontal-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout horizontal-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-width e))))) (loop for e across children for x = left then (+ x w) for w = (* scale (preferred-width e) total-width) for h = (* (preferred-height e) total-height) do (vsetf (the vec4 (extent e)) x (ecase alignment (:top top) (:center (+ top (/ (- total-height h) 2))) (:bottom (+ top (- total-height h)))) w h) (note-extent-change e NIL))))) (defclass vertical-layout (layout) ((alignment :initarg :alignment :initform :center :accessor alignment))) (defmethod apply-layout ((layout vertical-layout) (pane pane)) (with-vec4 (left top total-width total-height) (extent pane) (let* ((children (objects pane)) (alignment (alignment layout)) (scale (/ 1 (loop for e across children sum (preferred-height e))))) (loop for e across children for w = (* (preferred-width e) total-width) for h = (* scale (preferred-height e) total-height) for y = (+ top total-height (- h)) then (- y h) do (vsetf (the vec4 (extent e)) (ecase alignment (:left left) (:center (+ left (/ (- total-width w) 2))) (:right (+ left (- total-width w)))) y w h) (note-extent-change e NIL)))))
[ { "context": ";;;; -*- lisp -*-\n;;;\n;;; Copyright (C) 2003, 2004 Lars Brinkhoff.\n\n(defpackage :emacs-cl-tests (:use \"CL\"))\n(in-pa", "end": 65, "score": 0.9998552203178406, "start": 51, "tag": "NAME", "value": "Lars Brinkhoff" } ]
platform/site-lisp/sublisp-cl/emacs-cl/tests.lisp
TeamSPoon/CYC_JRTL_with_CommonLisp_OLD
10
;;;; -*- lisp -*- ;;; ;;; Copyright (C) 2003, 2004 Lars Brinkhoff. (defpackage :emacs-cl-tests (:use "CL")) (in-package :emacs-cl-tests) (setq *readtable* (copy-readtable)) (defconstant +true+ (make-symbol "TRUE")) (set-dispatch-macro-character #\# #\t (constantly +true+)) (defparameter *pass* 0) (defparameter *fail-eval* 0) (defparameter *fail-comp* 0) (defparameter *fail-exe* 0) (defvar *emacs-version* (let ((n (position #\. el:|emacs-version|))) (values (read-from-string (subseq el:|emacs-version| 0 n))))) (defmacro ignore-all-errors (form) `(ignore-errors (ignore-elisp-error (lambda () ,form)))) (defmacro el-defun (symbol string) `(setf (symbol-function ',symbol) (el:|byte-compile| (car (el:|read-from-string| ,string))))) (el-defun ignore-elisp-error "(lambda (fn) (condition-case cond (FUNCALL fn) (error nil)))") (defun deftest-equal (x y) (cond ((eq x +true+) y) ((eq y +true+) x) ((and (consp x) (consp y)) (and (deftest-equal (car x) (car y)) (deftest-equal (cdr x) (cdr y)))) ((and (vectorp x) (vectorp y)) (every #'deftest-equal x y)) (t (equal x y)))) (defmacro deftest (name form result) `(try-test ,(string name) ',form ',result)) (defun try-test (name form result) (let ((pass t)) (format t "~&Test ~A: " name) (write-string " " nil :start (length name)) (if (deftest-equal (ignore-errors (eval form)) result) (incf *pass*) (progn (princ "FAIL evaluation ") (incf *fail-eval*) (setq pass nil))) ;;(format t "~& -> ~A <-~%" (el:|compile2| `(lambda () ,form))) (let ((fn (ignore-all-errors (compile nil `(lambda () ,form))))) (cond (fn (incf *pass*) (if (deftest-equal (ignore-errors (funcall fn)) result) (incf *pass*) (progn (incf *fail-exe*) (princ "FAIL execution") (setq pass nil)))) (t (incf *fail-comp*) (princ "FAIL compilation ") (setq pass nil)))) (when pass (princ "pass")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftest "bignum arithmetic" (list (+ 67108864 67108864) (+ 134217727 1) (+ -134217728 -1) (+ -134217728 -134217728) (+ 268435455 268435455) (+ -268435456 -268435456) (+ 536870912 -268435456) (+ -268435456 536870912) (+ 268435456 -536870912) (+ -536870912 268435456) (+ 536870914 -536870913) (+ 536870914 -536870915) (+ 1824724491 4579695115) (+ 3330866858093 8219800381946) (+ 671088640 -1) (+ 26843545600000000 26843545600000000) (+ 27658482871109005 27658482871109005)) (134217728 134217728 -134217729 -268435456 536870910 -536870912 268435456 268435456 -268435456 -268435456 1 -1 6404419606 11550667240039 671088639 53687091200000000 55316965742218010)) (deftest "SETF CADR" (let ((x (list 1 2 3))) (setf (cadr x) 42) x) (1 42 3)) (deftest "#- at end of list" (read-from-string "(#-emacs-cl 1)") nil) (deftest "#| |# at end of list" (read-from-string "(1 #| 2 |#)") (1)) (deftest "reading dotted lists" (let ((x (read-from-string "(1 . 2)"))) (cons (car x) (cdr x))) (1 . 2)) (deftest "binding global special variable" (progn (makunbound '*foo*) (defvar *foo* 10) (defun foo () *foo*) (list (let ((*foo* 20)) (foo)) (foo))) (20 10)) (deftest "setting global special variable" (progn (makunbound '*foo*) (defvar *foo*) (defun foo () *foo*) (setq *foo* 30) (foo)) 30) ;;; XEmacs' byte-compiler is known to fail on this. (deftest "binding local special variable" (progn (defun bar () (declare (special %bar%)) %bar%) (let ((%bar% 99)) (declare (special %bar%)) (bar))) 99) (deftest "passing &optional and &key arguments" (progn (defun foo (a &optional b (c 100) &key d (e 101)) (list a b c d e)) (append (foo 1) (foo 1 2) (foo 1 2 3) (foo 1 2 3 :d 4) (foo 1 2 3 :e 5 :d 4))) (1 nil 100 nil 101 1 2 100 nil 101 1 2 3 nil 101 1 2 3 4 101 1 2 3 4 5)) (deftest "passing &rest and &key arguments" (progn (defun foo (&rest a) a) (defun bar (&rest a &key b c) (list a b c)) (list (foo) (foo 1) (foo 1 2 3) (bar) (bar :b 1) (bar :c 1 :b 2))) (() (1) (1 2 3) (() nil nil) ((:b 1) 1 nil) ((:c 1 :b 2) 2 1))) (deftest "returning the right number of multiple values" (list (length (multiple-value-list (1+ (values 1 2)))) (length (multiple-value-list (values (progn 1) (progn 2)))) (length (multiple-value-list (values (values 1 2)))) (length (multiple-value-list (unwind-protect (values 1 2) (values 1 2 3))))) (1 2 1 2)) (deftest "backquoting" (let ((a 1) (b '(2 3)) (c '(4 5))) (list `(a b c) `(a ,b ,c) `(a ,b ,@c) `(a ,@b ,c) `(a ,@b ,@c) `(a `(b ,',a c) d))) ((a b c) (a (2 3) (4 5)) (a (2 3) 4 5) (a 2 3 (4 5)) (a 2 3 4 5) (a '(b 1 c) d))) (deftest "reading character constants" (concatenate 'string '(#\A #\Space #\( #\) #\* #\# #\\ #\")) "A ()*#\\\"") (deftest "suppressing undefined reader macros" (read-from-string "#-emacs-cl #% 1 2") 2) (unless (el:|featurep| 'el:|xemacs|) (deftest "accessing hash tables" (let ((eq-ht (make-hash-table :test #'eq)) (eql-ht (make-hash-table)) (equal-ht (make-hash-table :test #'equal))) ;;(equalp-ht (make-hash-table :test #'equalp))) (setf (gethash 'foo eq-ht) 1) (setf (gethash #\A eql-ht) 2) (setf (gethash (list 1 2 3) equal-ht) 3) ;;(setf (gethash "foo" equalp-ht) 4) (list (gethash 'foo eq-ht) (gethash #\A eql-ht) (gethash (list 1 2 3) equal-ht))) ;;(gethash "FOO" equalp-ht))) (1 2 3))) ;4))) (deftest "declare in do and dolist" (list (do ((i 0 (1+ i))) ((>= i 10) 42) (declare (fixnum i))) (dolist (x '(1 2 3) 17) (declare (fixnum x)) x)) (42 17)) (defun compose (fn1 fn2) (lambda (&rest args) (funcall fn1 (apply fn2 args)))) (defun curry (fn &rest args1) (lambda (&rest args2) (apply fn (append args1 args2)))) (defun rcurry (fn &rest args2) (lambda (&rest args1) (apply fn (append args1 args2)))) (deftest "merging pathname directories" ;;(pathname-directory (merge-pathnames "a/b/c.d" "/x/y/z")) (mapcar (compose #'pathname-directory (curry #'apply #'merge-pathnames)) '(("a.b" "x/y/z") ("a/b/c.d" "/x/y/z"))) ((:relative "x" "y") (:absolute "x" "y" "a" "b"))) (deftest "butlast" (list (butlast (list 1 2)) (butlast (list 1)) (butlast nil)) ((1) nil nil)) (deftest "case" (list (case 'white (black 'red) (white 'green)) (case 'bar ((1 2 3) 42) ((foo bar baz) 17))) (green 17)) (deftest "remove-if-not" (remove-if-not #'oddp '(1 2 3 4 5 6)) (1 3 5)) (deftest "destructuring-bind" (list (destructuring-bind (&rest a) nil a) (destructuring-bind (a &optional b (c 42 d) &rest e) '(1 2 3 4 5) (list a b c d e)) (destructuring-bind (a &optional b (c 42 d) &body e) '(1) (list a b c d e)) (destructuring-bind (foo &key bar baz) '(1 :bar 2 :baz 3) (list baz bar foo)) (destructuring-bind (&rest foo &key bar baz) '(:bar 2 :baz 3) (list foo bar baz)) (destructuring-bind (&key (foo 10) (bar 20)) '(:foo 30) (list foo bar)) (destructuring-bind (&key (foo 10 foop) (bar 20 barp)) '(:bar 30) (list foo foop bar barp)) (destructuring-bind (&key ((foo bar))) '(foo 42) bar) (destructuring-bind (x . y) '(1 2 3) (list x y)) (destructuring-bind (&whole w) () w) (destructuring-bind (&whole w) 42 w) (destructuring-bind (&whole w) '(42) w) (destructuring-bind (&whole w &rest x) () (list w x)) (destructuring-bind (&whole w x) '(42) (list w x))) (nil (1 2 3 t (4 5)) (1 nil 42 nil nil) (3 2 1) ((:bar 2 :baz 3) 2 3) (30 20) (10 nil 30 t) 42 (1 (2 3)) () 42 (42) (() ()) ((42) 42))) (deftest "butlast" (let (lst foo) (list (setq lst '(1 2 3 4 5 6 7 8 9)) (butlast lst) (butlast lst 5) (butlast lst (+ 5 5)) lst (progn (setq lst (list 1 2 3 4 5 6 7 8 9)) (nbutlast lst 3)) lst (nbutlast lst 99) lst (butlast '(a b c d)) (butlast '((a b) (c d))) (butlast '(a)) (butlast nil) (setq foo (list 'a 'b 'c 'd)) (progn (setq foo (list 'a 'b 'c 'd)) (nbutlast foo)) foo (nbutlast (list 'a)) (nbutlast '()) (butlast '(1 2 3 . 4) 0) (butlast '(1 2 3 . 4) 1) (butlast '(1 2 3 . 4) 2))) ((1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6 7 8) (1 2 3 4) nil (1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6) (1 2 3 4 5 6) nil (1 2 3 4 5 6) (a b c) ((a b)) nil nil (a b c d) (a b c) (a b c) nil nil (1 2 3) (1 2) (1))) (deftest "last" (let (x) (list (last nil) (last '(1 2 3)) (last '(1 2 . 3)) (setq x (list 'a 'b 'c 'd)) (last x) (progn (setq x (list 'a 'b 'c 'd)) (rplacd (last x) (list 'e 'f)) x) (last x) (last '(a b c)) (last '(a b c) 0) (last '(a b c) 1) (last '(a b c) 2) (last '(a b c) 3) (last '(a b c) 4) (last '(a . b) 0) (last '(a . b) 1) (last '(a . b) 2))) (nil (3) (2 . 3) (a b c d) (d) (a b c d e f) (f) (c) () (c) (b c) (a b c) (a b c) b (a . b) (a . b))) (deftest "ldiff and tailp" (let ((lists '#((a b c) (a b c . d))) (result nil)) (dotimes (i (length lists) (nreverse result)) (let ((list (aref lists i))) (let ((objects (vector list (cddr list) (copy-list (cddr list)) '(f g h) '() 'd 'x))) (dotimes (j (length objects)) (let ((object (aref objects j))) (push (tailp object list) result) (push (ldiff list object) result))))))) (#t nil #t (a b) nil (a b c) nil (a b c) #t (a b c) nil (a b c) nil (a b c) #t nil #t (a b) nil (a b c . d) nil (a b c . d) nil (a b c . d) #t (a b c) nil (a b c . d))) (deftest "every, some, notevery, and notany" (list (every #'characterp "abc") (some #'= '(1 2 3 4 5) '(5 4 3 2 1)) (notevery #'< '(1 2 3 4) '(5 6 7 8) '(9 10 11 12)) (notany #'> '(1 2 3 4) '(5 6 7 8) '(9 10 11 12))) (#t #t nil #t)) (deftest "printing a symbol named ||" (prin1-to-string '||) "||") (deftest "reading escaped gensyms" (princ-to-string (list (read-from-string "#:|foo|") (read-from-string "#:||"))) "(foo )") (deftest "nested macrolets" (macrolet ((foo () ''win)) (macrolet ((foo () ''lose)) nil) (foo)) win) (deftest "reading a zero length bit vector" (prin1-to-string (read-from-string "#*")) "#*") (deftest "array-dimensions" (array-dimensions "abc") (3)) (deftest "multiple-value-setq" (let (x y z) (multiple-value-setq (x y z) (values 1 2 3)) (list x y z)) (1 2 3)) (unless (el:|featurep| 'el:|xemacs|) (deftest "rational" (rational 8.0e20) 800000000000000000000)) (unless (el:|featurep| 'el:|xemacs|) (deftest "truncate" (truncate 5075863620026369.0) 5075863620026369)) (deftest "floor and ceiling" (list (floor -1/2) (floor 1/2) (ceiling -1/2) (ceiling 1/2)) (-1 0 0 1)) (deftest "plusp and minusp" (list (plusp 1/2) (plusp 100000000000000000/3) (plusp -100000000000000000/3) (minusp 100000000000000000/3) (minusp -100000000000000000/3)) (#t #t nil nil #t)) (deftest "logand, logior, and logxor" (list (logand 8236387328762348762138787623487 1234978634857634056) (logior 8236387328762348762138787623487 1234978634857634056) (logxor 8236387328762348762138787623487 1234978634857634056)) (72761281498746888 8236387328763510979492146510655 8236387328763438218210647763767)) (deftest "typep" (list (typep 42 '(unsigned-byte 9)) (typep #() 'vector) (typep #() '(vector *)) (typep #() '(vector t)) (typep #() '(vector bit)) (typep #() '(vector * 0)) (typep #() '(vector * 1)) (typep #() 'array) (typep #() '(array *)) (typep #() '(array * *)) (typep #() '(array * 1)) (typep #() '(array * (*))) (typep #() '(array * (0))) (typep #() '(array * (1)))) (#t #t #t #t nil #t nil #t #t #t #t #t #t nil)) (deftest "expt" (expt 1/2 -1) 2) (deftest "length" (length (make-array 3 :adjustable t)) 3) (deftest "compile-file" (progn (with-open-file (f "temporary.lisp" :direction :output) (format f "(defun foo () #*11111111111010110101)~@ (defvar *bar* '#1=(1 . 1))~@ (defun bar () (let ((*bar* t)) (foo)))~@ (defvar *baz* #'foo)")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc") (bar)) (mapc #'delete-file '("temporary.lisp" "temporary.elc")) (foo)) #*11111111111010110101) (deftest "symbol-macrolet" (symbol-macrolet ((x y)) (let ((y nil)) (setf x 42) y)) 42) (deftest "not and null" (list (not nil) (null nil)) (t t)) (deftest "nested handler-bind" (block foo (handler-bind ((error (lambda (c) (return-from foo 'lose)))) (handler-bind ((error (lambda (c) (return-from foo 'win)))) (error "error")))) win) (deftest "load-time-value" (list (load-time-value (list 1 2 3)) (progn (fmakunbound '*value*) (with-open-file (f "temporary.lisp" :direction :output) (format f "(defparameter *value* (list 1 2 3))~@ (defparameter *load-time-value*~@ (load-time-value *value*))")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc")) *load-time-value*)) ((1 2 3) (1 2 3))) (deftest "complement" (list (funcall (complement (lambda () t))) (funcall (complement #'zerop) 0) (funcall (complement '=) 1 1)) (nil nil nil)) (deftest "defclass" (let ((foo-class (defclass foo () ())) (bar-class (defclass bar (foo) () ())) (foo-instance (make-instance 'foo)) (bar-instance (make-instance 'bar))) (and (typep foo-class t) (typep foo-class 'standard-class) (typep foo-instance t) (typep foo-instance 'standard-object) (typep foo-instance 'foo) (typep bar-class t) (typep bar-class 'standard-class) (typep bar-instance t) (typep bar-instance 'standard-object) (typep bar-instance 'foo) (typep bar-instance 'bar))) #t) (deftest "slot-value" (let ((test-class (defclass test () (x y))) (test-instance (make-instance 'test))) (and (slot-exists-p test-instance 'x) (slot-exists-p test-instance 'y) (not (slot-exists-p test-instance 'z)) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)) (setf (slot-value test-instance 'x) 42) (slot-boundp test-instance 'x) (not (slot-boundp test-instance 'y)) (eql (slot-value test-instance 'x) 42) (slot-makunbound test-instance 'x) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)))) t) (deftest "find-symbol" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ()))) (use-package foo-package bar-package) (use-package bar-package foo-package) (prog1 (find-symbol "foo" foo-package) (unuse-package foo-package bar-package) (delete-package foo-package) (delete-package bar-package))) nil) (deftest "shadowing-import" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ())) (baz-package (make-package "baz" :use '("foo"))) (foo-x (intern "x" foo-package)) (bar-x (intern "x" bar-package))) (shadowing-import foo-x bar-package) (shadowing-import foo-x baz-package) (prog1 (and (eq (find-symbol "x" "foo") (find-symbol "x" "bar")) (eq (find-symbol "x" "foo") (find-symbol "x" "baz"))) (delete-package baz-package) (delete-package bar-package) (delete-package foo-package))) #t) (deftest "defconstant" (progn (makunbound '+foo+) (fmakunbound 'foo) (defconstant +foo+ '(1 . 2)) (defun foo () +foo+) (foo)) (1 . 2)) (deftest "parsing function bodies" (macrolet ((test-bodies () `(list ,@(let ((result nil)) (dolist (decl1 '(nil ((declare (optimize speed))))) (dolist (doc '(nil ("doc"))) (dolist (decl2 '(nil ((declare (special *package*))))) (dolist (form '(nil ("str") (42))) (push `(let ((fn (lambda () ,@decl1 ,@doc ,@decl2 ,@form))) (list (funcall fn) (documentation fn t))) result))))) (nreverse result))))) (test-bodies)) ((nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc") (nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc"))) (deftest "coerce" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (object (list list vector string)) (dolist (type '(list vector simple-vector string simple-string)) (push (coerce object type) result))) (nreverse result)) ((#\a #\b) #(#\a #\b) #(#\a #\b) "ab" "ab" (#\c #\d) #(#\c #\d) #(#\c #\d) "cd" "cd" (#\e #\f) "ef" "ef" "ef" "ef")) (deftest "make-sequence" (list (make-sequence 'list 2 :initial-element t) (make-sequence 'simple-bit-vector 2 :initial-element 1) (make-sequence 'simple-string 2 :initial-element #\a) (make-sequence 'simple-vector 2 :initial-element t)) ((t t) #*11 "aa" #(t t))) (deftest "concatenate" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (type '(list vector simple-vector string simple-string)) (push (concatenate type list vector string) result)) (nreverse result)) ((#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) "abcdef" "abcdef")) (deftest "subtypep" (list ;; These should be subtypes. (loop for (t1 t2) on '((simple-vector 3) sequence integer number (integer 1 3) number null symbol) by #'cddr unless (subtypep t1 t2) collect (list t1 t2)) ;; These should not be subtypes. (loop for (t1 t2) on '(simple-vector string) by #'cddr when (subtypep t1 t2) collect (list t1 t2)) ;; These should be type-equal. (loop for (t1 t2) on '((or fixnum bignum) integer (or integer ratio) rational (or rational float) real (or real complex) number (or null cons) list (or list vector) sequence (array * (*)) vector (simple-array t (3 4)) (and (array t (3 *)) (simple-array * (* 4)))) by #'cddr unless (and (subtypep t1 t2) (subtypep t2 t1)) collect (list t1 t2))) (nil nil nil)) (deftest "flet and labels" (macrolet ((test (flet) `(,flet ((foo () 42)) (list (functionp #'foo) (foo))))) (list (test flet) (test labels) (labels ((foo () #'foo)) (eq #'foo (foo))))) ((#t 42) (#t 42) #t)) (defmacro foo1 (&whole w) (cdr w)) (defmacro foo2 (&whole w x) `(cons ',x ',w)) (defmacro foo3 (&rest x) `',x) (deftest "defmacro" (list (foo1 . 42) (foo2 42) (foo3 . 42) (foo3 42)) (42 (42 foo2 42) 42 (42))) (define-compiler-macro bar1 (&whole w) `',w) (define-compiler-macro bar2 (&whole w x) `'(,x . ,w)) (define-compiler-macro bar3 (&rest x) `',x) (define-compiler-macro (setf bar4) (&whole w) `',w) (deftest "define-compiler-macro" (funcall (compile nil '(lambda () (list (bar1 42) (funcall #'bar1 42) (bar2 42) (funcall 'bar2 42) (bar3 42) (funcall #'bar3 42) (funcall #'(setf bar4) 42))))) ((bar1 42) (funcall #'bar1 42) (42 bar2 42) (42 funcall 'bar2 42) (42) (42) (funcall #'(setf bar4) 42))) (deftest "string-left-trim and string-right-trim" (list (string-left-trim " " " foo ") (string-left-trim '(#\O #\F) 'foobar) (string-left-trim " " " ") (string-right-trim " " " foo ") (string-right-trim '(#\A #\R) 'foobar) (string-right-trim " " " ")) ("foo " "BAR" "" " foo" "FOOB" "")) (deftest "string comparisons" (mapcar (lambda (fn) (mapcar fn '("ab" "abc" "abcd") '("abc" "abc" "abc"))) (list #'string< #'string> #'string<= #'string>=)) ((2 nil nil) (nil nil 3) (2 3 nil) (nil 3 3))) ; (unless (or (= *emacs-version* 20) ; (el:|featurep| 'el:|xemacs|)) ; (deftest "printing circular structures" ; (mapcar (rcurry #'write-to-string :circle t) ; (list ; (let ((x (list 1 2 3))) (setf (cdddr x) x)) ; (let ((x (list 1 2 3))) (setf (car x) x)) ; (let ((x (list 1 2 3))) (setf (second x) (cddr x)) x) ; (let ((x (cons t t))) (setf (car x) (setf (cdr x) x))))) ; ("#1=(1 2 3 . #1#)" "#1=(#1# 2 3)" "(1 #1=(3) . #1#)" "#1=(#1# . #1#)"))) (format t "~&~@ All tests completed.~@ ~@ PASS: ~D~@ FAIL evaluation: ~D~@ FAIL compilation: ~D~@ FAIL execution: ~D~%~%" *pass* *fail-eval* *fail-comp* *fail-exe*)
20936
;;;; -*- lisp -*- ;;; ;;; Copyright (C) 2003, 2004 <NAME>. (defpackage :emacs-cl-tests (:use "CL")) (in-package :emacs-cl-tests) (setq *readtable* (copy-readtable)) (defconstant +true+ (make-symbol "TRUE")) (set-dispatch-macro-character #\# #\t (constantly +true+)) (defparameter *pass* 0) (defparameter *fail-eval* 0) (defparameter *fail-comp* 0) (defparameter *fail-exe* 0) (defvar *emacs-version* (let ((n (position #\. el:|emacs-version|))) (values (read-from-string (subseq el:|emacs-version| 0 n))))) (defmacro ignore-all-errors (form) `(ignore-errors (ignore-elisp-error (lambda () ,form)))) (defmacro el-defun (symbol string) `(setf (symbol-function ',symbol) (el:|byte-compile| (car (el:|read-from-string| ,string))))) (el-defun ignore-elisp-error "(lambda (fn) (condition-case cond (FUNCALL fn) (error nil)))") (defun deftest-equal (x y) (cond ((eq x +true+) y) ((eq y +true+) x) ((and (consp x) (consp y)) (and (deftest-equal (car x) (car y)) (deftest-equal (cdr x) (cdr y)))) ((and (vectorp x) (vectorp y)) (every #'deftest-equal x y)) (t (equal x y)))) (defmacro deftest (name form result) `(try-test ,(string name) ',form ',result)) (defun try-test (name form result) (let ((pass t)) (format t "~&Test ~A: " name) (write-string " " nil :start (length name)) (if (deftest-equal (ignore-errors (eval form)) result) (incf *pass*) (progn (princ "FAIL evaluation ") (incf *fail-eval*) (setq pass nil))) ;;(format t "~& -> ~A <-~%" (el:|compile2| `(lambda () ,form))) (let ((fn (ignore-all-errors (compile nil `(lambda () ,form))))) (cond (fn (incf *pass*) (if (deftest-equal (ignore-errors (funcall fn)) result) (incf *pass*) (progn (incf *fail-exe*) (princ "FAIL execution") (setq pass nil)))) (t (incf *fail-comp*) (princ "FAIL compilation ") (setq pass nil)))) (when pass (princ "pass")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftest "bignum arithmetic" (list (+ 67108864 67108864) (+ 134217727 1) (+ -134217728 -1) (+ -134217728 -134217728) (+ 268435455 268435455) (+ -268435456 -268435456) (+ 536870912 -268435456) (+ -268435456 536870912) (+ 268435456 -536870912) (+ -536870912 268435456) (+ 536870914 -536870913) (+ 536870914 -536870915) (+ 1824724491 4579695115) (+ 3330866858093 8219800381946) (+ 671088640 -1) (+ 26843545600000000 26843545600000000) (+ 27658482871109005 27658482871109005)) (134217728 134217728 -134217729 -268435456 536870910 -536870912 268435456 268435456 -268435456 -268435456 1 -1 6404419606 11550667240039 671088639 53687091200000000 55316965742218010)) (deftest "SETF CADR" (let ((x (list 1 2 3))) (setf (cadr x) 42) x) (1 42 3)) (deftest "#- at end of list" (read-from-string "(#-emacs-cl 1)") nil) (deftest "#| |# at end of list" (read-from-string "(1 #| 2 |#)") (1)) (deftest "reading dotted lists" (let ((x (read-from-string "(1 . 2)"))) (cons (car x) (cdr x))) (1 . 2)) (deftest "binding global special variable" (progn (makunbound '*foo*) (defvar *foo* 10) (defun foo () *foo*) (list (let ((*foo* 20)) (foo)) (foo))) (20 10)) (deftest "setting global special variable" (progn (makunbound '*foo*) (defvar *foo*) (defun foo () *foo*) (setq *foo* 30) (foo)) 30) ;;; XEmacs' byte-compiler is known to fail on this. (deftest "binding local special variable" (progn (defun bar () (declare (special %bar%)) %bar%) (let ((%bar% 99)) (declare (special %bar%)) (bar))) 99) (deftest "passing &optional and &key arguments" (progn (defun foo (a &optional b (c 100) &key d (e 101)) (list a b c d e)) (append (foo 1) (foo 1 2) (foo 1 2 3) (foo 1 2 3 :d 4) (foo 1 2 3 :e 5 :d 4))) (1 nil 100 nil 101 1 2 100 nil 101 1 2 3 nil 101 1 2 3 4 101 1 2 3 4 5)) (deftest "passing &rest and &key arguments" (progn (defun foo (&rest a) a) (defun bar (&rest a &key b c) (list a b c)) (list (foo) (foo 1) (foo 1 2 3) (bar) (bar :b 1) (bar :c 1 :b 2))) (() (1) (1 2 3) (() nil nil) ((:b 1) 1 nil) ((:c 1 :b 2) 2 1))) (deftest "returning the right number of multiple values" (list (length (multiple-value-list (1+ (values 1 2)))) (length (multiple-value-list (values (progn 1) (progn 2)))) (length (multiple-value-list (values (values 1 2)))) (length (multiple-value-list (unwind-protect (values 1 2) (values 1 2 3))))) (1 2 1 2)) (deftest "backquoting" (let ((a 1) (b '(2 3)) (c '(4 5))) (list `(a b c) `(a ,b ,c) `(a ,b ,@c) `(a ,@b ,c) `(a ,@b ,@c) `(a `(b ,',a c) d))) ((a b c) (a (2 3) (4 5)) (a (2 3) 4 5) (a 2 3 (4 5)) (a 2 3 4 5) (a '(b 1 c) d))) (deftest "reading character constants" (concatenate 'string '(#\A #\Space #\( #\) #\* #\# #\\ #\")) "A ()*#\\\"") (deftest "suppressing undefined reader macros" (read-from-string "#-emacs-cl #% 1 2") 2) (unless (el:|featurep| 'el:|xemacs|) (deftest "accessing hash tables" (let ((eq-ht (make-hash-table :test #'eq)) (eql-ht (make-hash-table)) (equal-ht (make-hash-table :test #'equal))) ;;(equalp-ht (make-hash-table :test #'equalp))) (setf (gethash 'foo eq-ht) 1) (setf (gethash #\A eql-ht) 2) (setf (gethash (list 1 2 3) equal-ht) 3) ;;(setf (gethash "foo" equalp-ht) 4) (list (gethash 'foo eq-ht) (gethash #\A eql-ht) (gethash (list 1 2 3) equal-ht))) ;;(gethash "FOO" equalp-ht))) (1 2 3))) ;4))) (deftest "declare in do and dolist" (list (do ((i 0 (1+ i))) ((>= i 10) 42) (declare (fixnum i))) (dolist (x '(1 2 3) 17) (declare (fixnum x)) x)) (42 17)) (defun compose (fn1 fn2) (lambda (&rest args) (funcall fn1 (apply fn2 args)))) (defun curry (fn &rest args1) (lambda (&rest args2) (apply fn (append args1 args2)))) (defun rcurry (fn &rest args2) (lambda (&rest args1) (apply fn (append args1 args2)))) (deftest "merging pathname directories" ;;(pathname-directory (merge-pathnames "a/b/c.d" "/x/y/z")) (mapcar (compose #'pathname-directory (curry #'apply #'merge-pathnames)) '(("a.b" "x/y/z") ("a/b/c.d" "/x/y/z"))) ((:relative "x" "y") (:absolute "x" "y" "a" "b"))) (deftest "butlast" (list (butlast (list 1 2)) (butlast (list 1)) (butlast nil)) ((1) nil nil)) (deftest "case" (list (case 'white (black 'red) (white 'green)) (case 'bar ((1 2 3) 42) ((foo bar baz) 17))) (green 17)) (deftest "remove-if-not" (remove-if-not #'oddp '(1 2 3 4 5 6)) (1 3 5)) (deftest "destructuring-bind" (list (destructuring-bind (&rest a) nil a) (destructuring-bind (a &optional b (c 42 d) &rest e) '(1 2 3 4 5) (list a b c d e)) (destructuring-bind (a &optional b (c 42 d) &body e) '(1) (list a b c d e)) (destructuring-bind (foo &key bar baz) '(1 :bar 2 :baz 3) (list baz bar foo)) (destructuring-bind (&rest foo &key bar baz) '(:bar 2 :baz 3) (list foo bar baz)) (destructuring-bind (&key (foo 10) (bar 20)) '(:foo 30) (list foo bar)) (destructuring-bind (&key (foo 10 foop) (bar 20 barp)) '(:bar 30) (list foo foop bar barp)) (destructuring-bind (&key ((foo bar))) '(foo 42) bar) (destructuring-bind (x . y) '(1 2 3) (list x y)) (destructuring-bind (&whole w) () w) (destructuring-bind (&whole w) 42 w) (destructuring-bind (&whole w) '(42) w) (destructuring-bind (&whole w &rest x) () (list w x)) (destructuring-bind (&whole w x) '(42) (list w x))) (nil (1 2 3 t (4 5)) (1 nil 42 nil nil) (3 2 1) ((:bar 2 :baz 3) 2 3) (30 20) (10 nil 30 t) 42 (1 (2 3)) () 42 (42) (() ()) ((42) 42))) (deftest "butlast" (let (lst foo) (list (setq lst '(1 2 3 4 5 6 7 8 9)) (butlast lst) (butlast lst 5) (butlast lst (+ 5 5)) lst (progn (setq lst (list 1 2 3 4 5 6 7 8 9)) (nbutlast lst 3)) lst (nbutlast lst 99) lst (butlast '(a b c d)) (butlast '((a b) (c d))) (butlast '(a)) (butlast nil) (setq foo (list 'a 'b 'c 'd)) (progn (setq foo (list 'a 'b 'c 'd)) (nbutlast foo)) foo (nbutlast (list 'a)) (nbutlast '()) (butlast '(1 2 3 . 4) 0) (butlast '(1 2 3 . 4) 1) (butlast '(1 2 3 . 4) 2))) ((1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6 7 8) (1 2 3 4) nil (1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6) (1 2 3 4 5 6) nil (1 2 3 4 5 6) (a b c) ((a b)) nil nil (a b c d) (a b c) (a b c) nil nil (1 2 3) (1 2) (1))) (deftest "last" (let (x) (list (last nil) (last '(1 2 3)) (last '(1 2 . 3)) (setq x (list 'a 'b 'c 'd)) (last x) (progn (setq x (list 'a 'b 'c 'd)) (rplacd (last x) (list 'e 'f)) x) (last x) (last '(a b c)) (last '(a b c) 0) (last '(a b c) 1) (last '(a b c) 2) (last '(a b c) 3) (last '(a b c) 4) (last '(a . b) 0) (last '(a . b) 1) (last '(a . b) 2))) (nil (3) (2 . 3) (a b c d) (d) (a b c d e f) (f) (c) () (c) (b c) (a b c) (a b c) b (a . b) (a . b))) (deftest "ldiff and tailp" (let ((lists '#((a b c) (a b c . d))) (result nil)) (dotimes (i (length lists) (nreverse result)) (let ((list (aref lists i))) (let ((objects (vector list (cddr list) (copy-list (cddr list)) '(f g h) '() 'd 'x))) (dotimes (j (length objects)) (let ((object (aref objects j))) (push (tailp object list) result) (push (ldiff list object) result))))))) (#t nil #t (a b) nil (a b c) nil (a b c) #t (a b c) nil (a b c) nil (a b c) #t nil #t (a b) nil (a b c . d) nil (a b c . d) nil (a b c . d) #t (a b c) nil (a b c . d))) (deftest "every, some, notevery, and notany" (list (every #'characterp "abc") (some #'= '(1 2 3 4 5) '(5 4 3 2 1)) (notevery #'< '(1 2 3 4) '(5 6 7 8) '(9 10 11 12)) (notany #'> '(1 2 3 4) '(5 6 7 8) '(9 10 11 12))) (#t #t nil #t)) (deftest "printing a symbol named ||" (prin1-to-string '||) "||") (deftest "reading escaped gensyms" (princ-to-string (list (read-from-string "#:|foo|") (read-from-string "#:||"))) "(foo )") (deftest "nested macrolets" (macrolet ((foo () ''win)) (macrolet ((foo () ''lose)) nil) (foo)) win) (deftest "reading a zero length bit vector" (prin1-to-string (read-from-string "#*")) "#*") (deftest "array-dimensions" (array-dimensions "abc") (3)) (deftest "multiple-value-setq" (let (x y z) (multiple-value-setq (x y z) (values 1 2 3)) (list x y z)) (1 2 3)) (unless (el:|featurep| 'el:|xemacs|) (deftest "rational" (rational 8.0e20) 800000000000000000000)) (unless (el:|featurep| 'el:|xemacs|) (deftest "truncate" (truncate 5075863620026369.0) 5075863620026369)) (deftest "floor and ceiling" (list (floor -1/2) (floor 1/2) (ceiling -1/2) (ceiling 1/2)) (-1 0 0 1)) (deftest "plusp and minusp" (list (plusp 1/2) (plusp 100000000000000000/3) (plusp -100000000000000000/3) (minusp 100000000000000000/3) (minusp -100000000000000000/3)) (#t #t nil nil #t)) (deftest "logand, logior, and logxor" (list (logand 8236387328762348762138787623487 1234978634857634056) (logior 8236387328762348762138787623487 1234978634857634056) (logxor 8236387328762348762138787623487 1234978634857634056)) (72761281498746888 8236387328763510979492146510655 8236387328763438218210647763767)) (deftest "typep" (list (typep 42 '(unsigned-byte 9)) (typep #() 'vector) (typep #() '(vector *)) (typep #() '(vector t)) (typep #() '(vector bit)) (typep #() '(vector * 0)) (typep #() '(vector * 1)) (typep #() 'array) (typep #() '(array *)) (typep #() '(array * *)) (typep #() '(array * 1)) (typep #() '(array * (*))) (typep #() '(array * (0))) (typep #() '(array * (1)))) (#t #t #t #t nil #t nil #t #t #t #t #t #t nil)) (deftest "expt" (expt 1/2 -1) 2) (deftest "length" (length (make-array 3 :adjustable t)) 3) (deftest "compile-file" (progn (with-open-file (f "temporary.lisp" :direction :output) (format f "(defun foo () #*11111111111010110101)~@ (defvar *bar* '#1=(1 . 1))~@ (defun bar () (let ((*bar* t)) (foo)))~@ (defvar *baz* #'foo)")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc") (bar)) (mapc #'delete-file '("temporary.lisp" "temporary.elc")) (foo)) #*11111111111010110101) (deftest "symbol-macrolet" (symbol-macrolet ((x y)) (let ((y nil)) (setf x 42) y)) 42) (deftest "not and null" (list (not nil) (null nil)) (t t)) (deftest "nested handler-bind" (block foo (handler-bind ((error (lambda (c) (return-from foo 'lose)))) (handler-bind ((error (lambda (c) (return-from foo 'win)))) (error "error")))) win) (deftest "load-time-value" (list (load-time-value (list 1 2 3)) (progn (fmakunbound '*value*) (with-open-file (f "temporary.lisp" :direction :output) (format f "(defparameter *value* (list 1 2 3))~@ (defparameter *load-time-value*~@ (load-time-value *value*))")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc")) *load-time-value*)) ((1 2 3) (1 2 3))) (deftest "complement" (list (funcall (complement (lambda () t))) (funcall (complement #'zerop) 0) (funcall (complement '=) 1 1)) (nil nil nil)) (deftest "defclass" (let ((foo-class (defclass foo () ())) (bar-class (defclass bar (foo) () ())) (foo-instance (make-instance 'foo)) (bar-instance (make-instance 'bar))) (and (typep foo-class t) (typep foo-class 'standard-class) (typep foo-instance t) (typep foo-instance 'standard-object) (typep foo-instance 'foo) (typep bar-class t) (typep bar-class 'standard-class) (typep bar-instance t) (typep bar-instance 'standard-object) (typep bar-instance 'foo) (typep bar-instance 'bar))) #t) (deftest "slot-value" (let ((test-class (defclass test () (x y))) (test-instance (make-instance 'test))) (and (slot-exists-p test-instance 'x) (slot-exists-p test-instance 'y) (not (slot-exists-p test-instance 'z)) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)) (setf (slot-value test-instance 'x) 42) (slot-boundp test-instance 'x) (not (slot-boundp test-instance 'y)) (eql (slot-value test-instance 'x) 42) (slot-makunbound test-instance 'x) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)))) t) (deftest "find-symbol" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ()))) (use-package foo-package bar-package) (use-package bar-package foo-package) (prog1 (find-symbol "foo" foo-package) (unuse-package foo-package bar-package) (delete-package foo-package) (delete-package bar-package))) nil) (deftest "shadowing-import" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ())) (baz-package (make-package "baz" :use '("foo"))) (foo-x (intern "x" foo-package)) (bar-x (intern "x" bar-package))) (shadowing-import foo-x bar-package) (shadowing-import foo-x baz-package) (prog1 (and (eq (find-symbol "x" "foo") (find-symbol "x" "bar")) (eq (find-symbol "x" "foo") (find-symbol "x" "baz"))) (delete-package baz-package) (delete-package bar-package) (delete-package foo-package))) #t) (deftest "defconstant" (progn (makunbound '+foo+) (fmakunbound 'foo) (defconstant +foo+ '(1 . 2)) (defun foo () +foo+) (foo)) (1 . 2)) (deftest "parsing function bodies" (macrolet ((test-bodies () `(list ,@(let ((result nil)) (dolist (decl1 '(nil ((declare (optimize speed))))) (dolist (doc '(nil ("doc"))) (dolist (decl2 '(nil ((declare (special *package*))))) (dolist (form '(nil ("str") (42))) (push `(let ((fn (lambda () ,@decl1 ,@doc ,@decl2 ,@form))) (list (funcall fn) (documentation fn t))) result))))) (nreverse result))))) (test-bodies)) ((nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc") (nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc"))) (deftest "coerce" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (object (list list vector string)) (dolist (type '(list vector simple-vector string simple-string)) (push (coerce object type) result))) (nreverse result)) ((#\a #\b) #(#\a #\b) #(#\a #\b) "ab" "ab" (#\c #\d) #(#\c #\d) #(#\c #\d) "cd" "cd" (#\e #\f) "ef" "ef" "ef" "ef")) (deftest "make-sequence" (list (make-sequence 'list 2 :initial-element t) (make-sequence 'simple-bit-vector 2 :initial-element 1) (make-sequence 'simple-string 2 :initial-element #\a) (make-sequence 'simple-vector 2 :initial-element t)) ((t t) #*11 "aa" #(t t))) (deftest "concatenate" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (type '(list vector simple-vector string simple-string)) (push (concatenate type list vector string) result)) (nreverse result)) ((#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) "abcdef" "abcdef")) (deftest "subtypep" (list ;; These should be subtypes. (loop for (t1 t2) on '((simple-vector 3) sequence integer number (integer 1 3) number null symbol) by #'cddr unless (subtypep t1 t2) collect (list t1 t2)) ;; These should not be subtypes. (loop for (t1 t2) on '(simple-vector string) by #'cddr when (subtypep t1 t2) collect (list t1 t2)) ;; These should be type-equal. (loop for (t1 t2) on '((or fixnum bignum) integer (or integer ratio) rational (or rational float) real (or real complex) number (or null cons) list (or list vector) sequence (array * (*)) vector (simple-array t (3 4)) (and (array t (3 *)) (simple-array * (* 4)))) by #'cddr unless (and (subtypep t1 t2) (subtypep t2 t1)) collect (list t1 t2))) (nil nil nil)) (deftest "flet and labels" (macrolet ((test (flet) `(,flet ((foo () 42)) (list (functionp #'foo) (foo))))) (list (test flet) (test labels) (labels ((foo () #'foo)) (eq #'foo (foo))))) ((#t 42) (#t 42) #t)) (defmacro foo1 (&whole w) (cdr w)) (defmacro foo2 (&whole w x) `(cons ',x ',w)) (defmacro foo3 (&rest x) `',x) (deftest "defmacro" (list (foo1 . 42) (foo2 42) (foo3 . 42) (foo3 42)) (42 (42 foo2 42) 42 (42))) (define-compiler-macro bar1 (&whole w) `',w) (define-compiler-macro bar2 (&whole w x) `'(,x . ,w)) (define-compiler-macro bar3 (&rest x) `',x) (define-compiler-macro (setf bar4) (&whole w) `',w) (deftest "define-compiler-macro" (funcall (compile nil '(lambda () (list (bar1 42) (funcall #'bar1 42) (bar2 42) (funcall 'bar2 42) (bar3 42) (funcall #'bar3 42) (funcall #'(setf bar4) 42))))) ((bar1 42) (funcall #'bar1 42) (42 bar2 42) (42 funcall 'bar2 42) (42) (42) (funcall #'(setf bar4) 42))) (deftest "string-left-trim and string-right-trim" (list (string-left-trim " " " foo ") (string-left-trim '(#\O #\F) 'foobar) (string-left-trim " " " ") (string-right-trim " " " foo ") (string-right-trim '(#\A #\R) 'foobar) (string-right-trim " " " ")) ("foo " "BAR" "" " foo" "FOOB" "")) (deftest "string comparisons" (mapcar (lambda (fn) (mapcar fn '("ab" "abc" "abcd") '("abc" "abc" "abc"))) (list #'string< #'string> #'string<= #'string>=)) ((2 nil nil) (nil nil 3) (2 3 nil) (nil 3 3))) ; (unless (or (= *emacs-version* 20) ; (el:|featurep| 'el:|xemacs|)) ; (deftest "printing circular structures" ; (mapcar (rcurry #'write-to-string :circle t) ; (list ; (let ((x (list 1 2 3))) (setf (cdddr x) x)) ; (let ((x (list 1 2 3))) (setf (car x) x)) ; (let ((x (list 1 2 3))) (setf (second x) (cddr x)) x) ; (let ((x (cons t t))) (setf (car x) (setf (cdr x) x))))) ; ("#1=(1 2 3 . #1#)" "#1=(#1# 2 3)" "(1 #1=(3) . #1#)" "#1=(#1# . #1#)"))) (format t "~&~@ All tests completed.~@ ~@ PASS: ~D~@ FAIL evaluation: ~D~@ FAIL compilation: ~D~@ FAIL execution: ~D~%~%" *pass* *fail-eval* *fail-comp* *fail-exe*)
true
;;;; -*- lisp -*- ;;; ;;; Copyright (C) 2003, 2004 PI:NAME:<NAME>END_PI. (defpackage :emacs-cl-tests (:use "CL")) (in-package :emacs-cl-tests) (setq *readtable* (copy-readtable)) (defconstant +true+ (make-symbol "TRUE")) (set-dispatch-macro-character #\# #\t (constantly +true+)) (defparameter *pass* 0) (defparameter *fail-eval* 0) (defparameter *fail-comp* 0) (defparameter *fail-exe* 0) (defvar *emacs-version* (let ((n (position #\. el:|emacs-version|))) (values (read-from-string (subseq el:|emacs-version| 0 n))))) (defmacro ignore-all-errors (form) `(ignore-errors (ignore-elisp-error (lambda () ,form)))) (defmacro el-defun (symbol string) `(setf (symbol-function ',symbol) (el:|byte-compile| (car (el:|read-from-string| ,string))))) (el-defun ignore-elisp-error "(lambda (fn) (condition-case cond (FUNCALL fn) (error nil)))") (defun deftest-equal (x y) (cond ((eq x +true+) y) ((eq y +true+) x) ((and (consp x) (consp y)) (and (deftest-equal (car x) (car y)) (deftest-equal (cdr x) (cdr y)))) ((and (vectorp x) (vectorp y)) (every #'deftest-equal x y)) (t (equal x y)))) (defmacro deftest (name form result) `(try-test ,(string name) ',form ',result)) (defun try-test (name form result) (let ((pass t)) (format t "~&Test ~A: " name) (write-string " " nil :start (length name)) (if (deftest-equal (ignore-errors (eval form)) result) (incf *pass*) (progn (princ "FAIL evaluation ") (incf *fail-eval*) (setq pass nil))) ;;(format t "~& -> ~A <-~%" (el:|compile2| `(lambda () ,form))) (let ((fn (ignore-all-errors (compile nil `(lambda () ,form))))) (cond (fn (incf *pass*) (if (deftest-equal (ignore-errors (funcall fn)) result) (incf *pass*) (progn (incf *fail-exe*) (princ "FAIL execution") (setq pass nil)))) (t (incf *fail-comp*) (princ "FAIL compilation ") (setq pass nil)))) (when pass (princ "pass")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftest "bignum arithmetic" (list (+ 67108864 67108864) (+ 134217727 1) (+ -134217728 -1) (+ -134217728 -134217728) (+ 268435455 268435455) (+ -268435456 -268435456) (+ 536870912 -268435456) (+ -268435456 536870912) (+ 268435456 -536870912) (+ -536870912 268435456) (+ 536870914 -536870913) (+ 536870914 -536870915) (+ 1824724491 4579695115) (+ 3330866858093 8219800381946) (+ 671088640 -1) (+ 26843545600000000 26843545600000000) (+ 27658482871109005 27658482871109005)) (134217728 134217728 -134217729 -268435456 536870910 -536870912 268435456 268435456 -268435456 -268435456 1 -1 6404419606 11550667240039 671088639 53687091200000000 55316965742218010)) (deftest "SETF CADR" (let ((x (list 1 2 3))) (setf (cadr x) 42) x) (1 42 3)) (deftest "#- at end of list" (read-from-string "(#-emacs-cl 1)") nil) (deftest "#| |# at end of list" (read-from-string "(1 #| 2 |#)") (1)) (deftest "reading dotted lists" (let ((x (read-from-string "(1 . 2)"))) (cons (car x) (cdr x))) (1 . 2)) (deftest "binding global special variable" (progn (makunbound '*foo*) (defvar *foo* 10) (defun foo () *foo*) (list (let ((*foo* 20)) (foo)) (foo))) (20 10)) (deftest "setting global special variable" (progn (makunbound '*foo*) (defvar *foo*) (defun foo () *foo*) (setq *foo* 30) (foo)) 30) ;;; XEmacs' byte-compiler is known to fail on this. (deftest "binding local special variable" (progn (defun bar () (declare (special %bar%)) %bar%) (let ((%bar% 99)) (declare (special %bar%)) (bar))) 99) (deftest "passing &optional and &key arguments" (progn (defun foo (a &optional b (c 100) &key d (e 101)) (list a b c d e)) (append (foo 1) (foo 1 2) (foo 1 2 3) (foo 1 2 3 :d 4) (foo 1 2 3 :e 5 :d 4))) (1 nil 100 nil 101 1 2 100 nil 101 1 2 3 nil 101 1 2 3 4 101 1 2 3 4 5)) (deftest "passing &rest and &key arguments" (progn (defun foo (&rest a) a) (defun bar (&rest a &key b c) (list a b c)) (list (foo) (foo 1) (foo 1 2 3) (bar) (bar :b 1) (bar :c 1 :b 2))) (() (1) (1 2 3) (() nil nil) ((:b 1) 1 nil) ((:c 1 :b 2) 2 1))) (deftest "returning the right number of multiple values" (list (length (multiple-value-list (1+ (values 1 2)))) (length (multiple-value-list (values (progn 1) (progn 2)))) (length (multiple-value-list (values (values 1 2)))) (length (multiple-value-list (unwind-protect (values 1 2) (values 1 2 3))))) (1 2 1 2)) (deftest "backquoting" (let ((a 1) (b '(2 3)) (c '(4 5))) (list `(a b c) `(a ,b ,c) `(a ,b ,@c) `(a ,@b ,c) `(a ,@b ,@c) `(a `(b ,',a c) d))) ((a b c) (a (2 3) (4 5)) (a (2 3) 4 5) (a 2 3 (4 5)) (a 2 3 4 5) (a '(b 1 c) d))) (deftest "reading character constants" (concatenate 'string '(#\A #\Space #\( #\) #\* #\# #\\ #\")) "A ()*#\\\"") (deftest "suppressing undefined reader macros" (read-from-string "#-emacs-cl #% 1 2") 2) (unless (el:|featurep| 'el:|xemacs|) (deftest "accessing hash tables" (let ((eq-ht (make-hash-table :test #'eq)) (eql-ht (make-hash-table)) (equal-ht (make-hash-table :test #'equal))) ;;(equalp-ht (make-hash-table :test #'equalp))) (setf (gethash 'foo eq-ht) 1) (setf (gethash #\A eql-ht) 2) (setf (gethash (list 1 2 3) equal-ht) 3) ;;(setf (gethash "foo" equalp-ht) 4) (list (gethash 'foo eq-ht) (gethash #\A eql-ht) (gethash (list 1 2 3) equal-ht))) ;;(gethash "FOO" equalp-ht))) (1 2 3))) ;4))) (deftest "declare in do and dolist" (list (do ((i 0 (1+ i))) ((>= i 10) 42) (declare (fixnum i))) (dolist (x '(1 2 3) 17) (declare (fixnum x)) x)) (42 17)) (defun compose (fn1 fn2) (lambda (&rest args) (funcall fn1 (apply fn2 args)))) (defun curry (fn &rest args1) (lambda (&rest args2) (apply fn (append args1 args2)))) (defun rcurry (fn &rest args2) (lambda (&rest args1) (apply fn (append args1 args2)))) (deftest "merging pathname directories" ;;(pathname-directory (merge-pathnames "a/b/c.d" "/x/y/z")) (mapcar (compose #'pathname-directory (curry #'apply #'merge-pathnames)) '(("a.b" "x/y/z") ("a/b/c.d" "/x/y/z"))) ((:relative "x" "y") (:absolute "x" "y" "a" "b"))) (deftest "butlast" (list (butlast (list 1 2)) (butlast (list 1)) (butlast nil)) ((1) nil nil)) (deftest "case" (list (case 'white (black 'red) (white 'green)) (case 'bar ((1 2 3) 42) ((foo bar baz) 17))) (green 17)) (deftest "remove-if-not" (remove-if-not #'oddp '(1 2 3 4 5 6)) (1 3 5)) (deftest "destructuring-bind" (list (destructuring-bind (&rest a) nil a) (destructuring-bind (a &optional b (c 42 d) &rest e) '(1 2 3 4 5) (list a b c d e)) (destructuring-bind (a &optional b (c 42 d) &body e) '(1) (list a b c d e)) (destructuring-bind (foo &key bar baz) '(1 :bar 2 :baz 3) (list baz bar foo)) (destructuring-bind (&rest foo &key bar baz) '(:bar 2 :baz 3) (list foo bar baz)) (destructuring-bind (&key (foo 10) (bar 20)) '(:foo 30) (list foo bar)) (destructuring-bind (&key (foo 10 foop) (bar 20 barp)) '(:bar 30) (list foo foop bar barp)) (destructuring-bind (&key ((foo bar))) '(foo 42) bar) (destructuring-bind (x . y) '(1 2 3) (list x y)) (destructuring-bind (&whole w) () w) (destructuring-bind (&whole w) 42 w) (destructuring-bind (&whole w) '(42) w) (destructuring-bind (&whole w &rest x) () (list w x)) (destructuring-bind (&whole w x) '(42) (list w x))) (nil (1 2 3 t (4 5)) (1 nil 42 nil nil) (3 2 1) ((:bar 2 :baz 3) 2 3) (30 20) (10 nil 30 t) 42 (1 (2 3)) () 42 (42) (() ()) ((42) 42))) (deftest "butlast" (let (lst foo) (list (setq lst '(1 2 3 4 5 6 7 8 9)) (butlast lst) (butlast lst 5) (butlast lst (+ 5 5)) lst (progn (setq lst (list 1 2 3 4 5 6 7 8 9)) (nbutlast lst 3)) lst (nbutlast lst 99) lst (butlast '(a b c d)) (butlast '((a b) (c d))) (butlast '(a)) (butlast nil) (setq foo (list 'a 'b 'c 'd)) (progn (setq foo (list 'a 'b 'c 'd)) (nbutlast foo)) foo (nbutlast (list 'a)) (nbutlast '()) (butlast '(1 2 3 . 4) 0) (butlast '(1 2 3 . 4) 1) (butlast '(1 2 3 . 4) 2))) ((1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6 7 8) (1 2 3 4) nil (1 2 3 4 5 6 7 8 9) (1 2 3 4 5 6) (1 2 3 4 5 6) nil (1 2 3 4 5 6) (a b c) ((a b)) nil nil (a b c d) (a b c) (a b c) nil nil (1 2 3) (1 2) (1))) (deftest "last" (let (x) (list (last nil) (last '(1 2 3)) (last '(1 2 . 3)) (setq x (list 'a 'b 'c 'd)) (last x) (progn (setq x (list 'a 'b 'c 'd)) (rplacd (last x) (list 'e 'f)) x) (last x) (last '(a b c)) (last '(a b c) 0) (last '(a b c) 1) (last '(a b c) 2) (last '(a b c) 3) (last '(a b c) 4) (last '(a . b) 0) (last '(a . b) 1) (last '(a . b) 2))) (nil (3) (2 . 3) (a b c d) (d) (a b c d e f) (f) (c) () (c) (b c) (a b c) (a b c) b (a . b) (a . b))) (deftest "ldiff and tailp" (let ((lists '#((a b c) (a b c . d))) (result nil)) (dotimes (i (length lists) (nreverse result)) (let ((list (aref lists i))) (let ((objects (vector list (cddr list) (copy-list (cddr list)) '(f g h) '() 'd 'x))) (dotimes (j (length objects)) (let ((object (aref objects j))) (push (tailp object list) result) (push (ldiff list object) result))))))) (#t nil #t (a b) nil (a b c) nil (a b c) #t (a b c) nil (a b c) nil (a b c) #t nil #t (a b) nil (a b c . d) nil (a b c . d) nil (a b c . d) #t (a b c) nil (a b c . d))) (deftest "every, some, notevery, and notany" (list (every #'characterp "abc") (some #'= '(1 2 3 4 5) '(5 4 3 2 1)) (notevery #'< '(1 2 3 4) '(5 6 7 8) '(9 10 11 12)) (notany #'> '(1 2 3 4) '(5 6 7 8) '(9 10 11 12))) (#t #t nil #t)) (deftest "printing a symbol named ||" (prin1-to-string '||) "||") (deftest "reading escaped gensyms" (princ-to-string (list (read-from-string "#:|foo|") (read-from-string "#:||"))) "(foo )") (deftest "nested macrolets" (macrolet ((foo () ''win)) (macrolet ((foo () ''lose)) nil) (foo)) win) (deftest "reading a zero length bit vector" (prin1-to-string (read-from-string "#*")) "#*") (deftest "array-dimensions" (array-dimensions "abc") (3)) (deftest "multiple-value-setq" (let (x y z) (multiple-value-setq (x y z) (values 1 2 3)) (list x y z)) (1 2 3)) (unless (el:|featurep| 'el:|xemacs|) (deftest "rational" (rational 8.0e20) 800000000000000000000)) (unless (el:|featurep| 'el:|xemacs|) (deftest "truncate" (truncate 5075863620026369.0) 5075863620026369)) (deftest "floor and ceiling" (list (floor -1/2) (floor 1/2) (ceiling -1/2) (ceiling 1/2)) (-1 0 0 1)) (deftest "plusp and minusp" (list (plusp 1/2) (plusp 100000000000000000/3) (plusp -100000000000000000/3) (minusp 100000000000000000/3) (minusp -100000000000000000/3)) (#t #t nil nil #t)) (deftest "logand, logior, and logxor" (list (logand 8236387328762348762138787623487 1234978634857634056) (logior 8236387328762348762138787623487 1234978634857634056) (logxor 8236387328762348762138787623487 1234978634857634056)) (72761281498746888 8236387328763510979492146510655 8236387328763438218210647763767)) (deftest "typep" (list (typep 42 '(unsigned-byte 9)) (typep #() 'vector) (typep #() '(vector *)) (typep #() '(vector t)) (typep #() '(vector bit)) (typep #() '(vector * 0)) (typep #() '(vector * 1)) (typep #() 'array) (typep #() '(array *)) (typep #() '(array * *)) (typep #() '(array * 1)) (typep #() '(array * (*))) (typep #() '(array * (0))) (typep #() '(array * (1)))) (#t #t #t #t nil #t nil #t #t #t #t #t #t nil)) (deftest "expt" (expt 1/2 -1) 2) (deftest "length" (length (make-array 3 :adjustable t)) 3) (deftest "compile-file" (progn (with-open-file (f "temporary.lisp" :direction :output) (format f "(defun foo () #*11111111111010110101)~@ (defvar *bar* '#1=(1 . 1))~@ (defun bar () (let ((*bar* t)) (foo)))~@ (defvar *baz* #'foo)")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc") (bar)) (mapc #'delete-file '("temporary.lisp" "temporary.elc")) (foo)) #*11111111111010110101) (deftest "symbol-macrolet" (symbol-macrolet ((x y)) (let ((y nil)) (setf x 42) y)) 42) (deftest "not and null" (list (not nil) (null nil)) (t t)) (deftest "nested handler-bind" (block foo (handler-bind ((error (lambda (c) (return-from foo 'lose)))) (handler-bind ((error (lambda (c) (return-from foo 'win)))) (error "error")))) win) (deftest "load-time-value" (list (load-time-value (list 1 2 3)) (progn (fmakunbound '*value*) (with-open-file (f "temporary.lisp" :direction :output) (format f "(defparameter *value* (list 1 2 3))~@ (defparameter *load-time-value*~@ (load-time-value *value*))")) (let ((*compile-print* nil) (*compile-verbose* nil) (*load-print* nil) (*load-verbose* nil)) (compile-file "temporary.lisp") (load "temporary.elc")) *load-time-value*)) ((1 2 3) (1 2 3))) (deftest "complement" (list (funcall (complement (lambda () t))) (funcall (complement #'zerop) 0) (funcall (complement '=) 1 1)) (nil nil nil)) (deftest "defclass" (let ((foo-class (defclass foo () ())) (bar-class (defclass bar (foo) () ())) (foo-instance (make-instance 'foo)) (bar-instance (make-instance 'bar))) (and (typep foo-class t) (typep foo-class 'standard-class) (typep foo-instance t) (typep foo-instance 'standard-object) (typep foo-instance 'foo) (typep bar-class t) (typep bar-class 'standard-class) (typep bar-instance t) (typep bar-instance 'standard-object) (typep bar-instance 'foo) (typep bar-instance 'bar))) #t) (deftest "slot-value" (let ((test-class (defclass test () (x y))) (test-instance (make-instance 'test))) (and (slot-exists-p test-instance 'x) (slot-exists-p test-instance 'y) (not (slot-exists-p test-instance 'z)) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)) (setf (slot-value test-instance 'x) 42) (slot-boundp test-instance 'x) (not (slot-boundp test-instance 'y)) (eql (slot-value test-instance 'x) 42) (slot-makunbound test-instance 'x) (not (slot-boundp test-instance 'x)) (not (slot-boundp test-instance 'y)))) t) (deftest "find-symbol" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ()))) (use-package foo-package bar-package) (use-package bar-package foo-package) (prog1 (find-symbol "foo" foo-package) (unuse-package foo-package bar-package) (delete-package foo-package) (delete-package bar-package))) nil) (deftest "shadowing-import" (let* ((foo-package (make-package "foo" :use ())) (bar-package (make-package "bar" :use ())) (baz-package (make-package "baz" :use '("foo"))) (foo-x (intern "x" foo-package)) (bar-x (intern "x" bar-package))) (shadowing-import foo-x bar-package) (shadowing-import foo-x baz-package) (prog1 (and (eq (find-symbol "x" "foo") (find-symbol "x" "bar")) (eq (find-symbol "x" "foo") (find-symbol "x" "baz"))) (delete-package baz-package) (delete-package bar-package) (delete-package foo-package))) #t) (deftest "defconstant" (progn (makunbound '+foo+) (fmakunbound 'foo) (defconstant +foo+ '(1 . 2)) (defun foo () +foo+) (foo)) (1 . 2)) (deftest "parsing function bodies" (macrolet ((test-bodies () `(list ,@(let ((result nil)) (dolist (decl1 '(nil ((declare (optimize speed))))) (dolist (doc '(nil ("doc"))) (dolist (decl2 '(nil ((declare (special *package*))))) (dolist (form '(nil ("str") (42))) (push `(let ((fn (lambda () ,@decl1 ,@doc ,@decl2 ,@form))) (list (funcall fn) (documentation fn t))) result))))) (nreverse result))))) (test-bodies)) ((nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc") (nil nil) ("str" nil) (42 nil) (nil nil) ("str" nil) (42 nil) ("doc" nil) ("str" "doc") (42 "doc") (nil "doc") ("str" "doc") (42 "doc"))) (deftest "coerce" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (object (list list vector string)) (dolist (type '(list vector simple-vector string simple-string)) (push (coerce object type) result))) (nreverse result)) ((#\a #\b) #(#\a #\b) #(#\a #\b) "ab" "ab" (#\c #\d) #(#\c #\d) #(#\c #\d) "cd" "cd" (#\e #\f) "ef" "ef" "ef" "ef")) (deftest "make-sequence" (list (make-sequence 'list 2 :initial-element t) (make-sequence 'simple-bit-vector 2 :initial-element 1) (make-sequence 'simple-string 2 :initial-element #\a) (make-sequence 'simple-vector 2 :initial-element t)) ((t t) #*11 "aa" #(t t))) (deftest "concatenate" (let ((list '(#\a #\b)) (vector #(#\c #\d)) (string "ef") (result nil)) (dolist (type '(list vector simple-vector string simple-string)) (push (concatenate type list vector string) result)) (nreverse result)) ((#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) #(#\a #\b #\c #\d #\e #\f) "abcdef" "abcdef")) (deftest "subtypep" (list ;; These should be subtypes. (loop for (t1 t2) on '((simple-vector 3) sequence integer number (integer 1 3) number null symbol) by #'cddr unless (subtypep t1 t2) collect (list t1 t2)) ;; These should not be subtypes. (loop for (t1 t2) on '(simple-vector string) by #'cddr when (subtypep t1 t2) collect (list t1 t2)) ;; These should be type-equal. (loop for (t1 t2) on '((or fixnum bignum) integer (or integer ratio) rational (or rational float) real (or real complex) number (or null cons) list (or list vector) sequence (array * (*)) vector (simple-array t (3 4)) (and (array t (3 *)) (simple-array * (* 4)))) by #'cddr unless (and (subtypep t1 t2) (subtypep t2 t1)) collect (list t1 t2))) (nil nil nil)) (deftest "flet and labels" (macrolet ((test (flet) `(,flet ((foo () 42)) (list (functionp #'foo) (foo))))) (list (test flet) (test labels) (labels ((foo () #'foo)) (eq #'foo (foo))))) ((#t 42) (#t 42) #t)) (defmacro foo1 (&whole w) (cdr w)) (defmacro foo2 (&whole w x) `(cons ',x ',w)) (defmacro foo3 (&rest x) `',x) (deftest "defmacro" (list (foo1 . 42) (foo2 42) (foo3 . 42) (foo3 42)) (42 (42 foo2 42) 42 (42))) (define-compiler-macro bar1 (&whole w) `',w) (define-compiler-macro bar2 (&whole w x) `'(,x . ,w)) (define-compiler-macro bar3 (&rest x) `',x) (define-compiler-macro (setf bar4) (&whole w) `',w) (deftest "define-compiler-macro" (funcall (compile nil '(lambda () (list (bar1 42) (funcall #'bar1 42) (bar2 42) (funcall 'bar2 42) (bar3 42) (funcall #'bar3 42) (funcall #'(setf bar4) 42))))) ((bar1 42) (funcall #'bar1 42) (42 bar2 42) (42 funcall 'bar2 42) (42) (42) (funcall #'(setf bar4) 42))) (deftest "string-left-trim and string-right-trim" (list (string-left-trim " " " foo ") (string-left-trim '(#\O #\F) 'foobar) (string-left-trim " " " ") (string-right-trim " " " foo ") (string-right-trim '(#\A #\R) 'foobar) (string-right-trim " " " ")) ("foo " "BAR" "" " foo" "FOOB" "")) (deftest "string comparisons" (mapcar (lambda (fn) (mapcar fn '("ab" "abc" "abcd") '("abc" "abc" "abc"))) (list #'string< #'string> #'string<= #'string>=)) ((2 nil nil) (nil nil 3) (2 3 nil) (nil 3 3))) ; (unless (or (= *emacs-version* 20) ; (el:|featurep| 'el:|xemacs|)) ; (deftest "printing circular structures" ; (mapcar (rcurry #'write-to-string :circle t) ; (list ; (let ((x (list 1 2 3))) (setf (cdddr x) x)) ; (let ((x (list 1 2 3))) (setf (car x) x)) ; (let ((x (list 1 2 3))) (setf (second x) (cddr x)) x) ; (let ((x (cons t t))) (setf (car x) (setf (cdr x) x))))) ; ("#1=(1 2 3 . #1#)" "#1=(#1# 2 3)" "(1 #1=(3) . #1#)" "#1=(#1# . #1#)"))) (format t "~&~@ All tests completed.~@ ~@ PASS: ~D~@ FAIL evaluation: ~D~@ FAIL compilation: ~D~@ FAIL execution: ~D~%~%" *pass* *fail-eval* *fail-comp* *fail-exe*)
[ { "context": ";;;\n;;;\n;; @file use-intrp.lisp\n;; @author Mitch Richling <https://www.mitchr.me>\n;; @brief Polynomial ", "end": 307, "score": 0.9998844861984253, "start": 293, "tag": "NAME", "value": "Mitch Richling" }, { "context": "rblock\n;; Copyright (c) 1997,1998,2004,2013,2015, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved.\n;;\n;", "end": 524, "score": 0.9998854994773865, "start": 503, "tag": "NAME", "value": "Mitchell Jay Richling" }, { "context": "e's algorithm with minor enhancements suggested by Stoer & Bulirsch (2002). Storage and CPU consumption ar", "end": 3616, "score": 0.9997437000274658, "start": 3611, "tag": "NAME", "value": "Stoer" }, { "context": "rithm with minor enhancements suggested by Stoer & Bulirsch (2002). Storage and CPU consumption are both O(1)", "end": 3627, "score": 0.9960589408874512, "start": 3619, "tag": "NAME", "value": "Bulirsch" }, { "context": "e and CPU consumption are both O(1).\n\nReference:\n Josef Stoer & Roland Bulirsch (2002); Introduction to numeric", "end": 3704, "score": 0.999847412109375, "start": 3693, "tag": "NAME", "value": "Josef Stoer" }, { "context": "umption are both O(1).\n\nReference:\n Josef Stoer & Roland Bulirsch (2002); Introduction to numerical analysis; Sprin", "end": 3722, "score": 0.9998688101768494, "start": 3707, "tag": "NAME", "value": "Roland Bulirsch" } ]
use-intrp.lisp
richmit/mjrcalc
17
;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;; @file use-intrp.lisp ;; @author Mitch Richling <https://www.mitchr.me> ;; @brief Polynomial interpolation.@EOL ;; @std Common Lisp ;; @see tst-intrp.lisp ;; @copyright ;; @parblock ;; Copyright (c) 1997,1998,2004,2013,2015, Mitchell Jay Richling <https://www.mitchr.me> All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ;; ;; 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation ;; and/or other materials provided with the distribution. ;; ;; 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;; @endparblock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defpackage :MJR_INTRP (:USE :COMMON-LISP :MJR_NUMU :MJR_CMP :MJR_VVEC) (:DOCUMENTATION "Brief: Polynomial interpolation.;") (:EXPORT #:mjr_intrp_help #:mjr_intrp_poly-val #:mjr_intrp_poly #:mjr_intrp_lfip ;; Not exported ;; #:mjr_intrp_poly-val-neville ;; #:mjr_intrp_poly-newton )) (in-package :MJR_INTRP) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_help () "Help for MJR_INTRP: Polynomial interpolation" (documentation 'mjr_intrp_help 'function)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val-neville (x x-data y-data) "Evaluate the polynomial interpolating X-DATA/Y-DATA at the point X. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: Based based upon Neville's algorithm with minor enhancements suggested by Stoer & Bulirsch (2002). Storage and CPU consumption are both O(1). Reference: Josef Stoer & Roland Bulirsch (2002); Introduction to numerical analysis; Springer; pp 42" (let ((tmp (copy-seq y-data)) (len (length y-data))) (loop for i from 1 upto (1- len) finally (return (aref tmp 0)) do (loop for j from (1- i) downto 0 for tj1 = (aref tmp (1+ j)) for xi = (aref x-data i) do (setf (aref tmp j) (+ tj1 (/ (* (- tj1 (aref tmp j)) (- x xi)) (- xi (elt x-data j))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val (x x-data y-data &optional use-points) "Return interpolating polynomial value at X. If the number of data points in Y-DATA outnumber the X-DATA points, then X-DATA is assumed to contain only TWO data points representing the minimum x data value and the maximum x data value, any remaining elements of X-DATA are ignored, and the x data used in the computation is COMPUTED on a regular grid the length Y-DATA. USE-POINTS is used to specify the number of data points to use for the interpolation. If it is less than the length of Y-DATA, then the closest USE-POINTS points to X will be selected in order to perform the interpolation. NOTE: If :use-points is 2, then this can be used to produce the piecewise linear interpolation function." (let* ((y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (leny (length y-data)) (x-data (if (< (length x-data) leny) (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len leny)) (if (vectorp x-data) x-data (concatenate 'vector x-data)))) (lenx (length x-data))) (cond ((< leny lenx) (error "mjr_intrp_poly-val: Not enough Y data points!")) ((< leny 1) (error "mjr_intrp_poly-val: No Y data points!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< leny use-points)) (error "mjr_intrp_poly-val: use-points value is too large!"))) (if (= 1 leny) (aref y-data 0) (if (and use-points (< use-points leny)) (let* ((xmini (min (or (mjr_vvec_map-mini (list :points x-data :map-fun (lambda (xi) (and (mjr_cmp_> x xi) (mjr_numu_absdif xi x))))) 0) (- leny use-points))) (xminx (aref x-data xmini))) (if (mjr_cmp_= xminx x) (aref y-data xmini) (mjr_intrp_poly-val-neville x (subseq x-data xmini (+ xmini use-points)) (subseq y-data xmini (+ xmini use-points))))) (mjr_intrp_poly-val-neville x x-data y-data))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-newton (x-data y-data) "Compute the interpolating polynomial for the given data. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: The implementation of this function first computes the Newton polynomial via the solution of a lower-triangular, Vandermonde-like system, and then transforms the Newton polynomial into the interpolating polynomial in the standard power basis. Storage and CPU consumption are O(n^2)." (let* ((len (length x-data)) (np (copy-seq y-data))) ;; Compute the newton polynomial (->np) (let ((a (make-array (list len len)))) ;; Construct Vandermonde-like matrix against the basis for the Newton form of interpolating polynomial (->a) ;; The upper triangular part of A is never used, so we never initialize it. ;; We don't use mjr_mat_make-from-func: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (setf (aref a row 0) 1)) (loop for col from 1 upto (1- len) for xc = (aref x-data (1- col)) do (loop for row from col upto (1- len) for x = (aref x-data row) do (setf (aref a row col) (* (aref a row (1- col)) (- x xc))))) ;; Solve a*np=y with substitution (->np) ;; We don't use mjr_mat_solve-sys-sub: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (loop for col from 0 upto (1- row) do (decf (aref np row) (* (aref np col) (aref a row col)))) do (setf (aref np row) (/ (aref np row) (aref a row row))))) ;; Compute and return the interpolating polynomial in the power basis form (let ((b (make-array len :initial-element 0)) (p (make-array len :initial-element 0))) ;; Iteratively compute the Newton basis polynomials (->b), and the power basis form (->p) ;; We don't use mjr_poly_* & mjr_poly_+: 1) for speed (loop for i from 0 upto (1- len) for ii from (1- len) downto 1 ;; Set the first b & p initially (setf (aref b (1- len)) 1 (aref p (1- len)) (* (aref np 0))) ;; Compute next b do (setf (aref b (- ii 1)) (aref b ii)) do (loop for jj from ii upto (- len 2) do (setf (aref b jj) (- (aref b (1+ jj)) (* (aref x-data i) (aref b jj))))) do (setf (aref b (1- len)) (* (aref b (1- len)) (- (aref x-data i)))) ;; Update p do (loop for j from 0 upto (1- len) do (incf (aref p j) (* (aref np (1+ i)) (aref b j))))) p))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly (x-data y-data &key start end) "Compute the interpolating polynomial for the given data." (let* ((len (length y-data)) (x-data (if (vectorp x-data) (if (= (length x-data) len) x-data (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len len))) (concatenate 'vector x-data))) (y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (poly (if (or start end) (let ((start (or start 0)) (end (or end (1- (length y-data))))) (mjr_intrp_poly-newton (subseq x-data start (1+ end)) (subseq y-data start (1+ end)))) (mjr_intrp_poly-newton x-data y-data)))) (subseq poly (or (position-if #'mjr_cmp_!=0 poly) 0)))) ;; remove leading zeros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_lfip (i x-data) "Compute the i'th (0-based) LFIP (Lagrange Fundamental Interpolating Polynomial) The LFIP is 0 on all the x values except the i'th one -- it is 1 on that x value." (let* ((y-data (make-array (length x-data) :initial-element 0))) (setf (svref y-data i) 1) (mjr_intrp_poly x-data y-data)))
92624
;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;; @file use-intrp.lisp ;; @author <NAME> <https://www.mitchr.me> ;; @brief Polynomial interpolation.@EOL ;; @std Common Lisp ;; @see tst-intrp.lisp ;; @copyright ;; @parblock ;; Copyright (c) 1997,1998,2004,2013,2015, <NAME> <https://www.mitchr.me> All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ;; ;; 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation ;; and/or other materials provided with the distribution. ;; ;; 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;; @endparblock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defpackage :MJR_INTRP (:USE :COMMON-LISP :MJR_NUMU :MJR_CMP :MJR_VVEC) (:DOCUMENTATION "Brief: Polynomial interpolation.;") (:EXPORT #:mjr_intrp_help #:mjr_intrp_poly-val #:mjr_intrp_poly #:mjr_intrp_lfip ;; Not exported ;; #:mjr_intrp_poly-val-neville ;; #:mjr_intrp_poly-newton )) (in-package :MJR_INTRP) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_help () "Help for MJR_INTRP: Polynomial interpolation" (documentation 'mjr_intrp_help 'function)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val-neville (x x-data y-data) "Evaluate the polynomial interpolating X-DATA/Y-DATA at the point X. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: Based based upon Neville's algorithm with minor enhancements suggested by <NAME> & <NAME> (2002). Storage and CPU consumption are both O(1). Reference: <NAME> & <NAME> (2002); Introduction to numerical analysis; Springer; pp 42" (let ((tmp (copy-seq y-data)) (len (length y-data))) (loop for i from 1 upto (1- len) finally (return (aref tmp 0)) do (loop for j from (1- i) downto 0 for tj1 = (aref tmp (1+ j)) for xi = (aref x-data i) do (setf (aref tmp j) (+ tj1 (/ (* (- tj1 (aref tmp j)) (- x xi)) (- xi (elt x-data j))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val (x x-data y-data &optional use-points) "Return interpolating polynomial value at X. If the number of data points in Y-DATA outnumber the X-DATA points, then X-DATA is assumed to contain only TWO data points representing the minimum x data value and the maximum x data value, any remaining elements of X-DATA are ignored, and the x data used in the computation is COMPUTED on a regular grid the length Y-DATA. USE-POINTS is used to specify the number of data points to use for the interpolation. If it is less than the length of Y-DATA, then the closest USE-POINTS points to X will be selected in order to perform the interpolation. NOTE: If :use-points is 2, then this can be used to produce the piecewise linear interpolation function." (let* ((y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (leny (length y-data)) (x-data (if (< (length x-data) leny) (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len leny)) (if (vectorp x-data) x-data (concatenate 'vector x-data)))) (lenx (length x-data))) (cond ((< leny lenx) (error "mjr_intrp_poly-val: Not enough Y data points!")) ((< leny 1) (error "mjr_intrp_poly-val: No Y data points!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< leny use-points)) (error "mjr_intrp_poly-val: use-points value is too large!"))) (if (= 1 leny) (aref y-data 0) (if (and use-points (< use-points leny)) (let* ((xmini (min (or (mjr_vvec_map-mini (list :points x-data :map-fun (lambda (xi) (and (mjr_cmp_> x xi) (mjr_numu_absdif xi x))))) 0) (- leny use-points))) (xminx (aref x-data xmini))) (if (mjr_cmp_= xminx x) (aref y-data xmini) (mjr_intrp_poly-val-neville x (subseq x-data xmini (+ xmini use-points)) (subseq y-data xmini (+ xmini use-points))))) (mjr_intrp_poly-val-neville x x-data y-data))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-newton (x-data y-data) "Compute the interpolating polynomial for the given data. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: The implementation of this function first computes the Newton polynomial via the solution of a lower-triangular, Vandermonde-like system, and then transforms the Newton polynomial into the interpolating polynomial in the standard power basis. Storage and CPU consumption are O(n^2)." (let* ((len (length x-data)) (np (copy-seq y-data))) ;; Compute the newton polynomial (->np) (let ((a (make-array (list len len)))) ;; Construct Vandermonde-like matrix against the basis for the Newton form of interpolating polynomial (->a) ;; The upper triangular part of A is never used, so we never initialize it. ;; We don't use mjr_mat_make-from-func: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (setf (aref a row 0) 1)) (loop for col from 1 upto (1- len) for xc = (aref x-data (1- col)) do (loop for row from col upto (1- len) for x = (aref x-data row) do (setf (aref a row col) (* (aref a row (1- col)) (- x xc))))) ;; Solve a*np=y with substitution (->np) ;; We don't use mjr_mat_solve-sys-sub: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (loop for col from 0 upto (1- row) do (decf (aref np row) (* (aref np col) (aref a row col)))) do (setf (aref np row) (/ (aref np row) (aref a row row))))) ;; Compute and return the interpolating polynomial in the power basis form (let ((b (make-array len :initial-element 0)) (p (make-array len :initial-element 0))) ;; Iteratively compute the Newton basis polynomials (->b), and the power basis form (->p) ;; We don't use mjr_poly_* & mjr_poly_+: 1) for speed (loop for i from 0 upto (1- len) for ii from (1- len) downto 1 ;; Set the first b & p initially (setf (aref b (1- len)) 1 (aref p (1- len)) (* (aref np 0))) ;; Compute next b do (setf (aref b (- ii 1)) (aref b ii)) do (loop for jj from ii upto (- len 2) do (setf (aref b jj) (- (aref b (1+ jj)) (* (aref x-data i) (aref b jj))))) do (setf (aref b (1- len)) (* (aref b (1- len)) (- (aref x-data i)))) ;; Update p do (loop for j from 0 upto (1- len) do (incf (aref p j) (* (aref np (1+ i)) (aref b j))))) p))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly (x-data y-data &key start end) "Compute the interpolating polynomial for the given data." (let* ((len (length y-data)) (x-data (if (vectorp x-data) (if (= (length x-data) len) x-data (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len len))) (concatenate 'vector x-data))) (y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (poly (if (or start end) (let ((start (or start 0)) (end (or end (1- (length y-data))))) (mjr_intrp_poly-newton (subseq x-data start (1+ end)) (subseq y-data start (1+ end)))) (mjr_intrp_poly-newton x-data y-data)))) (subseq poly (or (position-if #'mjr_cmp_!=0 poly) 0)))) ;; remove leading zeros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_lfip (i x-data) "Compute the i'th (0-based) LFIP (Lagrange Fundamental Interpolating Polynomial) The LFIP is 0 on all the x values except the i'th one -- it is 1 on that x value." (let* ((y-data (make-array (length x-data) :initial-element 0))) (setf (svref y-data i) 1) (mjr_intrp_poly x-data y-data)))
true
;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;; @file use-intrp.lisp ;; @author PI:NAME:<NAME>END_PI <https://www.mitchr.me> ;; @brief Polynomial interpolation.@EOL ;; @std Common Lisp ;; @see tst-intrp.lisp ;; @copyright ;; @parblock ;; Copyright (c) 1997,1998,2004,2013,2015, PI:NAME:<NAME>END_PI <https://www.mitchr.me> All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ;; ;; 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation ;; and/or other materials provided with the distribution. ;; ;; 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software ;; without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;; @endparblock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defpackage :MJR_INTRP (:USE :COMMON-LISP :MJR_NUMU :MJR_CMP :MJR_VVEC) (:DOCUMENTATION "Brief: Polynomial interpolation.;") (:EXPORT #:mjr_intrp_help #:mjr_intrp_poly-val #:mjr_intrp_poly #:mjr_intrp_lfip ;; Not exported ;; #:mjr_intrp_poly-val-neville ;; #:mjr_intrp_poly-newton )) (in-package :MJR_INTRP) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_help () "Help for MJR_INTRP: Polynomial interpolation" (documentation 'mjr_intrp_help 'function)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val-neville (x x-data y-data) "Evaluate the polynomial interpolating X-DATA/Y-DATA at the point X. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: Based based upon Neville's algorithm with minor enhancements suggested by PI:NAME:<NAME>END_PI & PI:NAME:<NAME>END_PI (2002). Storage and CPU consumption are both O(1). Reference: PI:NAME:<NAME>END_PI & PI:NAME:<NAME>END_PI (2002); Introduction to numerical analysis; Springer; pp 42" (let ((tmp (copy-seq y-data)) (len (length y-data))) (loop for i from 1 upto (1- len) finally (return (aref tmp 0)) do (loop for j from (1- i) downto 0 for tj1 = (aref tmp (1+ j)) for xi = (aref x-data i) do (setf (aref tmp j) (+ tj1 (/ (* (- tj1 (aref tmp j)) (- x xi)) (- xi (elt x-data j))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-val (x x-data y-data &optional use-points) "Return interpolating polynomial value at X. If the number of data points in Y-DATA outnumber the X-DATA points, then X-DATA is assumed to contain only TWO data points representing the minimum x data value and the maximum x data value, any remaining elements of X-DATA are ignored, and the x data used in the computation is COMPUTED on a regular grid the length Y-DATA. USE-POINTS is used to specify the number of data points to use for the interpolation. If it is less than the length of Y-DATA, then the closest USE-POINTS points to X will be selected in order to perform the interpolation. NOTE: If :use-points is 2, then this can be used to produce the piecewise linear interpolation function." (let* ((y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (leny (length y-data)) (x-data (if (< (length x-data) leny) (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len leny)) (if (vectorp x-data) x-data (concatenate 'vector x-data)))) (lenx (length x-data))) (cond ((< leny lenx) (error "mjr_intrp_poly-val: Not enough Y data points!")) ((< leny 1) (error "mjr_intrp_poly-val: No Y data points!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< use-points 1)) (error "mjr_intrp_poly-val: use-points value must be positive!")) ((and use-points (< leny use-points)) (error "mjr_intrp_poly-val: use-points value is too large!"))) (if (= 1 leny) (aref y-data 0) (if (and use-points (< use-points leny)) (let* ((xmini (min (or (mjr_vvec_map-mini (list :points x-data :map-fun (lambda (xi) (and (mjr_cmp_> x xi) (mjr_numu_absdif xi x))))) 0) (- leny use-points))) (xminx (aref x-data xmini))) (if (mjr_cmp_= xminx x) (aref y-data xmini) (mjr_intrp_poly-val-neville x (subseq x-data xmini (+ xmini use-points)) (subseq y-data xmini (+ xmini use-points))))) (mjr_intrp_poly-val-neville x x-data y-data))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly-newton (x-data y-data) "Compute the interpolating polynomial for the given data. NOTE: This is a raw algorithmic function intended for internal use by other functions -- not interactively. Not Exported. Implementation notes: The implementation of this function first computes the Newton polynomial via the solution of a lower-triangular, Vandermonde-like system, and then transforms the Newton polynomial into the interpolating polynomial in the standard power basis. Storage and CPU consumption are O(n^2)." (let* ((len (length x-data)) (np (copy-seq y-data))) ;; Compute the newton polynomial (->np) (let ((a (make-array (list len len)))) ;; Construct Vandermonde-like matrix against the basis for the Newton form of interpolating polynomial (->a) ;; The upper triangular part of A is never used, so we never initialize it. ;; We don't use mjr_mat_make-from-func: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (setf (aref a row 0) 1)) (loop for col from 1 upto (1- len) for xc = (aref x-data (1- col)) do (loop for row from col upto (1- len) for x = (aref x-data row) do (setf (aref a row col) (* (aref a row (1- col)) (- x xc))))) ;; Solve a*np=y with substitution (->np) ;; We don't use mjr_mat_solve-sys-sub: 1) don't want to depend on it, 2) for speed (loop for row from 0 upto (1- len) do (loop for col from 0 upto (1- row) do (decf (aref np row) (* (aref np col) (aref a row col)))) do (setf (aref np row) (/ (aref np row) (aref a row row))))) ;; Compute and return the interpolating polynomial in the power basis form (let ((b (make-array len :initial-element 0)) (p (make-array len :initial-element 0))) ;; Iteratively compute the Newton basis polynomials (->b), and the power basis form (->p) ;; We don't use mjr_poly_* & mjr_poly_+: 1) for speed (loop for i from 0 upto (1- len) for ii from (1- len) downto 1 ;; Set the first b & p initially (setf (aref b (1- len)) 1 (aref p (1- len)) (* (aref np 0))) ;; Compute next b do (setf (aref b (- ii 1)) (aref b ii)) do (loop for jj from ii upto (- len 2) do (setf (aref b jj) (- (aref b (1+ jj)) (* (aref x-data i) (aref b jj))))) do (setf (aref b (1- len)) (* (aref b (1- len)) (- (aref x-data i)))) ;; Update p do (loop for j from 0 upto (1- len) do (incf (aref p j) (* (aref np (1+ i)) (aref b j))))) p))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_poly (x-data y-data &key start end) "Compute the interpolating polynomial for the given data." (let* ((len (length y-data)) (x-data (if (vectorp x-data) (if (= (length x-data) len) x-data (mjr_vvec_to-vec (list :start (elt x-data 0) :end (elt x-data 1) :len len))) (concatenate 'vector x-data))) (y-data (if (vectorp y-data) y-data (concatenate 'vector y-data))) (poly (if (or start end) (let ((start (or start 0)) (end (or end (1- (length y-data))))) (mjr_intrp_poly-newton (subseq x-data start (1+ end)) (subseq y-data start (1+ end)))) (mjr_intrp_poly-newton x-data y-data)))) (subseq poly (or (position-if #'mjr_cmp_!=0 poly) 0)))) ;; remove leading zeros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mjr_intrp_lfip (i x-data) "Compute the i'th (0-based) LFIP (Lagrange Fundamental Interpolating Polynomial) The LFIP is 0 on all the x values except the i'th one -- it is 1 on that x value." (let* ((y-data (make-array (length x-data) :initial-element 0))) (setf (svref y-data i) 1) (mjr_intrp_poly x-data y-data)))
[ { "context": ":raw-binding-ncurses\n :description \"\"\n :author \"Andreas Ruscheinski <[email protected]>\"\n :license \"MIT", "end": 86, "score": 0.99986332654953, "start": 67, "tag": "NAME", "value": "Andreas Ruscheinski" }, { "context": " :description \"\"\n :author \"Andreas Ruscheinski <[email protected]>\"\n :license \"MIT\"\n :version \"0.0.1\"\n :serial ", "end": 117, "score": 0.9999322295188904, "start": 88, "tag": "EMAIL", "value": "[email protected]" }, { "context": "indings-ncurses/demo\n :description \"\"\n :author \"Andreas Ruscheinski <[email protected]>\"\n :license \"MIT", "end": 2780, "score": 0.9998900294303894, "start": 2761, "tag": "NAME", "value": "Andreas Ruscheinski" }, { "context": " :description \"\"\n :author \"Andreas Ruscheinski <[email protected]>\"\n :license \"MIT\"\n :version \"0.0.1\"\n :serial ", "end": 2811, "score": 0.9999291896820068, "start": 2782, "tag": "EMAIL", "value": "[email protected]" } ]
raw-binding-ncurses.asd
aruscher/raw-binding-ncurses
0
(asdf:defsystem #:raw-binding-ncurses :description "" :author "Andreas Ruscheinski <[email protected]>" :license "MIT" :version "0.0.1" :serial t :defsystem-depends-on ("cffi-grovel") :depends-on (:cffi) :pathname "src" :components ((:file "package") (:cffi-grovel-file "grovel-types") (:cffi-grovel-file "grovel-constants") ;; (:file "load-library") (:file "types") (:file "variables") (:file "addch") (:file "addchstr") (:file "addstr") (:file "add-wch") (:file "add-wchstr") (:file "addwstr") (:file "attr") (:file "beep") (:file "bkgd") (:file "bkgrnd") (:file "border") (:file "border-set") (:file "clear") (:file "color") (:file "default-colors") (:file "define-key") (:file "delch") (:file "deleteln") (:file "extend") (:file "getcchar") (:file "getch") (:file "getstr") (:file "get-wch") (:file "get-wstr") ;;(:cffi-wrapper-file "getyx-wrapper") (:file "inch") (:file "inchstr") (:file "initscr") (:file "inopts") (:file "insch") (:file "insstr") (:file "instr") (:file "ins-wch") (:file "ins-wstr") (:file "in-wch") (:file "in-wchstr") (:file "inwstr") (:file "kernel") (:file "keybound") (:file "key-defined") (:file "keyok") (:file "legacy") (:file "legacy-coding") (:file "memleaks") (:file "mouse") (:file "move") (:file "new-pair") (:file "opaque") (:file "outopts") (:file "overlay") (:file "pad") (:file "print") (:file "printw") (:file "refresh") (:file "resizeterm") (:file "scanw") (:file "scr-dump") (:file "scroll") (:file "slk") (:file "termattrs") (:file "termcap") (:file "terminfo") (:file "touch") (:file "util") (:file "window") (:file "wresize"))) (asdf:defsystem #:raw-bindings-ncurses/demo :description "" :author "Andreas Ruscheinski <[email protected]>" :license "MIT" :version "0.0.1" :serial t :depends-on ("raw-bindings-ncurses") :pathname "demo" :components ( (:file "initialization") (:file "output-functions") (:file "input-functions")))
40436
(asdf:defsystem #:raw-binding-ncurses :description "" :author "<NAME> <<EMAIL>>" :license "MIT" :version "0.0.1" :serial t :defsystem-depends-on ("cffi-grovel") :depends-on (:cffi) :pathname "src" :components ((:file "package") (:cffi-grovel-file "grovel-types") (:cffi-grovel-file "grovel-constants") ;; (:file "load-library") (:file "types") (:file "variables") (:file "addch") (:file "addchstr") (:file "addstr") (:file "add-wch") (:file "add-wchstr") (:file "addwstr") (:file "attr") (:file "beep") (:file "bkgd") (:file "bkgrnd") (:file "border") (:file "border-set") (:file "clear") (:file "color") (:file "default-colors") (:file "define-key") (:file "delch") (:file "deleteln") (:file "extend") (:file "getcchar") (:file "getch") (:file "getstr") (:file "get-wch") (:file "get-wstr") ;;(:cffi-wrapper-file "getyx-wrapper") (:file "inch") (:file "inchstr") (:file "initscr") (:file "inopts") (:file "insch") (:file "insstr") (:file "instr") (:file "ins-wch") (:file "ins-wstr") (:file "in-wch") (:file "in-wchstr") (:file "inwstr") (:file "kernel") (:file "keybound") (:file "key-defined") (:file "keyok") (:file "legacy") (:file "legacy-coding") (:file "memleaks") (:file "mouse") (:file "move") (:file "new-pair") (:file "opaque") (:file "outopts") (:file "overlay") (:file "pad") (:file "print") (:file "printw") (:file "refresh") (:file "resizeterm") (:file "scanw") (:file "scr-dump") (:file "scroll") (:file "slk") (:file "termattrs") (:file "termcap") (:file "terminfo") (:file "touch") (:file "util") (:file "window") (:file "wresize"))) (asdf:defsystem #:raw-bindings-ncurses/demo :description "" :author "<NAME> <<EMAIL>>" :license "MIT" :version "0.0.1" :serial t :depends-on ("raw-bindings-ncurses") :pathname "demo" :components ( (:file "initialization") (:file "output-functions") (:file "input-functions")))
true
(asdf:defsystem #:raw-binding-ncurses :description "" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "MIT" :version "0.0.1" :serial t :defsystem-depends-on ("cffi-grovel") :depends-on (:cffi) :pathname "src" :components ((:file "package") (:cffi-grovel-file "grovel-types") (:cffi-grovel-file "grovel-constants") ;; (:file "load-library") (:file "types") (:file "variables") (:file "addch") (:file "addchstr") (:file "addstr") (:file "add-wch") (:file "add-wchstr") (:file "addwstr") (:file "attr") (:file "beep") (:file "bkgd") (:file "bkgrnd") (:file "border") (:file "border-set") (:file "clear") (:file "color") (:file "default-colors") (:file "define-key") (:file "delch") (:file "deleteln") (:file "extend") (:file "getcchar") (:file "getch") (:file "getstr") (:file "get-wch") (:file "get-wstr") ;;(:cffi-wrapper-file "getyx-wrapper") (:file "inch") (:file "inchstr") (:file "initscr") (:file "inopts") (:file "insch") (:file "insstr") (:file "instr") (:file "ins-wch") (:file "ins-wstr") (:file "in-wch") (:file "in-wchstr") (:file "inwstr") (:file "kernel") (:file "keybound") (:file "key-defined") (:file "keyok") (:file "legacy") (:file "legacy-coding") (:file "memleaks") (:file "mouse") (:file "move") (:file "new-pair") (:file "opaque") (:file "outopts") (:file "overlay") (:file "pad") (:file "print") (:file "printw") (:file "refresh") (:file "resizeterm") (:file "scanw") (:file "scr-dump") (:file "scroll") (:file "slk") (:file "termattrs") (:file "termcap") (:file "terminfo") (:file "touch") (:file "util") (:file "window") (:file "wresize"))) (asdf:defsystem #:raw-bindings-ncurses/demo :description "" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "MIT" :version "0.0.1" :serial t :depends-on ("raw-bindings-ncurses") :pathname "demo" :components ( (:file "initialization") (:file "output-functions") (:file "input-functions")))
[ { "context": "upyter: a Common Lisp Jupyter kernel\n(C) 2019-2020 Tarn Burton (MIT)\"\n :language-name \"common-lisp\"\n :lang", "end": 536, "score": 0.9998626708984375, "start": 525, "tag": "NAME", "value": "Tarn Burton" }, { "context": " #+clasp (\"CLASP Website\" . \"https://github.com/clasp-developers/clasp\")\n #+clisp (\"CLISP Website", "end": 1384, "score": 0.9986402988433838, "start": 1368, "tag": "USERNAME", "value": "clasp-developers" } ]
src/cl-jupyter/kernel.lisp
cranebird/common-lisp-jupyter
1
(in-package #:common-lisp-jupyter) (defvar +display-name+ "Common Lisp") (defvar +language+ "common-lisp") (defvar +eval-flag+ #+clisp "-x" #+(or mkcl cmucl) "-eval" #-(or clisp cmucl mkcl) "--eval") (defvar +load-flag+ #+clisp "-i" #+(or mkcl cmucl) "-load" #-(or clisp cmucl mkcl) "--load") (defclass kernel (jupyter:kernel) () (:default-initargs :name "common-lisp" :package (find-package :common-lisp-user) :version "0.1" :banner "common-lisp-jupyter: a Common Lisp Jupyter kernel (C) 2019-2020 Tarn Burton (MIT)" :language-name "common-lisp" :language-version (uiop:lisp-version-string) :mime-type "text/x-common-lisp" :file-extension ".lisp" :pygments-lexer "common-lisp" :codemirror-mode "text/x-common-lisp" :help-links '(("Common Lisp Documentation" . "https://common-lisp.net/documentation") ("Common Lisp HyperSpec" . "http://www.lispworks.com/documentation/HyperSpec/Front/index.htm") ("Practical Common Lisp" . "http://www.gigamonkeys.com/book/") ("The Common Lisp Cookbook" . "https://lispcookbook.github.io/cl-cookbook/") #+abcl ("ABCL Website" . "https://common-lisp.net/project/armedbear/") #+ccl ("CCL Website" . "https://ccl.clozure.com/") #+clasp ("CLASP Website" . "https://github.com/clasp-developers/clasp") #+clisp ("CLISP Website" . "https://clisp.sourceforge.io/") #+cmucl ("CMUCL Website" . "https://common-lisp.net/project/cmucl/") #+ecl ("ECL Website" . "https://common-lisp.net/project/ecl/") #+sbcl ("SBCL Website" . "http://sbcl.org/")))) (defmethod jupyter:start :after ((k kernel)) (bordeaux-threads:make-thread (lambda () (jupyter:inform :info k "Loading CLHS map") (load-clhs-map)))) (defun my-read (&optional input-stream (eof-error-p t) eof-value recursive-p) (jupyter:handling-errors (read input-stream eof-error-p eof-value recursive-p))) (defun my-eval (expr) (jupyter:debugging-errors (setq common-lisp-user::- expr) (let ((evaluated-expr (multiple-value-list (eval expr)))) (setq common-lisp-user::*** common-lisp-user::** common-lisp-user::** common-lisp-user::* common-lisp-user::* (car evaluated-expr) common-lisp-user::/// common-lisp-user::// common-lisp-user::// common-lisp-user::/ common-lisp-user::/ evaluated-expr common-lisp-user::+++ common-lisp-user::++ common-lisp-user::++ common-lisp-user::+ common-lisp-user::+ expr) (remove nil (mapcar #'jupyter:make-lisp-result evaluated-expr))))) (defmethod jupyter:evaluate-code ((k kernel) code) (iter (for sexpr in-stream (make-string-input-stream code) using #'my-read) (when (typep sexpr 'jupyter:result) (collect sexpr) (finish)) (for result next (my-eval sexpr)) (if (listp result) (appending result) (collect result)) (until (jupyter:quit-eval-error-p result))))
14892
(in-package #:common-lisp-jupyter) (defvar +display-name+ "Common Lisp") (defvar +language+ "common-lisp") (defvar +eval-flag+ #+clisp "-x" #+(or mkcl cmucl) "-eval" #-(or clisp cmucl mkcl) "--eval") (defvar +load-flag+ #+clisp "-i" #+(or mkcl cmucl) "-load" #-(or clisp cmucl mkcl) "--load") (defclass kernel (jupyter:kernel) () (:default-initargs :name "common-lisp" :package (find-package :common-lisp-user) :version "0.1" :banner "common-lisp-jupyter: a Common Lisp Jupyter kernel (C) 2019-2020 <NAME> (MIT)" :language-name "common-lisp" :language-version (uiop:lisp-version-string) :mime-type "text/x-common-lisp" :file-extension ".lisp" :pygments-lexer "common-lisp" :codemirror-mode "text/x-common-lisp" :help-links '(("Common Lisp Documentation" . "https://common-lisp.net/documentation") ("Common Lisp HyperSpec" . "http://www.lispworks.com/documentation/HyperSpec/Front/index.htm") ("Practical Common Lisp" . "http://www.gigamonkeys.com/book/") ("The Common Lisp Cookbook" . "https://lispcookbook.github.io/cl-cookbook/") #+abcl ("ABCL Website" . "https://common-lisp.net/project/armedbear/") #+ccl ("CCL Website" . "https://ccl.clozure.com/") #+clasp ("CLASP Website" . "https://github.com/clasp-developers/clasp") #+clisp ("CLISP Website" . "https://clisp.sourceforge.io/") #+cmucl ("CMUCL Website" . "https://common-lisp.net/project/cmucl/") #+ecl ("ECL Website" . "https://common-lisp.net/project/ecl/") #+sbcl ("SBCL Website" . "http://sbcl.org/")))) (defmethod jupyter:start :after ((k kernel)) (bordeaux-threads:make-thread (lambda () (jupyter:inform :info k "Loading CLHS map") (load-clhs-map)))) (defun my-read (&optional input-stream (eof-error-p t) eof-value recursive-p) (jupyter:handling-errors (read input-stream eof-error-p eof-value recursive-p))) (defun my-eval (expr) (jupyter:debugging-errors (setq common-lisp-user::- expr) (let ((evaluated-expr (multiple-value-list (eval expr)))) (setq common-lisp-user::*** common-lisp-user::** common-lisp-user::** common-lisp-user::* common-lisp-user::* (car evaluated-expr) common-lisp-user::/// common-lisp-user::// common-lisp-user::// common-lisp-user::/ common-lisp-user::/ evaluated-expr common-lisp-user::+++ common-lisp-user::++ common-lisp-user::++ common-lisp-user::+ common-lisp-user::+ expr) (remove nil (mapcar #'jupyter:make-lisp-result evaluated-expr))))) (defmethod jupyter:evaluate-code ((k kernel) code) (iter (for sexpr in-stream (make-string-input-stream code) using #'my-read) (when (typep sexpr 'jupyter:result) (collect sexpr) (finish)) (for result next (my-eval sexpr)) (if (listp result) (appending result) (collect result)) (until (jupyter:quit-eval-error-p result))))
true
(in-package #:common-lisp-jupyter) (defvar +display-name+ "Common Lisp") (defvar +language+ "common-lisp") (defvar +eval-flag+ #+clisp "-x" #+(or mkcl cmucl) "-eval" #-(or clisp cmucl mkcl) "--eval") (defvar +load-flag+ #+clisp "-i" #+(or mkcl cmucl) "-load" #-(or clisp cmucl mkcl) "--load") (defclass kernel (jupyter:kernel) () (:default-initargs :name "common-lisp" :package (find-package :common-lisp-user) :version "0.1" :banner "common-lisp-jupyter: a Common Lisp Jupyter kernel (C) 2019-2020 PI:NAME:<NAME>END_PI (MIT)" :language-name "common-lisp" :language-version (uiop:lisp-version-string) :mime-type "text/x-common-lisp" :file-extension ".lisp" :pygments-lexer "common-lisp" :codemirror-mode "text/x-common-lisp" :help-links '(("Common Lisp Documentation" . "https://common-lisp.net/documentation") ("Common Lisp HyperSpec" . "http://www.lispworks.com/documentation/HyperSpec/Front/index.htm") ("Practical Common Lisp" . "http://www.gigamonkeys.com/book/") ("The Common Lisp Cookbook" . "https://lispcookbook.github.io/cl-cookbook/") #+abcl ("ABCL Website" . "https://common-lisp.net/project/armedbear/") #+ccl ("CCL Website" . "https://ccl.clozure.com/") #+clasp ("CLASP Website" . "https://github.com/clasp-developers/clasp") #+clisp ("CLISP Website" . "https://clisp.sourceforge.io/") #+cmucl ("CMUCL Website" . "https://common-lisp.net/project/cmucl/") #+ecl ("ECL Website" . "https://common-lisp.net/project/ecl/") #+sbcl ("SBCL Website" . "http://sbcl.org/")))) (defmethod jupyter:start :after ((k kernel)) (bordeaux-threads:make-thread (lambda () (jupyter:inform :info k "Loading CLHS map") (load-clhs-map)))) (defun my-read (&optional input-stream (eof-error-p t) eof-value recursive-p) (jupyter:handling-errors (read input-stream eof-error-p eof-value recursive-p))) (defun my-eval (expr) (jupyter:debugging-errors (setq common-lisp-user::- expr) (let ((evaluated-expr (multiple-value-list (eval expr)))) (setq common-lisp-user::*** common-lisp-user::** common-lisp-user::** common-lisp-user::* common-lisp-user::* (car evaluated-expr) common-lisp-user::/// common-lisp-user::// common-lisp-user::// common-lisp-user::/ common-lisp-user::/ evaluated-expr common-lisp-user::+++ common-lisp-user::++ common-lisp-user::++ common-lisp-user::+ common-lisp-user::+ expr) (remove nil (mapcar #'jupyter:make-lisp-result evaluated-expr))))) (defmethod jupyter:evaluate-code ((k kernel) code) (iter (for sexpr in-stream (make-string-input-stream code) using #'my-read) (when (typep sexpr 'jupyter:result) (collect sexpr) (finish)) (for result next (my-eval sexpr)) (if (listp result) (appending result) (collect result)) (until (jupyter:quit-eval-error-p result))))
[ { "context": "Weekend\n;;;;\n;;;; Written in 2021 based on work by Peter Shirley\n;;;;\n;;;; To the extent possible under law, the a", "end": 115, "score": 0.9998607635498047, "start": 102, "tag": "NAME", "value": "Peter Shirley" } ]
ray.lisp
jstoddard/rtiow
1
;;;; ray.lisp ;;;; ray class for Raytracing in One Weekend ;;;; ;;;; Written in 2021 based on work by Peter Shirley ;;;; ;;;; To the extent possible under law, the author(s) have dedicated all ;;;; copyright and related and neighboring rights to this software to the ;;;; public domain worldwide. This software is distributed without any ;;;; warranty. ;;;; ;;;; You should have received a copy of the CC0 Public Domain Dedication ;;;; along with this software. If not, see ;;;; <http://creativecommons.org/publicdomain/zero/1.0/>. (in-package #:rtiow) (defclass ray () ((origin :initarg :origin :initform (make-point) :accessor ray-origin) (direction :initarg :direction :initform (make-vec3 0.0d0 0.0d0 1.0d0) :accessor ray-direction)) (:documentation "A ray.")) (defun make-ray (&optional (origin (make-point)) (direction (make-vec3 0.0d0 0.0d0 1.0d0))) "Create a ray with given origin and direction." (make-instance 'ray :origin origin :direction direction)) (defgeneric ray-at (r s) (:documentation "Returns point along ray r at s.")) (defmethod ray-at ((r ray) s) (add-vec3 (ray-origin r) (scale-vec3 s (ray-direction r))))
19848
;;;; ray.lisp ;;;; ray class for Raytracing in One Weekend ;;;; ;;;; Written in 2021 based on work by <NAME> ;;;; ;;;; To the extent possible under law, the author(s) have dedicated all ;;;; copyright and related and neighboring rights to this software to the ;;;; public domain worldwide. This software is distributed without any ;;;; warranty. ;;;; ;;;; You should have received a copy of the CC0 Public Domain Dedication ;;;; along with this software. If not, see ;;;; <http://creativecommons.org/publicdomain/zero/1.0/>. (in-package #:rtiow) (defclass ray () ((origin :initarg :origin :initform (make-point) :accessor ray-origin) (direction :initarg :direction :initform (make-vec3 0.0d0 0.0d0 1.0d0) :accessor ray-direction)) (:documentation "A ray.")) (defun make-ray (&optional (origin (make-point)) (direction (make-vec3 0.0d0 0.0d0 1.0d0))) "Create a ray with given origin and direction." (make-instance 'ray :origin origin :direction direction)) (defgeneric ray-at (r s) (:documentation "Returns point along ray r at s.")) (defmethod ray-at ((r ray) s) (add-vec3 (ray-origin r) (scale-vec3 s (ray-direction r))))
true
;;;; ray.lisp ;;;; ray class for Raytracing in One Weekend ;;;; ;;;; Written in 2021 based on work by PI:NAME:<NAME>END_PI ;;;; ;;;; To the extent possible under law, the author(s) have dedicated all ;;;; copyright and related and neighboring rights to this software to the ;;;; public domain worldwide. This software is distributed without any ;;;; warranty. ;;;; ;;;; You should have received a copy of the CC0 Public Domain Dedication ;;;; along with this software. If not, see ;;;; <http://creativecommons.org/publicdomain/zero/1.0/>. (in-package #:rtiow) (defclass ray () ((origin :initarg :origin :initform (make-point) :accessor ray-origin) (direction :initarg :direction :initform (make-vec3 0.0d0 0.0d0 1.0d0) :accessor ray-direction)) (:documentation "A ray.")) (defun make-ray (&optional (origin (make-point)) (direction (make-vec3 0.0d0 0.0d0 1.0d0))) "Create a ray with given origin and direction." (make-instance 'ray :origin origin :direction direction)) (defgeneric ray-at (r s) (:documentation "Returns point along ray r at s.")) (defmethod ray-at ((r ray) s) (add-vec3 (ray-origin r) (scale-vec3 s (ray-direction r))))
[ { "context": "****************************\n;;;\n;;; Written by Bill Chiles.\n;;;\n\n(in-package :hemlock-internals)\n\n(export '(", "end": 432, "score": 0.9998059272766113, "start": 421, "tag": "NAME", "value": "Bill Chiles" } ]
cocoa-ide/hemlock/unused/archive/tty/tty-display.lisp
digikar99/ccl
732
;;; -*- Log: hemlock.log; Package: hemlock-internals -*- ;;; ;;; ********************************************************************** ;;; This code was written as part of the CMU Common Lisp project at ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; #+CMU (ext:file-comment "$Header$") ;;; ;;; ********************************************************************** ;;; ;;; Written by Bill Chiles. ;;; (in-package :hemlock-internals) (export '(redisplay redisplay-all define-tty-font)) ;;;; Macros. (eval-when (:compile-toplevel :execute) (defmacro tty-hunk-modeline-pos (hunk) `(tty-hunk-text-height ,hunk)) ) ;eval-when (defvar *currently-selected-hunk* nil) (defvar *hunk-top-line*) (declaim (fixnum *hunk-top-line*)) (eval-when (:compile-toplevel :execute) (defmacro select-hunk (hunk) `(unless (eq ,hunk *currently-selected-hunk*) (setf *currently-selected-hunk* ,hunk) (setf *hunk-top-line* (the fixnum (1+ (the fixnum (- (the fixnum (tty-hunk-text-position ,hunk)) (the fixnum (tty-hunk-text-height ,hunk))))))))) ) ;eval-when ;;; Screen image lines. ;;; (defstruct (si-line (:print-function print-screen-image-line) (:constructor %make-si-line (chars))) (chars nil :type simple-string) (length 0) (fonts nil :type list)) (defun make-si-line (n) (%make-si-line (make-string n))) (defun print-screen-image-line (obj str n) (declare (ignore n)) (write-string "#<Screen Image Line \"" str) (write-string (si-line-chars obj) str :end (si-line-length obj)) (write-string "\">" str)) (defun find-identical-prefix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (okay-until 0)) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len) (type (and unsigned-byte fixnum) okay-until)) (do ((dl-fonts dis-line-fonts (cdr dis-line-fonts)) (si-fonts (si-line-fonts si-line) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (let ((next-font (car (or dl-fonts si-fonts)))) (if next-font (let ((end (min dl-len si-len (cadr next-font)))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) end)) (let ((end (min dl-len si-len))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) (if (= dl-len si-len) nil end)))))) (let ((dl-font (caar dl-fonts)) (dl-start (cadar dl-fonts)) (dl-stop (cddar dl-fonts)) (si-font (caar si-fonts)) (si-start (cadar si-fonts)) (si-stop (cddar si-fonts))) (unless (and (= dl-font si-font) (= dl-start si-start)) (let ((font-lossage (min dl-start si-start))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (unless (= dl-stop si-stop) (let ((font-lossage (min dl-stop si-stop))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (let ((mismatch (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 dl-stop :end2 si-stop))) (if mismatch (return mismatch) (setf okay-until dl-stop))))))) (defun find-identical-suffix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (count (dotimes (i (min dl-len si-len) i) (when (char/= (schar dl-chars (- dl-len i 1)) (schar si-chars (- si-len i 1))) (return i))))) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len)) (do ((dl-fonts (reverse dis-line-fonts) (cdr dis-line-fonts)) (si-fonts (reverse (si-line-fonts si-line)) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (cond (dl-fonts (min (- dl-len (cddar dl-fonts)) count)) (si-fonts (min (- si-len (cddar si-fonts)) count)) (t count))) (let ((dl-font (caar dl-fonts)) (dl-start (- dl-len (cadar dl-fonts))) (dl-stop (- dl-len (cddar dl-fonts))) (si-font (caar si-fonts)) (si-start (- si-len (cadar si-fonts))) (si-stop (- si-len (cddar si-fonts)))) (unless (and (= dl-font si-font) (= dl-stop si-stop)) (return (min dl-stop si-stop count))) (unless (= dl-start si-start) (return (min dl-start si-start count))) (when (<= count dl-start) (return count)))))) (defmacro si-line (screen-image n) `(svref ,screen-image ,n)) ;;; Font support. (defvar *tty-font-strings* (make-array font-map-size :initial-element nil) "Array of (start-string . end-string) for fonts, or NIL if no such font.") (defun define-tty-font (font-id &rest stuff) (unless (<= 0 font-id (1- font-map-size)) (error "Bogus font-id: ~S" font-id)) (cond ((every #'keywordp stuff) (error "Can't extract font strings from the termcap entry yet.")) ((and (= (length stuff) 2) (stringp (car stuff)) (stringp (cadr stuff))) (setf (aref *tty-font-strings* font-id) (cons (car stuff) (cadr stuff)))) (t (error "Bogus font spec: ~S~%Must be either a list of keywords or ~ a list of the start string and end string.")))) (defun compute-font-usages (dis-line) (do ((results nil) (change (dis-line-font-changes dis-line) (font-change-next change)) (prev nil change)) ((null change) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (dis-line-length dis-line)) results)))) (nreverse results)) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (font-change-x change)) results)))))) ;;;; Dumb window redisplay. (defmacro tty-dumb-line-redisplay (device hunk dis-line &optional y) (let ((dl (gensym)) (dl-chars (gensym)) (dl-fonts (gensym)) (dl-len (gensym)) (dl-pos (gensym)) (screen-image-line (gensym))) `(let* ((,dl ,dis-line) (,dl-chars (dis-line-chars ,dl)) (,dl-fonts (compute-font-usages ,dis-line)) (,dl-len (dis-line-length ,dl)) (,dl-pos ,(or y `(dis-line-position ,dl)))) (funcall (tty-device-display-string ,device) ,hunk 0 ,dl-pos ,dl-chars ,dl-fonts 0 ,dl-len) (setf (dis-line-flags ,dl) unaltered-bits) (setf (dis-line-delta ,dl) 0) (select-hunk ,hunk) (let ((,screen-image-line (si-line (tty-device-screen-image ,device) (+ *hunk-top-line* ,dl-pos)))) (replace-si-line (si-line-chars ,screen-image-line) ,dl-chars 0 0 ,dl-len) (setf (si-line-length ,screen-image-line) ,dl-len) (setf (si-line-fonts ,screen-image-line) ,dl-fonts))))) (defun tty-dumb-window-redisplay (window) (let* ((first (window-first-line window)) (hunk (window-hunk window)) (device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device))) (funcall (tty-device-clear-to-eow device) hunk 0 0) (do ((i 0 (1+ i)) (dl (cdr first) (cdr dl))) ((eq dl the-sentinel) (setf (window-old-lines window) (1- i)) (select-hunk hunk) (do ((last (tty-hunk-text-position hunk)) (i (+ *hunk-top-line* i) (1+ i))) ((> i last)) (declare (fixnum i last)) (let ((si-line (si-line screen-image i))) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))) (tty-dumb-line-redisplay device hunk (car dl) i)) (setf (window-first-changed window) the-sentinel (window-last-changed window) first) (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window)) (y (tty-hunk-modeline-pos hunk))) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (funcall (tty-device-clear-to-eol device) hunk 0 y) (tty-dumb-line-redisplay device hunk dl y)) (funcall (tty-device-standout-end device) hunk)) (setf (dis-line-flags dl) unaltered-bits))))) ;;;; Dumb redisplay top n lines of a window. (defun tty-redisplay-n-lines (window n) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (funcall (tty-device-clear-lines device) hunk 0 0 n) (do ((n n (1- n)) (dl (cdr (window-first-line window)) (cdr dl))) ((or (zerop n) (eq dl the-sentinel))) (tty-dumb-line-redisplay device hunk (car dl))))) ;;;; Semi dumb window redisplay ;;; This is for terminals without opening and deleting lines. ;;; TTY-SEMI-DUMB-WINDOW-REDISPLAY is a lot like TTY-SMART-WINDOW-REDISPLAY, ;;; but it calls different line redisplay functions. ;;; (defun tty-semi-dumb-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if ;; One line-changed. (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) (tty-semi-dumb-line-redisplay device hunk (car first-changed)) ;; More lines changed. (do-semi-dumb-line-writes first-changed last-changed hunk)) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;; NEXT-DIS-LINE is used in DO-SEMI-DUMB-LINE-WRITES and ;;; COMPUTE-TTY-CHANGES. ;;; (eval-when (:compile-toplevel :execute) (defmacro next-dis-line () `(progn (setf prev dl) (setf dl (cdr dl)) (setf flags (dis-line-flags (car dl))))) ) ;eval-when ;;; DO-SEMI-DUMB-LINE-WRITES does what it says until it hits the last ;;; changed line. The commented out code was a gratuitous optimization, ;;; especially if the first-changed line really is the first changes line. ;;; Anyway, this had to be removed because of this function's use in ;;; TTY-SMART-WINDOW-REDISPLAY, which was punting line moves due to ;;; "Scroll Redraw Ratio". However, these supposedly moved lines had their ;;; bits set to unaltered bits in COMPUTE-TTY-CHANGES because it was ;;; assuming TTY-SMART-WINDOW-REDISPLAY guaranteed to do line moves. ;;; (defun do-semi-dumb-line-writes (first-changed last-changed hunk) (let* ((dl first-changed) flags ;(dis-line-flags (car dl))) flags bound for NEXT-DIS-LINE. prev) ;; ;; Skip old, unchanged, unmoved lines. ;; (loop ;; (unless (zerop flags) (return)) ;; (next-dis-line)) ;; ;; Write every remaining line. (let* ((device (device-hunk-device hunk)) (force-output (device-force-output device))) (loop (tty-semi-dumb-line-redisplay device hunk (car dl)) (when force-output (funcall force-output)) (next-dis-line) (when (eq prev last-changed) (return)))))) ;;; TTY-SEMI-DUMB-LINE-REDISPLAY finds the first different character ;;; comparing the display line and the screen image line, writes out the ;;; rest of the display line, and clears to end-of-line as necessary. ;;; (defun tty-semi-dumb-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (cond ;; See if the screen shows an initial substring of the dis-line. ((= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len)) ;; When the dis-line is an initial substring of what's on the screen. ((= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) ;; Otherwise, blast dl-chars and clear to eol as necessary. (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dl-len si-line-length) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Smart window redisplay -- operation queues and internal screen image. ;;; This is used for creating temporary smart redisplay structures. ;;; (defconstant tty-hunk-height-limit 100) ;;; Queues for redisplay operations and access macros. ;;; (defvar *tty-line-insertions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-deletions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-writes* (make-array tty-hunk-height-limit)) (defvar *tty-line-moves* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) (defmacro queue (value queue ptr) `(progn (setf (svref ,queue ,ptr) ,value) (the fixnum (incf (the fixnum ,ptr))))) (defmacro dequeue (queue ptr) `(prog1 (svref ,queue ,ptr) (the fixnum (incf (the fixnum ,ptr))))) ) ;eval-when ;;; INSERT-LINE-COUNT is used in TTY-SMART-WINDOW-REDISPLAY. The counting is ;;; based on calls to QUEUE in COMPUTE-TTY-CHANGES. ;;; (defun insert-line-count (ins) (do ((i 1 (+ i 2)) (count 0 (+ count (svref *tty-line-insertions* i)))) ((> i ins) count))) ;;; Temporary storage for screen-image lines and accessing macros. ;;; (defvar *screen-image-temp* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) ;;; DELETE-SI-LINES is used in DO-LINE-DELETIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num ;;; lines are deleted and saved in *screen-image-temp*; fsil is the ;;; end of the free screen image lines saved here. Also, we must ;;; move lines up in the screen-image structure. In the outer loop ;;; we save lines in the temp storage and move lines up at the same ;;; time. In the termination/inner loop we move any lines that still ;;; need to be moved up. The screen-length is adjusted by the fsil ;;; because any time a deletion is in progress, there are fsil bogus ;;; lines at the bottom of the screen image from lines being moved ;;; up previously. ;;; (defmacro delete-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (delete-index (gensym)) (free-lines (gensym)) (source-index (gensym)) (target-index (gensym)) (n (gensym)) (do-screen-length (gensym)) (do-y (gensym))) `(let ((,do-screen-image ,screen-image) (,do-screen-length (- ,screen-length fsil)) (,do-y ,y)) (declare (fixnum ,do-screen-length ,do-y)) (do ((,delete-index ,do-y (1+ ,delete-index)) (,free-lines ,fsil (1+ ,free-lines)) (,source-index (+ ,do-y ,num) (1+ ,source-index)) (,n ,num (1- ,n))) ((zerop ,n) (do ((,target-index ,delete-index (1+ ,target-index)) (,source-index ,source-index (1+ ,source-index))) ((>= ,source-index ,do-screen-length)) (declare (fixnum ,target-index ,source-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))) (declare (fixnum ,delete-index ,free-lines ,source-index ,n)) (setf (si-line *screen-image-temp* ,free-lines) (si-line ,do-screen-image ,delete-index)) (when (< ,source-index ,do-screen-length) (setf (si-line ,do-screen-image ,delete-index) (si-line ,do-screen-image ,source-index))))))) ;;; INSERT-SI-LINES is used in DO-LINE-INSERTIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num free ;;; lines are inserted from *screen-image-temp*; fsil is the end of the ;;; free lines. When copying lines down in screen-image, we must start ;;; with the lower lines and end with the higher ones, so we don't trash ;;; any lines. The outer loop does all the copying, and the termination/ ;;; inner loop inserts the free screen image lines, setting their length ;;; to zero. ;;; (defmacro insert-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (source-index (gensym)) (target-index (gensym)) (target-terminus (gensym)) (do-screen-length (gensym)) (temp (gensym)) (do-y (gensym)) (insert-index (gensym)) (free-lines-index (gensym)) (n (gensym))) `(let ((,do-screen-length ,screen-length) (,do-screen-image ,screen-image) (,do-y ,y)) (do ((,target-terminus (1- (+ ,do-y ,num))) ; (1- target-start) (,source-index (- ,do-screen-length ,fsil 1) ; (1- source-end) (1- ,source-index)) (,target-index (- (+ ,do-screen-length ,num) ,fsil 1) ; (1- target-end) (1- ,target-index))) ((= ,target-index ,target-terminus) (do ((,insert-index ,do-y (1+ ,insert-index)) (,free-lines-index (1- ,fsil) (1- ,free-lines-index)) (,n ,num (1- ,n))) ((zerop ,n)) (declare (fixnum ,insert-index ,free-lines-index ,n)) (let ((,temp (si-line *screen-image-temp* ,free-lines-index))) (setf (si-line-length ,temp) 0) (setf (si-line-fonts ,temp) nil) (setf (si-line ,do-screen-image ,insert-index) ,temp))) (decf ,fsil ,num)) (declare (fixnum ,target-terminus ,source-index ,target-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))))) ) ;eval-when ;;;; Smart window redisplay -- the function. ;;; TTY-SMART-WINDOW-REDISPLAY sees if only one line changed after ;;; some preliminary processing. If more than one line changed, ;;; then we compute changes to make to the screen in the form of ;;; line insertions, deletions, and writes. Deletions must be done ;;; first, so lines are not lost off the bottom of the screen by ;;; inserting lines. ;;; (defun tty-smart-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) ;; One line-changed. (tty-smart-line-redisplay device hunk (car first-changed)) ;; More lines changed. (multiple-value-bind (ins outs writes moves) (compute-tty-changes first-changed last-changed (tty-hunk-modeline-pos hunk)) (let ((ratio (variable-value 'hemlock::scroll-redraw-ratio))) (cond ((and ratio (> (/ (insert-line-count ins) (tty-hunk-text-height hunk)) ratio)) (do-semi-dumb-line-writes first-changed last-changed hunk)) (t (do-line-insertions hunk ins (do-line-deletions hunk outs)) (note-line-moves moves) (do-line-writes hunk writes)))))) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;;; Smart window redisplay -- computing changes to the display. ;;; There is a lot of documentation here to help since this code is not ;;; obviously correct. The code is not that cryptic, but the correctness ;;; of the algorithm is somewhat. Most of the complexity is in handling ;;; lines that moved on the screen which the introduction deals with. ;;; Also, the block of documentation immediately before the function ;;; COMPUTE-TTY-CHANGES has its largest portion dedicated to this part of ;;; the function which is the largest block of code in the function. ;;; The window image dis-lines are annotated with the difference between ;;; their current intended locations and their previous locations in the ;;; window. This delta (distance moved) is negative for an upward move and ;;; positive for a downward move. To determine what to do with moved ;;; groups of lines, we consider the transition (or difference in deltas) ;;; between two adjacent groups as we look at the window's dis-lines moving ;;; down the window image, disregarding whether they are contiguous (having ;;; moved only by a different delta) or separated by some lines (such as ;;; lines that are new and unmoved). ;;; ;;; Considering the transition between moved groups makes sense because a ;;; given group's delta affects all the lines below it since the dis-lines ;;; reflect the window's buffer's actual lines which are all connected in ;;; series. Therefore, if the previous group moved up some delta number of ;;; lines because of line deletions, then the lines below this group (down ;;; to the last line of the window image) moved up by the same delta too, ;;; unless one of the following is true: ;;; 1] The lines below the group moved up by a greater delta, possibly ;;; due to multiple disjoint buffer line deletions. ;;; 2] The lines below the group moved up by a lesser delta, possibly ;;; due to a number (less than the previous delta) of new line ;;; insertions below the group that moved up. ;;; 3] The lines below the group moved down, possibly due to a number ;;; (greater than the previous delta) of new line insertions below ;;; the group that moved up. ;;; Similarly, if the previous group moved down some delta number of lines ;;; because of new line insertions, then the lines below this group (down ;;; to the last line of the window image not to fall off the window's lower ;;; edge) moved down by the same delta too, unless one of the following is ;;; true: ;;; 1] The lines below the group moved down by a greater delta, possibly ;;; due to multiple disjoint buffer line insertions. ;;; 2] The lines below the group moved down by a lesser delta, possibly ;;; due to a number (less than the previous delta) of line deletions ;;; below the group that moved down. ;;; 3] The lines below the group moved up, possibly due to a number ;;; (greater than the previous delta) of line deletions below the ;;; group that moved down. ;;; ;;; Now we can see how the first moved group affects the window image below ;;; it except where there is a lower group of lines that have moved a ;;; different delta due to separate operations on the buffer's lines viewed ;;; through a window. We can see that this different delta is the expected ;;; effect throughout the window image below the second group, unless ;;; something lower down again has affected the window image. Also, in the ;;; case of a last group of lines that moved up, the group will never ;;; reflect all of the lines in the window image from the first line to ;;; move down to the bottom of the window image because somewhere down below ;;; the group that moved up are some new lines that have just been drawn up ;;; into the window's image. ;;; ;;; COMPUTE-TTY-CHANGES is used once in TTY-SMART-WINDOW-REDISPLAY. ;;; It goes through all the display lines for a window recording where ;;; lines need to be inserted, deleted, or written to make the screen ;;; consistent with the internal image of the screen. Pointers to ;;; the insertions, deletions, and writes that have to be done are ;;; returned. ;;; ;;; If a line is new, then simply queue it to be written. ;;; ;;; If a line is moved and/or changed, then we compute the difference ;;; between the last block of lines that moved with the same delta and the ;;; current block of lines that moved with the current delta. If this ;;; difference is positive, then some lines need to be deleted. Since we ;;; do all the line deletions first to prevent line insertions from ;;; dropping lines off the bottom of the screen, we have to compute the ;;; position of line deletions using the cumulative insertions ;;; (cum-inserts). Without any insertions, deletions may be done right at ;;; the dis-line's new position. With insertions needed above a given ;;; deletion point combined with the fact that deletions are all done ;;; first, the location for the deletion is higher than it would be without ;;; the insertions being done above the deletions. The location of the ;;; deletion is higher by the number of insertions we have currently put ;;; off. When computing the position of line insertions (a negative delta ;;; transition), we do not need to consider the cumulative insertions or ;;; cumulative deletions since everything above the point of insertion ;;; (both deletions and insertions) has been done. Because of the screen ;;; state being correct above the point of an insertion, the screen is only ;;; off by the delta transition number of lines. After determining the ;;; line insertions or deletions, loop over contiguous lines with the same ;;; delta queuing any changed ones to be written. The delta and flag ;;; fields are initialized according to the need to be written; since ;;; redisplay may be interrupted by more user input after moves have been ;;; done to the screen, we save the changed bit on, so the line will be ;;; queued to be written after redisplay is re-entered. ;;; ;;; If the line is changed or new, then queue it to be written. Since we can ;;; abort out of the actual dislpay at any time (due to pending input), we ;;; don't clear the flags or delta here. A dis-line may be groveled many times ;;; by this function before it actually makes it to the screen, so we may have ;;; odd combinations of bits such as both new and changed. ;;; ;;; Otherwise, get the next display line, loop, and see if it's ;;; interesting. ;;; (defun compute-tty-changes (first-changed last-changed modeline-pos) (declare (fixnum modeline-pos)) (let* ((dl first-changed) (flags (dis-line-flags (car dl))) (ins 0) (outs 0) (writes 0) (moves 0) (prev-delta 0) (cum-deletes 0) (net-delta 0) (cum-inserts 0) prev) (declare (fixnum flags ins outs writes moves prev-delta cum-deletes net-delta cum-inserts)) (loop (cond ((logtest flags new-bit) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) ((logtest flags moved-bit) (let* ((start-dl (car dl)) (start-pos (dis-line-position start-dl)) (curr-delta (dis-line-delta start-dl)) (delta-delta (- prev-delta curr-delta)) (car-dl start-dl)) (declare (fixnum start-pos curr-delta delta-delta)) (cond ((plusp delta-delta) (queue (the fixnum (- start-pos cum-inserts)) *tty-line-deletions* outs) (queue delta-delta *tty-line-deletions* outs) (incf cum-deletes delta-delta) (decf net-delta delta-delta)) ((minusp delta-delta) (let ((eff-pos (the fixnum (+ start-pos delta-delta))) (num (the fixnum (- delta-delta)))) (queue eff-pos *tty-line-insertions* ins) (queue num *tty-line-insertions* ins) (incf net-delta num) (incf cum-inserts num)))) (loop (if (logtest flags (logior changed-bit new-bit)) (queue car-dl *tty-line-writes* writes) (queue car-dl *tty-line-moves* moves)) (next-dis-line) (setf car-dl (car dl)) (when (or (eq prev last-changed) (/= (the fixnum (dis-line-delta car-dl)) curr-delta)) (setf prev-delta curr-delta) (return))))) ((logtest flags (logior changed-bit new-bit)) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) (t (next-dis-line))) (when (eq prev last-changed) (unless (zerop net-delta) (cond ((plusp net-delta) (queue (the fixnum (- modeline-pos cum-deletes net-delta)) *tty-line-deletions* outs) (queue net-delta *tty-line-deletions* outs)) (t (queue (the fixnum (+ modeline-pos net-delta)) *tty-line-insertions* ins) (queue (the fixnum (- net-delta)) *tty-line-insertions* ins)))) (return (values ins outs writes moves)))))) ;;;; Smart window redisplay -- operation methods. ;;; TTY-SMART-CLEAR-TO-EOW clears lines y through the last text line of hunk. ;;; It takes care not to clear a line unless it really has some characters ;;; displayed on it. It also maintains the device's screen image lines. ;;; (defun tty-smart-clear-to-eow (hunk y) (let* ((device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device)) (clear-to-eol (tty-device-clear-to-eol device))) (select-hunk hunk) (do ((y y (1+ y)) (si-idx (+ *hunk-top-line* y) (1+ si-idx)) (last (tty-hunk-text-position hunk))) ((> si-idx last)) (declare (fixnum y si-idx last)) (let ((si-line (si-line screen-image si-idx))) (unless (zerop (si-line-length si-line)) (funcall clear-to-eol hunk 0 y) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))))) ;;; NOTE-LINE-MOVES -- Internal ;;; ;;; Clear out the flags and delta of lines that have been moved. ;;; (defun note-line-moves (moves) (let ((i 0)) (loop (when (= i moves) (return)) (let ((dl (dequeue *tty-line-moves* i))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))))) ;;; DO-LINE-DELETIONS pops elements off the *tty-lines-deletions* queue, ;;; deleting lines from hunk's area of the screen. The internal screen ;;; image is updated, and the total number of lines deleted is returned. ;;; (defun do-line-deletions (hunk outs) (declare (fixnum outs)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-delete-line device)) (fsil 0)) ;free-screen-image-lines (declare (fixnum i fsil)) (loop (when (= i outs) (return fsil)) (let ((y (dequeue *tty-line-deletions* i)) (num (dequeue *tty-line-deletions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (delete-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)) (incf fsil num))))) ;;; DO-LINE-INSERTIONS pops elements off the *tty-line-insertions* queue, ;;; inserting lines into hunk's area of the screen. The internal screen ;;; image is updated using free screen image lines pointed to by fsil. ;;; (defun do-line-insertions (hunk ins fsil) (declare (fixnum ins fsil)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-open-line device))) (declare (fixnum i)) (loop (when (= i ins) (return)) (let ((y (dequeue *tty-line-insertions* i)) (num (dequeue *tty-line-insertions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (insert-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)))))) ;;; DO-LINE-WRITES pops elements off the *tty-line-writes* queue, displaying ;;; these dis-lines with TTY-SMART-LINE-REDISPLAY. We force output after ;;; each line, so the user can see how far we've gotten in case he chooses ;;; to give more editor commands which will abort redisplay until there's no ;;; more input. ;;; (defun do-line-writes (hunk writes) (declare (fixnum writes)) (let* ((i 0) (device (device-hunk-device hunk)) (force-output (device-force-output device))) (declare (fixnum i)) (loop (when (= i writes) (return)) (tty-smart-line-redisplay device hunk (dequeue *tty-line-writes* i)) (when force-output (funcall force-output))))) ;;; TTY-SMART-LINE-REDISPLAY uses an auxiliary screen image structure to ;;; try to do minimal character shipping to the terminal. Roughly, we find ;;; the first different character when comparing what's on the screen and ;;; what should be there; we will start altering the line after this same ;;; initial substring. Then we find, from the end, the first character ;;; that is different, blasting out characters to the lesser of the two ;;; indexes. If the dis-line index is lesser, we have some characters to ;;; delete from the screen, and if the screen index is lesser, we have some ;;; additional dis-line characters to insert. There are a few special ;;; cases that allow us to punt out of the above algorithm sketch. If the ;;; terminal doesn't have insert mode or delete mode, we have blast out to ;;; the end of the dis-line and possibly clear to the end of the screen's ;;; line, as appropriate. Sometimes we don't use insert or delete mode ;;; because of the overhead cost in characters; it simply is cheaper to ;;; blast out characters and clear to eol. ;;; (defun tty-smart-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (block tslr-main-body ;; ;; See if the screen shows an initial substring of the dis-line. (when (= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) ;; ;; When the dis-line is an initial substring of what's on the screen. (when (= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos) (return-from tslr-main-body t)) ;; ;; Find trailing substrings that are the same. (multiple-value-bind (sindex dindex) (let ((count (find-identical-suffix dl dl-fonts screen-image-line))) (values (- si-line-length count) (- dl-len count))) (declare (fixnum sindex dindex)) ;; ;; No trailing substrings -- blast and clear to eol. (when (= dindex dl-len) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dindex sindex) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) (let ((lindex (min sindex dindex))) (cond ((< lindex findex) ;; This can happen in funny situations -- believe me! (setf lindex findex)) (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex lindex) (replace-si-line si-line-chars dl-chars findex findex lindex))) (cond ((= dindex sindex)) ((< dindex sindex) (let ((delete-char-num (- sindex dindex))) (cond ((and (tty-device-delete-char device) (worth-using-delete-mode device delete-char-num (- si-line-length dl-len))) (funcall (tty-device-delete-char device) hunk dindex dl-pos delete-char-num)) (t (funcall (tty-device-display-string device) hunk dindex dl-pos dl-chars dl-fonts dindex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos))))) (t (if (and (tty-device-insert-string device) (worth-using-insert-mode device (- dindex sindex) (- dl-len sindex))) (funcall (tty-device-insert-string device) hunk sindex dl-pos dl-chars sindex dindex) (funcall (tty-device-display-string device) hunk sindex dl-pos dl-chars dl-fonts sindex dl-len)))) (replace-si-line si-line-chars dl-chars lindex lindex dl-len)))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Device methods ;;; Initializing and exiting the device (DEVICE-INIT and DEVICE-EXIT functions). ;;; These can be found in Tty-Display-Rt.Lisp. ;;; Clearing the device (DEVICE-CLEAR functions). (defun clear-device (device) (device-write-string (tty-device-clear-string device)) (cursor-motion device 0 0) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) 0)) ;;; Moving the cursor around (DEVICE-PUT-CURSOR) ;;; TTY-PUT-CURSOR makes sure the coordinates are mapped from the hunk's ;;; axis to the screen's and determines the minimal cost cursor motion ;;; sequence. Currently, it does no cost analysis of relative motion ;;; compared to absolute motion but simply makes sure the cursor isn't ;;; already where we want it. ;;; (defun tty-put-cursor (hunk x y) (declare (fixnum x y)) (select-hunk hunk) (let ((y (the fixnum (+ *hunk-top-line* y))) (device (device-hunk-device hunk))) (declare (fixnum y)) (unless (and (= (the fixnum (tty-device-cursor-x device)) x) (= (the fixnum (tty-device-cursor-y device)) y)) (cursor-motion device x y) (setf (tty-device-cursor-x device) x) (setf (tty-device-cursor-y device) y)))) ;;; UPDATE-CURSOR is used in device redisplay methods to make sure the ;;; cursor is where it should be. ;;; (eval-when (:compile-toplevel :execute) (defmacro update-cursor (hunk x y) `(funcall (device-put-cursor (device-hunk-device ,hunk)) ,hunk ,x ,y)) ) ;eval-when ;;; CURSOR-MOTION takes two coordinates on the screen's axis, ;;; moving the cursor to that location. X is the column index, ;;; and y is the line index, but Unix and Termcap believe that ;;; the default order of indexes is first the line and then the ;;; column or (y,x). Because of this, when reversep is non-nil, ;;; we send first x and then y. ;;; (defun cursor-motion (device x y) (let ((x-add-char (tty-device-cm-x-add-char device)) (y-add-char (tty-device-cm-y-add-char device)) (x-condx-add (tty-device-cm-x-condx-char device)) (y-condx-add (tty-device-cm-y-condx-char device)) (one-origin (tty-device-cm-one-origin device))) (when x-add-char (incf x x-add-char)) (when (and x-condx-add (> x x-condx-add)) (incf x (tty-device-cm-x-condx-add-char device))) (when y-add-char (incf y y-add-char)) (when (and y-condx-add (> y y-condx-add)) (incf y (tty-device-cm-y-condx-add-char device))) (when one-origin (incf x) (incf y))) (device-write-string (tty-device-cm-string1 device)) (let ((reversep (tty-device-cm-reversep device)) (x-pad (tty-device-cm-x-pad device)) (y-pad (tty-device-cm-y-pad device))) (if reversep (cm-output-coordinate x x-pad) (cm-output-coordinate y y-pad)) (device-write-string (tty-device-cm-string2 device)) (if reversep (cm-output-coordinate y y-pad) (cm-output-coordinate x x-pad)) (device-write-string (tty-device-cm-string3 device)))) ;;; CM-OUTPUT-COORDINATE outputs the coordinate with respect to the pad. If ;;; there is a pad, then the coordinate needs to be sent as digit-char's (for ;;; each digit in the coordinate), and if there is no pad, the coordinate needs ;;; to be converted into a character. Using CODE-CHAR here is not really ;;; portable. With a pad, the coordinate buffer is filled from the end as we ;;; truncate the coordinate by 10, generating ones digits. ;;; (defconstant cm-coordinate-buffer-len 5) (defvar *cm-coordinate-buffer* (make-string cm-coordinate-buffer-len)) ;;; (defun cm-output-coordinate (coordinate pad) (cond (pad (let ((i (1- cm-coordinate-buffer-len))) (loop (when (= i -1) (error "Terminal has too many lines!")) (multiple-value-bind (tens ones) (truncate coordinate 10) (setf (schar *cm-coordinate-buffer* i) (digit-char ones)) (when (zerop tens) (dotimes (n (- pad (- cm-coordinate-buffer-len i))) (decf i) (setf (schar *cm-coordinate-buffer* i) #\0)) (device-write-string *cm-coordinate-buffer* i cm-coordinate-buffer-len) (return)) (decf i) (setf coordinate tens))))) (t (tty-write-char (code-char coordinate))))) ;;; Writing strings (TTY-DEVICE-DISPLAY-STRING functions) ;;; DISPLAY-STRING is used to put a string at (x,y) on the device. ;;; (defun display-string (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) ;; Ignore font info for chars before the start of the string. (loop (if (or (null font-info) (< start (cddar font-info))) (return) (pop font-info))) (let ((posn start)) (dolist (next-font font-info) (let ((font (car next-font)) (start (cadr next-font)) (stop (cddr next-font))) (when (<= end start) (return)) (when (< posn start) (device-write-string string posn start) (setf posn start)) (let ((new-posn (min stop end)) (font-strings (aref *tty-font-strings* font))) (unwind-protect (progn (device-write-string (car font-strings)) (device-write-string string posn new-posn)) (device-write-string (cdr font-strings))) (setf posn new-posn)))) (when (< posn end) (device-write-string string posn end))) (setf (tty-device-cursor-x (device-hunk-device hunk)) (the fixnum (+ x (the fixnum (- end start)))))) ;;; DISPLAY-STRING-CHECKING-UNDERLINES is used for terminals that special ;;; case underlines doing an overstrike when they don't otherwise overstrike. ;;; Note: we do not know in this code whether the terminal can backspace (or ;;; what the sequence is), whether the terminal has insert-mode, or whether ;;; the terminal has delete-mode. ;;; (defun display-string-checking-underlines (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (ignore font-info)) (declare (fixnum x y start end) (simple-string string)) (update-cursor hunk x y) (let ((upos (position #\_ string :test #'char= :start start :end end)) (device (device-hunk-device hunk))) (if upos (let ((previous start) (after-pos 0)) (declare (fixnum previous after-pos)) (loop (device-write-string string previous upos) (setf after-pos (do ((i (1+ upos) (1+ i))) ((or (= i end) (char/= (schar string i) #\_)) i) (declare (fixnum i)))) (let ((ulen (the fixnum (- after-pos upos))) (cursor-x (the fixnum (+ x (the fixnum (- after-pos start)))))) (declare (fixnum ulen)) (dotimes (i ulen) (tty-write-char #\space)) (setf (tty-device-cursor-x device) cursor-x) (update-cursor hunk upos y) (dotimes (i ulen) (tty-write-char #\_)) (setf (tty-device-cursor-x device) cursor-x)) (setf previous after-pos) (setf upos (position #\_ string :test #'char= :start previous :end end)) (unless upos (device-write-string string previous end) (return)))) (device-write-string string start end)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) ;;; DEVICE-WRITE-STRING is used to shove a string at the terminal regardless ;;; of cursor position. ;;; (defun device-write-string (string &optional (start 0) (end (strlen string))) (declare (fixnum start end)) (unless (= start end) (tty-write-string string start (the fixnum (- end start))))) ;;; Clearing lines (TTY-DEVICE-CLEAR-TO-EOL, DEVICE-CLEAR-LINES, and ;;; TTY-DEVICE-CLEAR-TO-EOW functions.) (defun clear-to-eol (hunk x y) (update-cursor hunk x y) (device-write-string (tty-device-clear-to-eol-string (device-hunk-device hunk)))) (defun space-to-eol (hunk x y) (declare (fixnum x)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (num (- (the fixnum (tty-device-columns device)) x))) (declare (fixnum num)) (dotimes (i num) (tty-write-char #\space)) (setf (tty-device-cursor-x device) (+ x num)))) (defun clear-lines (hunk x y n) (let* ((device (device-hunk-device hunk)) (clear-to-eol (tty-device-clear-to-eol device))) (funcall clear-to-eol hunk x y) (do ((y (1+ y) (1+ y)) (count (1- n) (1- count))) ((zerop count) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) (1- y))) (declare (fixnum count y)) (funcall clear-to-eol hunk 0 y)))) (defun clear-to-eow (hunk x y) (declare (fixnum x y)) (funcall (tty-device-clear-lines (device-hunk-device hunk)) hunk x y (the fixnum (- (the fixnum (tty-hunk-text-height hunk)) y)))) ;;; Opening and Deleting lines (TTY-DEVICE-OPEN-LINE and TTY-DEVICE-DELETE-LINE) (defun open-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-open-line-string (device-hunk-device hunk))))) (defun delete-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-delete-line-string (device-hunk-device hunk))))) ;;; Insert and Delete modes (TTY-DEVICE-INSERT-STRING and TTY-DEVICE-DELETE-CHAR) (defun tty-insert-string (hunk x y string &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device))) (declare (type (or simple-string null) char-init-string char-end-string)) (when init-string (device-write-string init-string)) (if char-init-string (let ((cis-len (length char-init-string)) (ces-len (length char-end-string))) (do ((i start (1+ i))) ((= i end)) (device-write-string char-init-string 0 cis-len) (tty-write-char (schar string i)) (when char-end-string (device-write-string char-end-string 0 ces-len)))) (device-write-string string start end)) (when end-string (device-write-string end-string)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) (defun worth-using-insert-mode (device insert-char-num chars-saved) (let* ((init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device)) (cost 0)) (when init-string (incf cost (length (the simple-string init-string)))) (when char-init-string (incf cost (* insert-char-num (+ (length (the simple-string char-init-string)) (if char-end-string (length (the simple-string char-end-string)) 0))))) (when end-string (incf cost (length (the simple-string end-string)))) (< cost chars-saved))) (defun delete-char (hunk x y &optional (n 1)) (declare (fixnum x y n)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device))) (when init-string (device-write-string init-string)) (dotimes (i n) (device-write-string delete-char-string)) (when end-string (device-write-string end-string)))) (defun worth-using-delete-mode (device delete-char-num clear-char-num) (declare (fixnum delete-char-num clear-char-num)) (let ((init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device)) (clear-to-eol-string (tty-device-clear-to-eol-string device)) (cost 0)) (declare (type (or simple-string null) init-string end-string delete-char-string) (fixnum cost)) (when init-string (incf cost (the fixnum (length init-string)))) (when end-string (incf cost (the fixnum (length end-string)))) (incf cost (the fixnum (* (the fixnum (length delete-char-string)) delete-char-num))) (< cost (+ delete-char-num (if clear-to-eol-string (length clear-to-eol-string) clear-char-num))))) ;;; Standout mode (TTY-DEVICE-STANDOUT-INIT and TTY-DEVICE-STANDOUT-END) (defun standout-init (hunk) (device-write-string (tty-device-standout-init-string (device-hunk-device hunk)))) (defun standout-end (hunk) (device-write-string (tty-device-standout-end-string (device-hunk-device hunk))))
89067
;;; -*- Log: hemlock.log; Package: hemlock-internals -*- ;;; ;;; ********************************************************************** ;;; This code was written as part of the CMU Common Lisp project at ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; #+CMU (ext:file-comment "$Header$") ;;; ;;; ********************************************************************** ;;; ;;; Written by <NAME>. ;;; (in-package :hemlock-internals) (export '(redisplay redisplay-all define-tty-font)) ;;;; Macros. (eval-when (:compile-toplevel :execute) (defmacro tty-hunk-modeline-pos (hunk) `(tty-hunk-text-height ,hunk)) ) ;eval-when (defvar *currently-selected-hunk* nil) (defvar *hunk-top-line*) (declaim (fixnum *hunk-top-line*)) (eval-when (:compile-toplevel :execute) (defmacro select-hunk (hunk) `(unless (eq ,hunk *currently-selected-hunk*) (setf *currently-selected-hunk* ,hunk) (setf *hunk-top-line* (the fixnum (1+ (the fixnum (- (the fixnum (tty-hunk-text-position ,hunk)) (the fixnum (tty-hunk-text-height ,hunk))))))))) ) ;eval-when ;;; Screen image lines. ;;; (defstruct (si-line (:print-function print-screen-image-line) (:constructor %make-si-line (chars))) (chars nil :type simple-string) (length 0) (fonts nil :type list)) (defun make-si-line (n) (%make-si-line (make-string n))) (defun print-screen-image-line (obj str n) (declare (ignore n)) (write-string "#<Screen Image Line \"" str) (write-string (si-line-chars obj) str :end (si-line-length obj)) (write-string "\">" str)) (defun find-identical-prefix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (okay-until 0)) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len) (type (and unsigned-byte fixnum) okay-until)) (do ((dl-fonts dis-line-fonts (cdr dis-line-fonts)) (si-fonts (si-line-fonts si-line) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (let ((next-font (car (or dl-fonts si-fonts)))) (if next-font (let ((end (min dl-len si-len (cadr next-font)))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) end)) (let ((end (min dl-len si-len))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) (if (= dl-len si-len) nil end)))))) (let ((dl-font (caar dl-fonts)) (dl-start (cadar dl-fonts)) (dl-stop (cddar dl-fonts)) (si-font (caar si-fonts)) (si-start (cadar si-fonts)) (si-stop (cddar si-fonts))) (unless (and (= dl-font si-font) (= dl-start si-start)) (let ((font-lossage (min dl-start si-start))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (unless (= dl-stop si-stop) (let ((font-lossage (min dl-stop si-stop))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (let ((mismatch (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 dl-stop :end2 si-stop))) (if mismatch (return mismatch) (setf okay-until dl-stop))))))) (defun find-identical-suffix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (count (dotimes (i (min dl-len si-len) i) (when (char/= (schar dl-chars (- dl-len i 1)) (schar si-chars (- si-len i 1))) (return i))))) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len)) (do ((dl-fonts (reverse dis-line-fonts) (cdr dis-line-fonts)) (si-fonts (reverse (si-line-fonts si-line)) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (cond (dl-fonts (min (- dl-len (cddar dl-fonts)) count)) (si-fonts (min (- si-len (cddar si-fonts)) count)) (t count))) (let ((dl-font (caar dl-fonts)) (dl-start (- dl-len (cadar dl-fonts))) (dl-stop (- dl-len (cddar dl-fonts))) (si-font (caar si-fonts)) (si-start (- si-len (cadar si-fonts))) (si-stop (- si-len (cddar si-fonts)))) (unless (and (= dl-font si-font) (= dl-stop si-stop)) (return (min dl-stop si-stop count))) (unless (= dl-start si-start) (return (min dl-start si-start count))) (when (<= count dl-start) (return count)))))) (defmacro si-line (screen-image n) `(svref ,screen-image ,n)) ;;; Font support. (defvar *tty-font-strings* (make-array font-map-size :initial-element nil) "Array of (start-string . end-string) for fonts, or NIL if no such font.") (defun define-tty-font (font-id &rest stuff) (unless (<= 0 font-id (1- font-map-size)) (error "Bogus font-id: ~S" font-id)) (cond ((every #'keywordp stuff) (error "Can't extract font strings from the termcap entry yet.")) ((and (= (length stuff) 2) (stringp (car stuff)) (stringp (cadr stuff))) (setf (aref *tty-font-strings* font-id) (cons (car stuff) (cadr stuff)))) (t (error "Bogus font spec: ~S~%Must be either a list of keywords or ~ a list of the start string and end string.")))) (defun compute-font-usages (dis-line) (do ((results nil) (change (dis-line-font-changes dis-line) (font-change-next change)) (prev nil change)) ((null change) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (dis-line-length dis-line)) results)))) (nreverse results)) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (font-change-x change)) results)))))) ;;;; Dumb window redisplay. (defmacro tty-dumb-line-redisplay (device hunk dis-line &optional y) (let ((dl (gensym)) (dl-chars (gensym)) (dl-fonts (gensym)) (dl-len (gensym)) (dl-pos (gensym)) (screen-image-line (gensym))) `(let* ((,dl ,dis-line) (,dl-chars (dis-line-chars ,dl)) (,dl-fonts (compute-font-usages ,dis-line)) (,dl-len (dis-line-length ,dl)) (,dl-pos ,(or y `(dis-line-position ,dl)))) (funcall (tty-device-display-string ,device) ,hunk 0 ,dl-pos ,dl-chars ,dl-fonts 0 ,dl-len) (setf (dis-line-flags ,dl) unaltered-bits) (setf (dis-line-delta ,dl) 0) (select-hunk ,hunk) (let ((,screen-image-line (si-line (tty-device-screen-image ,device) (+ *hunk-top-line* ,dl-pos)))) (replace-si-line (si-line-chars ,screen-image-line) ,dl-chars 0 0 ,dl-len) (setf (si-line-length ,screen-image-line) ,dl-len) (setf (si-line-fonts ,screen-image-line) ,dl-fonts))))) (defun tty-dumb-window-redisplay (window) (let* ((first (window-first-line window)) (hunk (window-hunk window)) (device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device))) (funcall (tty-device-clear-to-eow device) hunk 0 0) (do ((i 0 (1+ i)) (dl (cdr first) (cdr dl))) ((eq dl the-sentinel) (setf (window-old-lines window) (1- i)) (select-hunk hunk) (do ((last (tty-hunk-text-position hunk)) (i (+ *hunk-top-line* i) (1+ i))) ((> i last)) (declare (fixnum i last)) (let ((si-line (si-line screen-image i))) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))) (tty-dumb-line-redisplay device hunk (car dl) i)) (setf (window-first-changed window) the-sentinel (window-last-changed window) first) (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window)) (y (tty-hunk-modeline-pos hunk))) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (funcall (tty-device-clear-to-eol device) hunk 0 y) (tty-dumb-line-redisplay device hunk dl y)) (funcall (tty-device-standout-end device) hunk)) (setf (dis-line-flags dl) unaltered-bits))))) ;;;; Dumb redisplay top n lines of a window. (defun tty-redisplay-n-lines (window n) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (funcall (tty-device-clear-lines device) hunk 0 0 n) (do ((n n (1- n)) (dl (cdr (window-first-line window)) (cdr dl))) ((or (zerop n) (eq dl the-sentinel))) (tty-dumb-line-redisplay device hunk (car dl))))) ;;;; Semi dumb window redisplay ;;; This is for terminals without opening and deleting lines. ;;; TTY-SEMI-DUMB-WINDOW-REDISPLAY is a lot like TTY-SMART-WINDOW-REDISPLAY, ;;; but it calls different line redisplay functions. ;;; (defun tty-semi-dumb-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if ;; One line-changed. (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) (tty-semi-dumb-line-redisplay device hunk (car first-changed)) ;; More lines changed. (do-semi-dumb-line-writes first-changed last-changed hunk)) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;; NEXT-DIS-LINE is used in DO-SEMI-DUMB-LINE-WRITES and ;;; COMPUTE-TTY-CHANGES. ;;; (eval-when (:compile-toplevel :execute) (defmacro next-dis-line () `(progn (setf prev dl) (setf dl (cdr dl)) (setf flags (dis-line-flags (car dl))))) ) ;eval-when ;;; DO-SEMI-DUMB-LINE-WRITES does what it says until it hits the last ;;; changed line. The commented out code was a gratuitous optimization, ;;; especially if the first-changed line really is the first changes line. ;;; Anyway, this had to be removed because of this function's use in ;;; TTY-SMART-WINDOW-REDISPLAY, which was punting line moves due to ;;; "Scroll Redraw Ratio". However, these supposedly moved lines had their ;;; bits set to unaltered bits in COMPUTE-TTY-CHANGES because it was ;;; assuming TTY-SMART-WINDOW-REDISPLAY guaranteed to do line moves. ;;; (defun do-semi-dumb-line-writes (first-changed last-changed hunk) (let* ((dl first-changed) flags ;(dis-line-flags (car dl))) flags bound for NEXT-DIS-LINE. prev) ;; ;; Skip old, unchanged, unmoved lines. ;; (loop ;; (unless (zerop flags) (return)) ;; (next-dis-line)) ;; ;; Write every remaining line. (let* ((device (device-hunk-device hunk)) (force-output (device-force-output device))) (loop (tty-semi-dumb-line-redisplay device hunk (car dl)) (when force-output (funcall force-output)) (next-dis-line) (when (eq prev last-changed) (return)))))) ;;; TTY-SEMI-DUMB-LINE-REDISPLAY finds the first different character ;;; comparing the display line and the screen image line, writes out the ;;; rest of the display line, and clears to end-of-line as necessary. ;;; (defun tty-semi-dumb-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (cond ;; See if the screen shows an initial substring of the dis-line. ((= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len)) ;; When the dis-line is an initial substring of what's on the screen. ((= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) ;; Otherwise, blast dl-chars and clear to eol as necessary. (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dl-len si-line-length) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Smart window redisplay -- operation queues and internal screen image. ;;; This is used for creating temporary smart redisplay structures. ;;; (defconstant tty-hunk-height-limit 100) ;;; Queues for redisplay operations and access macros. ;;; (defvar *tty-line-insertions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-deletions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-writes* (make-array tty-hunk-height-limit)) (defvar *tty-line-moves* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) (defmacro queue (value queue ptr) `(progn (setf (svref ,queue ,ptr) ,value) (the fixnum (incf (the fixnum ,ptr))))) (defmacro dequeue (queue ptr) `(prog1 (svref ,queue ,ptr) (the fixnum (incf (the fixnum ,ptr))))) ) ;eval-when ;;; INSERT-LINE-COUNT is used in TTY-SMART-WINDOW-REDISPLAY. The counting is ;;; based on calls to QUEUE in COMPUTE-TTY-CHANGES. ;;; (defun insert-line-count (ins) (do ((i 1 (+ i 2)) (count 0 (+ count (svref *tty-line-insertions* i)))) ((> i ins) count))) ;;; Temporary storage for screen-image lines and accessing macros. ;;; (defvar *screen-image-temp* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) ;;; DELETE-SI-LINES is used in DO-LINE-DELETIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num ;;; lines are deleted and saved in *screen-image-temp*; fsil is the ;;; end of the free screen image lines saved here. Also, we must ;;; move lines up in the screen-image structure. In the outer loop ;;; we save lines in the temp storage and move lines up at the same ;;; time. In the termination/inner loop we move any lines that still ;;; need to be moved up. The screen-length is adjusted by the fsil ;;; because any time a deletion is in progress, there are fsil bogus ;;; lines at the bottom of the screen image from lines being moved ;;; up previously. ;;; (defmacro delete-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (delete-index (gensym)) (free-lines (gensym)) (source-index (gensym)) (target-index (gensym)) (n (gensym)) (do-screen-length (gensym)) (do-y (gensym))) `(let ((,do-screen-image ,screen-image) (,do-screen-length (- ,screen-length fsil)) (,do-y ,y)) (declare (fixnum ,do-screen-length ,do-y)) (do ((,delete-index ,do-y (1+ ,delete-index)) (,free-lines ,fsil (1+ ,free-lines)) (,source-index (+ ,do-y ,num) (1+ ,source-index)) (,n ,num (1- ,n))) ((zerop ,n) (do ((,target-index ,delete-index (1+ ,target-index)) (,source-index ,source-index (1+ ,source-index))) ((>= ,source-index ,do-screen-length)) (declare (fixnum ,target-index ,source-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))) (declare (fixnum ,delete-index ,free-lines ,source-index ,n)) (setf (si-line *screen-image-temp* ,free-lines) (si-line ,do-screen-image ,delete-index)) (when (< ,source-index ,do-screen-length) (setf (si-line ,do-screen-image ,delete-index) (si-line ,do-screen-image ,source-index))))))) ;;; INSERT-SI-LINES is used in DO-LINE-INSERTIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num free ;;; lines are inserted from *screen-image-temp*; fsil is the end of the ;;; free lines. When copying lines down in screen-image, we must start ;;; with the lower lines and end with the higher ones, so we don't trash ;;; any lines. The outer loop does all the copying, and the termination/ ;;; inner loop inserts the free screen image lines, setting their length ;;; to zero. ;;; (defmacro insert-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (source-index (gensym)) (target-index (gensym)) (target-terminus (gensym)) (do-screen-length (gensym)) (temp (gensym)) (do-y (gensym)) (insert-index (gensym)) (free-lines-index (gensym)) (n (gensym))) `(let ((,do-screen-length ,screen-length) (,do-screen-image ,screen-image) (,do-y ,y)) (do ((,target-terminus (1- (+ ,do-y ,num))) ; (1- target-start) (,source-index (- ,do-screen-length ,fsil 1) ; (1- source-end) (1- ,source-index)) (,target-index (- (+ ,do-screen-length ,num) ,fsil 1) ; (1- target-end) (1- ,target-index))) ((= ,target-index ,target-terminus) (do ((,insert-index ,do-y (1+ ,insert-index)) (,free-lines-index (1- ,fsil) (1- ,free-lines-index)) (,n ,num (1- ,n))) ((zerop ,n)) (declare (fixnum ,insert-index ,free-lines-index ,n)) (let ((,temp (si-line *screen-image-temp* ,free-lines-index))) (setf (si-line-length ,temp) 0) (setf (si-line-fonts ,temp) nil) (setf (si-line ,do-screen-image ,insert-index) ,temp))) (decf ,fsil ,num)) (declare (fixnum ,target-terminus ,source-index ,target-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))))) ) ;eval-when ;;;; Smart window redisplay -- the function. ;;; TTY-SMART-WINDOW-REDISPLAY sees if only one line changed after ;;; some preliminary processing. If more than one line changed, ;;; then we compute changes to make to the screen in the form of ;;; line insertions, deletions, and writes. Deletions must be done ;;; first, so lines are not lost off the bottom of the screen by ;;; inserting lines. ;;; (defun tty-smart-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) ;; One line-changed. (tty-smart-line-redisplay device hunk (car first-changed)) ;; More lines changed. (multiple-value-bind (ins outs writes moves) (compute-tty-changes first-changed last-changed (tty-hunk-modeline-pos hunk)) (let ((ratio (variable-value 'hemlock::scroll-redraw-ratio))) (cond ((and ratio (> (/ (insert-line-count ins) (tty-hunk-text-height hunk)) ratio)) (do-semi-dumb-line-writes first-changed last-changed hunk)) (t (do-line-insertions hunk ins (do-line-deletions hunk outs)) (note-line-moves moves) (do-line-writes hunk writes)))))) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;;; Smart window redisplay -- computing changes to the display. ;;; There is a lot of documentation here to help since this code is not ;;; obviously correct. The code is not that cryptic, but the correctness ;;; of the algorithm is somewhat. Most of the complexity is in handling ;;; lines that moved on the screen which the introduction deals with. ;;; Also, the block of documentation immediately before the function ;;; COMPUTE-TTY-CHANGES has its largest portion dedicated to this part of ;;; the function which is the largest block of code in the function. ;;; The window image dis-lines are annotated with the difference between ;;; their current intended locations and their previous locations in the ;;; window. This delta (distance moved) is negative for an upward move and ;;; positive for a downward move. To determine what to do with moved ;;; groups of lines, we consider the transition (or difference in deltas) ;;; between two adjacent groups as we look at the window's dis-lines moving ;;; down the window image, disregarding whether they are contiguous (having ;;; moved only by a different delta) or separated by some lines (such as ;;; lines that are new and unmoved). ;;; ;;; Considering the transition between moved groups makes sense because a ;;; given group's delta affects all the lines below it since the dis-lines ;;; reflect the window's buffer's actual lines which are all connected in ;;; series. Therefore, if the previous group moved up some delta number of ;;; lines because of line deletions, then the lines below this group (down ;;; to the last line of the window image) moved up by the same delta too, ;;; unless one of the following is true: ;;; 1] The lines below the group moved up by a greater delta, possibly ;;; due to multiple disjoint buffer line deletions. ;;; 2] The lines below the group moved up by a lesser delta, possibly ;;; due to a number (less than the previous delta) of new line ;;; insertions below the group that moved up. ;;; 3] The lines below the group moved down, possibly due to a number ;;; (greater than the previous delta) of new line insertions below ;;; the group that moved up. ;;; Similarly, if the previous group moved down some delta number of lines ;;; because of new line insertions, then the lines below this group (down ;;; to the last line of the window image not to fall off the window's lower ;;; edge) moved down by the same delta too, unless one of the following is ;;; true: ;;; 1] The lines below the group moved down by a greater delta, possibly ;;; due to multiple disjoint buffer line insertions. ;;; 2] The lines below the group moved down by a lesser delta, possibly ;;; due to a number (less than the previous delta) of line deletions ;;; below the group that moved down. ;;; 3] The lines below the group moved up, possibly due to a number ;;; (greater than the previous delta) of line deletions below the ;;; group that moved down. ;;; ;;; Now we can see how the first moved group affects the window image below ;;; it except where there is a lower group of lines that have moved a ;;; different delta due to separate operations on the buffer's lines viewed ;;; through a window. We can see that this different delta is the expected ;;; effect throughout the window image below the second group, unless ;;; something lower down again has affected the window image. Also, in the ;;; case of a last group of lines that moved up, the group will never ;;; reflect all of the lines in the window image from the first line to ;;; move down to the bottom of the window image because somewhere down below ;;; the group that moved up are some new lines that have just been drawn up ;;; into the window's image. ;;; ;;; COMPUTE-TTY-CHANGES is used once in TTY-SMART-WINDOW-REDISPLAY. ;;; It goes through all the display lines for a window recording where ;;; lines need to be inserted, deleted, or written to make the screen ;;; consistent with the internal image of the screen. Pointers to ;;; the insertions, deletions, and writes that have to be done are ;;; returned. ;;; ;;; If a line is new, then simply queue it to be written. ;;; ;;; If a line is moved and/or changed, then we compute the difference ;;; between the last block of lines that moved with the same delta and the ;;; current block of lines that moved with the current delta. If this ;;; difference is positive, then some lines need to be deleted. Since we ;;; do all the line deletions first to prevent line insertions from ;;; dropping lines off the bottom of the screen, we have to compute the ;;; position of line deletions using the cumulative insertions ;;; (cum-inserts). Without any insertions, deletions may be done right at ;;; the dis-line's new position. With insertions needed above a given ;;; deletion point combined with the fact that deletions are all done ;;; first, the location for the deletion is higher than it would be without ;;; the insertions being done above the deletions. The location of the ;;; deletion is higher by the number of insertions we have currently put ;;; off. When computing the position of line insertions (a negative delta ;;; transition), we do not need to consider the cumulative insertions or ;;; cumulative deletions since everything above the point of insertion ;;; (both deletions and insertions) has been done. Because of the screen ;;; state being correct above the point of an insertion, the screen is only ;;; off by the delta transition number of lines. After determining the ;;; line insertions or deletions, loop over contiguous lines with the same ;;; delta queuing any changed ones to be written. The delta and flag ;;; fields are initialized according to the need to be written; since ;;; redisplay may be interrupted by more user input after moves have been ;;; done to the screen, we save the changed bit on, so the line will be ;;; queued to be written after redisplay is re-entered. ;;; ;;; If the line is changed or new, then queue it to be written. Since we can ;;; abort out of the actual dislpay at any time (due to pending input), we ;;; don't clear the flags or delta here. A dis-line may be groveled many times ;;; by this function before it actually makes it to the screen, so we may have ;;; odd combinations of bits such as both new and changed. ;;; ;;; Otherwise, get the next display line, loop, and see if it's ;;; interesting. ;;; (defun compute-tty-changes (first-changed last-changed modeline-pos) (declare (fixnum modeline-pos)) (let* ((dl first-changed) (flags (dis-line-flags (car dl))) (ins 0) (outs 0) (writes 0) (moves 0) (prev-delta 0) (cum-deletes 0) (net-delta 0) (cum-inserts 0) prev) (declare (fixnum flags ins outs writes moves prev-delta cum-deletes net-delta cum-inserts)) (loop (cond ((logtest flags new-bit) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) ((logtest flags moved-bit) (let* ((start-dl (car dl)) (start-pos (dis-line-position start-dl)) (curr-delta (dis-line-delta start-dl)) (delta-delta (- prev-delta curr-delta)) (car-dl start-dl)) (declare (fixnum start-pos curr-delta delta-delta)) (cond ((plusp delta-delta) (queue (the fixnum (- start-pos cum-inserts)) *tty-line-deletions* outs) (queue delta-delta *tty-line-deletions* outs) (incf cum-deletes delta-delta) (decf net-delta delta-delta)) ((minusp delta-delta) (let ((eff-pos (the fixnum (+ start-pos delta-delta))) (num (the fixnum (- delta-delta)))) (queue eff-pos *tty-line-insertions* ins) (queue num *tty-line-insertions* ins) (incf net-delta num) (incf cum-inserts num)))) (loop (if (logtest flags (logior changed-bit new-bit)) (queue car-dl *tty-line-writes* writes) (queue car-dl *tty-line-moves* moves)) (next-dis-line) (setf car-dl (car dl)) (when (or (eq prev last-changed) (/= (the fixnum (dis-line-delta car-dl)) curr-delta)) (setf prev-delta curr-delta) (return))))) ((logtest flags (logior changed-bit new-bit)) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) (t (next-dis-line))) (when (eq prev last-changed) (unless (zerop net-delta) (cond ((plusp net-delta) (queue (the fixnum (- modeline-pos cum-deletes net-delta)) *tty-line-deletions* outs) (queue net-delta *tty-line-deletions* outs)) (t (queue (the fixnum (+ modeline-pos net-delta)) *tty-line-insertions* ins) (queue (the fixnum (- net-delta)) *tty-line-insertions* ins)))) (return (values ins outs writes moves)))))) ;;;; Smart window redisplay -- operation methods. ;;; TTY-SMART-CLEAR-TO-EOW clears lines y through the last text line of hunk. ;;; It takes care not to clear a line unless it really has some characters ;;; displayed on it. It also maintains the device's screen image lines. ;;; (defun tty-smart-clear-to-eow (hunk y) (let* ((device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device)) (clear-to-eol (tty-device-clear-to-eol device))) (select-hunk hunk) (do ((y y (1+ y)) (si-idx (+ *hunk-top-line* y) (1+ si-idx)) (last (tty-hunk-text-position hunk))) ((> si-idx last)) (declare (fixnum y si-idx last)) (let ((si-line (si-line screen-image si-idx))) (unless (zerop (si-line-length si-line)) (funcall clear-to-eol hunk 0 y) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))))) ;;; NOTE-LINE-MOVES -- Internal ;;; ;;; Clear out the flags and delta of lines that have been moved. ;;; (defun note-line-moves (moves) (let ((i 0)) (loop (when (= i moves) (return)) (let ((dl (dequeue *tty-line-moves* i))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))))) ;;; DO-LINE-DELETIONS pops elements off the *tty-lines-deletions* queue, ;;; deleting lines from hunk's area of the screen. The internal screen ;;; image is updated, and the total number of lines deleted is returned. ;;; (defun do-line-deletions (hunk outs) (declare (fixnum outs)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-delete-line device)) (fsil 0)) ;free-screen-image-lines (declare (fixnum i fsil)) (loop (when (= i outs) (return fsil)) (let ((y (dequeue *tty-line-deletions* i)) (num (dequeue *tty-line-deletions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (delete-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)) (incf fsil num))))) ;;; DO-LINE-INSERTIONS pops elements off the *tty-line-insertions* queue, ;;; inserting lines into hunk's area of the screen. The internal screen ;;; image is updated using free screen image lines pointed to by fsil. ;;; (defun do-line-insertions (hunk ins fsil) (declare (fixnum ins fsil)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-open-line device))) (declare (fixnum i)) (loop (when (= i ins) (return)) (let ((y (dequeue *tty-line-insertions* i)) (num (dequeue *tty-line-insertions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (insert-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)))))) ;;; DO-LINE-WRITES pops elements off the *tty-line-writes* queue, displaying ;;; these dis-lines with TTY-SMART-LINE-REDISPLAY. We force output after ;;; each line, so the user can see how far we've gotten in case he chooses ;;; to give more editor commands which will abort redisplay until there's no ;;; more input. ;;; (defun do-line-writes (hunk writes) (declare (fixnum writes)) (let* ((i 0) (device (device-hunk-device hunk)) (force-output (device-force-output device))) (declare (fixnum i)) (loop (when (= i writes) (return)) (tty-smart-line-redisplay device hunk (dequeue *tty-line-writes* i)) (when force-output (funcall force-output))))) ;;; TTY-SMART-LINE-REDISPLAY uses an auxiliary screen image structure to ;;; try to do minimal character shipping to the terminal. Roughly, we find ;;; the first different character when comparing what's on the screen and ;;; what should be there; we will start altering the line after this same ;;; initial substring. Then we find, from the end, the first character ;;; that is different, blasting out characters to the lesser of the two ;;; indexes. If the dis-line index is lesser, we have some characters to ;;; delete from the screen, and if the screen index is lesser, we have some ;;; additional dis-line characters to insert. There are a few special ;;; cases that allow us to punt out of the above algorithm sketch. If the ;;; terminal doesn't have insert mode or delete mode, we have blast out to ;;; the end of the dis-line and possibly clear to the end of the screen's ;;; line, as appropriate. Sometimes we don't use insert or delete mode ;;; because of the overhead cost in characters; it simply is cheaper to ;;; blast out characters and clear to eol. ;;; (defun tty-smart-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (block tslr-main-body ;; ;; See if the screen shows an initial substring of the dis-line. (when (= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) ;; ;; When the dis-line is an initial substring of what's on the screen. (when (= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos) (return-from tslr-main-body t)) ;; ;; Find trailing substrings that are the same. (multiple-value-bind (sindex dindex) (let ((count (find-identical-suffix dl dl-fonts screen-image-line))) (values (- si-line-length count) (- dl-len count))) (declare (fixnum sindex dindex)) ;; ;; No trailing substrings -- blast and clear to eol. (when (= dindex dl-len) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dindex sindex) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) (let ((lindex (min sindex dindex))) (cond ((< lindex findex) ;; This can happen in funny situations -- believe me! (setf lindex findex)) (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex lindex) (replace-si-line si-line-chars dl-chars findex findex lindex))) (cond ((= dindex sindex)) ((< dindex sindex) (let ((delete-char-num (- sindex dindex))) (cond ((and (tty-device-delete-char device) (worth-using-delete-mode device delete-char-num (- si-line-length dl-len))) (funcall (tty-device-delete-char device) hunk dindex dl-pos delete-char-num)) (t (funcall (tty-device-display-string device) hunk dindex dl-pos dl-chars dl-fonts dindex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos))))) (t (if (and (tty-device-insert-string device) (worth-using-insert-mode device (- dindex sindex) (- dl-len sindex))) (funcall (tty-device-insert-string device) hunk sindex dl-pos dl-chars sindex dindex) (funcall (tty-device-display-string device) hunk sindex dl-pos dl-chars dl-fonts sindex dl-len)))) (replace-si-line si-line-chars dl-chars lindex lindex dl-len)))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Device methods ;;; Initializing and exiting the device (DEVICE-INIT and DEVICE-EXIT functions). ;;; These can be found in Tty-Display-Rt.Lisp. ;;; Clearing the device (DEVICE-CLEAR functions). (defun clear-device (device) (device-write-string (tty-device-clear-string device)) (cursor-motion device 0 0) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) 0)) ;;; Moving the cursor around (DEVICE-PUT-CURSOR) ;;; TTY-PUT-CURSOR makes sure the coordinates are mapped from the hunk's ;;; axis to the screen's and determines the minimal cost cursor motion ;;; sequence. Currently, it does no cost analysis of relative motion ;;; compared to absolute motion but simply makes sure the cursor isn't ;;; already where we want it. ;;; (defun tty-put-cursor (hunk x y) (declare (fixnum x y)) (select-hunk hunk) (let ((y (the fixnum (+ *hunk-top-line* y))) (device (device-hunk-device hunk))) (declare (fixnum y)) (unless (and (= (the fixnum (tty-device-cursor-x device)) x) (= (the fixnum (tty-device-cursor-y device)) y)) (cursor-motion device x y) (setf (tty-device-cursor-x device) x) (setf (tty-device-cursor-y device) y)))) ;;; UPDATE-CURSOR is used in device redisplay methods to make sure the ;;; cursor is where it should be. ;;; (eval-when (:compile-toplevel :execute) (defmacro update-cursor (hunk x y) `(funcall (device-put-cursor (device-hunk-device ,hunk)) ,hunk ,x ,y)) ) ;eval-when ;;; CURSOR-MOTION takes two coordinates on the screen's axis, ;;; moving the cursor to that location. X is the column index, ;;; and y is the line index, but Unix and Termcap believe that ;;; the default order of indexes is first the line and then the ;;; column or (y,x). Because of this, when reversep is non-nil, ;;; we send first x and then y. ;;; (defun cursor-motion (device x y) (let ((x-add-char (tty-device-cm-x-add-char device)) (y-add-char (tty-device-cm-y-add-char device)) (x-condx-add (tty-device-cm-x-condx-char device)) (y-condx-add (tty-device-cm-y-condx-char device)) (one-origin (tty-device-cm-one-origin device))) (when x-add-char (incf x x-add-char)) (when (and x-condx-add (> x x-condx-add)) (incf x (tty-device-cm-x-condx-add-char device))) (when y-add-char (incf y y-add-char)) (when (and y-condx-add (> y y-condx-add)) (incf y (tty-device-cm-y-condx-add-char device))) (when one-origin (incf x) (incf y))) (device-write-string (tty-device-cm-string1 device)) (let ((reversep (tty-device-cm-reversep device)) (x-pad (tty-device-cm-x-pad device)) (y-pad (tty-device-cm-y-pad device))) (if reversep (cm-output-coordinate x x-pad) (cm-output-coordinate y y-pad)) (device-write-string (tty-device-cm-string2 device)) (if reversep (cm-output-coordinate y y-pad) (cm-output-coordinate x x-pad)) (device-write-string (tty-device-cm-string3 device)))) ;;; CM-OUTPUT-COORDINATE outputs the coordinate with respect to the pad. If ;;; there is a pad, then the coordinate needs to be sent as digit-char's (for ;;; each digit in the coordinate), and if there is no pad, the coordinate needs ;;; to be converted into a character. Using CODE-CHAR here is not really ;;; portable. With a pad, the coordinate buffer is filled from the end as we ;;; truncate the coordinate by 10, generating ones digits. ;;; (defconstant cm-coordinate-buffer-len 5) (defvar *cm-coordinate-buffer* (make-string cm-coordinate-buffer-len)) ;;; (defun cm-output-coordinate (coordinate pad) (cond (pad (let ((i (1- cm-coordinate-buffer-len))) (loop (when (= i -1) (error "Terminal has too many lines!")) (multiple-value-bind (tens ones) (truncate coordinate 10) (setf (schar *cm-coordinate-buffer* i) (digit-char ones)) (when (zerop tens) (dotimes (n (- pad (- cm-coordinate-buffer-len i))) (decf i) (setf (schar *cm-coordinate-buffer* i) #\0)) (device-write-string *cm-coordinate-buffer* i cm-coordinate-buffer-len) (return)) (decf i) (setf coordinate tens))))) (t (tty-write-char (code-char coordinate))))) ;;; Writing strings (TTY-DEVICE-DISPLAY-STRING functions) ;;; DISPLAY-STRING is used to put a string at (x,y) on the device. ;;; (defun display-string (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) ;; Ignore font info for chars before the start of the string. (loop (if (or (null font-info) (< start (cddar font-info))) (return) (pop font-info))) (let ((posn start)) (dolist (next-font font-info) (let ((font (car next-font)) (start (cadr next-font)) (stop (cddr next-font))) (when (<= end start) (return)) (when (< posn start) (device-write-string string posn start) (setf posn start)) (let ((new-posn (min stop end)) (font-strings (aref *tty-font-strings* font))) (unwind-protect (progn (device-write-string (car font-strings)) (device-write-string string posn new-posn)) (device-write-string (cdr font-strings))) (setf posn new-posn)))) (when (< posn end) (device-write-string string posn end))) (setf (tty-device-cursor-x (device-hunk-device hunk)) (the fixnum (+ x (the fixnum (- end start)))))) ;;; DISPLAY-STRING-CHECKING-UNDERLINES is used for terminals that special ;;; case underlines doing an overstrike when they don't otherwise overstrike. ;;; Note: we do not know in this code whether the terminal can backspace (or ;;; what the sequence is), whether the terminal has insert-mode, or whether ;;; the terminal has delete-mode. ;;; (defun display-string-checking-underlines (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (ignore font-info)) (declare (fixnum x y start end) (simple-string string)) (update-cursor hunk x y) (let ((upos (position #\_ string :test #'char= :start start :end end)) (device (device-hunk-device hunk))) (if upos (let ((previous start) (after-pos 0)) (declare (fixnum previous after-pos)) (loop (device-write-string string previous upos) (setf after-pos (do ((i (1+ upos) (1+ i))) ((or (= i end) (char/= (schar string i) #\_)) i) (declare (fixnum i)))) (let ((ulen (the fixnum (- after-pos upos))) (cursor-x (the fixnum (+ x (the fixnum (- after-pos start)))))) (declare (fixnum ulen)) (dotimes (i ulen) (tty-write-char #\space)) (setf (tty-device-cursor-x device) cursor-x) (update-cursor hunk upos y) (dotimes (i ulen) (tty-write-char #\_)) (setf (tty-device-cursor-x device) cursor-x)) (setf previous after-pos) (setf upos (position #\_ string :test #'char= :start previous :end end)) (unless upos (device-write-string string previous end) (return)))) (device-write-string string start end)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) ;;; DEVICE-WRITE-STRING is used to shove a string at the terminal regardless ;;; of cursor position. ;;; (defun device-write-string (string &optional (start 0) (end (strlen string))) (declare (fixnum start end)) (unless (= start end) (tty-write-string string start (the fixnum (- end start))))) ;;; Clearing lines (TTY-DEVICE-CLEAR-TO-EOL, DEVICE-CLEAR-LINES, and ;;; TTY-DEVICE-CLEAR-TO-EOW functions.) (defun clear-to-eol (hunk x y) (update-cursor hunk x y) (device-write-string (tty-device-clear-to-eol-string (device-hunk-device hunk)))) (defun space-to-eol (hunk x y) (declare (fixnum x)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (num (- (the fixnum (tty-device-columns device)) x))) (declare (fixnum num)) (dotimes (i num) (tty-write-char #\space)) (setf (tty-device-cursor-x device) (+ x num)))) (defun clear-lines (hunk x y n) (let* ((device (device-hunk-device hunk)) (clear-to-eol (tty-device-clear-to-eol device))) (funcall clear-to-eol hunk x y) (do ((y (1+ y) (1+ y)) (count (1- n) (1- count))) ((zerop count) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) (1- y))) (declare (fixnum count y)) (funcall clear-to-eol hunk 0 y)))) (defun clear-to-eow (hunk x y) (declare (fixnum x y)) (funcall (tty-device-clear-lines (device-hunk-device hunk)) hunk x y (the fixnum (- (the fixnum (tty-hunk-text-height hunk)) y)))) ;;; Opening and Deleting lines (TTY-DEVICE-OPEN-LINE and TTY-DEVICE-DELETE-LINE) (defun open-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-open-line-string (device-hunk-device hunk))))) (defun delete-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-delete-line-string (device-hunk-device hunk))))) ;;; Insert and Delete modes (TTY-DEVICE-INSERT-STRING and TTY-DEVICE-DELETE-CHAR) (defun tty-insert-string (hunk x y string &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device))) (declare (type (or simple-string null) char-init-string char-end-string)) (when init-string (device-write-string init-string)) (if char-init-string (let ((cis-len (length char-init-string)) (ces-len (length char-end-string))) (do ((i start (1+ i))) ((= i end)) (device-write-string char-init-string 0 cis-len) (tty-write-char (schar string i)) (when char-end-string (device-write-string char-end-string 0 ces-len)))) (device-write-string string start end)) (when end-string (device-write-string end-string)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) (defun worth-using-insert-mode (device insert-char-num chars-saved) (let* ((init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device)) (cost 0)) (when init-string (incf cost (length (the simple-string init-string)))) (when char-init-string (incf cost (* insert-char-num (+ (length (the simple-string char-init-string)) (if char-end-string (length (the simple-string char-end-string)) 0))))) (when end-string (incf cost (length (the simple-string end-string)))) (< cost chars-saved))) (defun delete-char (hunk x y &optional (n 1)) (declare (fixnum x y n)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device))) (when init-string (device-write-string init-string)) (dotimes (i n) (device-write-string delete-char-string)) (when end-string (device-write-string end-string)))) (defun worth-using-delete-mode (device delete-char-num clear-char-num) (declare (fixnum delete-char-num clear-char-num)) (let ((init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device)) (clear-to-eol-string (tty-device-clear-to-eol-string device)) (cost 0)) (declare (type (or simple-string null) init-string end-string delete-char-string) (fixnum cost)) (when init-string (incf cost (the fixnum (length init-string)))) (when end-string (incf cost (the fixnum (length end-string)))) (incf cost (the fixnum (* (the fixnum (length delete-char-string)) delete-char-num))) (< cost (+ delete-char-num (if clear-to-eol-string (length clear-to-eol-string) clear-char-num))))) ;;; Standout mode (TTY-DEVICE-STANDOUT-INIT and TTY-DEVICE-STANDOUT-END) (defun standout-init (hunk) (device-write-string (tty-device-standout-init-string (device-hunk-device hunk)))) (defun standout-end (hunk) (device-write-string (tty-device-standout-end-string (device-hunk-device hunk))))
true
;;; -*- Log: hemlock.log; Package: hemlock-internals -*- ;;; ;;; ********************************************************************** ;;; This code was written as part of the CMU Common Lisp project at ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; #+CMU (ext:file-comment "$Header$") ;;; ;;; ********************************************************************** ;;; ;;; Written by PI:NAME:<NAME>END_PI. ;;; (in-package :hemlock-internals) (export '(redisplay redisplay-all define-tty-font)) ;;;; Macros. (eval-when (:compile-toplevel :execute) (defmacro tty-hunk-modeline-pos (hunk) `(tty-hunk-text-height ,hunk)) ) ;eval-when (defvar *currently-selected-hunk* nil) (defvar *hunk-top-line*) (declaim (fixnum *hunk-top-line*)) (eval-when (:compile-toplevel :execute) (defmacro select-hunk (hunk) `(unless (eq ,hunk *currently-selected-hunk*) (setf *currently-selected-hunk* ,hunk) (setf *hunk-top-line* (the fixnum (1+ (the fixnum (- (the fixnum (tty-hunk-text-position ,hunk)) (the fixnum (tty-hunk-text-height ,hunk))))))))) ) ;eval-when ;;; Screen image lines. ;;; (defstruct (si-line (:print-function print-screen-image-line) (:constructor %make-si-line (chars))) (chars nil :type simple-string) (length 0) (fonts nil :type list)) (defun make-si-line (n) (%make-si-line (make-string n))) (defun print-screen-image-line (obj str n) (declare (ignore n)) (write-string "#<Screen Image Line \"" str) (write-string (si-line-chars obj) str :end (si-line-length obj)) (write-string "\">" str)) (defun find-identical-prefix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (okay-until 0)) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len) (type (and unsigned-byte fixnum) okay-until)) (do ((dl-fonts dis-line-fonts (cdr dis-line-fonts)) (si-fonts (si-line-fonts si-line) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (let ((next-font (car (or dl-fonts si-fonts)))) (if next-font (let ((end (min dl-len si-len (cadr next-font)))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) end)) (let ((end (min dl-len si-len))) (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 end :end2 end) (if (= dl-len si-len) nil end)))))) (let ((dl-font (caar dl-fonts)) (dl-start (cadar dl-fonts)) (dl-stop (cddar dl-fonts)) (si-font (caar si-fonts)) (si-start (cadar si-fonts)) (si-stop (cddar si-fonts))) (unless (and (= dl-font si-font) (= dl-start si-start)) (let ((font-lossage (min dl-start si-start))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (unless (= dl-stop si-stop) (let ((font-lossage (min dl-stop si-stop))) (return (or (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 font-lossage :end2 font-lossage) font-lossage)))) (let ((mismatch (string/= dl-chars si-chars :start1 okay-until :start2 okay-until :end1 dl-stop :end2 si-stop))) (if mismatch (return mismatch) (setf okay-until dl-stop))))))) (defun find-identical-suffix (dis-line dis-line-fonts si-line) (declare (type dis-line dis-line) (type list dis-line-fonts) (type si-line si-line)) (let* ((dl-chars (dis-line-chars dis-line)) (dl-len (dis-line-length dis-line)) (si-chars (si-line-chars si-line)) (si-len (si-line-length si-line)) (count (dotimes (i (min dl-len si-len) i) (when (char/= (schar dl-chars (- dl-len i 1)) (schar si-chars (- si-len i 1))) (return i))))) (declare (type simple-string dl-chars si-chars) (type (and unsigned-byte fixnum) dl-len si-len)) (do ((dl-fonts (reverse dis-line-fonts) (cdr dis-line-fonts)) (si-fonts (reverse (si-line-fonts si-line)) (cdr si-fonts))) ((or (null dl-fonts) (null si-fonts)) (cond (dl-fonts (min (- dl-len (cddar dl-fonts)) count)) (si-fonts (min (- si-len (cddar si-fonts)) count)) (t count))) (let ((dl-font (caar dl-fonts)) (dl-start (- dl-len (cadar dl-fonts))) (dl-stop (- dl-len (cddar dl-fonts))) (si-font (caar si-fonts)) (si-start (- si-len (cadar si-fonts))) (si-stop (- si-len (cddar si-fonts)))) (unless (and (= dl-font si-font) (= dl-stop si-stop)) (return (min dl-stop si-stop count))) (unless (= dl-start si-start) (return (min dl-start si-start count))) (when (<= count dl-start) (return count)))))) (defmacro si-line (screen-image n) `(svref ,screen-image ,n)) ;;; Font support. (defvar *tty-font-strings* (make-array font-map-size :initial-element nil) "Array of (start-string . end-string) for fonts, or NIL if no such font.") (defun define-tty-font (font-id &rest stuff) (unless (<= 0 font-id (1- font-map-size)) (error "Bogus font-id: ~S" font-id)) (cond ((every #'keywordp stuff) (error "Can't extract font strings from the termcap entry yet.")) ((and (= (length stuff) 2) (stringp (car stuff)) (stringp (cadr stuff))) (setf (aref *tty-font-strings* font-id) (cons (car stuff) (cadr stuff)))) (t (error "Bogus font spec: ~S~%Must be either a list of keywords or ~ a list of the start string and end string.")))) (defun compute-font-usages (dis-line) (do ((results nil) (change (dis-line-font-changes dis-line) (font-change-next change)) (prev nil change)) ((null change) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (dis-line-length dis-line)) results)))) (nreverse results)) (when prev (let ((font (font-change-font prev))) (when (and (not (zerop font)) (aref *tty-font-strings* font)) (push (list* (font-change-font prev) (font-change-x prev) (font-change-x change)) results)))))) ;;;; Dumb window redisplay. (defmacro tty-dumb-line-redisplay (device hunk dis-line &optional y) (let ((dl (gensym)) (dl-chars (gensym)) (dl-fonts (gensym)) (dl-len (gensym)) (dl-pos (gensym)) (screen-image-line (gensym))) `(let* ((,dl ,dis-line) (,dl-chars (dis-line-chars ,dl)) (,dl-fonts (compute-font-usages ,dis-line)) (,dl-len (dis-line-length ,dl)) (,dl-pos ,(or y `(dis-line-position ,dl)))) (funcall (tty-device-display-string ,device) ,hunk 0 ,dl-pos ,dl-chars ,dl-fonts 0 ,dl-len) (setf (dis-line-flags ,dl) unaltered-bits) (setf (dis-line-delta ,dl) 0) (select-hunk ,hunk) (let ((,screen-image-line (si-line (tty-device-screen-image ,device) (+ *hunk-top-line* ,dl-pos)))) (replace-si-line (si-line-chars ,screen-image-line) ,dl-chars 0 0 ,dl-len) (setf (si-line-length ,screen-image-line) ,dl-len) (setf (si-line-fonts ,screen-image-line) ,dl-fonts))))) (defun tty-dumb-window-redisplay (window) (let* ((first (window-first-line window)) (hunk (window-hunk window)) (device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device))) (funcall (tty-device-clear-to-eow device) hunk 0 0) (do ((i 0 (1+ i)) (dl (cdr first) (cdr dl))) ((eq dl the-sentinel) (setf (window-old-lines window) (1- i)) (select-hunk hunk) (do ((last (tty-hunk-text-position hunk)) (i (+ *hunk-top-line* i) (1+ i))) ((> i last)) (declare (fixnum i last)) (let ((si-line (si-line screen-image i))) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))) (tty-dumb-line-redisplay device hunk (car dl) i)) (setf (window-first-changed window) the-sentinel (window-last-changed window) first) (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window)) (y (tty-hunk-modeline-pos hunk))) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (funcall (tty-device-clear-to-eol device) hunk 0 y) (tty-dumb-line-redisplay device hunk dl y)) (funcall (tty-device-standout-end device) hunk)) (setf (dis-line-flags dl) unaltered-bits))))) ;;;; Dumb redisplay top n lines of a window. (defun tty-redisplay-n-lines (window n) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (funcall (tty-device-clear-lines device) hunk 0 0 n) (do ((n n (1- n)) (dl (cdr (window-first-line window)) (cdr dl))) ((or (zerop n) (eq dl the-sentinel))) (tty-dumb-line-redisplay device hunk (car dl))))) ;;;; Semi dumb window redisplay ;;; This is for terminals without opening and deleting lines. ;;; TTY-SEMI-DUMB-WINDOW-REDISPLAY is a lot like TTY-SMART-WINDOW-REDISPLAY, ;;; but it calls different line redisplay functions. ;;; (defun tty-semi-dumb-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if ;; One line-changed. (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) (tty-semi-dumb-line-redisplay device hunk (car first-changed)) ;; More lines changed. (do-semi-dumb-line-writes first-changed last-changed hunk)) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;; NEXT-DIS-LINE is used in DO-SEMI-DUMB-LINE-WRITES and ;;; COMPUTE-TTY-CHANGES. ;;; (eval-when (:compile-toplevel :execute) (defmacro next-dis-line () `(progn (setf prev dl) (setf dl (cdr dl)) (setf flags (dis-line-flags (car dl))))) ) ;eval-when ;;; DO-SEMI-DUMB-LINE-WRITES does what it says until it hits the last ;;; changed line. The commented out code was a gratuitous optimization, ;;; especially if the first-changed line really is the first changes line. ;;; Anyway, this had to be removed because of this function's use in ;;; TTY-SMART-WINDOW-REDISPLAY, which was punting line moves due to ;;; "Scroll Redraw Ratio". However, these supposedly moved lines had their ;;; bits set to unaltered bits in COMPUTE-TTY-CHANGES because it was ;;; assuming TTY-SMART-WINDOW-REDISPLAY guaranteed to do line moves. ;;; (defun do-semi-dumb-line-writes (first-changed last-changed hunk) (let* ((dl first-changed) flags ;(dis-line-flags (car dl))) flags bound for NEXT-DIS-LINE. prev) ;; ;; Skip old, unchanged, unmoved lines. ;; (loop ;; (unless (zerop flags) (return)) ;; (next-dis-line)) ;; ;; Write every remaining line. (let* ((device (device-hunk-device hunk)) (force-output (device-force-output device))) (loop (tty-semi-dumb-line-redisplay device hunk (car dl)) (when force-output (funcall force-output)) (next-dis-line) (when (eq prev last-changed) (return)))))) ;;; TTY-SEMI-DUMB-LINE-REDISPLAY finds the first different character ;;; comparing the display line and the screen image line, writes out the ;;; rest of the display line, and clears to end-of-line as necessary. ;;; (defun tty-semi-dumb-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (cond ;; See if the screen shows an initial substring of the dis-line. ((= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len)) ;; When the dis-line is an initial substring of what's on the screen. ((= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) ;; Otherwise, blast dl-chars and clear to eol as necessary. (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dl-len si-line-length) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Smart window redisplay -- operation queues and internal screen image. ;;; This is used for creating temporary smart redisplay structures. ;;; (defconstant tty-hunk-height-limit 100) ;;; Queues for redisplay operations and access macros. ;;; (defvar *tty-line-insertions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-deletions* (make-array (* 2 tty-hunk-height-limit))) (defvar *tty-line-writes* (make-array tty-hunk-height-limit)) (defvar *tty-line-moves* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) (defmacro queue (value queue ptr) `(progn (setf (svref ,queue ,ptr) ,value) (the fixnum (incf (the fixnum ,ptr))))) (defmacro dequeue (queue ptr) `(prog1 (svref ,queue ,ptr) (the fixnum (incf (the fixnum ,ptr))))) ) ;eval-when ;;; INSERT-LINE-COUNT is used in TTY-SMART-WINDOW-REDISPLAY. The counting is ;;; based on calls to QUEUE in COMPUTE-TTY-CHANGES. ;;; (defun insert-line-count (ins) (do ((i 1 (+ i 2)) (count 0 (+ count (svref *tty-line-insertions* i)))) ((> i ins) count))) ;;; Temporary storage for screen-image lines and accessing macros. ;;; (defvar *screen-image-temp* (make-array tty-hunk-height-limit)) (eval-when (:compile-toplevel :execute) ;;; DELETE-SI-LINES is used in DO-LINE-DELETIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num ;;; lines are deleted and saved in *screen-image-temp*; fsil is the ;;; end of the free screen image lines saved here. Also, we must ;;; move lines up in the screen-image structure. In the outer loop ;;; we save lines in the temp storage and move lines up at the same ;;; time. In the termination/inner loop we move any lines that still ;;; need to be moved up. The screen-length is adjusted by the fsil ;;; because any time a deletion is in progress, there are fsil bogus ;;; lines at the bottom of the screen image from lines being moved ;;; up previously. ;;; (defmacro delete-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (delete-index (gensym)) (free-lines (gensym)) (source-index (gensym)) (target-index (gensym)) (n (gensym)) (do-screen-length (gensym)) (do-y (gensym))) `(let ((,do-screen-image ,screen-image) (,do-screen-length (- ,screen-length fsil)) (,do-y ,y)) (declare (fixnum ,do-screen-length ,do-y)) (do ((,delete-index ,do-y (1+ ,delete-index)) (,free-lines ,fsil (1+ ,free-lines)) (,source-index (+ ,do-y ,num) (1+ ,source-index)) (,n ,num (1- ,n))) ((zerop ,n) (do ((,target-index ,delete-index (1+ ,target-index)) (,source-index ,source-index (1+ ,source-index))) ((>= ,source-index ,do-screen-length)) (declare (fixnum ,target-index ,source-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))) (declare (fixnum ,delete-index ,free-lines ,source-index ,n)) (setf (si-line *screen-image-temp* ,free-lines) (si-line ,do-screen-image ,delete-index)) (when (< ,source-index ,do-screen-length) (setf (si-line ,do-screen-image ,delete-index) (si-line ,do-screen-image ,source-index))))))) ;;; INSERT-SI-LINES is used in DO-LINE-INSERTIONS to simulate what's ;;; happening to the screen in a device's screen-image. At y, num free ;;; lines are inserted from *screen-image-temp*; fsil is the end of the ;;; free lines. When copying lines down in screen-image, we must start ;;; with the lower lines and end with the higher ones, so we don't trash ;;; any lines. The outer loop does all the copying, and the termination/ ;;; inner loop inserts the free screen image lines, setting their length ;;; to zero. ;;; (defmacro insert-si-lines (screen-image y num fsil screen-length) (let ((do-screen-image (gensym)) (source-index (gensym)) (target-index (gensym)) (target-terminus (gensym)) (do-screen-length (gensym)) (temp (gensym)) (do-y (gensym)) (insert-index (gensym)) (free-lines-index (gensym)) (n (gensym))) `(let ((,do-screen-length ,screen-length) (,do-screen-image ,screen-image) (,do-y ,y)) (do ((,target-terminus (1- (+ ,do-y ,num))) ; (1- target-start) (,source-index (- ,do-screen-length ,fsil 1) ; (1- source-end) (1- ,source-index)) (,target-index (- (+ ,do-screen-length ,num) ,fsil 1) ; (1- target-end) (1- ,target-index))) ((= ,target-index ,target-terminus) (do ((,insert-index ,do-y (1+ ,insert-index)) (,free-lines-index (1- ,fsil) (1- ,free-lines-index)) (,n ,num (1- ,n))) ((zerop ,n)) (declare (fixnum ,insert-index ,free-lines-index ,n)) (let ((,temp (si-line *screen-image-temp* ,free-lines-index))) (setf (si-line-length ,temp) 0) (setf (si-line-fonts ,temp) nil) (setf (si-line ,do-screen-image ,insert-index) ,temp))) (decf ,fsil ,num)) (declare (fixnum ,target-terminus ,source-index ,target-index)) (setf (si-line ,do-screen-image ,target-index) (si-line ,do-screen-image ,source-index)))))) ) ;eval-when ;;;; Smart window redisplay -- the function. ;;; TTY-SMART-WINDOW-REDISPLAY sees if only one line changed after ;;; some preliminary processing. If more than one line changed, ;;; then we compute changes to make to the screen in the form of ;;; line insertions, deletions, and writes. Deletions must be done ;;; first, so lines are not lost off the bottom of the screen by ;;; inserting lines. ;;; (defun tty-smart-window-redisplay (window) (let* ((hunk (window-hunk window)) (device (device-hunk-device hunk))) (let ((first-changed (window-first-changed window)) (last-changed (window-last-changed window))) ;; Is there anything to do? (unless (eq first-changed the-sentinel) (if (and (eq first-changed last-changed) (zerop (dis-line-delta (car first-changed)))) ;; One line-changed. (tty-smart-line-redisplay device hunk (car first-changed)) ;; More lines changed. (multiple-value-bind (ins outs writes moves) (compute-tty-changes first-changed last-changed (tty-hunk-modeline-pos hunk)) (let ((ratio (variable-value 'hemlock::scroll-redraw-ratio))) (cond ((and ratio (> (/ (insert-line-count ins) (tty-hunk-text-height hunk)) ratio)) (do-semi-dumb-line-writes first-changed last-changed hunk)) (t (do-line-insertions hunk ins (do-line-deletions hunk outs)) (note-line-moves moves) (do-line-writes hunk writes)))))) ;; Set the bounds so we know we displayed... (setf (window-first-changed window) the-sentinel (window-last-changed window) (window-first-line window)))) ;; ;; Clear any extra lines at the end of the window. (let ((pos (dis-line-position (car (window-last-line window))))) (when (< pos (1- (window-height window))) (tty-smart-clear-to-eow hunk (1+ pos))) (setf (window-old-lines window) pos)) ;; ;; Update the modeline if needed. (when (window-modeline-buffer window) (let ((dl (window-modeline-dis-line window))) (when (/= (dis-line-flags dl) unaltered-bits) (unwind-protect (progn (funcall (tty-device-standout-init device) hunk) (tty-smart-line-redisplay device hunk dl (tty-hunk-modeline-pos hunk))) (funcall (tty-device-standout-end device) hunk))))))) ;;;; Smart window redisplay -- computing changes to the display. ;;; There is a lot of documentation here to help since this code is not ;;; obviously correct. The code is not that cryptic, but the correctness ;;; of the algorithm is somewhat. Most of the complexity is in handling ;;; lines that moved on the screen which the introduction deals with. ;;; Also, the block of documentation immediately before the function ;;; COMPUTE-TTY-CHANGES has its largest portion dedicated to this part of ;;; the function which is the largest block of code in the function. ;;; The window image dis-lines are annotated with the difference between ;;; their current intended locations and their previous locations in the ;;; window. This delta (distance moved) is negative for an upward move and ;;; positive for a downward move. To determine what to do with moved ;;; groups of lines, we consider the transition (or difference in deltas) ;;; between two adjacent groups as we look at the window's dis-lines moving ;;; down the window image, disregarding whether they are contiguous (having ;;; moved only by a different delta) or separated by some lines (such as ;;; lines that are new and unmoved). ;;; ;;; Considering the transition between moved groups makes sense because a ;;; given group's delta affects all the lines below it since the dis-lines ;;; reflect the window's buffer's actual lines which are all connected in ;;; series. Therefore, if the previous group moved up some delta number of ;;; lines because of line deletions, then the lines below this group (down ;;; to the last line of the window image) moved up by the same delta too, ;;; unless one of the following is true: ;;; 1] The lines below the group moved up by a greater delta, possibly ;;; due to multiple disjoint buffer line deletions. ;;; 2] The lines below the group moved up by a lesser delta, possibly ;;; due to a number (less than the previous delta) of new line ;;; insertions below the group that moved up. ;;; 3] The lines below the group moved down, possibly due to a number ;;; (greater than the previous delta) of new line insertions below ;;; the group that moved up. ;;; Similarly, if the previous group moved down some delta number of lines ;;; because of new line insertions, then the lines below this group (down ;;; to the last line of the window image not to fall off the window's lower ;;; edge) moved down by the same delta too, unless one of the following is ;;; true: ;;; 1] The lines below the group moved down by a greater delta, possibly ;;; due to multiple disjoint buffer line insertions. ;;; 2] The lines below the group moved down by a lesser delta, possibly ;;; due to a number (less than the previous delta) of line deletions ;;; below the group that moved down. ;;; 3] The lines below the group moved up, possibly due to a number ;;; (greater than the previous delta) of line deletions below the ;;; group that moved down. ;;; ;;; Now we can see how the first moved group affects the window image below ;;; it except where there is a lower group of lines that have moved a ;;; different delta due to separate operations on the buffer's lines viewed ;;; through a window. We can see that this different delta is the expected ;;; effect throughout the window image below the second group, unless ;;; something lower down again has affected the window image. Also, in the ;;; case of a last group of lines that moved up, the group will never ;;; reflect all of the lines in the window image from the first line to ;;; move down to the bottom of the window image because somewhere down below ;;; the group that moved up are some new lines that have just been drawn up ;;; into the window's image. ;;; ;;; COMPUTE-TTY-CHANGES is used once in TTY-SMART-WINDOW-REDISPLAY. ;;; It goes through all the display lines for a window recording where ;;; lines need to be inserted, deleted, or written to make the screen ;;; consistent with the internal image of the screen. Pointers to ;;; the insertions, deletions, and writes that have to be done are ;;; returned. ;;; ;;; If a line is new, then simply queue it to be written. ;;; ;;; If a line is moved and/or changed, then we compute the difference ;;; between the last block of lines that moved with the same delta and the ;;; current block of lines that moved with the current delta. If this ;;; difference is positive, then some lines need to be deleted. Since we ;;; do all the line deletions first to prevent line insertions from ;;; dropping lines off the bottom of the screen, we have to compute the ;;; position of line deletions using the cumulative insertions ;;; (cum-inserts). Without any insertions, deletions may be done right at ;;; the dis-line's new position. With insertions needed above a given ;;; deletion point combined with the fact that deletions are all done ;;; first, the location for the deletion is higher than it would be without ;;; the insertions being done above the deletions. The location of the ;;; deletion is higher by the number of insertions we have currently put ;;; off. When computing the position of line insertions (a negative delta ;;; transition), we do not need to consider the cumulative insertions or ;;; cumulative deletions since everything above the point of insertion ;;; (both deletions and insertions) has been done. Because of the screen ;;; state being correct above the point of an insertion, the screen is only ;;; off by the delta transition number of lines. After determining the ;;; line insertions or deletions, loop over contiguous lines with the same ;;; delta queuing any changed ones to be written. The delta and flag ;;; fields are initialized according to the need to be written; since ;;; redisplay may be interrupted by more user input after moves have been ;;; done to the screen, we save the changed bit on, so the line will be ;;; queued to be written after redisplay is re-entered. ;;; ;;; If the line is changed or new, then queue it to be written. Since we can ;;; abort out of the actual dislpay at any time (due to pending input), we ;;; don't clear the flags or delta here. A dis-line may be groveled many times ;;; by this function before it actually makes it to the screen, so we may have ;;; odd combinations of bits such as both new and changed. ;;; ;;; Otherwise, get the next display line, loop, and see if it's ;;; interesting. ;;; (defun compute-tty-changes (first-changed last-changed modeline-pos) (declare (fixnum modeline-pos)) (let* ((dl first-changed) (flags (dis-line-flags (car dl))) (ins 0) (outs 0) (writes 0) (moves 0) (prev-delta 0) (cum-deletes 0) (net-delta 0) (cum-inserts 0) prev) (declare (fixnum flags ins outs writes moves prev-delta cum-deletes net-delta cum-inserts)) (loop (cond ((logtest flags new-bit) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) ((logtest flags moved-bit) (let* ((start-dl (car dl)) (start-pos (dis-line-position start-dl)) (curr-delta (dis-line-delta start-dl)) (delta-delta (- prev-delta curr-delta)) (car-dl start-dl)) (declare (fixnum start-pos curr-delta delta-delta)) (cond ((plusp delta-delta) (queue (the fixnum (- start-pos cum-inserts)) *tty-line-deletions* outs) (queue delta-delta *tty-line-deletions* outs) (incf cum-deletes delta-delta) (decf net-delta delta-delta)) ((minusp delta-delta) (let ((eff-pos (the fixnum (+ start-pos delta-delta))) (num (the fixnum (- delta-delta)))) (queue eff-pos *tty-line-insertions* ins) (queue num *tty-line-insertions* ins) (incf net-delta num) (incf cum-inserts num)))) (loop (if (logtest flags (logior changed-bit new-bit)) (queue car-dl *tty-line-writes* writes) (queue car-dl *tty-line-moves* moves)) (next-dis-line) (setf car-dl (car dl)) (when (or (eq prev last-changed) (/= (the fixnum (dis-line-delta car-dl)) curr-delta)) (setf prev-delta curr-delta) (return))))) ((logtest flags (logior changed-bit new-bit)) (queue (car dl) *tty-line-writes* writes) (next-dis-line)) (t (next-dis-line))) (when (eq prev last-changed) (unless (zerop net-delta) (cond ((plusp net-delta) (queue (the fixnum (- modeline-pos cum-deletes net-delta)) *tty-line-deletions* outs) (queue net-delta *tty-line-deletions* outs)) (t (queue (the fixnum (+ modeline-pos net-delta)) *tty-line-insertions* ins) (queue (the fixnum (- net-delta)) *tty-line-insertions* ins)))) (return (values ins outs writes moves)))))) ;;;; Smart window redisplay -- operation methods. ;;; TTY-SMART-CLEAR-TO-EOW clears lines y through the last text line of hunk. ;;; It takes care not to clear a line unless it really has some characters ;;; displayed on it. It also maintains the device's screen image lines. ;;; (defun tty-smart-clear-to-eow (hunk y) (let* ((device (device-hunk-device hunk)) (screen-image (tty-device-screen-image device)) (clear-to-eol (tty-device-clear-to-eol device))) (select-hunk hunk) (do ((y y (1+ y)) (si-idx (+ *hunk-top-line* y) (1+ si-idx)) (last (tty-hunk-text-position hunk))) ((> si-idx last)) (declare (fixnum y si-idx last)) (let ((si-line (si-line screen-image si-idx))) (unless (zerop (si-line-length si-line)) (funcall clear-to-eol hunk 0 y) (setf (si-line-length si-line) 0) (setf (si-line-fonts si-line) nil)))))) ;;; NOTE-LINE-MOVES -- Internal ;;; ;;; Clear out the flags and delta of lines that have been moved. ;;; (defun note-line-moves (moves) (let ((i 0)) (loop (when (= i moves) (return)) (let ((dl (dequeue *tty-line-moves* i))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))))) ;;; DO-LINE-DELETIONS pops elements off the *tty-lines-deletions* queue, ;;; deleting lines from hunk's area of the screen. The internal screen ;;; image is updated, and the total number of lines deleted is returned. ;;; (defun do-line-deletions (hunk outs) (declare (fixnum outs)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-delete-line device)) (fsil 0)) ;free-screen-image-lines (declare (fixnum i fsil)) (loop (when (= i outs) (return fsil)) (let ((y (dequeue *tty-line-deletions* i)) (num (dequeue *tty-line-deletions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (delete-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)) (incf fsil num))))) ;;; DO-LINE-INSERTIONS pops elements off the *tty-line-insertions* queue, ;;; inserting lines into hunk's area of the screen. The internal screen ;;; image is updated using free screen image lines pointed to by fsil. ;;; (defun do-line-insertions (hunk ins fsil) (declare (fixnum ins fsil)) (let* ((i 0) (device (device-hunk-device hunk)) (fun (tty-device-open-line device))) (declare (fixnum i)) (loop (when (= i ins) (return)) (let ((y (dequeue *tty-line-insertions* i)) (num (dequeue *tty-line-insertions* i))) (declare (fixnum y num)) (funcall fun hunk 0 y num) (select-hunk hunk) (insert-si-lines (tty-device-screen-image device) (+ *hunk-top-line* y) num fsil (tty-device-lines device)))))) ;;; DO-LINE-WRITES pops elements off the *tty-line-writes* queue, displaying ;;; these dis-lines with TTY-SMART-LINE-REDISPLAY. We force output after ;;; each line, so the user can see how far we've gotten in case he chooses ;;; to give more editor commands which will abort redisplay until there's no ;;; more input. ;;; (defun do-line-writes (hunk writes) (declare (fixnum writes)) (let* ((i 0) (device (device-hunk-device hunk)) (force-output (device-force-output device))) (declare (fixnum i)) (loop (when (= i writes) (return)) (tty-smart-line-redisplay device hunk (dequeue *tty-line-writes* i)) (when force-output (funcall force-output))))) ;;; TTY-SMART-LINE-REDISPLAY uses an auxiliary screen image structure to ;;; try to do minimal character shipping to the terminal. Roughly, we find ;;; the first different character when comparing what's on the screen and ;;; what should be there; we will start altering the line after this same ;;; initial substring. Then we find, from the end, the first character ;;; that is different, blasting out characters to the lesser of the two ;;; indexes. If the dis-line index is lesser, we have some characters to ;;; delete from the screen, and if the screen index is lesser, we have some ;;; additional dis-line characters to insert. There are a few special ;;; cases that allow us to punt out of the above algorithm sketch. If the ;;; terminal doesn't have insert mode or delete mode, we have blast out to ;;; the end of the dis-line and possibly clear to the end of the screen's ;;; line, as appropriate. Sometimes we don't use insert or delete mode ;;; because of the overhead cost in characters; it simply is cheaper to ;;; blast out characters and clear to eol. ;;; (defun tty-smart-line-redisplay (device hunk dl &optional (dl-pos (dis-line-position dl))) (declare (fixnum dl-pos)) (let* ((dl-chars (dis-line-chars dl)) (dl-len (dis-line-length dl)) (dl-fonts (compute-font-usages dl))) (declare (fixnum dl-len) (simple-string dl-chars)) (when (listen-editor-input *editor-input*) (throw 'redisplay-catcher :editor-input)) (select-hunk hunk) (let* ((screen-image-line (si-line (tty-device-screen-image device) (+ *hunk-top-line* dl-pos))) (si-line-chars (si-line-chars screen-image-line)) (si-line-length (si-line-length screen-image-line)) (findex (find-identical-prefix dl dl-fonts screen-image-line))) (declare (type (or fixnum null) findex) (simple-string si-line-chars)) ;; ;; When the dis-line and screen chars are not string=. (when findex (block tslr-main-body ;; ;; See if the screen shows an initial substring of the dis-line. (when (= findex si-line-length) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) ;; ;; When the dis-line is an initial substring of what's on the screen. (when (= findex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos) (return-from tslr-main-body t)) ;; ;; Find trailing substrings that are the same. (multiple-value-bind (sindex dindex) (let ((count (find-identical-suffix dl dl-fonts screen-image-line))) (values (- si-line-length count) (- dl-len count))) (declare (fixnum sindex dindex)) ;; ;; No trailing substrings -- blast and clear to eol. (when (= dindex dl-len) (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex dl-len) (when (< dindex sindex) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos)) (replace-si-line si-line-chars dl-chars findex findex dl-len) (return-from tslr-main-body t)) (let ((lindex (min sindex dindex))) (cond ((< lindex findex) ;; This can happen in funny situations -- believe me! (setf lindex findex)) (t (funcall (tty-device-display-string device) hunk findex dl-pos dl-chars dl-fonts findex lindex) (replace-si-line si-line-chars dl-chars findex findex lindex))) (cond ((= dindex sindex)) ((< dindex sindex) (let ((delete-char-num (- sindex dindex))) (cond ((and (tty-device-delete-char device) (worth-using-delete-mode device delete-char-num (- si-line-length dl-len))) (funcall (tty-device-delete-char device) hunk dindex dl-pos delete-char-num)) (t (funcall (tty-device-display-string device) hunk dindex dl-pos dl-chars dl-fonts dindex dl-len) (funcall (tty-device-clear-to-eol device) hunk dl-len dl-pos))))) (t (if (and (tty-device-insert-string device) (worth-using-insert-mode device (- dindex sindex) (- dl-len sindex))) (funcall (tty-device-insert-string device) hunk sindex dl-pos dl-chars sindex dindex) (funcall (tty-device-display-string device) hunk sindex dl-pos dl-chars dl-fonts sindex dl-len)))) (replace-si-line si-line-chars dl-chars lindex lindex dl-len)))) (setf (si-line-length screen-image-line) dl-len) (setf (si-line-fonts screen-image-line) dl-fonts))) (setf (dis-line-flags dl) unaltered-bits) (setf (dis-line-delta dl) 0))) ;;;; Device methods ;;; Initializing and exiting the device (DEVICE-INIT and DEVICE-EXIT functions). ;;; These can be found in Tty-Display-Rt.Lisp. ;;; Clearing the device (DEVICE-CLEAR functions). (defun clear-device (device) (device-write-string (tty-device-clear-string device)) (cursor-motion device 0 0) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) 0)) ;;; Moving the cursor around (DEVICE-PUT-CURSOR) ;;; TTY-PUT-CURSOR makes sure the coordinates are mapped from the hunk's ;;; axis to the screen's and determines the minimal cost cursor motion ;;; sequence. Currently, it does no cost analysis of relative motion ;;; compared to absolute motion but simply makes sure the cursor isn't ;;; already where we want it. ;;; (defun tty-put-cursor (hunk x y) (declare (fixnum x y)) (select-hunk hunk) (let ((y (the fixnum (+ *hunk-top-line* y))) (device (device-hunk-device hunk))) (declare (fixnum y)) (unless (and (= (the fixnum (tty-device-cursor-x device)) x) (= (the fixnum (tty-device-cursor-y device)) y)) (cursor-motion device x y) (setf (tty-device-cursor-x device) x) (setf (tty-device-cursor-y device) y)))) ;;; UPDATE-CURSOR is used in device redisplay methods to make sure the ;;; cursor is where it should be. ;;; (eval-when (:compile-toplevel :execute) (defmacro update-cursor (hunk x y) `(funcall (device-put-cursor (device-hunk-device ,hunk)) ,hunk ,x ,y)) ) ;eval-when ;;; CURSOR-MOTION takes two coordinates on the screen's axis, ;;; moving the cursor to that location. X is the column index, ;;; and y is the line index, but Unix and Termcap believe that ;;; the default order of indexes is first the line and then the ;;; column or (y,x). Because of this, when reversep is non-nil, ;;; we send first x and then y. ;;; (defun cursor-motion (device x y) (let ((x-add-char (tty-device-cm-x-add-char device)) (y-add-char (tty-device-cm-y-add-char device)) (x-condx-add (tty-device-cm-x-condx-char device)) (y-condx-add (tty-device-cm-y-condx-char device)) (one-origin (tty-device-cm-one-origin device))) (when x-add-char (incf x x-add-char)) (when (and x-condx-add (> x x-condx-add)) (incf x (tty-device-cm-x-condx-add-char device))) (when y-add-char (incf y y-add-char)) (when (and y-condx-add (> y y-condx-add)) (incf y (tty-device-cm-y-condx-add-char device))) (when one-origin (incf x) (incf y))) (device-write-string (tty-device-cm-string1 device)) (let ((reversep (tty-device-cm-reversep device)) (x-pad (tty-device-cm-x-pad device)) (y-pad (tty-device-cm-y-pad device))) (if reversep (cm-output-coordinate x x-pad) (cm-output-coordinate y y-pad)) (device-write-string (tty-device-cm-string2 device)) (if reversep (cm-output-coordinate y y-pad) (cm-output-coordinate x x-pad)) (device-write-string (tty-device-cm-string3 device)))) ;;; CM-OUTPUT-COORDINATE outputs the coordinate with respect to the pad. If ;;; there is a pad, then the coordinate needs to be sent as digit-char's (for ;;; each digit in the coordinate), and if there is no pad, the coordinate needs ;;; to be converted into a character. Using CODE-CHAR here is not really ;;; portable. With a pad, the coordinate buffer is filled from the end as we ;;; truncate the coordinate by 10, generating ones digits. ;;; (defconstant cm-coordinate-buffer-len 5) (defvar *cm-coordinate-buffer* (make-string cm-coordinate-buffer-len)) ;;; (defun cm-output-coordinate (coordinate pad) (cond (pad (let ((i (1- cm-coordinate-buffer-len))) (loop (when (= i -1) (error "Terminal has too many lines!")) (multiple-value-bind (tens ones) (truncate coordinate 10) (setf (schar *cm-coordinate-buffer* i) (digit-char ones)) (when (zerop tens) (dotimes (n (- pad (- cm-coordinate-buffer-len i))) (decf i) (setf (schar *cm-coordinate-buffer* i) #\0)) (device-write-string *cm-coordinate-buffer* i cm-coordinate-buffer-len) (return)) (decf i) (setf coordinate tens))))) (t (tty-write-char (code-char coordinate))))) ;;; Writing strings (TTY-DEVICE-DISPLAY-STRING functions) ;;; DISPLAY-STRING is used to put a string at (x,y) on the device. ;;; (defun display-string (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) ;; Ignore font info for chars before the start of the string. (loop (if (or (null font-info) (< start (cddar font-info))) (return) (pop font-info))) (let ((posn start)) (dolist (next-font font-info) (let ((font (car next-font)) (start (cadr next-font)) (stop (cddr next-font))) (when (<= end start) (return)) (when (< posn start) (device-write-string string posn start) (setf posn start)) (let ((new-posn (min stop end)) (font-strings (aref *tty-font-strings* font))) (unwind-protect (progn (device-write-string (car font-strings)) (device-write-string string posn new-posn)) (device-write-string (cdr font-strings))) (setf posn new-posn)))) (when (< posn end) (device-write-string string posn end))) (setf (tty-device-cursor-x (device-hunk-device hunk)) (the fixnum (+ x (the fixnum (- end start)))))) ;;; DISPLAY-STRING-CHECKING-UNDERLINES is used for terminals that special ;;; case underlines doing an overstrike when they don't otherwise overstrike. ;;; Note: we do not know in this code whether the terminal can backspace (or ;;; what the sequence is), whether the terminal has insert-mode, or whether ;;; the terminal has delete-mode. ;;; (defun display-string-checking-underlines (hunk x y string font-info &optional (start 0) (end (strlen string))) (declare (ignore font-info)) (declare (fixnum x y start end) (simple-string string)) (update-cursor hunk x y) (let ((upos (position #\_ string :test #'char= :start start :end end)) (device (device-hunk-device hunk))) (if upos (let ((previous start) (after-pos 0)) (declare (fixnum previous after-pos)) (loop (device-write-string string previous upos) (setf after-pos (do ((i (1+ upos) (1+ i))) ((or (= i end) (char/= (schar string i) #\_)) i) (declare (fixnum i)))) (let ((ulen (the fixnum (- after-pos upos))) (cursor-x (the fixnum (+ x (the fixnum (- after-pos start)))))) (declare (fixnum ulen)) (dotimes (i ulen) (tty-write-char #\space)) (setf (tty-device-cursor-x device) cursor-x) (update-cursor hunk upos y) (dotimes (i ulen) (tty-write-char #\_)) (setf (tty-device-cursor-x device) cursor-x)) (setf previous after-pos) (setf upos (position #\_ string :test #'char= :start previous :end end)) (unless upos (device-write-string string previous end) (return)))) (device-write-string string start end)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) ;;; DEVICE-WRITE-STRING is used to shove a string at the terminal regardless ;;; of cursor position. ;;; (defun device-write-string (string &optional (start 0) (end (strlen string))) (declare (fixnum start end)) (unless (= start end) (tty-write-string string start (the fixnum (- end start))))) ;;; Clearing lines (TTY-DEVICE-CLEAR-TO-EOL, DEVICE-CLEAR-LINES, and ;;; TTY-DEVICE-CLEAR-TO-EOW functions.) (defun clear-to-eol (hunk x y) (update-cursor hunk x y) (device-write-string (tty-device-clear-to-eol-string (device-hunk-device hunk)))) (defun space-to-eol (hunk x y) (declare (fixnum x)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (num (- (the fixnum (tty-device-columns device)) x))) (declare (fixnum num)) (dotimes (i num) (tty-write-char #\space)) (setf (tty-device-cursor-x device) (+ x num)))) (defun clear-lines (hunk x y n) (let* ((device (device-hunk-device hunk)) (clear-to-eol (tty-device-clear-to-eol device))) (funcall clear-to-eol hunk x y) (do ((y (1+ y) (1+ y)) (count (1- n) (1- count))) ((zerop count) (setf (tty-device-cursor-x device) 0) (setf (tty-device-cursor-y device) (1- y))) (declare (fixnum count y)) (funcall clear-to-eol hunk 0 y)))) (defun clear-to-eow (hunk x y) (declare (fixnum x y)) (funcall (tty-device-clear-lines (device-hunk-device hunk)) hunk x y (the fixnum (- (the fixnum (tty-hunk-text-height hunk)) y)))) ;;; Opening and Deleting lines (TTY-DEVICE-OPEN-LINE and TTY-DEVICE-DELETE-LINE) (defun open-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-open-line-string (device-hunk-device hunk))))) (defun delete-tty-line (hunk x y &optional (n 1)) (update-cursor hunk x y) (dotimes (i n) (device-write-string (tty-device-delete-line-string (device-hunk-device hunk))))) ;;; Insert and Delete modes (TTY-DEVICE-INSERT-STRING and TTY-DEVICE-DELETE-CHAR) (defun tty-insert-string (hunk x y string &optional (start 0) (end (strlen string))) (declare (fixnum x y start end)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device))) (declare (type (or simple-string null) char-init-string char-end-string)) (when init-string (device-write-string init-string)) (if char-init-string (let ((cis-len (length char-init-string)) (ces-len (length char-end-string))) (do ((i start (1+ i))) ((= i end)) (device-write-string char-init-string 0 cis-len) (tty-write-char (schar string i)) (when char-end-string (device-write-string char-end-string 0 ces-len)))) (device-write-string string start end)) (when end-string (device-write-string end-string)) (setf (tty-device-cursor-x device) (the fixnum (+ x (the fixnum (- end start))))))) (defun worth-using-insert-mode (device insert-char-num chars-saved) (let* ((init-string (tty-device-insert-init-string device)) (char-init-string (tty-device-insert-char-init-string device)) (char-end-string (tty-device-insert-char-end-string device)) (end-string (tty-device-insert-end-string device)) (cost 0)) (when init-string (incf cost (length (the simple-string init-string)))) (when char-init-string (incf cost (* insert-char-num (+ (length (the simple-string char-init-string)) (if char-end-string (length (the simple-string char-end-string)) 0))))) (when end-string (incf cost (length (the simple-string end-string)))) (< cost chars-saved))) (defun delete-char (hunk x y &optional (n 1)) (declare (fixnum x y n)) (update-cursor hunk x y) (let* ((device (device-hunk-device hunk)) (init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device))) (when init-string (device-write-string init-string)) (dotimes (i n) (device-write-string delete-char-string)) (when end-string (device-write-string end-string)))) (defun worth-using-delete-mode (device delete-char-num clear-char-num) (declare (fixnum delete-char-num clear-char-num)) (let ((init-string (tty-device-delete-init-string device)) (end-string (tty-device-delete-end-string device)) (delete-char-string (tty-device-delete-char-string device)) (clear-to-eol-string (tty-device-clear-to-eol-string device)) (cost 0)) (declare (type (or simple-string null) init-string end-string delete-char-string) (fixnum cost)) (when init-string (incf cost (the fixnum (length init-string)))) (when end-string (incf cost (the fixnum (length end-string)))) (incf cost (the fixnum (* (the fixnum (length delete-char-string)) delete-char-num))) (< cost (+ delete-char-num (if clear-to-eol-string (length clear-to-eol-string) clear-char-num))))) ;;; Standout mode (TTY-DEVICE-STANDOUT-INIT and TTY-DEVICE-STANDOUT-END) (defun standout-init (hunk) (device-write-string (tty-device-standout-init-string (device-hunk-device hunk)))) (defun standout-end (hunk) (device-write-string (tty-device-standout-end-string (device-hunk-device hunk))))
[ { "context": "ion\n;;;; All rights reserved.\n;;;;\n;;;; Author(s): Neil T. Dantam <[email protected]>\n;;;; Georgia Tech Humanoid Robot", "end": 143, "score": 0.9998809099197388, "start": 129, "tag": "NAME", "value": "Neil T. Dantam" }, { "context": "ts reserved.\n;;;;\n;;;; Author(s): Neil T. Dantam <[email protected]>\n;;;; Georgia Tech Humanoid Robotics Lab\n;;;; Und", "end": 159, "score": 0.9999305605888367, "start": 145, "tag": "EMAIL", "value": "[email protected]" } ]
src/bnf.lisp
golems/motion-grammar-kit
10
;;;; -*- Lisp -*- ;;;; ;;;; Copyright (c) 2012, Georgia Tech Research Corporation ;;;; All rights reserved. ;;;; ;;;; Author(s): Neil T. Dantam <[email protected]> ;;;; Georgia Tech Humanoid Robotics Lab ;;;; Under Direction of Prof. Mike Stilman ;;;; ;;;; This file is provided under the following "BSD-style" License: ;;;; ;;;; Redistribution and use in source and binary forms, with or ;;;; without modification, are permitted provided that the following ;;;; conditions are met: ;;;; * Redistributions of source code must retain the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer. ;;;; * Redistributions in binary form must reproduce the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer in the documentation and/or other materials ;;;; provided with the distribution. ;;;; ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ;;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ;;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ;;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ;;;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ;;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ;;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ;;;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ;;;; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (in-package :motion-grammar-kit) (defun bnf-chop-ears (string) (subseq string 1 (1- (length string)))) (deflexer bnf-lexer (terminal (:concatenation #\" (:+ (:union :alnum-class #\- #\_)) #\") (symbol-function 'bnf-chop-ears)) (nonterminal (:concatenation #\< (:+ (:union :alnum-class #\- #\_)) #\>) (symbol-function 'bnf-chop-ears)) (equals (:union "=" ":=" "::=" "->")) (newline (:+ #\Newline)) (alternate #\|) (:skip (:union (:+ :blank-class) (:concatenation #\; (:closure (:not #\Newline)) (:closure #\Newline))))) (defun bnf-parse (stream) (let (rules) (labels ((next () (bnf-lexer stream)) (head (type text) (assert (eq type 'nonterminal)) (multiple-value-bind (equals text) (next) (declare (ignore text)) (assert (eq equals 'equals))) (stuff type text)) (stuff (type text) (assert (or (eq type 'terminal) (eq type 'nonterminal))) (multiple-value-bind (body body-type body-text) (body) (declare (ignore body-text)) (push (cons text body) rules) (ecase body-type ((nil) nil) (alternate (stuff type text)) (newline (multiple-value-bind (next-type next-text) (next) (ecase next-type (nonterminal (head next-type next-text)) (alternate (stuff type text)) ((nil) nil))))))) (body () (multiple-value-bind (type text) (next) (ecase type ((terminal nonterminal) (multiple-value-bind (next-body next-type next-text) (body) (values (cons text next-body) next-type next-text))) ((newline alternate nil) (values nil type text)))))) (multiple-value-call #'head (next))) (reverse rules))) (defun save-bnf (grammar filespec &key if-exists) "Save GRAMMAR to a file in Backus-Naur Form. IF-EXISTS: one of :error, :new-version, :rename, :rename-and-delete, :overwrite, :append, :supersede, or nil." (with-open-file (s filespec :direction :output :if-exists if-exists) (grammar-print grammar :output s))) (defun load-bnf (filespec) "Load a grammar from a file in Backus-Naur Form." (with-open-file (s filespec :direction :input) (bnf-parse s)))
89697
;;;; -*- Lisp -*- ;;;; ;;;; Copyright (c) 2012, Georgia Tech Research Corporation ;;;; All rights reserved. ;;;; ;;;; Author(s): <NAME> <<EMAIL>> ;;;; Georgia Tech Humanoid Robotics Lab ;;;; Under Direction of Prof. Mike Stilman ;;;; ;;;; This file is provided under the following "BSD-style" License: ;;;; ;;;; Redistribution and use in source and binary forms, with or ;;;; without modification, are permitted provided that the following ;;;; conditions are met: ;;;; * Redistributions of source code must retain the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer. ;;;; * Redistributions in binary form must reproduce the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer in the documentation and/or other materials ;;;; provided with the distribution. ;;;; ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ;;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ;;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ;;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ;;;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ;;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ;;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ;;;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ;;;; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (in-package :motion-grammar-kit) (defun bnf-chop-ears (string) (subseq string 1 (1- (length string)))) (deflexer bnf-lexer (terminal (:concatenation #\" (:+ (:union :alnum-class #\- #\_)) #\") (symbol-function 'bnf-chop-ears)) (nonterminal (:concatenation #\< (:+ (:union :alnum-class #\- #\_)) #\>) (symbol-function 'bnf-chop-ears)) (equals (:union "=" ":=" "::=" "->")) (newline (:+ #\Newline)) (alternate #\|) (:skip (:union (:+ :blank-class) (:concatenation #\; (:closure (:not #\Newline)) (:closure #\Newline))))) (defun bnf-parse (stream) (let (rules) (labels ((next () (bnf-lexer stream)) (head (type text) (assert (eq type 'nonterminal)) (multiple-value-bind (equals text) (next) (declare (ignore text)) (assert (eq equals 'equals))) (stuff type text)) (stuff (type text) (assert (or (eq type 'terminal) (eq type 'nonterminal))) (multiple-value-bind (body body-type body-text) (body) (declare (ignore body-text)) (push (cons text body) rules) (ecase body-type ((nil) nil) (alternate (stuff type text)) (newline (multiple-value-bind (next-type next-text) (next) (ecase next-type (nonterminal (head next-type next-text)) (alternate (stuff type text)) ((nil) nil))))))) (body () (multiple-value-bind (type text) (next) (ecase type ((terminal nonterminal) (multiple-value-bind (next-body next-type next-text) (body) (values (cons text next-body) next-type next-text))) ((newline alternate nil) (values nil type text)))))) (multiple-value-call #'head (next))) (reverse rules))) (defun save-bnf (grammar filespec &key if-exists) "Save GRAMMAR to a file in Backus-Naur Form. IF-EXISTS: one of :error, :new-version, :rename, :rename-and-delete, :overwrite, :append, :supersede, or nil." (with-open-file (s filespec :direction :output :if-exists if-exists) (grammar-print grammar :output s))) (defun load-bnf (filespec) "Load a grammar from a file in Backus-Naur Form." (with-open-file (s filespec :direction :input) (bnf-parse s)))
true
;;;; -*- Lisp -*- ;;;; ;;;; Copyright (c) 2012, Georgia Tech Research Corporation ;;;; All rights reserved. ;;;; ;;;; Author(s): PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;;; Georgia Tech Humanoid Robotics Lab ;;;; Under Direction of Prof. Mike Stilman ;;;; ;;;; This file is provided under the following "BSD-style" License: ;;;; ;;;; Redistribution and use in source and binary forms, with or ;;;; without modification, are permitted provided that the following ;;;; conditions are met: ;;;; * Redistributions of source code must retain the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer. ;;;; * Redistributions in binary form must reproduce the above ;;;; copyright notice, this list of conditions and the following ;;;; disclaimer in the documentation and/or other materials ;;;; provided with the distribution. ;;;; ;;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ;;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ;;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ;;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ;;;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ;;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ;;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ;;;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ;;;; EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (in-package :motion-grammar-kit) (defun bnf-chop-ears (string) (subseq string 1 (1- (length string)))) (deflexer bnf-lexer (terminal (:concatenation #\" (:+ (:union :alnum-class #\- #\_)) #\") (symbol-function 'bnf-chop-ears)) (nonterminal (:concatenation #\< (:+ (:union :alnum-class #\- #\_)) #\>) (symbol-function 'bnf-chop-ears)) (equals (:union "=" ":=" "::=" "->")) (newline (:+ #\Newline)) (alternate #\|) (:skip (:union (:+ :blank-class) (:concatenation #\; (:closure (:not #\Newline)) (:closure #\Newline))))) (defun bnf-parse (stream) (let (rules) (labels ((next () (bnf-lexer stream)) (head (type text) (assert (eq type 'nonterminal)) (multiple-value-bind (equals text) (next) (declare (ignore text)) (assert (eq equals 'equals))) (stuff type text)) (stuff (type text) (assert (or (eq type 'terminal) (eq type 'nonterminal))) (multiple-value-bind (body body-type body-text) (body) (declare (ignore body-text)) (push (cons text body) rules) (ecase body-type ((nil) nil) (alternate (stuff type text)) (newline (multiple-value-bind (next-type next-text) (next) (ecase next-type (nonterminal (head next-type next-text)) (alternate (stuff type text)) ((nil) nil))))))) (body () (multiple-value-bind (type text) (next) (ecase type ((terminal nonterminal) (multiple-value-bind (next-body next-type next-text) (body) (values (cons text next-body) next-type next-text))) ((newline alternate nil) (values nil type text)))))) (multiple-value-call #'head (next))) (reverse rules))) (defun save-bnf (grammar filespec &key if-exists) "Save GRAMMAR to a file in Backus-Naur Form. IF-EXISTS: one of :error, :new-version, :rename, :rename-and-delete, :overwrite, :append, :supersede, or nil." (with-open-file (s filespec :direction :output :if-exists if-exists) (grammar-print grammar :output s))) (defun load-bnf (filespec) "Load a grammar from a file in Backus-Naur Form." (with-open-file (s filespec :direction :input) (bnf-parse s)))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 190, "score": 0.9998816847801208, "start": 173, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 210, "score": 0.9999315142631531, "start": 192, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/yul/library-extensions/lists.lisp
mayankmanj/acl2
0
; Yul Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Extensions of the list library. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm non-zero-len-when-consp (implies (consp x) (> (len x) 0)) :rule-classes :type-prescription)
65903
; Yul Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Extensions of the list library. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm non-zero-len-when-consp (implies (consp x) (> (len x) 0)) :rule-classes :type-prescription)
true
; Yul Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Extensions of the list library. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm non-zero-len-when-consp (implies (consp x) (> (len x) 0)) :rule-classes :type-prescription)
[ { "context": "-middleware-backtrace\n :version \"0.1\"\n :author \"Eitaro Fukamachi\"\n :license \"LLGPL\"\n :depends-on (:uiop)\n :comp", "end": 211, "score": 0.9998800754547119, "start": 195, "tag": "NAME", "value": "Eitaro Fukamachi" } ]
bundle-libs/software/lack-20190521-git/lack-middleware-backtrace.asd
dbym4820/photon
4
(in-package :cl-user) (defpackage :lack-middleware-backtrace-asd (:use :cl :asdf)) (in-package :lack-middleware-backtrace-asd) (defsystem lack-middleware-backtrace :version "0.1" :author "Eitaro Fukamachi" :license "LLGPL" :depends-on (:uiop) :components ((:file "src/middleware/backtrace")) :in-order-to ((test-op (test-op t-lack-middleware-backtrace))))
89398
(in-package :cl-user) (defpackage :lack-middleware-backtrace-asd (:use :cl :asdf)) (in-package :lack-middleware-backtrace-asd) (defsystem lack-middleware-backtrace :version "0.1" :author "<NAME>" :license "LLGPL" :depends-on (:uiop) :components ((:file "src/middleware/backtrace")) :in-order-to ((test-op (test-op t-lack-middleware-backtrace))))
true
(in-package :cl-user) (defpackage :lack-middleware-backtrace-asd (:use :cl :asdf)) (in-package :lack-middleware-backtrace-asd) (defsystem lack-middleware-backtrace :version "0.1" :author "PI:NAME:<NAME>END_PI" :license "LLGPL" :depends-on (:uiop) :components ((:file "src/middleware/backtrace")) :in-order-to ((test-op (test-op t-lack-middleware-backtrace))))
[ { "context": "of Radiance\n (c) 2014 Shirakumo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n", "end": 92, "score": 0.999909520149231, "start": 74, "tag": "EMAIL", "value": "[email protected]" }, { "context": "umo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:modularize", "end": 117, "score": 0.9998878836631775, "start": 103, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": ".eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:modularize-user)\n(define-modul", "end": 137, "score": 0.9999200105667114, "start": 119, "tag": "EMAIL", "value": "[email protected]" } ]
i-json/i-json.lisp
jjkola/radiance-contribs
0
#| This file is a part of Radiance (c) 2014 Shirakumo http://tymoon.eu ([email protected]) Author: Nicolas Hafner <[email protected]> |# (in-package #:modularize-user) (define-module #:i-json (:use #:cl #:radiance)) (in-package #:i-json) (defgeneric serialize (o) (:method (o) o) (:method ((o string)) o) (:method ((o list)) (mapcar #'serialize o)) (:method ((o vector)) (map 'vector #'serialize o)) (:method ((o hash-table)) (loop with n = (make-hash-table :test (hash-table-test o)) for k being the hash-keys of o for v being the hash-values of o do (setf (gethash (serialize k) n) (serialize v)) finally (return n))) (:method ((o condition)) (loop with n = (make-hash-table) for d in (c2mop:class-slots (class-of o)) for s = (c2mop:slot-definition-name d) for v = (slot-value o s) do (setf (gethash (serialize s) n) (serialize v)) finally (return n))) (:method ((o standard-object)) ;; We don't want secure data leaking out... (princ-to-string o)) (:method ((o function)) (princ-to-string o)) (:method ((o pathname)) (princ-to-string o))) (define-api-format json (object) (setf (content-type *response*) "application/json; charset=utf-8") (with-output-to-string (stream) (cl-json:encode-json (serialize object) stream))) (setf *default-api-format* "json")
3466
#| This file is a part of Radiance (c) 2014 Shirakumo http://tymoon.eu (<EMAIL>) Author: <NAME> <<EMAIL>> |# (in-package #:modularize-user) (define-module #:i-json (:use #:cl #:radiance)) (in-package #:i-json) (defgeneric serialize (o) (:method (o) o) (:method ((o string)) o) (:method ((o list)) (mapcar #'serialize o)) (:method ((o vector)) (map 'vector #'serialize o)) (:method ((o hash-table)) (loop with n = (make-hash-table :test (hash-table-test o)) for k being the hash-keys of o for v being the hash-values of o do (setf (gethash (serialize k) n) (serialize v)) finally (return n))) (:method ((o condition)) (loop with n = (make-hash-table) for d in (c2mop:class-slots (class-of o)) for s = (c2mop:slot-definition-name d) for v = (slot-value o s) do (setf (gethash (serialize s) n) (serialize v)) finally (return n))) (:method ((o standard-object)) ;; We don't want secure data leaking out... (princ-to-string o)) (:method ((o function)) (princ-to-string o)) (:method ((o pathname)) (princ-to-string o))) (define-api-format json (object) (setf (content-type *response*) "application/json; charset=utf-8") (with-output-to-string (stream) (cl-json:encode-json (serialize object) stream))) (setf *default-api-format* "json")
true
#| This file is a part of Radiance (c) 2014 Shirakumo http://tymoon.eu (PI:EMAIL:<EMAIL>END_PI) Author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> |# (in-package #:modularize-user) (define-module #:i-json (:use #:cl #:radiance)) (in-package #:i-json) (defgeneric serialize (o) (:method (o) o) (:method ((o string)) o) (:method ((o list)) (mapcar #'serialize o)) (:method ((o vector)) (map 'vector #'serialize o)) (:method ((o hash-table)) (loop with n = (make-hash-table :test (hash-table-test o)) for k being the hash-keys of o for v being the hash-values of o do (setf (gethash (serialize k) n) (serialize v)) finally (return n))) (:method ((o condition)) (loop with n = (make-hash-table) for d in (c2mop:class-slots (class-of o)) for s = (c2mop:slot-definition-name d) for v = (slot-value o s) do (setf (gethash (serialize s) n) (serialize v)) finally (return n))) (:method ((o standard-object)) ;; We don't want secure data leaking out... (princ-to-string o)) (:method ((o function)) (princ-to-string o)) (:method ((o pathname)) (princ-to-string o))) (define-api-format json (object) (setf (content-type *response*) "application/json; charset=utf-8") (with-output-to-string (stream) (cl-json:encode-json (serialize object) stream))) (setf *default-api-format* "json")
[ { "context": "or for AIT tapes\n;;;\n;;;\n;;; Copyright (C) 2005 by Greg Menke, [email protected]\n;;;\n;;; This program is ", "end": 84, "score": 0.9998042583465576, "start": 74, "tag": "NAME", "value": "Greg Menke" }, { "context": "apes\n;;;\n;;;\n;;; Copyright (C) 2005 by Greg Menke, [email protected]\n;;;\n;;; This program is free software; you can re", "end": 109, "score": 0.9999351501464844, "start": 86, "tag": "EMAIL", "value": "[email protected]" } ]
contrib/Examples/lisp/ait_label_gen/ait-label.lisp
liushudan/SerialTraceKeyBoard
0
;;; ;;; Barcode generator for AIT tapes ;;; ;;; ;;; Copyright (C) 2005 by Greg Menke, [email protected] ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License ;;; as published by the Free Software Foundation; either version 2 ;;; of the License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; ;;; http://www.gnu.org/licenses/gpl.html ;;; ;;; ;;; ;;; Uses the Pure Postscript Barcode Generator: ;;; http://bwipp.terryburton.co.uk ;;; ;;; ;;; ;;; This script can be run by most any Common Lisp implementation. ;;; Unless you have one installed already, CLISP is generally the ;;; most broadly available and quickest to install. CLISP is available ;;; an binary and source forms at ;;; ;;; http://clisp.cons.org/ ;;; ;;; ;;; To run the script using CLISP, invoke the following in the same ;;; directory where the Pure Postscript files were extracted. ;;; ;;; clisp -q ait-tape.lisp | lp ;;; ;;; This assumes 'lp' has a default printer that accepts postscript, ;;; modify as required to direct the output properly. ;;; (defstruct pagedef (pane-rows) (pane-cols) (pane-width) (pane-height) (pane-inside-horizontal) (pane-inside-vertical) (left-pane-offset) (top-pane-offset) (pane-divider-width) (pane-divider-height)) ;;; ;;; postscript points are 1/72" ;;; (defparameter %DPI% 72) (defun make-barcode-coordinates (pdef) (let* ((bc-coords nil) (bc-width (* %WIDTH-PER-CODE% %DPI%)) (bc-height (* %HEIGHT-PER-CODE% %DPI%)) (pane-width (* (pagedef-pane-width pdef) %DPI%)) (pane-height (* (pagedef-pane-height pdef) %DPI%)) (pane-inside-hor (* (pagedef-pane-inside-horizontal pdef) %DPI%)) (pane-inside-vert (* (pagedef-pane-inside-vertical pdef) %DPI%)) (pane-offset-x (* (pagedef-left-pane-offset pdef) %DPI%)) (pane-offset-y (* (pagedef-top-pane-offset pdef) %DPI%)) (pane-divider-width (* (pagedef-pane-divider-width pdef) %DPI%)) (pane-divider-height (* (pagedef-pane-divider-height pdef) %DPI%)) ) (let ((bcodes-per-pane-horiz (floor (/ pane-width (+ bc-width (* pane-inside-hor 2)))) ) (bcodes-per-pane-vert (floor (/ pane-height (+ bc-height (* pane-inside-vert 2)))) ) ) (loop for pcol from 0 below (pagedef-pane-cols pdef) for basex = (+ pane-offset-x (* pcol pane-width) (* pcol pane-divider-width)) do (loop for prow from 0 below (pagedef-pane-rows pdef) for basey = (+ pane-offset-y (* prow pane-height) (* prow pane-divider-height)) do (loop for bcol from 0 below bcodes-per-pane-horiz for barcodex = (+ basex (* bcol bc-width) pane-inside-hor) do (loop for brow from 0 below bcodes-per-pane-vert for barcodey = (+ basey (* brow bc-height) pane-inside-vert bc-height) do (push (list (floor barcodex) (floor barcodey)) bc-coords) )))) ) (coerce (reverse bc-coords) 'vector) )) (defun print-strings ( slist ) "Print each postscript string to standard-output, terminating with newlines" (loop for e in slist do (cond ((typep e 'cons) (print-strings e)) (t (format *standard-output* "~A~%" e)) ) )) (defun bcode (bcode pagedef startval endval &optional (opts "")) "Create the barcode postscript strings, then print them" (let* ((prolog-strings '("%!PS-Adobe-2.0")) (template-strings (with-open-file (str "barcode.ps" :direction :input :if-does-not-exist :error) ;; skip file text till we hit BEGIN TEMPLATE (loop for l = (read-line str nil nil) while (and l (not (search "% --BEGIN TEMPLATE--" l))) ) ;; now inside template (loop for l = (read-line str nil nil) while (and l (not (search "% --END TEMPLATE--" l))) collect l)) ) (content-opts (concatenate 'string opts (format nil " height=~D " %BOPT-HEIGHT%)) ) (content-strings (loop with bc-coords = (make-barcode-coordinates pagedef) for i from startval upto endval for j from 0 below (length bc-coords) collect (list "gsave" (destructuring-bind (x y) (svref bc-coords j) (format nil "~D ~D translate" x y)) (format nil "0 0 moveto (~A) (~A) ~A barcode" (format nil "~6,'0D" i) content-opts bcode) "grestore")) ) (epilog-strings '("showpage")) ) ;; ;; now accumulate the strings and print them in order ;; (print-strings (append prolog-strings template-strings content-strings epilog-strings)) )) ;;; ;;; Parameters in inches ;;; (defparameter %WIDTH-PER-CODE% 2.250 ) (defparameter %HEIGHT-PER-CODE% 0.375 ) (defparameter %BOPT-HEIGHT% 0.24 ) ;;; ;;; Page definitions, in inches ;;; (defparameter %avery-6873% (make-pagedef :pane-rows 4 :pane-cols 2 :pane-width 3.75 :pane-height 2.00 :pane-inside-horizontal 0.062 :pane-inside-vertical 0.062 :left-pane-offset 0.375 :top-pane-offset 1.125 :pane-divider-width 0.250 :pane-divider-height 0.250)) ;;; ;;; Adjust parameters of this call to select the barcode format, ;;; text numbers and text options ;;; (bcode "code39" %avery-6873% 10 40 "includetext includecheck") ;;; eof
44045
;;; ;;; Barcode generator for AIT tapes ;;; ;;; ;;; Copyright (C) 2005 by <NAME>, <EMAIL> ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License ;;; as published by the Free Software Foundation; either version 2 ;;; of the License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; ;;; http://www.gnu.org/licenses/gpl.html ;;; ;;; ;;; ;;; Uses the Pure Postscript Barcode Generator: ;;; http://bwipp.terryburton.co.uk ;;; ;;; ;;; ;;; This script can be run by most any Common Lisp implementation. ;;; Unless you have one installed already, CLISP is generally the ;;; most broadly available and quickest to install. CLISP is available ;;; an binary and source forms at ;;; ;;; http://clisp.cons.org/ ;;; ;;; ;;; To run the script using CLISP, invoke the following in the same ;;; directory where the Pure Postscript files were extracted. ;;; ;;; clisp -q ait-tape.lisp | lp ;;; ;;; This assumes 'lp' has a default printer that accepts postscript, ;;; modify as required to direct the output properly. ;;; (defstruct pagedef (pane-rows) (pane-cols) (pane-width) (pane-height) (pane-inside-horizontal) (pane-inside-vertical) (left-pane-offset) (top-pane-offset) (pane-divider-width) (pane-divider-height)) ;;; ;;; postscript points are 1/72" ;;; (defparameter %DPI% 72) (defun make-barcode-coordinates (pdef) (let* ((bc-coords nil) (bc-width (* %WIDTH-PER-CODE% %DPI%)) (bc-height (* %HEIGHT-PER-CODE% %DPI%)) (pane-width (* (pagedef-pane-width pdef) %DPI%)) (pane-height (* (pagedef-pane-height pdef) %DPI%)) (pane-inside-hor (* (pagedef-pane-inside-horizontal pdef) %DPI%)) (pane-inside-vert (* (pagedef-pane-inside-vertical pdef) %DPI%)) (pane-offset-x (* (pagedef-left-pane-offset pdef) %DPI%)) (pane-offset-y (* (pagedef-top-pane-offset pdef) %DPI%)) (pane-divider-width (* (pagedef-pane-divider-width pdef) %DPI%)) (pane-divider-height (* (pagedef-pane-divider-height pdef) %DPI%)) ) (let ((bcodes-per-pane-horiz (floor (/ pane-width (+ bc-width (* pane-inside-hor 2)))) ) (bcodes-per-pane-vert (floor (/ pane-height (+ bc-height (* pane-inside-vert 2)))) ) ) (loop for pcol from 0 below (pagedef-pane-cols pdef) for basex = (+ pane-offset-x (* pcol pane-width) (* pcol pane-divider-width)) do (loop for prow from 0 below (pagedef-pane-rows pdef) for basey = (+ pane-offset-y (* prow pane-height) (* prow pane-divider-height)) do (loop for bcol from 0 below bcodes-per-pane-horiz for barcodex = (+ basex (* bcol bc-width) pane-inside-hor) do (loop for brow from 0 below bcodes-per-pane-vert for barcodey = (+ basey (* brow bc-height) pane-inside-vert bc-height) do (push (list (floor barcodex) (floor barcodey)) bc-coords) )))) ) (coerce (reverse bc-coords) 'vector) )) (defun print-strings ( slist ) "Print each postscript string to standard-output, terminating with newlines" (loop for e in slist do (cond ((typep e 'cons) (print-strings e)) (t (format *standard-output* "~A~%" e)) ) )) (defun bcode (bcode pagedef startval endval &optional (opts "")) "Create the barcode postscript strings, then print them" (let* ((prolog-strings '("%!PS-Adobe-2.0")) (template-strings (with-open-file (str "barcode.ps" :direction :input :if-does-not-exist :error) ;; skip file text till we hit BEGIN TEMPLATE (loop for l = (read-line str nil nil) while (and l (not (search "% --BEGIN TEMPLATE--" l))) ) ;; now inside template (loop for l = (read-line str nil nil) while (and l (not (search "% --END TEMPLATE--" l))) collect l)) ) (content-opts (concatenate 'string opts (format nil " height=~D " %BOPT-HEIGHT%)) ) (content-strings (loop with bc-coords = (make-barcode-coordinates pagedef) for i from startval upto endval for j from 0 below (length bc-coords) collect (list "gsave" (destructuring-bind (x y) (svref bc-coords j) (format nil "~D ~D translate" x y)) (format nil "0 0 moveto (~A) (~A) ~A barcode" (format nil "~6,'0D" i) content-opts bcode) "grestore")) ) (epilog-strings '("showpage")) ) ;; ;; now accumulate the strings and print them in order ;; (print-strings (append prolog-strings template-strings content-strings epilog-strings)) )) ;;; ;;; Parameters in inches ;;; (defparameter %WIDTH-PER-CODE% 2.250 ) (defparameter %HEIGHT-PER-CODE% 0.375 ) (defparameter %BOPT-HEIGHT% 0.24 ) ;;; ;;; Page definitions, in inches ;;; (defparameter %avery-6873% (make-pagedef :pane-rows 4 :pane-cols 2 :pane-width 3.75 :pane-height 2.00 :pane-inside-horizontal 0.062 :pane-inside-vertical 0.062 :left-pane-offset 0.375 :top-pane-offset 1.125 :pane-divider-width 0.250 :pane-divider-height 0.250)) ;;; ;;; Adjust parameters of this call to select the barcode format, ;;; text numbers and text options ;;; (bcode "code39" %avery-6873% 10 40 "includetext includecheck") ;;; eof
true
;;; ;;; Barcode generator for AIT tapes ;;; ;;; ;;; Copyright (C) 2005 by PI:NAME:<NAME>END_PI, PI:EMAIL:<EMAIL>END_PI ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License ;;; as published by the Free Software Foundation; either version 2 ;;; of the License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; ;;; http://www.gnu.org/licenses/gpl.html ;;; ;;; ;;; ;;; Uses the Pure Postscript Barcode Generator: ;;; http://bwipp.terryburton.co.uk ;;; ;;; ;;; ;;; This script can be run by most any Common Lisp implementation. ;;; Unless you have one installed already, CLISP is generally the ;;; most broadly available and quickest to install. CLISP is available ;;; an binary and source forms at ;;; ;;; http://clisp.cons.org/ ;;; ;;; ;;; To run the script using CLISP, invoke the following in the same ;;; directory where the Pure Postscript files were extracted. ;;; ;;; clisp -q ait-tape.lisp | lp ;;; ;;; This assumes 'lp' has a default printer that accepts postscript, ;;; modify as required to direct the output properly. ;;; (defstruct pagedef (pane-rows) (pane-cols) (pane-width) (pane-height) (pane-inside-horizontal) (pane-inside-vertical) (left-pane-offset) (top-pane-offset) (pane-divider-width) (pane-divider-height)) ;;; ;;; postscript points are 1/72" ;;; (defparameter %DPI% 72) (defun make-barcode-coordinates (pdef) (let* ((bc-coords nil) (bc-width (* %WIDTH-PER-CODE% %DPI%)) (bc-height (* %HEIGHT-PER-CODE% %DPI%)) (pane-width (* (pagedef-pane-width pdef) %DPI%)) (pane-height (* (pagedef-pane-height pdef) %DPI%)) (pane-inside-hor (* (pagedef-pane-inside-horizontal pdef) %DPI%)) (pane-inside-vert (* (pagedef-pane-inside-vertical pdef) %DPI%)) (pane-offset-x (* (pagedef-left-pane-offset pdef) %DPI%)) (pane-offset-y (* (pagedef-top-pane-offset pdef) %DPI%)) (pane-divider-width (* (pagedef-pane-divider-width pdef) %DPI%)) (pane-divider-height (* (pagedef-pane-divider-height pdef) %DPI%)) ) (let ((bcodes-per-pane-horiz (floor (/ pane-width (+ bc-width (* pane-inside-hor 2)))) ) (bcodes-per-pane-vert (floor (/ pane-height (+ bc-height (* pane-inside-vert 2)))) ) ) (loop for pcol from 0 below (pagedef-pane-cols pdef) for basex = (+ pane-offset-x (* pcol pane-width) (* pcol pane-divider-width)) do (loop for prow from 0 below (pagedef-pane-rows pdef) for basey = (+ pane-offset-y (* prow pane-height) (* prow pane-divider-height)) do (loop for bcol from 0 below bcodes-per-pane-horiz for barcodex = (+ basex (* bcol bc-width) pane-inside-hor) do (loop for brow from 0 below bcodes-per-pane-vert for barcodey = (+ basey (* brow bc-height) pane-inside-vert bc-height) do (push (list (floor barcodex) (floor barcodey)) bc-coords) )))) ) (coerce (reverse bc-coords) 'vector) )) (defun print-strings ( slist ) "Print each postscript string to standard-output, terminating with newlines" (loop for e in slist do (cond ((typep e 'cons) (print-strings e)) (t (format *standard-output* "~A~%" e)) ) )) (defun bcode (bcode pagedef startval endval &optional (opts "")) "Create the barcode postscript strings, then print them" (let* ((prolog-strings '("%!PS-Adobe-2.0")) (template-strings (with-open-file (str "barcode.ps" :direction :input :if-does-not-exist :error) ;; skip file text till we hit BEGIN TEMPLATE (loop for l = (read-line str nil nil) while (and l (not (search "% --BEGIN TEMPLATE--" l))) ) ;; now inside template (loop for l = (read-line str nil nil) while (and l (not (search "% --END TEMPLATE--" l))) collect l)) ) (content-opts (concatenate 'string opts (format nil " height=~D " %BOPT-HEIGHT%)) ) (content-strings (loop with bc-coords = (make-barcode-coordinates pagedef) for i from startval upto endval for j from 0 below (length bc-coords) collect (list "gsave" (destructuring-bind (x y) (svref bc-coords j) (format nil "~D ~D translate" x y)) (format nil "0 0 moveto (~A) (~A) ~A barcode" (format nil "~6,'0D" i) content-opts bcode) "grestore")) ) (epilog-strings '("showpage")) ) ;; ;; now accumulate the strings and print them in order ;; (print-strings (append prolog-strings template-strings content-strings epilog-strings)) )) ;;; ;;; Parameters in inches ;;; (defparameter %WIDTH-PER-CODE% 2.250 ) (defparameter %HEIGHT-PER-CODE% 0.375 ) (defparameter %BOPT-HEIGHT% 0.24 ) ;;; ;;; Page definitions, in inches ;;; (defparameter %avery-6873% (make-pagedef :pane-rows 4 :pane-cols 2 :pane-width 3.75 :pane-height 2.00 :pane-inside-horizontal 0.062 :pane-inside-vertical 0.062 :left-pane-offset 0.375 :top-pane-offset 1.125 :pane-divider-width 0.250 :pane-divider-height 0.250)) ;;; ;;; Adjust parameters of this call to select the barcode format, ;;; text numbers and text options ;;; (bcode "code39" %avery-6873% 10 40 "includetext includecheck") ;;; eof
[ { "context": "il address to:\n;;; CommonLoops Coordinator\n;;; Xerox PARC\n;;; 3333 Coyote Hill Rd.\n;;; Palo Alto, CA 94", "end": 859, "score": 0.8965913653373718, "start": 849, "tag": "NAME", "value": "Xerox PARC" }, { "context": " Palo Alto, CA 94304\n;;; (or send Arpanet mail to [email protected])\n;;;\n;;; Suggestions, comments and requests for i", "end": 979, "score": 0.9995154142379761, "start": 942, "tag": "EMAIL", "value": "[email protected]" } ]
impl/cmu/cmu-low.lisp
binghe/portable-clos
57
;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*- ;;; ;;; ************************************************************************* ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation. ;;; All rights reserved. ;;; ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted. Any distribution of this ;;; software or derivative works must comply with all applicable United ;;; States export control laws. ;;; ;;; This software is made available AS IS, and Xerox Corporation makes no ;;; warranty about the software, its performance or its conformity to any ;;; specification. ;;; ;;; Any person obtaining a copy of this software is requested to send their ;;; name and post office or electronic mail address to: ;;; CommonLoops Coordinator ;;; Xerox PARC ;;; 3333 Coyote Hill Rd. ;;; Palo Alto, CA 94304 ;;; (or send Arpanet mail to [email protected]) ;;; ;;; Suggestions, comments and requests for improvements are also welcome. ;;; ************************************************************************* ;;; ;;; This is the CMU Lisp version of the file low. ;;; (in-package :pcl) (defmacro dotimes ((var count &optional (result nil)) &body body) `(lisp:dotimes (,var (the fixnum ,count) ,result) (declare (fixnum ,var)) ,@body)) ;;; Just use our without-interrupts. We don't have the INTERRUPTS-ON/OFF local ;;; macros spec'ed in low.lisp, but they aren't used. ;;; (defmacro without-interrupts (&rest stuff) `(sys:without-interrupts ,@stuff)) ;;; Print the object addr in default printers. ;;; (defun printing-random-thing-internal (thing stream) (format stream "{~X}" (sys:%primitive c:make-fixnum thing))) (eval-when (compile load eval) (c:def-source-transform std-instance-p (x) (ext:once-only ((n-x x)) `(and (ext:structurep ,n-x) (eq (kernel:structure-ref ,n-x 0) 'std-instance))))) (defun function-arglist (fcn) "Returns the argument list of a compiled function, if possible." (cond ((symbolp fcn) (when (fboundp fcn) (function-arglist (symbol-function fcn)))) ((eval:interpreted-function-p fcn) (eval:interpreted-function-arglist fcn)) ((functionp fcn) (let ((lambda-expr (function-lambda-expression fcn))) (if lambda-expr (cadr lambda-expr) (let ((function (kernel:%closure-function fcn))) (values (read-from-string (kernel:%function-header-arglist function))))))))) ;;; We have this here and in fin.lisp, 'cause PCL wants to compile this ;;; file first. ;;; (defsetf funcallable-instance-name set-funcallable-instance-name) ;;; And returns the function, not the *name*. (defun set-function-name (fcn new-name) "Set the name of a compiled function object." (cond ((symbolp fcn) (set-function-name (symbol-function fcn) new-name)) ((funcallable-instance-p fcn) (setf (funcallable-instance-name fcn) new-name) fcn) ((eval:interpreted-function-p fcn) (setf (eval:interpreted-function-name fcn) new-name) fcn) (t (let ((header (kernel:%closure-function fcn))) ;;#+cmu17 ;;(setf (c::%function-name header) new-name) ;;#-cmu17 (system:%primitive c::set-function-name header new-name)) fcn))) (in-package "C") ;;From compiler/ir1util (def-source-context pcl:defmethod (name &rest stuff) (let ((arg-pos (position-if #'listp stuff))) (if arg-pos `(pcl:defmethod ,name ,@(subseq stuff 0 arg-pos) ,(nth-value 2 (pcl::parse-specialized-lambda-list (elt stuff arg-pos)))) `(pcl:defmethod ,name "<illegal syntax>")))) (define-info-type type kind (member :primitive :defined :structure :class nil) (if (or (info type builtin name) (info type translator name)) :primitive nil)) (define-info-type type class-info (or pcl::class symbol null) nil) (in-package "KERNEL") (export '(clos-type clos-type-class)) (defmacro cold-load-init (&rest forms) `(progn ,@forms)) (defstruct (clos-type (:include ctype (:class-info (type-class-or-lose 'clos)) (:enumerable t)) (:print-function %print-type)) ;; ;; The CLOS class. (class nil)) (define-type-class clos) (define-type-method (clos :unparse) (x) (clos-type-class x)) (define-type-method (clos :complex-union) (type1 type2) (make-union-type (list type1 type2))) (define-type-method (clos :simple-=) (type1 type2) (values (eq (clos-type-class type1) (clos-type-class type2)) t)) (define-type-method (clos :simple-subtypep) (type1 type2) (let ((class1 (pcl:find-class (clos-type-class type1) nil)) (class2 (pcl:find-class (clos-type-class type2) nil))) (if (and class1 class2) (values (member class2 (pcl:class-precedence-list class2)) t) (values nil nil)))) ;; Add the new ctype to its supertypes. ;; (let ((the-type-* (values-specifier-type '*))) (pushnew 'clos (named-type-subclasses the-type-*))) (let ((the-type-t (values-specifier-type 't))) (pushnew 'clos (named-type-subclasses the-type-t))) (defun-cached (values-specifier-type :hash-function (lambda (x) (the fixnum (logand (the fixnum (cache-hash-eq x)) #x3FF))) :hash-bits 10) ((spec eq)) (or (info type builtin spec) (let ((expand (type-expand spec))) (if (eq expand spec) (let* ((lspec (if (atom spec) (list spec) spec)) (fun (info type translator (car lspec)))) (cond (fun (funcall fun lspec)) ((and (symbolp spec) (eq (info type kind spec) :structure)) (make-structure-type :name spec)) ((and (symbolp spec) (eq (info type kind spec) :class)) (make-clos-type :class spec)) ((or (and (consp spec) (symbolp (car spec))) (symbolp spec)) (signal 'parse-unknown-type :specifier spec) ;; ;; Inhibit caching... (return-from values-specifier-type (make-unknown-type :specifier spec))) (t (error "Bad thing to be a type specifier: ~S." spec)))) (values-specifier-type expand))))) (defun ctypep (obj type) (declare (type ctype type)) (etypecase type ((or numeric-type named-type member-type array-type) (values (typep obj (type-specifier type)) t)) (structure-type (if (structurep obj) (let* ((name (structure-type-name type)) (info (info type structure-info name)) (defined-info (info type defined-structure-info name))) (if (and info defined-info (equal (c::dd-includes info) (c::dd-includes defined-info))) (values (typep obj name) t) (values nil nil))) (values nil t))) (clos-type (let ((class (clos-type-class type))) (if (pcl::std-instance-p obj) (values (pcl::*typep obj class) t) (values nil t)))) (union-type (dolist (mem (union-type-types type) (values nil t)) (multiple-value-bind (val win) (ctypep obj mem) (unless win (return (values nil nil))) (when val (return (values t t)))))) (function-type (values (functionp obj) t)) (unknown-type (values nil nil)) (alien-type-type (values (alien-typep obj (alien-type-type-alien-type type)) t)) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (if (atom hairy-spec) (values t t) (dolist (spec (cdr hairy-spec) (values t t)) (multiple-value-bind (res win) (ctypep obj (specifier-type spec)) (unless win (return (values nil nil))) (unless res (return (values nil t))))))) (not (multiple-value-bind (res win) (ctypep obj (specifier-type (cadr hairy-spec))) (if win (values (not res) t) (values nil nil)))) (satisfies (let ((fun (second hairy-spec))) (cond ((and (consp fun) (eq (car fun) 'lambda)) (values (not (null (funcall (coerce fun 'function) obj))) t)) ((and (symbolp fun) (fboundp fun)) (values (not (null (funcall fun obj))) t)) (t (values nil nil)))))))))) (in-package "LISP") (defun %%typep (object type) (declare (type ctype type)) (etypecase type (named-type (ecase (named-type-name type) ((* t) t) ((nil) nil) (character (characterp object)) (base-char (base-char-p object)) (standard-char (and (characterp object) (standard-char-p object))) (extended-char (and (characterp object) (not (base-char-p object)))) (function (functionp object)) (cons (consp object)) (symbol (symbolp object)) (keyword (and (symbolp object) (eq (symbol-package object) (symbol-package :foo)))) (system-area-pointer (system-area-pointer-p object)) (weak-pointer (weak-pointer-p object)) (code-component (code-component-p object)) (lra (lra-p object)) (fdefn (fdefn-p object)) (scavenger-hook (scavenger-hook-p object)) (structure (structurep object)))) (numeric-type (and (numberp object) (let ((num (if (complexp object) (realpart object) object))) (ecase (numeric-type-class type) (integer (integerp num)) (rational (rationalp num)) (float (ecase (numeric-type-format type) (short-float (typep object 'short-float)) (single-float (typep object 'single-float)) (double-float (typep object 'double-float)) (long-float (typep object 'long-float)) ((nil) (floatp num)))) ((nil) t))) (flet ((bound-test (val) (let ((low (numeric-type-low type)) (high (numeric-type-high type))) (and (cond ((null low) t) ((listp low) (> val (car low))) (t (>= val low))) (cond ((null high) t) ((listp high) (< val (car high))) (t (<= val high))))))) (ecase (numeric-type-complexp type) ((nil) t) (:complex (and (complexp object) (bound-test (realpart object)) (bound-test (imagpart object)))) (:real (and (not (complexp object)) (bound-test object))))))) (array-type (and (arrayp object) (ecase (array-type-complexp type) ((t) (not (typep object 'simple-array))) ((nil) (typep object 'simple-array)) (* t)) (or (eq (array-type-dimensions type) '*) (do ((want (array-type-dimensions type) (cdr want)) (got (array-dimensions object) (cdr got))) ((and (null want) (null got)) t) (unless (and want got (or (eq (car want) '*) (= (car want) (car got)))) (return nil)))) (or (eq (array-type-element-type type) *wild-type*) (type= (array-type-specialized-element-type type) (specifier-type (array-element-type object)))))) (member-type (if (member object (member-type-members type)) t)) (structure-type (structure-typep object (structure-type-name type))) (clos-type (pcl::*typep object (clos-type-class type))) (union-type (dolist (type (union-type-types type)) (when (%%typep object type) (return t)))) (unknown-type ;; Type may be unknown to the compiler (and SPECIFIER-TYPE), yet be ;; a defined structure in the core. (let ((orig-spec (unknown-type-specifier type))) (if (and (symbolp orig-spec) (info type defined-structure-info orig-spec)) (structure-typep object orig-spec) (error "Unknown type specifier: ~S" orig-spec)))) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (or (atom hairy-spec) (dolist (spec (cdr hairy-spec) t) (unless (%%typep object (specifier-type spec)) (return nil))))) (not (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (not (%%typep object (specifier-type (cadr hairy-spec))))) (satisfies (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (let ((fn (cadr hairy-spec))) (if (funcall (typecase fn (function fn) (symbol (symbol-function fn)) (t (coerce fn 'function))) object) t nil)))))) (alien-type-type (alien-internals:alien-typep object (alien-type-type-alien-type type))) (function-type (error "Function types are not a legal argument to TYPEP:~% ~S" (type-specifier type))))) (defun %deftype (name expander &optional doc) (ecase (info type kind name) (:primitive (error "Illegal to redefine standard type: ~S." name)) (:structure (warn "Redefining structure type ~S with DEFTYPE." name) (c::undefine-structure (info type structure-info name))) (:class (warn "Redefining class ~S with DEFTYPE." name)) ((nil :defined))) (setf (info type kind name) :defined) (setf (info type expander name) expander) (when doc (setf (documentation name 'type) doc)) ;; ### Bootstrap hack -- we need to define types before %note-type-defined ;; is defined. (when (fboundp 'c::%note-type-defined) (c::%note-type-defined name)) name) (defun type-of (object) "Return the type of OBJECT." (typecase object ;; First the ones that we can tell by testing the lowtag (fixnum 'fixnum) (function (type-specifier (ctype-of object))) (null 'null) (list 'cons) ;; Any other immediates. (character (typecase object (standard-char 'standard-char) (base-char 'base-char) (t 'character))) ;; And now for the complicated ones. (number (etypecase object (fixnum 'fixnum) (bignum 'bignum) (float (etypecase object (double-float 'double-float) (single-float 'single-float) (short-float 'short-float) (long-float 'long-float))) (ratio 'ratio) (complex 'complex))) (symbol (if (eq (symbol-package object) (symbol-package :foo)) 'keyword 'symbol)) (structure (let ((name (structure-ref object 0))) (case name (pcl::std-instance (pcl:class-name (pcl:class-of object))) (alien-internals:alien-value `(alien:alien ,(alien-internals:unparse-alien-type (alien-internals:alien-value-type object)))) (t name)))) (array (type-specifier (ctype-of object))) (system-area-pointer 'system-area-pointer) (weak-pointer 'weak-pointer) (code-component 'code-component) (lra 'lra) (fdefn 'fdefn) (scavenger-hook 'scavenger-hook) (t (warn "Can't figure out the type of ~S" object) t))) (in-package "PCL") (pushnew :structure-wrapper *features*) (defun structure-functions-exist-p () t) (defun structure-instance-p (x) (and (structurep x) (not (eq (kernel:structure-ref x 0) 'std-instance)))) (defun structure-type (x) (kernel:structure-ref x 0)) (defun structure-type-p (type) (not (null (ext:info c::type c::defined-structure-info type)))) (defun structure-type-included-type-name (type) (let ((include (c::dd-include (ext:info c::type c::defined-structure-info type)))) (if (consp include) (car include) include))) (defun structure-type-slot-description-list (type) (nthcdr (length (let ((include (structure-type-included-type-name type))) (and include (structure-type-slot-description-list include)))) (c::dd-slots (ext:info c::type c::defined-structure-info type)))) (defun structure-slotd-name (slotd) (intern (c::dsd-%name slotd) "USER")) (defun structure-slotd-accessor-symbol (slotd) (c::dsd-accessor slotd)) (defun structure-slotd-reader-function (slotd) (fdefinition (c::dsd-accessor slotd))) (defun structure-slotd-writer-function (slotd) (unless (c::dsd-read-only slotd) (fdefinition `(setf ,(c::dsd-accessor slotd))))) (defun structure-slotd-type (slotd) (c::dsd-type slotd)) (defun structure-slotd-init-form (slotd) (c::dsd-default slotd))
48663
;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*- ;;; ;;; ************************************************************************* ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation. ;;; All rights reserved. ;;; ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted. Any distribution of this ;;; software or derivative works must comply with all applicable United ;;; States export control laws. ;;; ;;; This software is made available AS IS, and Xerox Corporation makes no ;;; warranty about the software, its performance or its conformity to any ;;; specification. ;;; ;;; Any person obtaining a copy of this software is requested to send their ;;; name and post office or electronic mail address to: ;;; CommonLoops Coordinator ;;; <NAME> ;;; 3333 Coyote Hill Rd. ;;; Palo Alto, CA 94304 ;;; (or send Arpanet mail to <EMAIL>) ;;; ;;; Suggestions, comments and requests for improvements are also welcome. ;;; ************************************************************************* ;;; ;;; This is the CMU Lisp version of the file low. ;;; (in-package :pcl) (defmacro dotimes ((var count &optional (result nil)) &body body) `(lisp:dotimes (,var (the fixnum ,count) ,result) (declare (fixnum ,var)) ,@body)) ;;; Just use our without-interrupts. We don't have the INTERRUPTS-ON/OFF local ;;; macros spec'ed in low.lisp, but they aren't used. ;;; (defmacro without-interrupts (&rest stuff) `(sys:without-interrupts ,@stuff)) ;;; Print the object addr in default printers. ;;; (defun printing-random-thing-internal (thing stream) (format stream "{~X}" (sys:%primitive c:make-fixnum thing))) (eval-when (compile load eval) (c:def-source-transform std-instance-p (x) (ext:once-only ((n-x x)) `(and (ext:structurep ,n-x) (eq (kernel:structure-ref ,n-x 0) 'std-instance))))) (defun function-arglist (fcn) "Returns the argument list of a compiled function, if possible." (cond ((symbolp fcn) (when (fboundp fcn) (function-arglist (symbol-function fcn)))) ((eval:interpreted-function-p fcn) (eval:interpreted-function-arglist fcn)) ((functionp fcn) (let ((lambda-expr (function-lambda-expression fcn))) (if lambda-expr (cadr lambda-expr) (let ((function (kernel:%closure-function fcn))) (values (read-from-string (kernel:%function-header-arglist function))))))))) ;;; We have this here and in fin.lisp, 'cause PCL wants to compile this ;;; file first. ;;; (defsetf funcallable-instance-name set-funcallable-instance-name) ;;; And returns the function, not the *name*. (defun set-function-name (fcn new-name) "Set the name of a compiled function object." (cond ((symbolp fcn) (set-function-name (symbol-function fcn) new-name)) ((funcallable-instance-p fcn) (setf (funcallable-instance-name fcn) new-name) fcn) ((eval:interpreted-function-p fcn) (setf (eval:interpreted-function-name fcn) new-name) fcn) (t (let ((header (kernel:%closure-function fcn))) ;;#+cmu17 ;;(setf (c::%function-name header) new-name) ;;#-cmu17 (system:%primitive c::set-function-name header new-name)) fcn))) (in-package "C") ;;From compiler/ir1util (def-source-context pcl:defmethod (name &rest stuff) (let ((arg-pos (position-if #'listp stuff))) (if arg-pos `(pcl:defmethod ,name ,@(subseq stuff 0 arg-pos) ,(nth-value 2 (pcl::parse-specialized-lambda-list (elt stuff arg-pos)))) `(pcl:defmethod ,name "<illegal syntax>")))) (define-info-type type kind (member :primitive :defined :structure :class nil) (if (or (info type builtin name) (info type translator name)) :primitive nil)) (define-info-type type class-info (or pcl::class symbol null) nil) (in-package "KERNEL") (export '(clos-type clos-type-class)) (defmacro cold-load-init (&rest forms) `(progn ,@forms)) (defstruct (clos-type (:include ctype (:class-info (type-class-or-lose 'clos)) (:enumerable t)) (:print-function %print-type)) ;; ;; The CLOS class. (class nil)) (define-type-class clos) (define-type-method (clos :unparse) (x) (clos-type-class x)) (define-type-method (clos :complex-union) (type1 type2) (make-union-type (list type1 type2))) (define-type-method (clos :simple-=) (type1 type2) (values (eq (clos-type-class type1) (clos-type-class type2)) t)) (define-type-method (clos :simple-subtypep) (type1 type2) (let ((class1 (pcl:find-class (clos-type-class type1) nil)) (class2 (pcl:find-class (clos-type-class type2) nil))) (if (and class1 class2) (values (member class2 (pcl:class-precedence-list class2)) t) (values nil nil)))) ;; Add the new ctype to its supertypes. ;; (let ((the-type-* (values-specifier-type '*))) (pushnew 'clos (named-type-subclasses the-type-*))) (let ((the-type-t (values-specifier-type 't))) (pushnew 'clos (named-type-subclasses the-type-t))) (defun-cached (values-specifier-type :hash-function (lambda (x) (the fixnum (logand (the fixnum (cache-hash-eq x)) #x3FF))) :hash-bits 10) ((spec eq)) (or (info type builtin spec) (let ((expand (type-expand spec))) (if (eq expand spec) (let* ((lspec (if (atom spec) (list spec) spec)) (fun (info type translator (car lspec)))) (cond (fun (funcall fun lspec)) ((and (symbolp spec) (eq (info type kind spec) :structure)) (make-structure-type :name spec)) ((and (symbolp spec) (eq (info type kind spec) :class)) (make-clos-type :class spec)) ((or (and (consp spec) (symbolp (car spec))) (symbolp spec)) (signal 'parse-unknown-type :specifier spec) ;; ;; Inhibit caching... (return-from values-specifier-type (make-unknown-type :specifier spec))) (t (error "Bad thing to be a type specifier: ~S." spec)))) (values-specifier-type expand))))) (defun ctypep (obj type) (declare (type ctype type)) (etypecase type ((or numeric-type named-type member-type array-type) (values (typep obj (type-specifier type)) t)) (structure-type (if (structurep obj) (let* ((name (structure-type-name type)) (info (info type structure-info name)) (defined-info (info type defined-structure-info name))) (if (and info defined-info (equal (c::dd-includes info) (c::dd-includes defined-info))) (values (typep obj name) t) (values nil nil))) (values nil t))) (clos-type (let ((class (clos-type-class type))) (if (pcl::std-instance-p obj) (values (pcl::*typep obj class) t) (values nil t)))) (union-type (dolist (mem (union-type-types type) (values nil t)) (multiple-value-bind (val win) (ctypep obj mem) (unless win (return (values nil nil))) (when val (return (values t t)))))) (function-type (values (functionp obj) t)) (unknown-type (values nil nil)) (alien-type-type (values (alien-typep obj (alien-type-type-alien-type type)) t)) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (if (atom hairy-spec) (values t t) (dolist (spec (cdr hairy-spec) (values t t)) (multiple-value-bind (res win) (ctypep obj (specifier-type spec)) (unless win (return (values nil nil))) (unless res (return (values nil t))))))) (not (multiple-value-bind (res win) (ctypep obj (specifier-type (cadr hairy-spec))) (if win (values (not res) t) (values nil nil)))) (satisfies (let ((fun (second hairy-spec))) (cond ((and (consp fun) (eq (car fun) 'lambda)) (values (not (null (funcall (coerce fun 'function) obj))) t)) ((and (symbolp fun) (fboundp fun)) (values (not (null (funcall fun obj))) t)) (t (values nil nil)))))))))) (in-package "LISP") (defun %%typep (object type) (declare (type ctype type)) (etypecase type (named-type (ecase (named-type-name type) ((* t) t) ((nil) nil) (character (characterp object)) (base-char (base-char-p object)) (standard-char (and (characterp object) (standard-char-p object))) (extended-char (and (characterp object) (not (base-char-p object)))) (function (functionp object)) (cons (consp object)) (symbol (symbolp object)) (keyword (and (symbolp object) (eq (symbol-package object) (symbol-package :foo)))) (system-area-pointer (system-area-pointer-p object)) (weak-pointer (weak-pointer-p object)) (code-component (code-component-p object)) (lra (lra-p object)) (fdefn (fdefn-p object)) (scavenger-hook (scavenger-hook-p object)) (structure (structurep object)))) (numeric-type (and (numberp object) (let ((num (if (complexp object) (realpart object) object))) (ecase (numeric-type-class type) (integer (integerp num)) (rational (rationalp num)) (float (ecase (numeric-type-format type) (short-float (typep object 'short-float)) (single-float (typep object 'single-float)) (double-float (typep object 'double-float)) (long-float (typep object 'long-float)) ((nil) (floatp num)))) ((nil) t))) (flet ((bound-test (val) (let ((low (numeric-type-low type)) (high (numeric-type-high type))) (and (cond ((null low) t) ((listp low) (> val (car low))) (t (>= val low))) (cond ((null high) t) ((listp high) (< val (car high))) (t (<= val high))))))) (ecase (numeric-type-complexp type) ((nil) t) (:complex (and (complexp object) (bound-test (realpart object)) (bound-test (imagpart object)))) (:real (and (not (complexp object)) (bound-test object))))))) (array-type (and (arrayp object) (ecase (array-type-complexp type) ((t) (not (typep object 'simple-array))) ((nil) (typep object 'simple-array)) (* t)) (or (eq (array-type-dimensions type) '*) (do ((want (array-type-dimensions type) (cdr want)) (got (array-dimensions object) (cdr got))) ((and (null want) (null got)) t) (unless (and want got (or (eq (car want) '*) (= (car want) (car got)))) (return nil)))) (or (eq (array-type-element-type type) *wild-type*) (type= (array-type-specialized-element-type type) (specifier-type (array-element-type object)))))) (member-type (if (member object (member-type-members type)) t)) (structure-type (structure-typep object (structure-type-name type))) (clos-type (pcl::*typep object (clos-type-class type))) (union-type (dolist (type (union-type-types type)) (when (%%typep object type) (return t)))) (unknown-type ;; Type may be unknown to the compiler (and SPECIFIER-TYPE), yet be ;; a defined structure in the core. (let ((orig-spec (unknown-type-specifier type))) (if (and (symbolp orig-spec) (info type defined-structure-info orig-spec)) (structure-typep object orig-spec) (error "Unknown type specifier: ~S" orig-spec)))) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (or (atom hairy-spec) (dolist (spec (cdr hairy-spec) t) (unless (%%typep object (specifier-type spec)) (return nil))))) (not (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (not (%%typep object (specifier-type (cadr hairy-spec))))) (satisfies (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (let ((fn (cadr hairy-spec))) (if (funcall (typecase fn (function fn) (symbol (symbol-function fn)) (t (coerce fn 'function))) object) t nil)))))) (alien-type-type (alien-internals:alien-typep object (alien-type-type-alien-type type))) (function-type (error "Function types are not a legal argument to TYPEP:~% ~S" (type-specifier type))))) (defun %deftype (name expander &optional doc) (ecase (info type kind name) (:primitive (error "Illegal to redefine standard type: ~S." name)) (:structure (warn "Redefining structure type ~S with DEFTYPE." name) (c::undefine-structure (info type structure-info name))) (:class (warn "Redefining class ~S with DEFTYPE." name)) ((nil :defined))) (setf (info type kind name) :defined) (setf (info type expander name) expander) (when doc (setf (documentation name 'type) doc)) ;; ### Bootstrap hack -- we need to define types before %note-type-defined ;; is defined. (when (fboundp 'c::%note-type-defined) (c::%note-type-defined name)) name) (defun type-of (object) "Return the type of OBJECT." (typecase object ;; First the ones that we can tell by testing the lowtag (fixnum 'fixnum) (function (type-specifier (ctype-of object))) (null 'null) (list 'cons) ;; Any other immediates. (character (typecase object (standard-char 'standard-char) (base-char 'base-char) (t 'character))) ;; And now for the complicated ones. (number (etypecase object (fixnum 'fixnum) (bignum 'bignum) (float (etypecase object (double-float 'double-float) (single-float 'single-float) (short-float 'short-float) (long-float 'long-float))) (ratio 'ratio) (complex 'complex))) (symbol (if (eq (symbol-package object) (symbol-package :foo)) 'keyword 'symbol)) (structure (let ((name (structure-ref object 0))) (case name (pcl::std-instance (pcl:class-name (pcl:class-of object))) (alien-internals:alien-value `(alien:alien ,(alien-internals:unparse-alien-type (alien-internals:alien-value-type object)))) (t name)))) (array (type-specifier (ctype-of object))) (system-area-pointer 'system-area-pointer) (weak-pointer 'weak-pointer) (code-component 'code-component) (lra 'lra) (fdefn 'fdefn) (scavenger-hook 'scavenger-hook) (t (warn "Can't figure out the type of ~S" object) t))) (in-package "PCL") (pushnew :structure-wrapper *features*) (defun structure-functions-exist-p () t) (defun structure-instance-p (x) (and (structurep x) (not (eq (kernel:structure-ref x 0) 'std-instance)))) (defun structure-type (x) (kernel:structure-ref x 0)) (defun structure-type-p (type) (not (null (ext:info c::type c::defined-structure-info type)))) (defun structure-type-included-type-name (type) (let ((include (c::dd-include (ext:info c::type c::defined-structure-info type)))) (if (consp include) (car include) include))) (defun structure-type-slot-description-list (type) (nthcdr (length (let ((include (structure-type-included-type-name type))) (and include (structure-type-slot-description-list include)))) (c::dd-slots (ext:info c::type c::defined-structure-info type)))) (defun structure-slotd-name (slotd) (intern (c::dsd-%name slotd) "USER")) (defun structure-slotd-accessor-symbol (slotd) (c::dsd-accessor slotd)) (defun structure-slotd-reader-function (slotd) (fdefinition (c::dsd-accessor slotd))) (defun structure-slotd-writer-function (slotd) (unless (c::dsd-read-only slotd) (fdefinition `(setf ,(c::dsd-accessor slotd))))) (defun structure-slotd-type (slotd) (c::dsd-type slotd)) (defun structure-slotd-init-form (slotd) (c::dsd-default slotd))
true
;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*- ;;; ;;; ************************************************************************* ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation. ;;; All rights reserved. ;;; ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted. Any distribution of this ;;; software or derivative works must comply with all applicable United ;;; States export control laws. ;;; ;;; This software is made available AS IS, and Xerox Corporation makes no ;;; warranty about the software, its performance or its conformity to any ;;; specification. ;;; ;;; Any person obtaining a copy of this software is requested to send their ;;; name and post office or electronic mail address to: ;;; CommonLoops Coordinator ;;; PI:NAME:<NAME>END_PI ;;; 3333 Coyote Hill Rd. ;;; Palo Alto, CA 94304 ;;; (or send Arpanet mail to PI:EMAIL:<EMAIL>END_PI) ;;; ;;; Suggestions, comments and requests for improvements are also welcome. ;;; ************************************************************************* ;;; ;;; This is the CMU Lisp version of the file low. ;;; (in-package :pcl) (defmacro dotimes ((var count &optional (result nil)) &body body) `(lisp:dotimes (,var (the fixnum ,count) ,result) (declare (fixnum ,var)) ,@body)) ;;; Just use our without-interrupts. We don't have the INTERRUPTS-ON/OFF local ;;; macros spec'ed in low.lisp, but they aren't used. ;;; (defmacro without-interrupts (&rest stuff) `(sys:without-interrupts ,@stuff)) ;;; Print the object addr in default printers. ;;; (defun printing-random-thing-internal (thing stream) (format stream "{~X}" (sys:%primitive c:make-fixnum thing))) (eval-when (compile load eval) (c:def-source-transform std-instance-p (x) (ext:once-only ((n-x x)) `(and (ext:structurep ,n-x) (eq (kernel:structure-ref ,n-x 0) 'std-instance))))) (defun function-arglist (fcn) "Returns the argument list of a compiled function, if possible." (cond ((symbolp fcn) (when (fboundp fcn) (function-arglist (symbol-function fcn)))) ((eval:interpreted-function-p fcn) (eval:interpreted-function-arglist fcn)) ((functionp fcn) (let ((lambda-expr (function-lambda-expression fcn))) (if lambda-expr (cadr lambda-expr) (let ((function (kernel:%closure-function fcn))) (values (read-from-string (kernel:%function-header-arglist function))))))))) ;;; We have this here and in fin.lisp, 'cause PCL wants to compile this ;;; file first. ;;; (defsetf funcallable-instance-name set-funcallable-instance-name) ;;; And returns the function, not the *name*. (defun set-function-name (fcn new-name) "Set the name of a compiled function object." (cond ((symbolp fcn) (set-function-name (symbol-function fcn) new-name)) ((funcallable-instance-p fcn) (setf (funcallable-instance-name fcn) new-name) fcn) ((eval:interpreted-function-p fcn) (setf (eval:interpreted-function-name fcn) new-name) fcn) (t (let ((header (kernel:%closure-function fcn))) ;;#+cmu17 ;;(setf (c::%function-name header) new-name) ;;#-cmu17 (system:%primitive c::set-function-name header new-name)) fcn))) (in-package "C") ;;From compiler/ir1util (def-source-context pcl:defmethod (name &rest stuff) (let ((arg-pos (position-if #'listp stuff))) (if arg-pos `(pcl:defmethod ,name ,@(subseq stuff 0 arg-pos) ,(nth-value 2 (pcl::parse-specialized-lambda-list (elt stuff arg-pos)))) `(pcl:defmethod ,name "<illegal syntax>")))) (define-info-type type kind (member :primitive :defined :structure :class nil) (if (or (info type builtin name) (info type translator name)) :primitive nil)) (define-info-type type class-info (or pcl::class symbol null) nil) (in-package "KERNEL") (export '(clos-type clos-type-class)) (defmacro cold-load-init (&rest forms) `(progn ,@forms)) (defstruct (clos-type (:include ctype (:class-info (type-class-or-lose 'clos)) (:enumerable t)) (:print-function %print-type)) ;; ;; The CLOS class. (class nil)) (define-type-class clos) (define-type-method (clos :unparse) (x) (clos-type-class x)) (define-type-method (clos :complex-union) (type1 type2) (make-union-type (list type1 type2))) (define-type-method (clos :simple-=) (type1 type2) (values (eq (clos-type-class type1) (clos-type-class type2)) t)) (define-type-method (clos :simple-subtypep) (type1 type2) (let ((class1 (pcl:find-class (clos-type-class type1) nil)) (class2 (pcl:find-class (clos-type-class type2) nil))) (if (and class1 class2) (values (member class2 (pcl:class-precedence-list class2)) t) (values nil nil)))) ;; Add the new ctype to its supertypes. ;; (let ((the-type-* (values-specifier-type '*))) (pushnew 'clos (named-type-subclasses the-type-*))) (let ((the-type-t (values-specifier-type 't))) (pushnew 'clos (named-type-subclasses the-type-t))) (defun-cached (values-specifier-type :hash-function (lambda (x) (the fixnum (logand (the fixnum (cache-hash-eq x)) #x3FF))) :hash-bits 10) ((spec eq)) (or (info type builtin spec) (let ((expand (type-expand spec))) (if (eq expand spec) (let* ((lspec (if (atom spec) (list spec) spec)) (fun (info type translator (car lspec)))) (cond (fun (funcall fun lspec)) ((and (symbolp spec) (eq (info type kind spec) :structure)) (make-structure-type :name spec)) ((and (symbolp spec) (eq (info type kind spec) :class)) (make-clos-type :class spec)) ((or (and (consp spec) (symbolp (car spec))) (symbolp spec)) (signal 'parse-unknown-type :specifier spec) ;; ;; Inhibit caching... (return-from values-specifier-type (make-unknown-type :specifier spec))) (t (error "Bad thing to be a type specifier: ~S." spec)))) (values-specifier-type expand))))) (defun ctypep (obj type) (declare (type ctype type)) (etypecase type ((or numeric-type named-type member-type array-type) (values (typep obj (type-specifier type)) t)) (structure-type (if (structurep obj) (let* ((name (structure-type-name type)) (info (info type structure-info name)) (defined-info (info type defined-structure-info name))) (if (and info defined-info (equal (c::dd-includes info) (c::dd-includes defined-info))) (values (typep obj name) t) (values nil nil))) (values nil t))) (clos-type (let ((class (clos-type-class type))) (if (pcl::std-instance-p obj) (values (pcl::*typep obj class) t) (values nil t)))) (union-type (dolist (mem (union-type-types type) (values nil t)) (multiple-value-bind (val win) (ctypep obj mem) (unless win (return (values nil nil))) (when val (return (values t t)))))) (function-type (values (functionp obj) t)) (unknown-type (values nil nil)) (alien-type-type (values (alien-typep obj (alien-type-type-alien-type type)) t)) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (if (atom hairy-spec) (values t t) (dolist (spec (cdr hairy-spec) (values t t)) (multiple-value-bind (res win) (ctypep obj (specifier-type spec)) (unless win (return (values nil nil))) (unless res (return (values nil t))))))) (not (multiple-value-bind (res win) (ctypep obj (specifier-type (cadr hairy-spec))) (if win (values (not res) t) (values nil nil)))) (satisfies (let ((fun (second hairy-spec))) (cond ((and (consp fun) (eq (car fun) 'lambda)) (values (not (null (funcall (coerce fun 'function) obj))) t)) ((and (symbolp fun) (fboundp fun)) (values (not (null (funcall fun obj))) t)) (t (values nil nil)))))))))) (in-package "LISP") (defun %%typep (object type) (declare (type ctype type)) (etypecase type (named-type (ecase (named-type-name type) ((* t) t) ((nil) nil) (character (characterp object)) (base-char (base-char-p object)) (standard-char (and (characterp object) (standard-char-p object))) (extended-char (and (characterp object) (not (base-char-p object)))) (function (functionp object)) (cons (consp object)) (symbol (symbolp object)) (keyword (and (symbolp object) (eq (symbol-package object) (symbol-package :foo)))) (system-area-pointer (system-area-pointer-p object)) (weak-pointer (weak-pointer-p object)) (code-component (code-component-p object)) (lra (lra-p object)) (fdefn (fdefn-p object)) (scavenger-hook (scavenger-hook-p object)) (structure (structurep object)))) (numeric-type (and (numberp object) (let ((num (if (complexp object) (realpart object) object))) (ecase (numeric-type-class type) (integer (integerp num)) (rational (rationalp num)) (float (ecase (numeric-type-format type) (short-float (typep object 'short-float)) (single-float (typep object 'single-float)) (double-float (typep object 'double-float)) (long-float (typep object 'long-float)) ((nil) (floatp num)))) ((nil) t))) (flet ((bound-test (val) (let ((low (numeric-type-low type)) (high (numeric-type-high type))) (and (cond ((null low) t) ((listp low) (> val (car low))) (t (>= val low))) (cond ((null high) t) ((listp high) (< val (car high))) (t (<= val high))))))) (ecase (numeric-type-complexp type) ((nil) t) (:complex (and (complexp object) (bound-test (realpart object)) (bound-test (imagpart object)))) (:real (and (not (complexp object)) (bound-test object))))))) (array-type (and (arrayp object) (ecase (array-type-complexp type) ((t) (not (typep object 'simple-array))) ((nil) (typep object 'simple-array)) (* t)) (or (eq (array-type-dimensions type) '*) (do ((want (array-type-dimensions type) (cdr want)) (got (array-dimensions object) (cdr got))) ((and (null want) (null got)) t) (unless (and want got (or (eq (car want) '*) (= (car want) (car got)))) (return nil)))) (or (eq (array-type-element-type type) *wild-type*) (type= (array-type-specialized-element-type type) (specifier-type (array-element-type object)))))) (member-type (if (member object (member-type-members type)) t)) (structure-type (structure-typep object (structure-type-name type))) (clos-type (pcl::*typep object (clos-type-class type))) (union-type (dolist (type (union-type-types type)) (when (%%typep object type) (return t)))) (unknown-type ;; Type may be unknown to the compiler (and SPECIFIER-TYPE), yet be ;; a defined structure in the core. (let ((orig-spec (unknown-type-specifier type))) (if (and (symbolp orig-spec) (info type defined-structure-info orig-spec)) (structure-typep object orig-spec) (error "Unknown type specifier: ~S" orig-spec)))) (hairy-type ;; Now the tricky stuff. (let* ((hairy-spec (hairy-type-specifier type)) (symbol (if (consp hairy-spec) (car hairy-spec) hairy-spec))) (ecase symbol (and (or (atom hairy-spec) (dolist (spec (cdr hairy-spec) t) (unless (%%typep object (specifier-type spec)) (return nil))))) (not (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (not (%%typep object (specifier-type (cadr hairy-spec))))) (satisfies (unless (and (listp hairy-spec) (= (length hairy-spec) 2)) (error "Invalid type specifier: ~S" hairy-spec)) (let ((fn (cadr hairy-spec))) (if (funcall (typecase fn (function fn) (symbol (symbol-function fn)) (t (coerce fn 'function))) object) t nil)))))) (alien-type-type (alien-internals:alien-typep object (alien-type-type-alien-type type))) (function-type (error "Function types are not a legal argument to TYPEP:~% ~S" (type-specifier type))))) (defun %deftype (name expander &optional doc) (ecase (info type kind name) (:primitive (error "Illegal to redefine standard type: ~S." name)) (:structure (warn "Redefining structure type ~S with DEFTYPE." name) (c::undefine-structure (info type structure-info name))) (:class (warn "Redefining class ~S with DEFTYPE." name)) ((nil :defined))) (setf (info type kind name) :defined) (setf (info type expander name) expander) (when doc (setf (documentation name 'type) doc)) ;; ### Bootstrap hack -- we need to define types before %note-type-defined ;; is defined. (when (fboundp 'c::%note-type-defined) (c::%note-type-defined name)) name) (defun type-of (object) "Return the type of OBJECT." (typecase object ;; First the ones that we can tell by testing the lowtag (fixnum 'fixnum) (function (type-specifier (ctype-of object))) (null 'null) (list 'cons) ;; Any other immediates. (character (typecase object (standard-char 'standard-char) (base-char 'base-char) (t 'character))) ;; And now for the complicated ones. (number (etypecase object (fixnum 'fixnum) (bignum 'bignum) (float (etypecase object (double-float 'double-float) (single-float 'single-float) (short-float 'short-float) (long-float 'long-float))) (ratio 'ratio) (complex 'complex))) (symbol (if (eq (symbol-package object) (symbol-package :foo)) 'keyword 'symbol)) (structure (let ((name (structure-ref object 0))) (case name (pcl::std-instance (pcl:class-name (pcl:class-of object))) (alien-internals:alien-value `(alien:alien ,(alien-internals:unparse-alien-type (alien-internals:alien-value-type object)))) (t name)))) (array (type-specifier (ctype-of object))) (system-area-pointer 'system-area-pointer) (weak-pointer 'weak-pointer) (code-component 'code-component) (lra 'lra) (fdefn 'fdefn) (scavenger-hook 'scavenger-hook) (t (warn "Can't figure out the type of ~S" object) t))) (in-package "PCL") (pushnew :structure-wrapper *features*) (defun structure-functions-exist-p () t) (defun structure-instance-p (x) (and (structurep x) (not (eq (kernel:structure-ref x 0) 'std-instance)))) (defun structure-type (x) (kernel:structure-ref x 0)) (defun structure-type-p (type) (not (null (ext:info c::type c::defined-structure-info type)))) (defun structure-type-included-type-name (type) (let ((include (c::dd-include (ext:info c::type c::defined-structure-info type)))) (if (consp include) (car include) include))) (defun structure-type-slot-description-list (type) (nthcdr (length (let ((include (structure-type-included-type-name type))) (and include (structure-type-slot-description-list include)))) (c::dd-slots (ext:info c::type c::defined-structure-info type)))) (defun structure-slotd-name (slotd) (intern (c::dsd-%name slotd) "USER")) (defun structure-slotd-accessor-symbol (slotd) (c::dsd-accessor slotd)) (defun structure-slotd-reader-function (slotd) (fdefinition (c::dsd-accessor slotd))) (defun structure-slotd-writer-function (slotd) (unless (c::dsd-read-only slotd) (fdefinition `(setf ,(c::dsd-accessor slotd))))) (defun structure-slotd-type (slotd) (c::dsd-type slotd)) (defun structure-slotd-init-form (slotd) (c::dsd-default slotd))
[ { "context": "efsystem cellodemo\n :name \"cellodemo\"\n :author \"Kenny Tilton <[email protected]>\"\n :version \"1.0.0\"\n :maint", "end": 296, "score": 0.9998688697814941, "start": 284, "tag": "NAME", "value": "Kenny Tilton" }, { "context": "demo\n :name \"cellodemo\"\n :author \"Kenny Tilton <[email protected]>\"\n :version \"1.0.0\"\n :maintainer \"Kenny Tilton ", "end": 316, "score": 0.9999326467514038, "start": 298, "tag": "EMAIL", "value": "[email protected]" }, { "context": "[email protected]>\"\n :version \"1.0.0\"\n :maintainer \"Kenny Tilton <[email protected]>\"\n :licence \"MIT\"\n :descrip", "end": 365, "score": 0.9998698830604553, "start": 353, "tag": "NAME", "value": "Kenny Tilton" }, { "context": "\"\n :version \"1.0.0\"\n :maintainer \"Kenny Tilton <[email protected]>\"\n :licence \"MIT\"\n :description \"Cello Demos\"\n ", "end": 385, "score": 0.9999319911003113, "start": 367, "tag": "EMAIL", "value": "[email protected]" } ]
cellodemo/cellodemo.asd
kennytilton/Cello
9
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;(declaim (optimize (debug 2) (speed 1) (safety 1) (compilation-speed 1))) (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :asdf) (defsystem cellodemo :name "cellodemo" :author "Kenny Tilton <[email protected]>" :version "1.0.0" :maintainer "Kenny Tilton <[email protected]>" :licence "MIT" :description "Cello Demos" :long-description "Cello Demonstrations" :components (#+notyet (:module :cloucell :components ((:file "inspection") (:file "ct-item-stack" :depends-on ("inspection")) (:file "ct-slot-stack" :depends-on ("ct-item-stack")) (:file "inspector-toolbar" :depends-on ("ct-slot-stack")) (:file "inspector-window" :depends-on ("inspector-toolbar")) (:file "outline" :depends-on ("inspector-window")) (:file "slot-inspector" :depends-on ("outline")) (:file "structure-view" :depends-on ("slot-inspector")))) (:file "cellodemo") (:file "demo-window") (:file "tutor-geometry") (:file "light-panel") (:file "hedron-render") (:file "hedron-decoration")))
16771
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;(declaim (optimize (debug 2) (speed 1) (safety 1) (compilation-speed 1))) (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :asdf) (defsystem cellodemo :name "cellodemo" :author "<NAME> <<EMAIL>>" :version "1.0.0" :maintainer "<NAME> <<EMAIL>>" :licence "MIT" :description "Cello Demos" :long-description "Cello Demonstrations" :components (#+notyet (:module :cloucell :components ((:file "inspection") (:file "ct-item-stack" :depends-on ("inspection")) (:file "ct-slot-stack" :depends-on ("ct-item-stack")) (:file "inspector-toolbar" :depends-on ("ct-slot-stack")) (:file "inspector-window" :depends-on ("inspector-toolbar")) (:file "outline" :depends-on ("inspector-window")) (:file "slot-inspector" :depends-on ("outline")) (:file "structure-view" :depends-on ("slot-inspector")))) (:file "cellodemo") (:file "demo-window") (:file "tutor-geometry") (:file "light-panel") (:file "hedron-render") (:file "hedron-decoration")))
true
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;(declaim (optimize (debug 2) (speed 1) (safety 1) (compilation-speed 1))) (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) (in-package :asdf) (defsystem cellodemo :name "cellodemo" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :version "1.0.0" :maintainer "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :licence "MIT" :description "Cello Demos" :long-description "Cello Demonstrations" :components (#+notyet (:module :cloucell :components ((:file "inspection") (:file "ct-item-stack" :depends-on ("inspection")) (:file "ct-slot-stack" :depends-on ("ct-item-stack")) (:file "inspector-toolbar" :depends-on ("ct-slot-stack")) (:file "inspector-window" :depends-on ("inspector-toolbar")) (:file "outline" :depends-on ("inspector-window")) (:file "slot-inspector" :depends-on ("outline")) (:file "structure-view" :depends-on ("slot-inspector")))) (:file "cellodemo") (:file "demo-window") (:file "tutor-geometry") (:file "light-panel") (:file "hedron-render") (:file "hedron-decoration")))
[ { "context": "ase-name \"example\"\n :username \"fireflower0\"\n :password \"password\"))\n\n(def", "end": 314, "score": 0.9995751976966858, "start": 303, "tag": "USERNAME", "value": "fireflower0" }, { "context": "name \"fireflower0\"\n :password \"password\"))\n\n(defclass users ()\n ((name :col-type (:varch", "end": 355, "score": 0.9993608593940735, "start": 347, "tag": "PASSWORD", "value": "password" } ]
backend/app/app.lisp
fireflower0/web-app-docker-template
0
(ql:quickload :mito) (defpackage #:app (:use #:cl #:utopian #:mito)) (in-package #:app) (defparameter *connection* (connect-toplevel :postgres :host "db" :port 5432 :database-name "example" :username "fireflower0" :password "password")) (defclass users () ((name :col-type (:varchar 64) :accessor users-name) (email :col-type (or (:varchar 128) :null) :accessor users-email)) (:metaclass dao-table-class)) (defun index (params) (declare (ignore params)) "Hello, Utopian!") (defun foo (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "foo")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun bar (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "bar")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun baz (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "baz")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defroutes *routes* ((:GET "/" #'index) (:GET "/foo" #'foo) (:GET "/bar" #'bar) (:GET "/baz" #'baz))) (defapp app () ()) (make-instance 'app :routes *routes*)
30285
(ql:quickload :mito) (defpackage #:app (:use #:cl #:utopian #:mito)) (in-package #:app) (defparameter *connection* (connect-toplevel :postgres :host "db" :port 5432 :database-name "example" :username "fireflower0" :password "<PASSWORD>")) (defclass users () ((name :col-type (:varchar 64) :accessor users-name) (email :col-type (or (:varchar 128) :null) :accessor users-email)) (:metaclass dao-table-class)) (defun index (params) (declare (ignore params)) "Hello, Utopian!") (defun foo (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "foo")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun bar (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "bar")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun baz (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "baz")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defroutes *routes* ((:GET "/" #'index) (:GET "/foo" #'foo) (:GET "/bar" #'bar) (:GET "/baz" #'baz))) (defapp app () ()) (make-instance 'app :routes *routes*)
true
(ql:quickload :mito) (defpackage #:app (:use #:cl #:utopian #:mito)) (in-package #:app) (defparameter *connection* (connect-toplevel :postgres :host "db" :port 5432 :database-name "example" :username "fireflower0" :password "PI:PASSWORD:<PASSWORD>END_PI")) (defclass users () ((name :col-type (:varchar 64) :accessor users-name) (email :col-type (or (:varchar 128) :null) :accessor users-email)) (:metaclass dao-table-class)) (defun index (params) (declare (ignore params)) "Hello, Utopian!") (defun foo (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "foo")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun bar (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "bar")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defun baz (params) (declare (ignore params)) (let* ((ret (find-dao 'users :name "baz")) (name (users-name ret)) (email (users-email ret))) (format nil "Hello, ~A! Your email is ~A" name email))) (defroutes *routes* ((:GET "/" #'index) (:GET "/foo" #'foo) (:GET "/bar" #'bar) (:GET "/baz" #'baz))) (defapp app () ()) (make-instance 'app :routes *routes*)
[ { "context": ";;; simplification-grab-bag.lisp\n;;;;\n;;;; Author: Robert Smith\n\n(in-package #:cl-quil.frontend)\n\n;;;; This file ", "end": 64, "score": 0.9997992515563965, "start": 52, "tag": "NAME", "value": "Robert Smith" } ]
src/analysis/simplification-grab-bag.lisp
mkeshita/quilc
1
;;;; simplification-grab-bag.lisp ;;;; ;;;; Author: Robert Smith (in-package #:cl-quil.frontend) ;;;; This file contains a grab bag of INDIVIDUAL INSTRUCTION ;;;; SIMPLIFICATIONS. The reason for the "grab bag" nature is to avoid ;;;; having lots of passes over the same program, and instead have one ;;;; pass that may simplify a lot in one go. ;;;; ;;;; Current simplifications include: (defparameter *grab-bag-simplifiers* '(simplify-instruction-modifiers simplify-arithmetic)) ;;; Arithmetic Simplifier ;;; See simplify-arithmetic.lisp ;;; Dagger Simplifier (defun simplify-daggers (od) "Take an operator description and simplify the DAGGERs on it." (labels ((rec (od c) ;; c = # of daggers counted so far (adt:match operator-description od ((named-operator _) (if (evenp c) od (dagger-operator od))) ((controlled-operator x) (controlled-operator (rec x c))) ((dagger-operator x) (rec x (1+ c))) ((forked-operator x) (forked-operator (rec x c)))))) (rec od 0))) (defgeneric simplify-instruction-modifiers (isn) (:method ((isn t)) isn) (:method ((isn application)) (let ((new-app (copy-instance isn))) (setf (application-operator new-app) (simplify-daggers (application-operator new-app))) new-app))) ;;; Instruction Rewriter (defun grab-bag-simplify-instruction (isn) (dolist (simp *grab-bag-simplifiers* isn) (setf isn (funcall simp isn)))) ;;; Transform (defun simplify-individual-instructions (parsed-prog) (map-into (parsed-program-executable-code parsed-prog) #'grab-bag-simplify-instruction (parsed-program-executable-code parsed-prog)) parsed-prog) (define-transform simplify-individual-instructions (simplify-individual-instructions) "Simplify individual instructions with a variety of straightforward techniques.")
7295
;;;; simplification-grab-bag.lisp ;;;; ;;;; Author: <NAME> (in-package #:cl-quil.frontend) ;;;; This file contains a grab bag of INDIVIDUAL INSTRUCTION ;;;; SIMPLIFICATIONS. The reason for the "grab bag" nature is to avoid ;;;; having lots of passes over the same program, and instead have one ;;;; pass that may simplify a lot in one go. ;;;; ;;;; Current simplifications include: (defparameter *grab-bag-simplifiers* '(simplify-instruction-modifiers simplify-arithmetic)) ;;; Arithmetic Simplifier ;;; See simplify-arithmetic.lisp ;;; Dagger Simplifier (defun simplify-daggers (od) "Take an operator description and simplify the DAGGERs on it." (labels ((rec (od c) ;; c = # of daggers counted so far (adt:match operator-description od ((named-operator _) (if (evenp c) od (dagger-operator od))) ((controlled-operator x) (controlled-operator (rec x c))) ((dagger-operator x) (rec x (1+ c))) ((forked-operator x) (forked-operator (rec x c)))))) (rec od 0))) (defgeneric simplify-instruction-modifiers (isn) (:method ((isn t)) isn) (:method ((isn application)) (let ((new-app (copy-instance isn))) (setf (application-operator new-app) (simplify-daggers (application-operator new-app))) new-app))) ;;; Instruction Rewriter (defun grab-bag-simplify-instruction (isn) (dolist (simp *grab-bag-simplifiers* isn) (setf isn (funcall simp isn)))) ;;; Transform (defun simplify-individual-instructions (parsed-prog) (map-into (parsed-program-executable-code parsed-prog) #'grab-bag-simplify-instruction (parsed-program-executable-code parsed-prog)) parsed-prog) (define-transform simplify-individual-instructions (simplify-individual-instructions) "Simplify individual instructions with a variety of straightforward techniques.")
true
;;;; simplification-grab-bag.lisp ;;;; ;;;; Author: PI:NAME:<NAME>END_PI (in-package #:cl-quil.frontend) ;;;; This file contains a grab bag of INDIVIDUAL INSTRUCTION ;;;; SIMPLIFICATIONS. The reason for the "grab bag" nature is to avoid ;;;; having lots of passes over the same program, and instead have one ;;;; pass that may simplify a lot in one go. ;;;; ;;;; Current simplifications include: (defparameter *grab-bag-simplifiers* '(simplify-instruction-modifiers simplify-arithmetic)) ;;; Arithmetic Simplifier ;;; See simplify-arithmetic.lisp ;;; Dagger Simplifier (defun simplify-daggers (od) "Take an operator description and simplify the DAGGERs on it." (labels ((rec (od c) ;; c = # of daggers counted so far (adt:match operator-description od ((named-operator _) (if (evenp c) od (dagger-operator od))) ((controlled-operator x) (controlled-operator (rec x c))) ((dagger-operator x) (rec x (1+ c))) ((forked-operator x) (forked-operator (rec x c)))))) (rec od 0))) (defgeneric simplify-instruction-modifiers (isn) (:method ((isn t)) isn) (:method ((isn application)) (let ((new-app (copy-instance isn))) (setf (application-operator new-app) (simplify-daggers (application-operator new-app))) new-app))) ;;; Instruction Rewriter (defun grab-bag-simplify-instruction (isn) (dolist (simp *grab-bag-simplifiers* isn) (setf isn (funcall simp isn)))) ;;; Transform (defun simplify-individual-instructions (parsed-prog) (map-into (parsed-program-executable-code parsed-prog) #'grab-bag-simplify-instruction (parsed-program-executable-code parsed-prog)) parsed-prog) (define-transform simplify-individual-instructions (simplify-individual-instructions) "Simplify individual instructions with a variety of straightforward techniques.")
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 263, "score": 0.9998726844787598, "start": 246, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 283, "score": 0.9999314546585083, "start": 265, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/c/atc/fty-pseudo-terms.lisp
mayankmanj/acl2
0
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "clause-processors/pseudo-term-fty" :dir :system) (include-book "kestrel/fty/symbol-pseudoterm-alist" :dir :system) (include-book "kestrel/std/system/check-and-call" :dir :system) (include-book "kestrel/std/system/check-fn-call" :dir :system) (include-book "kestrel/std/system/fsublis-var" :dir :system) (include-book "kestrel/std/system/check-if-call" :dir :system) (include-book "kestrel/std/system/check-lambda-call" :dir :system) (include-book "kestrel/std/system/check-list-call" :dir :system) (include-book "kestrel/std/system/check-mbt-call" :dir :system) (include-book "kestrel/std/system/check-mbt-dollar-call" :dir :system) (include-book "kestrel/std/system/check-mv-let-call" :dir :system) (include-book "kestrel/std/system/check-not-call" :dir :system) (include-book "kestrel/std/system/check-or-call" :dir :system) (include-book "std/util/defrule" :dir :system) (include-book "xdoc/defxdoc-plus" :dir :system) (local (include-book "std/typed-lists/pseudo-term-listp" :dir :system)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ fty-pseudo-term-utilities :parents (atc-implementation) :short "FTY utilities for pseudo-terms." :long (xdoc::topstring (xdoc::p "Many system utilities, e.g. built-in and in " (xdoc::seetopic "acl2::std/system" "Std/system") ", are written using the built-in ACL2 term API. When using these system utilities in code that uses the " (xdoc::seetopic "acl2::pseudo-term-fty" "FTY term API") ", there may be a slight ``mismatch'', e.g. in the way the two APIs fix non-terms, or in the fact that, for termination, the ACL2 API is based on @(tsee acl2-count) while the FTY API is based on @(tsee pseudo-term-count).") (xdoc::p "The mismatch can be bridged by introducing simple wrappers of those system utilities that fix the term (in the FTY way) and then call the utilities. Here we provide a number of such wrappers, which should be eventually moved to a more central place.") (xdoc::p "The wrappers are accompanied by theorems leveraged from the wrapped utilities. This way the wrappers can be left disabled in code that uses them.") (xdoc::p "The @(tsee acl2-count) vs. @(tsee pseudo-term-count) issue requires a bit more work. Suppose we have a utility that returns results that are @(tsee acl2-count)-smaller than its arguments (under suitable conditions). In order to prove that the wrapper returns results that are @(tsee pseudo-term-count)-smaller than its arguments, we cannot leverage the theorems about @(tsee acl2-count). Instead, we need to enable the utilities to prove the theorems, and we also need to enable some FTY pseudo-term operations, because we need to break the FTY pseudo-term abstraction: we use this approach to prove theorems about the original utilities and @(tsee pseudo-term-count) under @(tsee pseudo-termp) assumptions, from which then the desired theorems about the wrappers readily follow. The theorems about the original utilities and @(tsee pseudo-term-count) are useful to prove the analogous theorems of utilities that call them.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-fn-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (fn symbolp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-fn-call)." (check-fn-call (pseudo-term-fix term)) /// (more-returns (args true-listp :rule-classes :type-prescription)) (defret fty-check-fn-call-not-quote (not (equal fn 'quote))) (defrule pseudo-term-list-count-of-check-fn-call.args (implies (pseudo-termp term) (b* (((mv yes/no & args) (check-fn-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-fn-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-fn-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-if-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (test pseudo-termp) (then pseudo-termp) (else pseudo-termp)) :short "FTY version of @(tsee check-if-call)." (check-if-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-if-call.test (implies (pseudo-termp term) (b* (((mv yes/no test & &) (check-if-call term))) (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.test (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.then (implies (pseudo-termp term) (b* (((mv yes/no & then &) (check-if-call term))) (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.then (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.else (implies (pseudo-termp term) (b* (((mv yes/no & & else) (check-if-call term))) (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.else (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call (implies (pseudo-termp term) (b* (((mv yes/no test then else) (check-if-call term))) (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-lambda-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (formals symbol-listp) (body pseudo-termp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-lambda-call)." (check-lambda-call (pseudo-term-fix term)) /// (defret len-of-fty-check-lambda-calls.formals-is-args (equal (len formals) (len args)) :hints (("Goal" :expand ((pseudo-term-fix term)) :in-theory (enable check-lambda-call)))) (defret len-of-fty-check-lambda-calls.args-is-formals (equal (len args) (len formals)) :hints (("Goal" :use len-of-fty-check-lambda-calls.formals-is-args))) (in-theory (disable len-of-fty-check-lambda-calls.formals-is-args len-of-fty-check-lambda-calls.args-is-formals)) (theory-invariant (incompatible (:rewrite fty-len-of-check-lambda-calls.formals-is-args) (:rewrite fty-len-of-check-lambda-calls.args-is-formals))) (more-returns (formals true-listp :rule-classes :type-prescription) (args true-listp :rule-classes :type-prescription)) (defrule pseudo-term-count-of-check-lambda-call.body (implies (pseudo-termp term) (b* (((mv yes/no & body &) (check-lambda-call term))) (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->body) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-lambda-call.body (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-list-count-of-check-lambda-call.args (implies (pseudo-termp term) (b* (((mv yes/no & & args) (check-lambda-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-lambda-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-lambda-call (implies (pseudo-termp term) (b* (((mv yes/no & body args) (check-lambda-call term))) (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-count pseudo-term-list-count pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args)) (defret pseudo-term-count-of-fty-check-lambda-call (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-remove-equal-formals-actuals ((formals symbol-listp) (actuals pseudo-term-listp)) :guard (= (len formals) (len actuals)) :returns (mv (new-formals symbol-listp :hyp (symbol-listp formals)) (new-actuals pseudo-term-listp)) :short "FTY version of @(tsee remove-equal-formals-actuals)." (remove-equal-formals-actuals formals (pseudo-term-list-fix actuals)) /// (more-returns (new-formals true-listp :rule-classes :type-prescription) (new-actuals true-listp :rule-classes :type-prescription)) (defret len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals (equal (len new-formals) (len new-actuals)) :hints (("Goal" :in-theory (enable remove-equal-formals-actuals acl2::remove-equal-formals-actuals-same-len)))) (defret len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals (equal (len new-actuals) (len new-formals)) :hints (("Goal" :use len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals))) (in-theory (disable len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals)) (theory-invariant (incompatible (:rewrite len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals) (:rewrite len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals))) (defrule pseudo-term-list-count-of-remove-equal-formals-actuals (b* (((mv & new-actuals) (remove-equal-formals-actuals formals actuals))) (implies (pseudo-term-listp actuals) (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)))) :rule-classes :linear :enable (remove-equal-formals-actuals pseudo-term-list-count)) (defret pseudo-term-list-count-of-fty-remove-equal-formals-actuals (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-not-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (arg pseudo-termp)) :short "FTY version of @(tsee check-not-call)." (check-not-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-not-call.arg (implies (pseudo-termp term) (b* (((mv yes/no arg) (check-not-call term))) (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))))) :rule-classes :linear :enable (check-not-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-not-call.arg (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-and-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-and-call)." (check-and-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-and-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-and-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defrule pseudo-term-count-of-check-and-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-and-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defret pseudo-term-count-of-fty-check-and-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-and-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-or-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-or-call)." (check-or-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-or-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-or-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defrule pseudo-term-count-of-check-or-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-or-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defret pseudo-term-count-of-fty-check-or-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-or-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-mv-let-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (mv-var symbolp) (vars symbol-listp) (indices nat-listp) (hides boolean-listp) (mv-term pseudo-termp) (body-term pseudo-termp)) :short "FTY version of @(tsee check-mv-let-call)." (check-mv-let-call (pseudo-term-fix term)) /// (defret len-of-fty-check-mv-let-call.indices/vars (implies yes/no (equal (len indices) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.indices/vars)))) (defret len-of-fty-check-mv-let-call.hides/vars (implies yes/no (equal (len hides) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.hides/vars)))) (in-theory (disable len-of-fty-check-mv-let-call.indices/vars len-of-fty-check-mv-let-call.indices/vars)) (defrule pseudo-term-count-of-check-mv-let-call.mv-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term &) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind) :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (not (pseudo-term-case term :quote))) (<= (pseudo-term-list-count (cdr term)) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-call->args pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.mv-term (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call.body-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & & body-term) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))))) :rule-classes :linear :enable check-mv-let-call :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (consp (car term))) (< (pseudo-term-count (caddr (car term))) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-lambda->body pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.body-term (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term body-term) (check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args pseudo-term-count pseudo-term-list-count)) (defret pseudo-term-count-if-fty-check-mv-let-call (implies yes/no (b* (((mv yes/no & & & & mv-term body-term) (fty-check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-list-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (elements pseudo-term-listp)) :short "FTY version of @(tsee check-list-call)." (check-list-call (pseudo-term-fix term)) /// (more-returns (elements true-listp :rule-classes :type-prescription))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var ((subst symbol-pseudoterm-alistp) (term pseudo-termp)) :returns (new-term pseudo-termp) :short "FTY version of @(tsee fsublis-var)." (fsublis-var (symbol-pseudoterm-alist-fix subst) (pseudo-term-fix term)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp alist) (pseudo-termp term)) (pseudo-termp (fsublis-var alist term))) :enable acl2::symbol-pseudoterm-alistp-alt-def))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var-lst ((subst symbol-pseudoterm-alistp) (terms pseudo-term-listp)) :returns (new-terms pseudo-term-listp) :short "FTY version of @(tsee fsublis-var-lst)." (fsublis-var-lst (symbol-pseudoterm-alist-fix subst) (pseudo-term-list-fix terms)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp subst) (pseudo-term-listp terms)) (pseudo-term-listp (fsublis-var-lst subst terms))) :enable acl2::symbol-pseudoterm-alistp-alt-def)))
9465
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "clause-processors/pseudo-term-fty" :dir :system) (include-book "kestrel/fty/symbol-pseudoterm-alist" :dir :system) (include-book "kestrel/std/system/check-and-call" :dir :system) (include-book "kestrel/std/system/check-fn-call" :dir :system) (include-book "kestrel/std/system/fsublis-var" :dir :system) (include-book "kestrel/std/system/check-if-call" :dir :system) (include-book "kestrel/std/system/check-lambda-call" :dir :system) (include-book "kestrel/std/system/check-list-call" :dir :system) (include-book "kestrel/std/system/check-mbt-call" :dir :system) (include-book "kestrel/std/system/check-mbt-dollar-call" :dir :system) (include-book "kestrel/std/system/check-mv-let-call" :dir :system) (include-book "kestrel/std/system/check-not-call" :dir :system) (include-book "kestrel/std/system/check-or-call" :dir :system) (include-book "std/util/defrule" :dir :system) (include-book "xdoc/defxdoc-plus" :dir :system) (local (include-book "std/typed-lists/pseudo-term-listp" :dir :system)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ fty-pseudo-term-utilities :parents (atc-implementation) :short "FTY utilities for pseudo-terms." :long (xdoc::topstring (xdoc::p "Many system utilities, e.g. built-in and in " (xdoc::seetopic "acl2::std/system" "Std/system") ", are written using the built-in ACL2 term API. When using these system utilities in code that uses the " (xdoc::seetopic "acl2::pseudo-term-fty" "FTY term API") ", there may be a slight ``mismatch'', e.g. in the way the two APIs fix non-terms, or in the fact that, for termination, the ACL2 API is based on @(tsee acl2-count) while the FTY API is based on @(tsee pseudo-term-count).") (xdoc::p "The mismatch can be bridged by introducing simple wrappers of those system utilities that fix the term (in the FTY way) and then call the utilities. Here we provide a number of such wrappers, which should be eventually moved to a more central place.") (xdoc::p "The wrappers are accompanied by theorems leveraged from the wrapped utilities. This way the wrappers can be left disabled in code that uses them.") (xdoc::p "The @(tsee acl2-count) vs. @(tsee pseudo-term-count) issue requires a bit more work. Suppose we have a utility that returns results that are @(tsee acl2-count)-smaller than its arguments (under suitable conditions). In order to prove that the wrapper returns results that are @(tsee pseudo-term-count)-smaller than its arguments, we cannot leverage the theorems about @(tsee acl2-count). Instead, we need to enable the utilities to prove the theorems, and we also need to enable some FTY pseudo-term operations, because we need to break the FTY pseudo-term abstraction: we use this approach to prove theorems about the original utilities and @(tsee pseudo-term-count) under @(tsee pseudo-termp) assumptions, from which then the desired theorems about the wrappers readily follow. The theorems about the original utilities and @(tsee pseudo-term-count) are useful to prove the analogous theorems of utilities that call them.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-fn-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (fn symbolp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-fn-call)." (check-fn-call (pseudo-term-fix term)) /// (more-returns (args true-listp :rule-classes :type-prescription)) (defret fty-check-fn-call-not-quote (not (equal fn 'quote))) (defrule pseudo-term-list-count-of-check-fn-call.args (implies (pseudo-termp term) (b* (((mv yes/no & args) (check-fn-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-fn-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-fn-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-if-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (test pseudo-termp) (then pseudo-termp) (else pseudo-termp)) :short "FTY version of @(tsee check-if-call)." (check-if-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-if-call.test (implies (pseudo-termp term) (b* (((mv yes/no test & &) (check-if-call term))) (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.test (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.then (implies (pseudo-termp term) (b* (((mv yes/no & then &) (check-if-call term))) (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.then (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.else (implies (pseudo-termp term) (b* (((mv yes/no & & else) (check-if-call term))) (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.else (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call (implies (pseudo-termp term) (b* (((mv yes/no test then else) (check-if-call term))) (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-lambda-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (formals symbol-listp) (body pseudo-termp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-lambda-call)." (check-lambda-call (pseudo-term-fix term)) /// (defret len-of-fty-check-lambda-calls.formals-is-args (equal (len formals) (len args)) :hints (("Goal" :expand ((pseudo-term-fix term)) :in-theory (enable check-lambda-call)))) (defret len-of-fty-check-lambda-calls.args-is-formals (equal (len args) (len formals)) :hints (("Goal" :use len-of-fty-check-lambda-calls.formals-is-args))) (in-theory (disable len-of-fty-check-lambda-calls.formals-is-args len-of-fty-check-lambda-calls.args-is-formals)) (theory-invariant (incompatible (:rewrite fty-len-of-check-lambda-calls.formals-is-args) (:rewrite fty-len-of-check-lambda-calls.args-is-formals))) (more-returns (formals true-listp :rule-classes :type-prescription) (args true-listp :rule-classes :type-prescription)) (defrule pseudo-term-count-of-check-lambda-call.body (implies (pseudo-termp term) (b* (((mv yes/no & body &) (check-lambda-call term))) (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->body) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-lambda-call.body (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-list-count-of-check-lambda-call.args (implies (pseudo-termp term) (b* (((mv yes/no & & args) (check-lambda-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-lambda-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-lambda-call (implies (pseudo-termp term) (b* (((mv yes/no & body args) (check-lambda-call term))) (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-count pseudo-term-list-count pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args)) (defret pseudo-term-count-of-fty-check-lambda-call (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-remove-equal-formals-actuals ((formals symbol-listp) (actuals pseudo-term-listp)) :guard (= (len formals) (len actuals)) :returns (mv (new-formals symbol-listp :hyp (symbol-listp formals)) (new-actuals pseudo-term-listp)) :short "FTY version of @(tsee remove-equal-formals-actuals)." (remove-equal-formals-actuals formals (pseudo-term-list-fix actuals)) /// (more-returns (new-formals true-listp :rule-classes :type-prescription) (new-actuals true-listp :rule-classes :type-prescription)) (defret len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals (equal (len new-formals) (len new-actuals)) :hints (("Goal" :in-theory (enable remove-equal-formals-actuals acl2::remove-equal-formals-actuals-same-len)))) (defret len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals (equal (len new-actuals) (len new-formals)) :hints (("Goal" :use len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals))) (in-theory (disable len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals)) (theory-invariant (incompatible (:rewrite len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals) (:rewrite len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals))) (defrule pseudo-term-list-count-of-remove-equal-formals-actuals (b* (((mv & new-actuals) (remove-equal-formals-actuals formals actuals))) (implies (pseudo-term-listp actuals) (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)))) :rule-classes :linear :enable (remove-equal-formals-actuals pseudo-term-list-count)) (defret pseudo-term-list-count-of-fty-remove-equal-formals-actuals (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-not-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (arg pseudo-termp)) :short "FTY version of @(tsee check-not-call)." (check-not-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-not-call.arg (implies (pseudo-termp term) (b* (((mv yes/no arg) (check-not-call term))) (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))))) :rule-classes :linear :enable (check-not-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-not-call.arg (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-and-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-and-call)." (check-and-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-and-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-and-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defrule pseudo-term-count-of-check-and-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-and-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defret pseudo-term-count-of-fty-check-and-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-and-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-or-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-or-call)." (check-or-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-or-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-or-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defrule pseudo-term-count-of-check-or-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-or-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defret pseudo-term-count-of-fty-check-or-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-or-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-mv-let-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (mv-var symbolp) (vars symbol-listp) (indices nat-listp) (hides boolean-listp) (mv-term pseudo-termp) (body-term pseudo-termp)) :short "FTY version of @(tsee check-mv-let-call)." (check-mv-let-call (pseudo-term-fix term)) /// (defret len-of-fty-check-mv-let-call.indices/vars (implies yes/no (equal (len indices) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.indices/vars)))) (defret len-of-fty-check-mv-let-call.hides/vars (implies yes/no (equal (len hides) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.hides/vars)))) (in-theory (disable len-of-fty-check-mv-let-call.indices/vars len-of-fty-check-mv-let-call.indices/vars)) (defrule pseudo-term-count-of-check-mv-let-call.mv-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term &) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind) :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (not (pseudo-term-case term :quote))) (<= (pseudo-term-list-count (cdr term)) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-call->args pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.mv-term (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call.body-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & & body-term) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))))) :rule-classes :linear :enable check-mv-let-call :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (consp (car term))) (< (pseudo-term-count (caddr (car term))) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-lambda->body pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.body-term (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term body-term) (check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args pseudo-term-count pseudo-term-list-count)) (defret pseudo-term-count-if-fty-check-mv-let-call (implies yes/no (b* (((mv yes/no & & & & mv-term body-term) (fty-check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-list-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (elements pseudo-term-listp)) :short "FTY version of @(tsee check-list-call)." (check-list-call (pseudo-term-fix term)) /// (more-returns (elements true-listp :rule-classes :type-prescription))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var ((subst symbol-pseudoterm-alistp) (term pseudo-termp)) :returns (new-term pseudo-termp) :short "FTY version of @(tsee fsublis-var)." (fsublis-var (symbol-pseudoterm-alist-fix subst) (pseudo-term-fix term)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp alist) (pseudo-termp term)) (pseudo-termp (fsublis-var alist term))) :enable acl2::symbol-pseudoterm-alistp-alt-def))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var-lst ((subst symbol-pseudoterm-alistp) (terms pseudo-term-listp)) :returns (new-terms pseudo-term-listp) :short "FTY version of @(tsee fsublis-var-lst)." (fsublis-var-lst (symbol-pseudoterm-alist-fix subst) (pseudo-term-list-fix terms)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp subst) (pseudo-term-listp terms)) (pseudo-term-listp (fsublis-var-lst subst terms))) :enable acl2::symbol-pseudoterm-alistp-alt-def)))
true
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "clause-processors/pseudo-term-fty" :dir :system) (include-book "kestrel/fty/symbol-pseudoterm-alist" :dir :system) (include-book "kestrel/std/system/check-and-call" :dir :system) (include-book "kestrel/std/system/check-fn-call" :dir :system) (include-book "kestrel/std/system/fsublis-var" :dir :system) (include-book "kestrel/std/system/check-if-call" :dir :system) (include-book "kestrel/std/system/check-lambda-call" :dir :system) (include-book "kestrel/std/system/check-list-call" :dir :system) (include-book "kestrel/std/system/check-mbt-call" :dir :system) (include-book "kestrel/std/system/check-mbt-dollar-call" :dir :system) (include-book "kestrel/std/system/check-mv-let-call" :dir :system) (include-book "kestrel/std/system/check-not-call" :dir :system) (include-book "kestrel/std/system/check-or-call" :dir :system) (include-book "std/util/defrule" :dir :system) (include-book "xdoc/defxdoc-plus" :dir :system) (local (include-book "std/typed-lists/pseudo-term-listp" :dir :system)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ fty-pseudo-term-utilities :parents (atc-implementation) :short "FTY utilities for pseudo-terms." :long (xdoc::topstring (xdoc::p "Many system utilities, e.g. built-in and in " (xdoc::seetopic "acl2::std/system" "Std/system") ", are written using the built-in ACL2 term API. When using these system utilities in code that uses the " (xdoc::seetopic "acl2::pseudo-term-fty" "FTY term API") ", there may be a slight ``mismatch'', e.g. in the way the two APIs fix non-terms, or in the fact that, for termination, the ACL2 API is based on @(tsee acl2-count) while the FTY API is based on @(tsee pseudo-term-count).") (xdoc::p "The mismatch can be bridged by introducing simple wrappers of those system utilities that fix the term (in the FTY way) and then call the utilities. Here we provide a number of such wrappers, which should be eventually moved to a more central place.") (xdoc::p "The wrappers are accompanied by theorems leveraged from the wrapped utilities. This way the wrappers can be left disabled in code that uses them.") (xdoc::p "The @(tsee acl2-count) vs. @(tsee pseudo-term-count) issue requires a bit more work. Suppose we have a utility that returns results that are @(tsee acl2-count)-smaller than its arguments (under suitable conditions). In order to prove that the wrapper returns results that are @(tsee pseudo-term-count)-smaller than its arguments, we cannot leverage the theorems about @(tsee acl2-count). Instead, we need to enable the utilities to prove the theorems, and we also need to enable some FTY pseudo-term operations, because we need to break the FTY pseudo-term abstraction: we use this approach to prove theorems about the original utilities and @(tsee pseudo-term-count) under @(tsee pseudo-termp) assumptions, from which then the desired theorems about the wrappers readily follow. The theorems about the original utilities and @(tsee pseudo-term-count) are useful to prove the analogous theorems of utilities that call them.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-fn-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (fn symbolp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-fn-call)." (check-fn-call (pseudo-term-fix term)) /// (more-returns (args true-listp :rule-classes :type-prescription)) (defret fty-check-fn-call-not-quote (not (equal fn 'quote))) (defrule pseudo-term-list-count-of-check-fn-call.args (implies (pseudo-termp term) (b* (((mv yes/no & args) (check-fn-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-fn-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-fn-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-if-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (test pseudo-termp) (then pseudo-termp) (else pseudo-termp)) :short "FTY version of @(tsee check-if-call)." (check-if-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-if-call.test (implies (pseudo-termp term) (b* (((mv yes/no test & &) (check-if-call term))) (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.test (implies yes/no (< (pseudo-term-count test) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.then (implies (pseudo-termp term) (b* (((mv yes/no & then &) (check-if-call term))) (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.then (implies yes/no (< (pseudo-term-count then) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call.else (implies (pseudo-termp term) (b* (((mv yes/no & & else) (check-if-call term))) (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call.else (implies yes/no (< (pseudo-term-count else) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-if-call (implies (pseudo-termp term) (b* (((mv yes/no test then else) (check-if-call term))) (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-if-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-if-call (implies yes/no (< (+ (pseudo-term-count test) (pseudo-term-count then) (pseudo-term-count else)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-lambda-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (formals symbol-listp) (body pseudo-termp) (args pseudo-term-listp)) :short "FTY version of @(tsee check-lambda-call)." (check-lambda-call (pseudo-term-fix term)) /// (defret len-of-fty-check-lambda-calls.formals-is-args (equal (len formals) (len args)) :hints (("Goal" :expand ((pseudo-term-fix term)) :in-theory (enable check-lambda-call)))) (defret len-of-fty-check-lambda-calls.args-is-formals (equal (len args) (len formals)) :hints (("Goal" :use len-of-fty-check-lambda-calls.formals-is-args))) (in-theory (disable len-of-fty-check-lambda-calls.formals-is-args len-of-fty-check-lambda-calls.args-is-formals)) (theory-invariant (incompatible (:rewrite fty-len-of-check-lambda-calls.formals-is-args) (:rewrite fty-len-of-check-lambda-calls.args-is-formals))) (more-returns (formals true-listp :rule-classes :type-prescription) (args true-listp :rule-classes :type-prescription)) (defrule pseudo-term-count-of-check-lambda-call.body (implies (pseudo-termp term) (b* (((mv yes/no & body &) (check-lambda-call term))) (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->body) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-lambda-call.body (implies yes/no (< (pseudo-term-count body) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-list-count-of-check-lambda-call.args (implies (pseudo-termp term) (b* (((mv yes/no & & args) (check-lambda-call term))) (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-kind pseudo-term-lambda->args) :expand (pseudo-term-count term)) (defret pseudo-term-list-count-of-fty-check-lambda-call.args (implies yes/no (< (pseudo-term-list-count args) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-lambda-call (implies (pseudo-termp term) (b* (((mv yes/no & body args) (check-lambda-call term))) (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-lambda-call pseudo-term-count pseudo-term-list-count pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args)) (defret pseudo-term-count-of-fty-check-lambda-call (implies yes/no (< (+ (pseudo-term-count body) (pseudo-term-list-count args)) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-remove-equal-formals-actuals ((formals symbol-listp) (actuals pseudo-term-listp)) :guard (= (len formals) (len actuals)) :returns (mv (new-formals symbol-listp :hyp (symbol-listp formals)) (new-actuals pseudo-term-listp)) :short "FTY version of @(tsee remove-equal-formals-actuals)." (remove-equal-formals-actuals formals (pseudo-term-list-fix actuals)) /// (more-returns (new-formals true-listp :rule-classes :type-prescription) (new-actuals true-listp :rule-classes :type-prescription)) (defret len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals (equal (len new-formals) (len new-actuals)) :hints (("Goal" :in-theory (enable remove-equal-formals-actuals acl2::remove-equal-formals-actuals-same-len)))) (defret len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals (equal (len new-actuals) (len new-formals)) :hints (("Goal" :use len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals))) (in-theory (disable len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals)) (theory-invariant (incompatible (:rewrite len-of-fty-remove-equal-formals-actuals.new-formals-is-new-actuals) (:rewrite len-of-fty-remove-equal-formals-actuals.new-actuals-is-new-formals))) (defrule pseudo-term-list-count-of-remove-equal-formals-actuals (b* (((mv & new-actuals) (remove-equal-formals-actuals formals actuals))) (implies (pseudo-term-listp actuals) (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)))) :rule-classes :linear :enable (remove-equal-formals-actuals pseudo-term-list-count)) (defret pseudo-term-list-count-of-fty-remove-equal-formals-actuals (<= (pseudo-term-list-count new-actuals) (pseudo-term-list-count actuals)) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-not-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (arg pseudo-termp)) :short "FTY version of @(tsee check-not-call)." (check-not-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-not-call.arg (implies (pseudo-termp term) (b* (((mv yes/no arg) (check-not-call term))) (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))))) :rule-classes :linear :enable (check-not-call pseudo-term-kind pseudo-term-call->args) :expand (pseudo-term-count term)) (defret pseudo-term-count-of-fty-check-not-call.arg (implies yes/no (< (pseudo-term-count arg) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-and-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-and-call)." (check-and-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-and-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-and-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defrule pseudo-term-count-of-check-and-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-and-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-and-call) (defret pseudo-term-count-of-fty-check-and-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-and-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-or-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (left pseudo-termp) (right pseudo-termp)) :short "FTY version of @(tsee check-or-call)." (check-or-call (pseudo-term-fix term)) /// (defrule pseudo-term-count-of-check-or-call.left (implies (pseudo-termp term) (b* (((mv yes/no left &) (check-or-call term))) (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defrule pseudo-term-count-of-check-or-call.right (implies (pseudo-termp term) (b* (((mv yes/no & right) (check-or-call term))) (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))))) :rule-classes :linear :enable check-or-call) (defret pseudo-term-count-of-fty-check-or-call.left (implies yes/no (< (pseudo-term-count left) (pseudo-term-count term))) :rule-classes :linear) (defret pseudo-term-count-of-fty-check-or-call.right (implies yes/no (< (pseudo-term-count right) (pseudo-term-count term))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-mv-let-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (mv-var symbolp) (vars symbol-listp) (indices nat-listp) (hides boolean-listp) (mv-term pseudo-termp) (body-term pseudo-termp)) :short "FTY version of @(tsee check-mv-let-call)." (check-mv-let-call (pseudo-term-fix term)) /// (defret len-of-fty-check-mv-let-call.indices/vars (implies yes/no (equal (len indices) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.indices/vars)))) (defret len-of-fty-check-mv-let-call.hides/vars (implies yes/no (equal (len hides) (len vars))) :hyp :guard :hints (("Goal" :in-theory (enable acl2::len-of-check-mv-let-call.hides/vars)))) (in-theory (disable len-of-fty-check-mv-let-call.indices/vars len-of-fty-check-mv-let-call.indices/vars)) (defrule pseudo-term-count-of-check-mv-let-call.mv-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term &) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind) :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (not (pseudo-term-case term :quote))) (<= (pseudo-term-list-count (cdr term)) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-call->args pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.mv-term (implies yes/no (< (pseudo-term-count mv-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call.body-term (implies (pseudo-termp term) (b* (((mv yes/no & & & & & body-term) (check-mv-let-call term))) (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))))) :rule-classes :linear :enable check-mv-let-call :prep-lemmas ((defrule lemma (implies (and (pseudo-termp term) (consp (car term))) (< (pseudo-term-count (caddr (car term))) (pseudo-term-count term))) :rule-classes :linear :expand (pseudo-term-count term) :enable (pseudo-term-lambda->body pseudo-term-kind)))) (defret pseudo-term-count-of-fty-check-mv-let-call.body-term (implies yes/no (< (pseudo-term-count body-term) (pseudo-term-count term))) :rule-classes :linear) (defrule pseudo-term-count-of-check-mv-let-call (implies (pseudo-termp term) (b* (((mv yes/no & & & & mv-term body-term) (check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear :enable (check-mv-let-call pseudo-term-kind pseudo-term-lambda->body pseudo-term-call->args pseudo-term-count pseudo-term-list-count)) (defret pseudo-term-count-if-fty-check-mv-let-call (implies yes/no (b* (((mv yes/no & & & & mv-term body-term) (fty-check-mv-let-call term))) (implies yes/no (< (+ (pseudo-term-count mv-term) (pseudo-term-count body-term)) (pseudo-term-count term))))) :rule-classes :linear)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-check-list-call ((term pseudo-termp)) :returns (mv (yes/no booleanp) (elements pseudo-term-listp)) :short "FTY version of @(tsee check-list-call)." (check-list-call (pseudo-term-fix term)) /// (more-returns (elements true-listp :rule-classes :type-prescription))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var ((subst symbol-pseudoterm-alistp) (term pseudo-termp)) :returns (new-term pseudo-termp) :short "FTY version of @(tsee fsublis-var)." (fsublis-var (symbol-pseudoterm-alist-fix subst) (pseudo-term-fix term)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp alist) (pseudo-termp term)) (pseudo-termp (fsublis-var alist term))) :enable acl2::symbol-pseudoterm-alistp-alt-def))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fty-fsublis-var-lst ((subst symbol-pseudoterm-alistp) (terms pseudo-term-listp)) :returns (new-terms pseudo-term-listp) :short "FTY version of @(tsee fsublis-var-lst)." (fsublis-var-lst (symbol-pseudoterm-alist-fix subst) (pseudo-term-list-fix terms)) :prepwork ((defrulel lemma (implies (and (symbol-pseudoterm-alistp subst) (pseudo-term-listp terms)) (pseudo-term-listp (fsublis-var-lst subst terms))) :enable acl2::symbol-pseudoterm-alistp-alt-def)))
[ { "context": "t-in types and typedefs\n;;;\n;;; Copyright (C) 2011 Liam M. Healy <[email protected]>\n;;;\n;;; Permission is h", "end": 178, "score": 0.9998778700828552, "start": 165, "tag": "NAME", "value": "Liam M. Healy" }, { "context": "pedefs\n;;;\n;;; Copyright (C) 2011 Liam M. Healy <[email protected]>\n;;;\n;;; Permission is hereby granted, free of ch", "end": 203, "score": 0.9999339580535889, "start": 181, "tag": "EMAIL", "value": "[email protected]" } ]
libffi/built-in-types.lisp
orivej/cffi
79
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; built-in-types.lisp -- Define libffi-type-pointers for built-in types and typedefs ;;; ;;; Copyright (C) 2011 Liam M. Healy <[email protected]> ;;; ;;; Permission is hereby granted, free of charge, to any person ;;; obtaining a copy of this software and associated documentation ;;; files (the "Software"), to deal in the Software without ;;; restriction, including without limitation the rights to use, copy, ;;; modify, merge, publish, distribute, sublicense, and/or sell copies ;;; of the Software, and to permit persons to whom the Software is ;;; furnished to do so, subject to the following conditions: ;;; ;;; The above copyright notice and this permission notice shall be ;;; included in all copies or substantial portions of the Software. ;;; ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;;; DEALINGS IN THE SOFTWARE. ;;; (in-package #:cffi) (defun set-libffi-type-pointer-for-built-in (type &optional (libffi-name type)) (set-libffi-type-pointer type (foreign-symbol-pointer (format nil "ffi_type_~(~a~)" libffi-name)))) ;;; Set the type pointers for non-integer built-in types (dolist (type (append *built-in-float-types* *other-builtin-types*)) (set-libffi-type-pointer-for-built-in type)) ;;; Set the type pointers for integer built-in types (dolist (type *built-in-integer-types*) (set-libffi-type-pointer-for-built-in type (format nil "~aint~d" (if (string-equal type "unsigned" :end1 (min 8 (length (string type)))) "u" "s") (* 8 (foreign-type-size type))))) ;;; Set the type pointer on demand for alias (e.g. typedef) types (defmethod libffi-type-pointer ((type foreign-type-alias)) (libffi-type-pointer (follow-typedefs type))) ;;; Luis thinks this is unnecessary; FOREIGN-ENUM inherits from FOREIGN-TYPE-ALIAS. #+(or) (defmethod libffi-type-pointer ((type foreign-enum)) (libffi-type-pointer (actual-type type)))
51048
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; built-in-types.lisp -- Define libffi-type-pointers for built-in types and typedefs ;;; ;;; Copyright (C) 2011 <NAME> <<EMAIL>> ;;; ;;; Permission is hereby granted, free of charge, to any person ;;; obtaining a copy of this software and associated documentation ;;; files (the "Software"), to deal in the Software without ;;; restriction, including without limitation the rights to use, copy, ;;; modify, merge, publish, distribute, sublicense, and/or sell copies ;;; of the Software, and to permit persons to whom the Software is ;;; furnished to do so, subject to the following conditions: ;;; ;;; The above copyright notice and this permission notice shall be ;;; included in all copies or substantial portions of the Software. ;;; ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;;; DEALINGS IN THE SOFTWARE. ;;; (in-package #:cffi) (defun set-libffi-type-pointer-for-built-in (type &optional (libffi-name type)) (set-libffi-type-pointer type (foreign-symbol-pointer (format nil "ffi_type_~(~a~)" libffi-name)))) ;;; Set the type pointers for non-integer built-in types (dolist (type (append *built-in-float-types* *other-builtin-types*)) (set-libffi-type-pointer-for-built-in type)) ;;; Set the type pointers for integer built-in types (dolist (type *built-in-integer-types*) (set-libffi-type-pointer-for-built-in type (format nil "~aint~d" (if (string-equal type "unsigned" :end1 (min 8 (length (string type)))) "u" "s") (* 8 (foreign-type-size type))))) ;;; Set the type pointer on demand for alias (e.g. typedef) types (defmethod libffi-type-pointer ((type foreign-type-alias)) (libffi-type-pointer (follow-typedefs type))) ;;; Luis thinks this is unnecessary; FOREIGN-ENUM inherits from FOREIGN-TYPE-ALIAS. #+(or) (defmethod libffi-type-pointer ((type foreign-enum)) (libffi-type-pointer (actual-type type)))
true
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; built-in-types.lisp -- Define libffi-type-pointers for built-in types and typedefs ;;; ;;; Copyright (C) 2011 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;; ;;; Permission is hereby granted, free of charge, to any person ;;; obtaining a copy of this software and associated documentation ;;; files (the "Software"), to deal in the Software without ;;; restriction, including without limitation the rights to use, copy, ;;; modify, merge, publish, distribute, sublicense, and/or sell copies ;;; of the Software, and to permit persons to whom the Software is ;;; furnished to do so, subject to the following conditions: ;;; ;;; The above copyright notice and this permission notice shall be ;;; included in all copies or substantial portions of the Software. ;;; ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;;; DEALINGS IN THE SOFTWARE. ;;; (in-package #:cffi) (defun set-libffi-type-pointer-for-built-in (type &optional (libffi-name type)) (set-libffi-type-pointer type (foreign-symbol-pointer (format nil "ffi_type_~(~a~)" libffi-name)))) ;;; Set the type pointers for non-integer built-in types (dolist (type (append *built-in-float-types* *other-builtin-types*)) (set-libffi-type-pointer-for-built-in type)) ;;; Set the type pointers for integer built-in types (dolist (type *built-in-integer-types*) (set-libffi-type-pointer-for-built-in type (format nil "~aint~d" (if (string-equal type "unsigned" :end1 (min 8 (length (string type)))) "u" "s") (* 8 (foreign-type-size type))))) ;;; Set the type pointer on demand for alias (e.g. typedef) types (defmethod libffi-type-pointer ((type foreign-type-alias)) (libffi-type-pointer (follow-typedefs type))) ;;; Luis thinks this is unnecessary; FOREIGN-ENUM inherits from FOREIGN-TYPE-ALIAS. #+(or) (defmethod libffi-type-pointer ((type foreign-enum)) (libffi-type-pointer (actual-type type)))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 222, "score": 0.9998796582221985, "start": 205, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 242, "score": 0.9999317526817322, "start": 224, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/utilities/integer-range-fixing-tests.lisp
MattKaufmann/acl2
1
; Fixing Function for Integer Ranges -- Tests ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "integer-range-fixing") (include-book "testing") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm test1 (equal (integer-range-fix 20 10 "abc") 0)) (defthm test2 (equal (integer-range-fix 20 10 5) 0)) (defthm test3 (equal (integer-range-fix 20 10 100) 0)) (defthm test4 (equal (integer-range-fix 20 10 15) 0)) (defthm test5 (equal (integer-range-fix 10 20 5) 10)) (defthm test6 (equal (integer-range-fix 10 20 100) 19)) (defthm test7 (equal (integer-range-fix 10 20 '(15)) 10))
59200
; Fixing Function for Integer Ranges -- Tests ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "integer-range-fixing") (include-book "testing") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm test1 (equal (integer-range-fix 20 10 "abc") 0)) (defthm test2 (equal (integer-range-fix 20 10 5) 0)) (defthm test3 (equal (integer-range-fix 20 10 100) 0)) (defthm test4 (equal (integer-range-fix 20 10 15) 0)) (defthm test5 (equal (integer-range-fix 10 20 5) 10)) (defthm test6 (equal (integer-range-fix 10 20 100) 19)) (defthm test7 (equal (integer-range-fix 10 20 '(15)) 10))
true
; Fixing Function for Integer Ranges -- Tests ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "integer-range-fixing") (include-book "testing") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defthm test1 (equal (integer-range-fix 20 10 "abc") 0)) (defthm test2 (equal (integer-range-fix 20 10 5) 0)) (defthm test3 (equal (integer-range-fix 20 10 100) 0)) (defthm test4 (equal (integer-range-fix 20 10 15) 0)) (defthm test5 (equal (integer-range-fix 10 20 5) 10)) (defthm test6 (equal (integer-range-fix 10 20 100) 19)) (defthm test7 (equal (integer-range-fix 10 20 '(15)) 10))
[ { "context": ";-*- Mode: Lisp -*-\n;;;; Author: Paul Dietz\n;;;; Created: Sun Aug 29 17:30:40 2004\n;;;; Cont", "end": 49, "score": 0.999860405921936, "start": 39, "tag": "NAME", "value": "Paul Dietz" } ]
ansi-tests/simple-base-string.lsp
TeamSPoon/CYC_JRTL_with_CommonLisp_OLD
10
;-*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Sun Aug 29 17:30:40 2004 ;;;; Contains: Tests associated with SIMPLE-BASE-STRING (in-package :cl-test) (deftest simple-base-string.1 (subtypep* 'simple-base-string 'string) t t) (deftest simple-base-string.2 (subtypep* 'simple-base-string 'vector) t t) (deftest simple-base-string.3 (subtypep* 'simple-base-string 'simple-array) t t) (deftest simple-base-string.4 (subtypep* 'simple-base-string 'array) t t) (deftest simple-base-string.5 (subtypep* 'simple-base-string 'sequence) t t) (deftest simple-base-string.6 (subtypep* 'simple-base-string 'base-string) t t) (deftest simple-base-string.7 (subtypep* 'simple-base-string 'simple-string) t t) (deftest simple-base-string.8 (subtypep* 'simple-base-string 'simple-vector) nil t) (deftest simple-base-string.9 :notes (:allow-nil-arrays :nil-vectors-are-strings) (subtypep* '(simple-array nil (*)) 'simple-base-string) nil t) (deftest simple-base-string.10 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(0) :element-type nil) 'simple-base-string) nil) (deftest simple-base-string.11 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(12) :element-type nil) 'simple-base-string) nil)
83494
;-*- Mode: Lisp -*- ;;;; Author: <NAME> ;;;; Created: Sun Aug 29 17:30:40 2004 ;;;; Contains: Tests associated with SIMPLE-BASE-STRING (in-package :cl-test) (deftest simple-base-string.1 (subtypep* 'simple-base-string 'string) t t) (deftest simple-base-string.2 (subtypep* 'simple-base-string 'vector) t t) (deftest simple-base-string.3 (subtypep* 'simple-base-string 'simple-array) t t) (deftest simple-base-string.4 (subtypep* 'simple-base-string 'array) t t) (deftest simple-base-string.5 (subtypep* 'simple-base-string 'sequence) t t) (deftest simple-base-string.6 (subtypep* 'simple-base-string 'base-string) t t) (deftest simple-base-string.7 (subtypep* 'simple-base-string 'simple-string) t t) (deftest simple-base-string.8 (subtypep* 'simple-base-string 'simple-vector) nil t) (deftest simple-base-string.9 :notes (:allow-nil-arrays :nil-vectors-are-strings) (subtypep* '(simple-array nil (*)) 'simple-base-string) nil t) (deftest simple-base-string.10 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(0) :element-type nil) 'simple-base-string) nil) (deftest simple-base-string.11 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(12) :element-type nil) 'simple-base-string) nil)
true
;-*- Mode: Lisp -*- ;;;; Author: PI:NAME:<NAME>END_PI ;;;; Created: Sun Aug 29 17:30:40 2004 ;;;; Contains: Tests associated with SIMPLE-BASE-STRING (in-package :cl-test) (deftest simple-base-string.1 (subtypep* 'simple-base-string 'string) t t) (deftest simple-base-string.2 (subtypep* 'simple-base-string 'vector) t t) (deftest simple-base-string.3 (subtypep* 'simple-base-string 'simple-array) t t) (deftest simple-base-string.4 (subtypep* 'simple-base-string 'array) t t) (deftest simple-base-string.5 (subtypep* 'simple-base-string 'sequence) t t) (deftest simple-base-string.6 (subtypep* 'simple-base-string 'base-string) t t) (deftest simple-base-string.7 (subtypep* 'simple-base-string 'simple-string) t t) (deftest simple-base-string.8 (subtypep* 'simple-base-string 'simple-vector) nil t) (deftest simple-base-string.9 :notes (:allow-nil-arrays :nil-vectors-are-strings) (subtypep* '(simple-array nil (*)) 'simple-base-string) nil t) (deftest simple-base-string.10 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(0) :element-type nil) 'simple-base-string) nil) (deftest simple-base-string.11 :notes (:allow-nil-arrays :nil-vectors-are-strings) (typep* (make-array '(12) :element-type nil) 'simple-base-string) nil)
[ { "context": ":description \"Tests for cl-shellwords\"\n :author \"Joram Schrijver <[email protected]>\"\n :license \"MIT\"\n :depends-on (#:c", "end": 98, "score": 0.9998838305473328, "start": 83, "tag": "NAME", "value": "Joram Schrijver" }, { "context": "ts for cl-shellwords\"\n :author \"Joram Schrijver <[email protected]>\"\n :license \"MIT\"\n :depends-on (#:cl-shellwords", "end": 110, "score": 0.9999280571937561, "start": 100, "tag": "EMAIL", "value": "[email protected]" } ]
cl-shellwords-test.asd
jorams/cl-shellwords
14
(defsystem :cl-shellwords-test :description "Tests for cl-shellwords" :author "Joram Schrijver <[email protected]>" :license "MIT" :depends-on (#:cl-shellwords #:prove) :components ((:file "test")) :perform (test-op :after (op component) (unless (funcall (intern #.(string :run-test-package) :prove) :cl-shellwords-test) (error "Tests failed."))))
71427
(defsystem :cl-shellwords-test :description "Tests for cl-shellwords" :author "<NAME> <<EMAIL>>" :license "MIT" :depends-on (#:cl-shellwords #:prove) :components ((:file "test")) :perform (test-op :after (op component) (unless (funcall (intern #.(string :run-test-package) :prove) :cl-shellwords-test) (error "Tests failed."))))
true
(defsystem :cl-shellwords-test :description "Tests for cl-shellwords" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "MIT" :depends-on (#:cl-shellwords #:prove) :components ((:file "test")) :perform (test-op :after (op component) (unless (funcall (intern #.(string :run-test-package) :prove) :cl-shellwords-test) (error "Tests failed."))))
[ { "context": ";; Copyright (c) 2015 YOKOTA Yuki <[email protected]>\n;;\n;; This software is ", "end": 33, "score": 0.9998437762260437, "start": 22, "tag": "NAME", "value": "YOKOTA Yuki" }, { "context": ";; Copyright (c) 2015 YOKOTA Yuki <[email protected]>\n;;\n;; This software is released under the MIT Li", "end": 58, "score": 0.9999315142631531, "start": 35, "tag": "EMAIL", "value": "[email protected]" }, { "context": "indings for numa(3).\"\n :license \"MIT\"\n :author \"YOKOTA Yuki <[email protected]>\"\n :depends-on (:cffi)\n", "end": 323, "score": 0.9998638033866882, "start": 312, "tag": "NAME", "value": "YOKOTA Yuki" }, { "context": "uma(3).\"\n :license \"MIT\"\n :author \"YOKOTA Yuki <[email protected]>\"\n :depends-on (:cffi)\n :defsystem-depends-on (", "end": 348, "score": 0.9999310374259949, "start": 325, "tag": "EMAIL", "value": "[email protected]" } ]
cl-libnuma.asd
y2q-actionman/cl-libnuma
0
;; Copyright (c) 2015 YOKOTA Yuki <[email protected]> ;; ;; This software is released under the MIT License. ;; See the LICENSE file. (in-package :cl-user) ;; needs: apt-get install libnuma-dev (asdf:defsystem :cl-libnuma :description "A set of CFFI bindings for numa(3)." :license "MIT" :author "YOKOTA Yuki <[email protected]>" :depends-on (:cffi) :defsystem-depends-on (:cffi-grovel) :components ((:module "src" :serial t :components ((:file "package") (:file "library") (:cffi-grovel-file "grovelling") (:cffi-wrapper-file "wrapping" :soname "cl-libnuma-wrapping") (:file "types") (:file "binding")))) :in-order-to ((asdf:test-op (asdf:test-op #:cl-libnuma.test)))) (defmethod asdf:operate :after ((operate (eql 'asdf:load-op)) (component (eql :cl-libnuma)) &rest args &key &allow-other-keys) (declare (ignore args)) (when (/= (symbol-value (find-symbol "+LIBNUMA-API-VERSION+" :cl-libnuma.grovel)) (symbol-value (find-symbol "+CL-LIBNUMA-TARGET-API-VERSION+" :cl-libnuma))) (warn "libnuma is newer than cl-libnuma implemented")) (unless (uiop:symbol-call :cl-libnuma '#:numa-available) (warn "libnuma is unavailable in this system. ~ All functions without numa-avaliable are undefined.")))
85536
;; Copyright (c) 2015 <NAME> <<EMAIL>> ;; ;; This software is released under the MIT License. ;; See the LICENSE file. (in-package :cl-user) ;; needs: apt-get install libnuma-dev (asdf:defsystem :cl-libnuma :description "A set of CFFI bindings for numa(3)." :license "MIT" :author "<NAME> <<EMAIL>>" :depends-on (:cffi) :defsystem-depends-on (:cffi-grovel) :components ((:module "src" :serial t :components ((:file "package") (:file "library") (:cffi-grovel-file "grovelling") (:cffi-wrapper-file "wrapping" :soname "cl-libnuma-wrapping") (:file "types") (:file "binding")))) :in-order-to ((asdf:test-op (asdf:test-op #:cl-libnuma.test)))) (defmethod asdf:operate :after ((operate (eql 'asdf:load-op)) (component (eql :cl-libnuma)) &rest args &key &allow-other-keys) (declare (ignore args)) (when (/= (symbol-value (find-symbol "+LIBNUMA-API-VERSION+" :cl-libnuma.grovel)) (symbol-value (find-symbol "+CL-LIBNUMA-TARGET-API-VERSION+" :cl-libnuma))) (warn "libnuma is newer than cl-libnuma implemented")) (unless (uiop:symbol-call :cl-libnuma '#:numa-available) (warn "libnuma is unavailable in this system. ~ All functions without numa-avaliable are undefined.")))
true
;; Copyright (c) 2015 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;; ;; This software is released under the MIT License. ;; See the LICENSE file. (in-package :cl-user) ;; needs: apt-get install libnuma-dev (asdf:defsystem :cl-libnuma :description "A set of CFFI bindings for numa(3)." :license "MIT" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :depends-on (:cffi) :defsystem-depends-on (:cffi-grovel) :components ((:module "src" :serial t :components ((:file "package") (:file "library") (:cffi-grovel-file "grovelling") (:cffi-wrapper-file "wrapping" :soname "cl-libnuma-wrapping") (:file "types") (:file "binding")))) :in-order-to ((asdf:test-op (asdf:test-op #:cl-libnuma.test)))) (defmethod asdf:operate :after ((operate (eql 'asdf:load-op)) (component (eql :cl-libnuma)) &rest args &key &allow-other-keys) (declare (ignore args)) (when (/= (symbol-value (find-symbol "+LIBNUMA-API-VERSION+" :cl-libnuma.grovel)) (symbol-value (find-symbol "+CL-LIBNUMA-TARGET-API-VERSION+" :cl-libnuma))) (warn "libnuma is newer than cl-libnuma implemented")) (unless (uiop:symbol-call :cl-libnuma '#:numa-available) (warn "libnuma is unavailable in this system. ~ All functions without numa-avaliable are undefined.")))
[ { "context": " Last edited: 1/29/93, KDF\n\n;; Copyright (c) 1992, Kenneth D. Forbus, Northwestern\n;; University, and Johan de Kleer,", "end": 113, "score": 0.9998799562454224, "start": 96, "tag": "NAME", "value": "Kenneth D. Forbus" }, { "context": "enneth D. Forbus, Northwestern\n;; University, and Johan de Kleer, the Xerox Corporation\n;; All rights reserved.\n\n;", "end": 162, "score": 0.9998826384544373, "start": 148, "tag": "NAME", "value": "Johan de Kleer" } ]
atms/adata.lisp
ska80/bpss-lisp
1
;;; -*- Mode: Lisp; -*- ;;; ATRE database ;; Last edited: 1/29/93, KDF ;; Copyright (c) 1992, Kenneth D. Forbus, Northwestern ;; University, and Johan de Kleer, the Xerox Corporation ;; All rights reserved. ;;; See the file legal.txt for a paragraph stating scope of permission ;;; and disclaimer of warranty. The above copyright notice and that ;;; paragraph must be included in any separate copy of this file. (in-package :COMMON-LISP-USER) (defun assert! (fact just &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (unless (listp just) (setq just (list just))) (debugging-atre "~% Asserting ~A via ~A." fact just) (justify-node (car just) node (mapcar #'(lambda (f) (datum-tms-node (referent f t))) (cdr just))) datum) (defun assume! (fact reason &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (cond ((not (datum-assumption? datum)) (setf (datum-assumption? datum) reason) (debugging-atre "~% Assuming ~A via ~A." fact reason) (assume-node node)) ((eq reason (datum-assumption? datum))) (t (error "Fact ~A assumed because of ~A assumed again because of ~A" (show-datum datum) (datum-assumption? datum) reason))) datum) (defun already-assumed? (fact) (tms-node-assumption? (get-tms-node fact))) (defun assume-if-needed (fact reason &optional (*atre* *atre*)) (unless (already-assumed? fact) (assume! fact reason))) (defmacro rassert! (fact just) `(assert! ,(quotize fact) ,(quotize just))) (defun contradiction (fact &optional (*atre* *atre*)) (make-contradiction (datum-tms-node (referent fact t)))) (defmacro rnogood! (informant &rest facts) `(assert! 'false ,(quotize (cons informant facts)))) ;;;; Database system (defun get-dbclass (fact &aux dbclass) (cond ((null fact) (error "~% NIL can't be a dbclass.")) ((listp fact) (get-dbclass (car fact))) ((variable? fact) (cond ((boundp fact) (get-dbclass (symbol-value fact))) (t (error "~%Dbclass unbound: ~A" fact)))) ((symbolp fact) (cond ((setq dbclass (gethash fact (atre-dbclass-table *atre*))) dbclass) (t (setq dbclass (make-dbclass :NAME fact :FACTS nil :RULES nil :ATRE *atre*)) (setf (gethash fact (atre-dbclass-table *atre*)) dbclass) (push dbclass (atre-dbclasses *atre*)) dbclass))) (t (error "Bad dbclass type: ~A" fact)))) (defun referent (fact &optional (virtual? nil)) (if virtual? (insert fact) (referent1 fact))) (defun referent1 (fact) ;; Could use seperate hash table (dolist (candidate (dbclass-facts (get-dbclass fact))) (when (equal (datum-lisp-form candidate) fact) (return-from referent1 candidate)))) (defun insert (fact &aux datum) (setq datum (referent1 fact)) (cond (datum (values datum t)) (t (setq datum (make-datum :COUNTER (incf (atre-datum-counter *atre*)) :ATRE *atre* :LISP-FORM fact :DBCLASS (get-dbclass fact))) (setf (datum-tms-node datum) (tms-create-node (atre-atms *atre*) datum)) (push datum (dbclass-facts (datum-dbclass datum))) (try-rules datum) (values datum nil)))) (defun fetch (pattern &optional (*atre* *atre*) &aux bindings unifiers) (dolist (candidate (get-candidates pattern) unifiers) (setq bindings (unify pattern (datum-lisp-form candidate))) (unless (eq bindings :FAIL) (push (sublis bindings pattern) unifiers)))) (defun get-candidates (pattern) (dbclass-facts (get-dbclass pattern))) ;;;; Interface and display of data (defun true? (fact &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (true-node? (datum-tms-node r)))) (defun in? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (in-node? (datum-tms-node r) env))) (defun out? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (out-node? (datum-tms-node r) env))) (defun consistent-with? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (node-consistent-with? (datum-tms-node r) env))) (defun why? (fact &optional (*atre* *atre*) (stream *standard-output*) &aux r) (when (setq r (referent fact nil)) (why-node (datum-tms-node r) stream))) (defun environment-of (facts &optional (*atre* *atre*) &aux node env) (setq env (atms-empty-env (atre-atms *atre*))) (dolist (fact facts) (setq node (get-tms-node fact *atre*)) (unless (tms-node-assumption? node) (error "Non-assumption in ENVIRONMENT-OF: ~A." fact)) (setq env (cons-env node env)) (when (env-nogood? env) (return-from ENVIRONMENT-OF (values nil env)))) env) (defun environment-cons (fact env) (cons-env (get-tms-node fact) env)) (defun view-env (env) (mapcar #'view-node (env-assumptions env))) (defun justifications (fact &optional (*atre* *atre*) (stream *standard-output*)) (node-justifications (get-tms-node fact *atre*) stream)) ;;; More interrogatives (defun the-e (num &optional (*atre* *atre*)) (e (atre-atms *atre*) num)) (defun get-tms-node (fact &optional (*atre* *atre*)) (datum-tms-node (referent fact t))) (defun view-node (node) (datum-lisp-form (tms-node-datum node))) (defun stringify-node (node) (format nil "~A" (view-node node))) (defun assumptions-of (fact) (tms-node-label (datum-tms-node (referent fact t)))) (defun get-datum (num &optional (*atre* *atre*)) (maphash #'(lambda (key dbclass) (declare (ignore key)) (dolist (datum (dbclass-facts dbclass)) (when (= (datum-counter datum) num) (return-from GET-DATUM datum)))) (atre-dbclass-table *atre*))) (defun get-just (num &optional (*atre* *atre*)) (dolist (just (atms-justs (atre-atms *atre*))) (when (= (just-index just) num) (return-from GET-just just)))) ;;; Extra printing routines (defun show-datum (datum) (format nil "~A" (datum-lisp-form datum))) (defun show-data (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (format stream "~%~D facts total." (atre-datum-counter *atre*)) (dolist (dbclass (atre-dbclasses *atre*) counter) (dolist (datum (dbclass-facts dbclass)) (incf counter) (format stream "~%~A: ~A" (show-datum datum) (assumptions-of (datum-lisp-form datum))))) counter) (defun show-context (env &optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*)) (dolist (datum (dbclass-facts dbclass)) (when (in-node? (datum-tms-node datum) env) (incf counter) (format stream "~%~A" (show-datum datum))))) (format stream "~%~D facts total." counter) counter) (defun show-dbclasses (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) ;; Handy for finding buggy assertions (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*) counter) (incf counter) (format stream "~% ~A: ~D facts, ~D rules" (dbclass-name dbclass) (length (dbclass-facts dbclass)) (length (dbclass-rules dbclass)))))
76233
;;; -*- Mode: Lisp; -*- ;;; ATRE database ;; Last edited: 1/29/93, KDF ;; Copyright (c) 1992, <NAME>, Northwestern ;; University, and <NAME>, the Xerox Corporation ;; All rights reserved. ;;; See the file legal.txt for a paragraph stating scope of permission ;;; and disclaimer of warranty. The above copyright notice and that ;;; paragraph must be included in any separate copy of this file. (in-package :COMMON-LISP-USER) (defun assert! (fact just &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (unless (listp just) (setq just (list just))) (debugging-atre "~% Asserting ~A via ~A." fact just) (justify-node (car just) node (mapcar #'(lambda (f) (datum-tms-node (referent f t))) (cdr just))) datum) (defun assume! (fact reason &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (cond ((not (datum-assumption? datum)) (setf (datum-assumption? datum) reason) (debugging-atre "~% Assuming ~A via ~A." fact reason) (assume-node node)) ((eq reason (datum-assumption? datum))) (t (error "Fact ~A assumed because of ~A assumed again because of ~A" (show-datum datum) (datum-assumption? datum) reason))) datum) (defun already-assumed? (fact) (tms-node-assumption? (get-tms-node fact))) (defun assume-if-needed (fact reason &optional (*atre* *atre*)) (unless (already-assumed? fact) (assume! fact reason))) (defmacro rassert! (fact just) `(assert! ,(quotize fact) ,(quotize just))) (defun contradiction (fact &optional (*atre* *atre*)) (make-contradiction (datum-tms-node (referent fact t)))) (defmacro rnogood! (informant &rest facts) `(assert! 'false ,(quotize (cons informant facts)))) ;;;; Database system (defun get-dbclass (fact &aux dbclass) (cond ((null fact) (error "~% NIL can't be a dbclass.")) ((listp fact) (get-dbclass (car fact))) ((variable? fact) (cond ((boundp fact) (get-dbclass (symbol-value fact))) (t (error "~%Dbclass unbound: ~A" fact)))) ((symbolp fact) (cond ((setq dbclass (gethash fact (atre-dbclass-table *atre*))) dbclass) (t (setq dbclass (make-dbclass :NAME fact :FACTS nil :RULES nil :ATRE *atre*)) (setf (gethash fact (atre-dbclass-table *atre*)) dbclass) (push dbclass (atre-dbclasses *atre*)) dbclass))) (t (error "Bad dbclass type: ~A" fact)))) (defun referent (fact &optional (virtual? nil)) (if virtual? (insert fact) (referent1 fact))) (defun referent1 (fact) ;; Could use seperate hash table (dolist (candidate (dbclass-facts (get-dbclass fact))) (when (equal (datum-lisp-form candidate) fact) (return-from referent1 candidate)))) (defun insert (fact &aux datum) (setq datum (referent1 fact)) (cond (datum (values datum t)) (t (setq datum (make-datum :COUNTER (incf (atre-datum-counter *atre*)) :ATRE *atre* :LISP-FORM fact :DBCLASS (get-dbclass fact))) (setf (datum-tms-node datum) (tms-create-node (atre-atms *atre*) datum)) (push datum (dbclass-facts (datum-dbclass datum))) (try-rules datum) (values datum nil)))) (defun fetch (pattern &optional (*atre* *atre*) &aux bindings unifiers) (dolist (candidate (get-candidates pattern) unifiers) (setq bindings (unify pattern (datum-lisp-form candidate))) (unless (eq bindings :FAIL) (push (sublis bindings pattern) unifiers)))) (defun get-candidates (pattern) (dbclass-facts (get-dbclass pattern))) ;;;; Interface and display of data (defun true? (fact &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (true-node? (datum-tms-node r)))) (defun in? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (in-node? (datum-tms-node r) env))) (defun out? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (out-node? (datum-tms-node r) env))) (defun consistent-with? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (node-consistent-with? (datum-tms-node r) env))) (defun why? (fact &optional (*atre* *atre*) (stream *standard-output*) &aux r) (when (setq r (referent fact nil)) (why-node (datum-tms-node r) stream))) (defun environment-of (facts &optional (*atre* *atre*) &aux node env) (setq env (atms-empty-env (atre-atms *atre*))) (dolist (fact facts) (setq node (get-tms-node fact *atre*)) (unless (tms-node-assumption? node) (error "Non-assumption in ENVIRONMENT-OF: ~A." fact)) (setq env (cons-env node env)) (when (env-nogood? env) (return-from ENVIRONMENT-OF (values nil env)))) env) (defun environment-cons (fact env) (cons-env (get-tms-node fact) env)) (defun view-env (env) (mapcar #'view-node (env-assumptions env))) (defun justifications (fact &optional (*atre* *atre*) (stream *standard-output*)) (node-justifications (get-tms-node fact *atre*) stream)) ;;; More interrogatives (defun the-e (num &optional (*atre* *atre*)) (e (atre-atms *atre*) num)) (defun get-tms-node (fact &optional (*atre* *atre*)) (datum-tms-node (referent fact t))) (defun view-node (node) (datum-lisp-form (tms-node-datum node))) (defun stringify-node (node) (format nil "~A" (view-node node))) (defun assumptions-of (fact) (tms-node-label (datum-tms-node (referent fact t)))) (defun get-datum (num &optional (*atre* *atre*)) (maphash #'(lambda (key dbclass) (declare (ignore key)) (dolist (datum (dbclass-facts dbclass)) (when (= (datum-counter datum) num) (return-from GET-DATUM datum)))) (atre-dbclass-table *atre*))) (defun get-just (num &optional (*atre* *atre*)) (dolist (just (atms-justs (atre-atms *atre*))) (when (= (just-index just) num) (return-from GET-just just)))) ;;; Extra printing routines (defun show-datum (datum) (format nil "~A" (datum-lisp-form datum))) (defun show-data (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (format stream "~%~D facts total." (atre-datum-counter *atre*)) (dolist (dbclass (atre-dbclasses *atre*) counter) (dolist (datum (dbclass-facts dbclass)) (incf counter) (format stream "~%~A: ~A" (show-datum datum) (assumptions-of (datum-lisp-form datum))))) counter) (defun show-context (env &optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*)) (dolist (datum (dbclass-facts dbclass)) (when (in-node? (datum-tms-node datum) env) (incf counter) (format stream "~%~A" (show-datum datum))))) (format stream "~%~D facts total." counter) counter) (defun show-dbclasses (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) ;; Handy for finding buggy assertions (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*) counter) (incf counter) (format stream "~% ~A: ~D facts, ~D rules" (dbclass-name dbclass) (length (dbclass-facts dbclass)) (length (dbclass-rules dbclass)))))
true
;;; -*- Mode: Lisp; -*- ;;; ATRE database ;; Last edited: 1/29/93, KDF ;; Copyright (c) 1992, PI:NAME:<NAME>END_PI, Northwestern ;; University, and PI:NAME:<NAME>END_PI, the Xerox Corporation ;; All rights reserved. ;;; See the file legal.txt for a paragraph stating scope of permission ;;; and disclaimer of warranty. The above copyright notice and that ;;; paragraph must be included in any separate copy of this file. (in-package :COMMON-LISP-USER) (defun assert! (fact just &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (unless (listp just) (setq just (list just))) (debugging-atre "~% Asserting ~A via ~A." fact just) (justify-node (car just) node (mapcar #'(lambda (f) (datum-tms-node (referent f t))) (cdr just))) datum) (defun assume! (fact reason &optional (*atre* *atre*) &aux datum node) (setq datum (referent fact t) node (datum-tms-node datum)) (cond ((not (datum-assumption? datum)) (setf (datum-assumption? datum) reason) (debugging-atre "~% Assuming ~A via ~A." fact reason) (assume-node node)) ((eq reason (datum-assumption? datum))) (t (error "Fact ~A assumed because of ~A assumed again because of ~A" (show-datum datum) (datum-assumption? datum) reason))) datum) (defun already-assumed? (fact) (tms-node-assumption? (get-tms-node fact))) (defun assume-if-needed (fact reason &optional (*atre* *atre*)) (unless (already-assumed? fact) (assume! fact reason))) (defmacro rassert! (fact just) `(assert! ,(quotize fact) ,(quotize just))) (defun contradiction (fact &optional (*atre* *atre*)) (make-contradiction (datum-tms-node (referent fact t)))) (defmacro rnogood! (informant &rest facts) `(assert! 'false ,(quotize (cons informant facts)))) ;;;; Database system (defun get-dbclass (fact &aux dbclass) (cond ((null fact) (error "~% NIL can't be a dbclass.")) ((listp fact) (get-dbclass (car fact))) ((variable? fact) (cond ((boundp fact) (get-dbclass (symbol-value fact))) (t (error "~%Dbclass unbound: ~A" fact)))) ((symbolp fact) (cond ((setq dbclass (gethash fact (atre-dbclass-table *atre*))) dbclass) (t (setq dbclass (make-dbclass :NAME fact :FACTS nil :RULES nil :ATRE *atre*)) (setf (gethash fact (atre-dbclass-table *atre*)) dbclass) (push dbclass (atre-dbclasses *atre*)) dbclass))) (t (error "Bad dbclass type: ~A" fact)))) (defun referent (fact &optional (virtual? nil)) (if virtual? (insert fact) (referent1 fact))) (defun referent1 (fact) ;; Could use seperate hash table (dolist (candidate (dbclass-facts (get-dbclass fact))) (when (equal (datum-lisp-form candidate) fact) (return-from referent1 candidate)))) (defun insert (fact &aux datum) (setq datum (referent1 fact)) (cond (datum (values datum t)) (t (setq datum (make-datum :COUNTER (incf (atre-datum-counter *atre*)) :ATRE *atre* :LISP-FORM fact :DBCLASS (get-dbclass fact))) (setf (datum-tms-node datum) (tms-create-node (atre-atms *atre*) datum)) (push datum (dbclass-facts (datum-dbclass datum))) (try-rules datum) (values datum nil)))) (defun fetch (pattern &optional (*atre* *atre*) &aux bindings unifiers) (dolist (candidate (get-candidates pattern) unifiers) (setq bindings (unify pattern (datum-lisp-form candidate))) (unless (eq bindings :FAIL) (push (sublis bindings pattern) unifiers)))) (defun get-candidates (pattern) (dbclass-facts (get-dbclass pattern))) ;;;; Interface and display of data (defun true? (fact &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (true-node? (datum-tms-node r)))) (defun in? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (in-node? (datum-tms-node r) env))) (defun out? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (out-node? (datum-tms-node r) env))) (defun consistent-with? (fact env &optional (*atre* *atre*) &aux r) (when (setq r (referent fact nil)) (node-consistent-with? (datum-tms-node r) env))) (defun why? (fact &optional (*atre* *atre*) (stream *standard-output*) &aux r) (when (setq r (referent fact nil)) (why-node (datum-tms-node r) stream))) (defun environment-of (facts &optional (*atre* *atre*) &aux node env) (setq env (atms-empty-env (atre-atms *atre*))) (dolist (fact facts) (setq node (get-tms-node fact *atre*)) (unless (tms-node-assumption? node) (error "Non-assumption in ENVIRONMENT-OF: ~A." fact)) (setq env (cons-env node env)) (when (env-nogood? env) (return-from ENVIRONMENT-OF (values nil env)))) env) (defun environment-cons (fact env) (cons-env (get-tms-node fact) env)) (defun view-env (env) (mapcar #'view-node (env-assumptions env))) (defun justifications (fact &optional (*atre* *atre*) (stream *standard-output*)) (node-justifications (get-tms-node fact *atre*) stream)) ;;; More interrogatives (defun the-e (num &optional (*atre* *atre*)) (e (atre-atms *atre*) num)) (defun get-tms-node (fact &optional (*atre* *atre*)) (datum-tms-node (referent fact t))) (defun view-node (node) (datum-lisp-form (tms-node-datum node))) (defun stringify-node (node) (format nil "~A" (view-node node))) (defun assumptions-of (fact) (tms-node-label (datum-tms-node (referent fact t)))) (defun get-datum (num &optional (*atre* *atre*)) (maphash #'(lambda (key dbclass) (declare (ignore key)) (dolist (datum (dbclass-facts dbclass)) (when (= (datum-counter datum) num) (return-from GET-DATUM datum)))) (atre-dbclass-table *atre*))) (defun get-just (num &optional (*atre* *atre*)) (dolist (just (atms-justs (atre-atms *atre*))) (when (= (just-index just) num) (return-from GET-just just)))) ;;; Extra printing routines (defun show-datum (datum) (format nil "~A" (datum-lisp-form datum))) (defun show-data (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (format stream "~%~D facts total." (atre-datum-counter *atre*)) (dolist (dbclass (atre-dbclasses *atre*) counter) (dolist (datum (dbclass-facts dbclass)) (incf counter) (format stream "~%~A: ~A" (show-datum datum) (assumptions-of (datum-lisp-form datum))))) counter) (defun show-context (env &optional (*atre* *atre*) (stream *standard-output*) &aux counter) (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*)) (dolist (datum (dbclass-facts dbclass)) (when (in-node? (datum-tms-node datum) env) (incf counter) (format stream "~%~A" (show-datum datum))))) (format stream "~%~D facts total." counter) counter) (defun show-dbclasses (&optional (*atre* *atre*) (stream *standard-output*) &aux counter) ;; Handy for finding buggy assertions (setq counter 0) (dolist (dbclass (atre-dbclasses *atre*) counter) (incf counter) (format stream "~% ~A: ~D facts, ~D rules" (dbclass-name dbclass) (length (dbclass-facts dbclass)) (length (dbclass-rules dbclass)))))
[ { "context": " |\n;;; Copyright (c) 2021, Sentot Kromodimoeljo, William Pase, |\n;;; Mark Saaltink, D", "end": 194, "score": 0.9998701810836792, "start": 174, "tag": "NAME", "value": "Sentot Kromodimoeljo" }, { "context": " |\n;;; Copyright (c) 2021, Sentot Kromodimoeljo, William Pase, |\n;;; Mark Saaltink, Dan Craigen and", "end": 208, "score": 0.9998291730880737, "start": 196, "tag": "NAME", "value": "William Pase" }, { "context": "tot Kromodimoeljo, William Pase, |\n;;; Mark Saaltink, Dan Craigen and Irwin Meisels. ", "end": 241, "score": 0.9998287558555603, "start": 228, "tag": "NAME", "value": "Mark Saaltink" }, { "context": "jo, William Pase, |\n;;; Mark Saaltink, Dan Craigen and Irwin Meisels. |\n;;; Al", "end": 254, "score": 0.9998390078544617, "start": 243, "tag": "NAME", "value": "Dan Craigen" }, { "context": ", |\n;;; Mark Saaltink, Dan Craigen and Irwin Meisels. |\n;;; All Rights Reserved.", "end": 272, "score": 0.999856173992157, "start": 259, "tag": "NAME", "value": "Irwin Meisels" } ]
sources/induction.lisp
sentot/ZK
0
;;;====================================================================== ;;; | ;;; Copyright (c) 2021, Sentot Kromodimoeljo, William Pase, | ;;; Mark Saaltink, Dan Craigen and Irwin Meisels. | ;;; All Rights Reserved. | ;;; | ;;; Redistribution and use in source and binary forms, with or without | ;;; modification, are permitted provided the following conditions are | ;;; met: | ;;; | ;;; 1. Redistributions of source code must retain the above copyright | ;;; notice, this list of conditions and the following disclaimer. | ;;; 2. Redistributions in binary form must reproduce the above | ;;; copyright notice, this list of conditions and the following | ;;; disclaimer in the documentation and/or other materials provided | ;;; with the distribution. | ;;; | ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ;;; USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ;;; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ;;; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ;;; THE POSSIBILITY OF SUCH DAMAGE. | ;;; | ;;;====================================================================== (in-package "ZK") ;;; Boyer-Moore style induction. ;;; All the heuristics of Boyer-Moore induction plus the concept of ;;; a scheme being inherently flawed when weeding out flawed ;;; induction schemes. ;;; More than half of the code has to do with proof logging. ;;; ----- Structures for use during induction. ;;; Structure for the induction cases. An induction template is just ;;; a list of induction cases. (defstruct (induction-case :named) tests ;list of tests for the case substitutions ;list of substitution lists (one for each recursive call) calls ;list of recursive calls (*p*'s) in hypothesis hypothesis) ;conjunction of *p*'s possibly universally quantified ;;; Structure for representing the induction schemes. (defstruct (scheme :named) template ;induction template for the scheme changing ;changing variables unchanging ;unchanging variables changeables ;changeable variables unchangeables ;unchangeable variables score ;for ranking schemes flawed ;flawed scheme origin) ;term that suggested the induction scheme ;;; ==================== Prover Commands ==================== (defcmd induct (&optional term :display) ((:string "Try to apply an induction scheme to the current subformula. Normally, the induction scheme is heuristically chosen. However, you may explicitly supply a term on which to induct. The term on which to induct does not have to be in the current subformula.")) (let ((formula (display-formula display)) (template nil) (origin nil)) (if (null term) (let ((schemes (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula))))) (when schemes ;; Need to choose a scheme. (let ((scheme (select-induction-scheme schemes))) ;; Set the template. (setq template (scheme-template scheme) origin (scheme-origin scheme))))) (without-proof-logging ;; No need to choose a scheme in this case. (and (parse-formula-phase-1 term) (not (formula-unmentionable-p term)) (subset-p (unique (list-of-free-variables-unexpanded term)) (unique (list-of-free-variables-unexpanded formula))) ;; Set the template. (setq template (third (get-induction-template-for-term (rename-quantified-variables (expand-formula term nil) nil) (unique (list-of-free-variables-unexpanded formula)))) origin term)))) (when template ;; Apply the template. (let* ((vars (unique (list-of-free-variables-unexpanded formula))) (machine (machine-from-template template vars)) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (event (get-event (car origin))) (measured-expressions (mapcar #'(lambda (u v) (and u v)) (ufunction-measured-subset event) (cdr origin))) (measured-positions (mapcar #'(lambda (u) (occurs-in u measured-expressions)) vars)) (measured-quants (measured-quants-in-machine machine measured-positions)) (measure (sublis-eq (pairlis (ufunction-args event) (cdr origin)) (ufunction-measure event)))) (log-induction formula vars machine origin measure measured-quants (display-base-index display)) (push-proof-log 'marker index (list 'checkpoint (make-implies h1 formula))) ;; (implies H1 Phi) where H1 is induction machine in IF form. (log-apply-machine (if-form-machine machine) template vars formula index (make-context-for-bool-p (make-all (last vars) *true*) (cdr index)))) (push-proof-log 'marker index (list 'checkpoint (apply-induction-template-to-formula template formula))) ;; Now really apply the template. (let ((result (unexpand-formula (unrename-quantified-variables (expand-formula (apply-induction-template-to-formula template formula) index) index) index))) (make-display :formula result :explain `((:string "Inducting using the following scheme ...") ;; **** Unrename may be different from above? (:newline) (:formula ,(without-proof-logging (unexpand-formula (unrename-quantified-variables (expand-formula (scheme-description template formula) nil) nil) nil))) (:newline) (:string "produces ..."))))))) ;;; Printable representation of a scheme that goes in a proof detail. (defun scheme-description (induction-template formula) (let* ((vars (sort (unique (list-of-free-variables-unexpanded formula)) #'alphalessp)) (form (cons '*p* vars))) (apply-induction-template-to-formula induction-template form))) (defcmd prove-by-induction (:display) ((:string "Try to prove the current subformula with automatic induction (see") (:help-name induction) (:punctuation ").") (:string "A non-inductive proof is first attempted. If this fails, the theorem prover will try to apply an induction scheme to the formula. The theorem prover may discard the non-inductive proof prior to the induction.")) (let* ((original-formula-worth-inducting (worth-inducting-p (display-formula display))) (success (reduce))) (cond ((literal-p (display-formula *current-display*)) success) ((and success original-formula-worth-inducting) (back) (induct) (reduce) t) ;have succeeded ((worth-inducting-p (display-formula *current-display*)) (induct) (reduce) t) ;induction performed (t success)))) ;;; Decide whether or not we should induct on the formula. (defun worth-inducting-p (formula) (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula)))) ;;; ==================== Supporting Functions ==================== ;;; ----- Functions used to prepare proof logging. ;;; Construct induction machine from template. May be different ;;; from induction machine stored in the struct for the recursive ;;; function, although the format is the same (a list of cases where ;;; each case has a list of assumptions and an induction hypothesis). (defun machine-from-template (template vars) (mapcar #'(lambda (u) (let ((call-substitutions (mapcar #'(lambda (c s) (cons c (sublis-eq s (cons *induction-pattern* vars)))) (induction-case-calls u) (induction-case-substitutions u)))) (list (induction-case-tests u) (sublis-equal call-substitutions (induction-case-hypothesis u))))) template)) ;;; List of bound variables in the hypotheses of the machines that ;;; occur in measured positions, needed for proof logging. (defun measured-quants-in-machine (machine measured-positions) (let ((measured-expressions (loop for call in (list-of-calls *induction-pattern* machine) append (loop for expr in (cdr call) for measured in measured-positions when measured collect expr))) (bound (loop for case in machine append (list-of-bound-variables-unexpanded (second case))))) (remove-if-not #'(lambda (u) (occurs-in u measured-expressions)) bound))) ;;; ==================== Templates ==================== ;;; ----- Apply Template ;;; Take an induction template and a formula, and apply the template ;;; to produce an equivalent formula. (defun apply-induction-template-to-formula (induction-template formula) ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (m) (make-induction-lemma-case m formula)) induction-template) *true*)) ;;; Make an induction case. (defun make-induction-lemma-case (induction-case formula) (let ((induction-hypothesis (substitute-hypothesis (induction-case-substitutions induction-case) (induction-case-calls induction-case) (induction-case-hypothesis induction-case) formula))) (let ((result (make-implies ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (u) (if (and (if-p u) (true-p (if-left u)) (false-p (if-right u))) (if-test u) u)) (append (induction-case-tests induction-case) (list-of-induction-hypotheses induction-hypothesis))) *true*) formula))) result))) (defun list-of-induction-hypotheses (induction-hypothesis) (cond ((and-p induction-hypothesis) (cdr induction-hypothesis)) ((null induction-hypothesis) nil) (t (list induction-hypothesis)))) (defun substitute-hypothesis (subst calls hypo formula) (sublis-equal (pairlis calls (mapcar #'(lambda (u) (sublis-eq u formula)) subst)) hypo)) ;;; ----- Make Template ;;; Make an induction template from a recursive definition and a ;;; term. It is assumed that the template suggested by the recursive ;;; definition applies to the term. (defun construct-induction-template (args subst changeables unchangeables machine) (let ((instantiated-machine (sublis-eq subst machine))) (mapcar #'(lambda (m) (without-proof-logging (let* ((hypothesis (rename-quantified-variables (second m) nil)) (calls (list-of-calls *induction-pattern* hypothesis))) (make-induction-case :tests (first m) :substitutions (construct-induction-substitutions args changeables unchangeables calls) :calls calls :hypothesis hypothesis)))) instantiated-machine))) ;;; Construct the substitutions for the calls of a machine case. (defun construct-induction-substitutions (args changeables unchangeables calls) (when calls (cons (construct-induction-substitution-case args changeables unchangeables (car calls)) (construct-induction-substitutions args changeables unchangeables (cdr calls))))) ;;; Construct the substitution for a call of a machine case. Illegal ;;; substitutions are deleted here. (defun construct-induction-substitution-case (args changeables unchangeables call) (let ((subst (mapcar #'cons args (cdr call))) (substitution nil)) (mapc #'(lambda (u v) (or ;; never substitute unchangeables (member-eq (car u) unchangeables) ;; never substitute non-variables (not (variable-p (car u))) ;;(eq (car u) (cdr u)) (let ((entry (assoc-eq (car u) substitution))) (setq substitution (if (and entry v) (cons u (remove-eq entry substitution)) (cons u substitution)))))) subst changeables) (reverse substitution))) ;;; ----- Changing/Unchangeable Variables. ;;; Given an induction template, return the list of changing arguments ;;; (Boyer-Moore's terminology - from "A Computational Logic"). (defun changing-induction-variables-in-template (induction-template) (and (not (null induction-template)) (unique (union-eq (variables-substituted (induction-case-substitutions (car induction-template))) (changing-induction-variables-in-template (cdr induction-template)))))) ;;; Given a set of substitutions, return a unique list of variables that ;;; are substituted for (with something other than itself). (defun variables-substituted (case-substitutions) (and (not (null case-substitutions)) (unique (union-eq (loop for pair in (car case-substitutions) when (not (eq (car pair) (cdr pair))) collect (car pair)) (variables-substituted (cdr case-substitutions)))))) ;;; List of unchangeables as defined in Boyer & Moore's "A Computational ;;; Logic." These are variables in expressions appearing in measured ;;; positions that cannot change. (defun list-of-unchangeables (measured-positions unchanging-positions term-arguments) (let ((unchangeable-expressions (mapcar #'(lambda (u v w) (and u v w)) measured-positions unchanging-positions term-arguments))) (unique (mapcan #'list-of-free-variables-unexpanded unchangeable-expressions)))) ;;; Return t if the elements of the given list are distinct variables. (defun is-list-of-distinct-variables-p (list-of-expr) (let ((checked-variables nil) (success t)) (dolist (e list-of-expr) (if (or (not (variable-p e)) (member-eq e checked-variables)) (return (setq success nil)) (push e checked-variables))) success)) ;;; =============== Choose Scheme =============== ;;; ----- Called first, get candidate induction schemes. ;;; Collect all induction schemes suggested by terms in the formula. (defun get-induction-schemes (formula free-vars) (and (consp formula) (let ((induction-template (get-induction-template-for-term formula free-vars))) (cond (induction-template (let ((changeables (first induction-template)) (unchangeables (second induction-template)) (template (third induction-template))) (let ((changing (changing-induction-variables-in-template template)) (args (cdr formula))) (cons (make-scheme :template template :changing changing :unchanging (set-difference-equal (unique (loop for x in args append (list-of-free-variables-unexpanded x))) changing) :changeables changeables :unchangeables unchangeables :score (rdiv (length changing) (length args)) ;; Set if inherently flawed. :flawed (flawed-template-p template args) :origin formula) (loop for expr in formula append (get-induction-schemes expr free-vars)))))) (t (loop for expr in formula append (get-induction-schemes expr free-vars))))))) ;;; Construct an induction template for a term when there is an ;;; induction template that applies to the term. (defun get-induction-template-for-term (term free-vars) (and (consp term) (atom (first term)) (let ((name (get-event (first term)))) (and (ufunction-p name) (not (event-inaccessible-p name)) (ufunction-recursive name) (every #'(lambda (v) (occurs-in v free-vars)) (unique (list-of-free-variables-unexpanded term))) (let ((measured-positions (ufunction-measured-subset name)) (unchanging-positions (ufunction-unchangeables name)) (term-arguments (cdr term))) (let ((changeables (mapcar #'(lambda (u v w) (and u (not v) w)) measured-positions unchanging-positions term-arguments)) (unchangeables (list-of-unchangeables measured-positions unchanging-positions term-arguments))) (and (induction-template-applies-p changeables unchangeables) (list (remove-if #'null changeables) unchangeables (construct-induction-template (cdr term) (pairlis (ufunction-args name) (cdr term)) changeables unchangeables (ufunction-machine name)))))))))) ;;; Return t if the changeables are distinct variables and the ;;; intersection of changeables and unchangeables is empty. (defun induction-template-applies-p (changeables unchangeables) (let ((changeable-list (remove-if #'null changeables))) (and (is-list-of-distinct-variables-p changeable-list) (null (intersection-eq changeable-list unchangeables))))) ;;; Code to help determine if an induction scheme is inherently "flawed". ;;; Some cases flawed. (defun flawed-template-p (template args) (some #'(lambda (u) (flawed-template-case u args)) template)) ;;; All calls flawed. (defun flawed-template-case (case args) (let ((calls (induction-case-calls case))) (and calls (every #'(lambda (u) (flawed-template-call u args)) calls)))) ;;; Flawed call. (defun flawed-template-call (call args) (some #'(lambda (u v) (and (not (equal u v)) (not (variable-p v)))) (cdr call) args)) ;;; ----- Select Induction Scheme ;;; Selection goes through 3 filtering steps before a winner is picked: ;;; 1. Remove subsumed schemes (and increase scores of subsuming schemes). ;;; 2. Merge schemes, removing the original schemes merged. ;;; 3. Remove flawed schemes if possible. (defun select-induction-scheme (list-of-schemes) (superimpose-cases (pick-winner (list-of-unflawed-schemes (list-of-merged-schemes (list-of-unsubsumed-schemes list-of-schemes)))))) ;;; Pick an induction scheme with the highest score. (defun pick-winner (list-of-schemes) (let ((champ (first list-of-schemes))) (dolist (challenger (cdr list-of-schemes)) (when (> (scheme-score challenger) (scheme-score champ)) (setq champ challenger))) champ)) ;;; =============== Code for Manipulating Schemes =============== ;;; ----- Superimpose Scheme Cases ;;; Once a winner is picked, superimpose (merge) induction cases that ;;; have the same test (condition). (defun superimpose-cases (scheme) (when scheme (let ((template (scheme-template scheme)) (acc nil)) (dolist (case template) (unless (dolist (c acc) (when (and (subsetp-equal (induction-case-tests c) (induction-case-tests case)) (subsetp-equal (induction-case-tests case) (induction-case-tests c))) (setf (induction-case-substitutions c) (append (induction-case-substitutions c) (induction-case-substitutions case))) (setf (induction-case-calls c) (append (induction-case-calls c) (induction-case-calls case))) (setf (induction-case-hypothesis c) (make-simplified-and (induction-case-hypothesis c) (induction-case-hypothesis case))) (simplify-superimposed-case c) (return t))) (push case acc))) (setf (scheme-template scheme) (reverse acc)))) scheme) (defun simplify-superimposed-case (case) (when (and-p (induction-case-hypothesis case)) (let ((mask (simplify-superimposed-case-aux nil (cdr (induction-case-hypothesis case))))) (setf (induction-case-substitutions case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-substitutions case))) (setf (induction-case-calls case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-calls case))) (setf (induction-case-hypothesis case) (mapcan #'(lambda (x y) (and x (list y))) mask (if (and-p (induction-case-hypothesis case)) (cdr (induction-case-hypothesis case)) (induction-case-hypothesis case)))) (setf (induction-case-hypothesis case) (if (null (cdr (induction-case-hypothesis case))) (car (induction-case-hypothesis case)) (cons 'and (induction-case-hypothesis case))))))) (defun simplify-superimposed-case-aux (acc hyps) (cond ((null hyps) nil) ((member-equal (car hyps) acc) (cons nil (simplify-superimposed-case-aux acc (cdr hyps)))) (t (cons t (simplify-superimposed-case-aux (cons (car hyps) acc) (cdr hyps)))))) ;;; ----- Scheme Subsumption ;;; Given a list of induction schemes, it deletes those that are ;;; subsumed by other schemes. This is the first filtering step. (defun list-of-unsubsumed-schemes (list-of-schemes) (and list-of-schemes (list-of-unsubsumed-schemes-aux (first list-of-schemes) (list-of-unsubsumed-schemes (cdr list-of-schemes)) nil))) (defun list-of-unsubsumed-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((next-scheme (first unprocessed-schemes))) (cond ((scheme-subsumes-scheme-p scheme next-scheme) (list-of-unsubsumed-schemes-aux (make-scheme :template (scheme-template scheme) :changing (scheme-changing scheme) :unchanging (scheme-unchanging scheme) :changeables (scheme-changeables scheme) :unchangeables (scheme-unchangeables scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed scheme) :origin (scheme-origin scheme)) (cdr unprocessed-schemes) processed-schemes)) ((scheme-subsumes-scheme-p next-scheme scheme) (append (cdr unprocessed-schemes) (cons (make-scheme :template (scheme-template next-scheme) :changing (scheme-changing next-scheme) :unchanging (scheme-unchanging next-scheme) :changeables (scheme-changeables next-scheme) :unchangeables (scheme-unchangeables next-scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed next-scheme) :origin (scheme-origin next-scheme)) processed-schemes))) (t (list-of-unsubsumed-schemes-aux scheme (cdr unprocessed-schemes) (cons next-scheme processed-schemes))))))) ;;; Subsumption check for induction schemes as described in ;;; Boyer & Moore's "A Computational Logic." ;;; Return t if the first scheme subsumes the second scheme. (defun scheme-subsumes-scheme-p (scheme-1 scheme-2) (and (subset-p (scheme-changing scheme-2) (scheme-changing scheme-1)) (subset-p (scheme-unchanging scheme-2) (scheme-unchanging scheme-1)) (scheme-cases-subsume-p (scheme-template scheme-1) (scheme-template scheme-2)))) ;;; For cases of a scheme to subsume cases of another scheme each case of ;;; the latter scheme must be subsumed by a unique case of the former scheme. (defun scheme-cases-subsume-p (template-1 template-2) (or (null template-2) (multiple-value-bind (subsumed updated-template) (scheme-case-subsumed-by (first template-2) template-1 nil) (and subsumed (scheme-cases-subsume-p updated-template (cdr template-2)))))) ;;; Determine if a case is subsumed by a another case in a template. ;;; If successful it will return two values: t and the list of cases ;;; in the template minus the case that subsumes the first case. (defun scheme-case-subsumed-by (case template updated-template) (cond ((null template) (values nil updated-template)) ((scheme-single-case-subsumes-p (first template) case) (values t (append (cdr template) updated-template))) (t (scheme-case-subsumed-by case (cdr template) (cons (car template) updated-template))))) ;;; Return t if the first case subsumes the second case. (defun scheme-single-case-subsumes-p (case-1 case-2) (and (subset-p (induction-case-tests case-2) (induction-case-tests case-1)) (substitutions-subsumes-substitutions-p (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) ;;; Return t if a list of substitutions subsumes a second list. (defun substitutions-subsumes-substitutions-p (list-of-sublis-1 list-of-sublis-2) (or (null list-of-sublis-2) (multiple-value-bind (subsumed updated-list) (substitution-subsumed-by-list (first list-of-sublis-2) list-of-sublis-1 nil) (and subsumed (substitutions-subsumes-substitutions-p updated-list (cdr list-of-sublis-2)))))) ;;; Return a success indicator and the modified list of substitutions ;;; if the substitution is subsumed by a substitution in the list. ;;; The modified list will have the subsuming substitution removed. (defun substitution-subsumed-by-list (subst list-of-subst updated-list) (cond ((null list-of-subst) (values nil updated-list)) ((substitution-subsumed-by subst (first list-of-subst)) (values t (append (cdr list-of-subst) updated-list))) (t (substitution-subsumed-by-list subst (cdr list-of-subst) (cons (car list-of-subst) updated-list))))) (defun substitution-subsumed-by (subst1 subst2) (cond ((null subst1) t) (t (let ((match (assoc-eq (caar subst1) subst2))) (and match (expr-occurs (cdar subst1) (cdr match)) (substitution-subsumed-by (cdr subst1) (remove-equal match subst2))))))) ;;; ----- Merging Schemes ;;; Given a list of schemes, it will delete those that can be merged into ;;; other schemes. This is the second filtering step. (defun list-of-merged-schemes (list-of-schemes) (and list-of-schemes (list-of-merged-schemes-aux (first list-of-schemes) (list-of-merged-schemes (cdr list-of-schemes)) nil))) (defun list-of-merged-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((merged (merge-schemes scheme (first unprocessed-schemes)))) (if merged (list-of-merged-schemes-aux merged (append (cdr unprocessed-schemes) processed-schemes) nil) (list-of-merged-schemes-aux scheme (cdr unprocessed-schemes) (cons (first unprocessed-schemes) processed-schemes)))))) ;;; Return the merged scheme if one of the schemes can be merged into ;;; the other scheme. (defun merge-schemes (scheme-1 scheme-2) (and (not (null (intersection-eq (scheme-changing scheme-1) (scheme-changing scheme-2)))) (null (intersection-eq (scheme-unchanging scheme-1) (scheme-changing scheme-2))) (null (intersection-eq (scheme-unchanging scheme-2) (scheme-changing scheme-1))) ;; only merge into a scheme which has no quantified hypothesis (or (make-merged-scheme scheme-2 scheme-1 (merge-templates (scheme-template scheme-2) (scheme-template scheme-1))) (make-merged-scheme scheme-1 scheme-2 (merge-templates (scheme-template scheme-1) (scheme-template scheme-2)))))) (defun make-merged-scheme (scheme-1 scheme-2 merged-template) (and merged-template (make-scheme :template merged-template :changing (unique (union-eq (scheme-changing scheme-1) (scheme-changing scheme-2))) :unchanging (unique (union-eq (scheme-unchanging scheme-1) (scheme-unchanging scheme-2))) :changeables (scheme-changeables scheme-2) :unchangeables (scheme-unchangeables scheme-2) :score (+ (scheme-score scheme-1) (scheme-score scheme-2)) :flawed (or (scheme-flawed scheme-1) (scheme-flawed scheme-2)) :origin (scheme-origin scheme-2)))) ;;; Return the merged template if the first template can be merged into ;;; the second one. (defun merge-templates (template-1 template-2) (and (<= (length template-1) (length template-2)) (let ((template (merge-templates-stage-1 template-1 template-2))) (when template (merge-template-stage-2 template-1 template-2))))) ;;; In stage 1, try to merge each case of the first template into a unique ;;; case of the second template. If successful it will return the merged ;;; template. (defun merge-templates-stage-1 (template-1 template-2) (merge-templates-stage-1-aux template-1 template-2 (mapcar #'(lambda (u) u nil) template-2))) (defun merge-templates-stage-1-aux (template-1 template-2 merged-cases) (cond ((null template-1) template-2) ((null (induction-case-substitutions (car template-1))) (merge-templates-stage-1-aux (cdr template-1) template-2 merged-cases)) (t (multiple-value-bind (template merged) (merge-templates-stage-1-aux-aux (car template-1) template-2 merged-cases nil nil) (when template (merge-templates-stage-1-aux (cdr template-1) template merged)))))) (defun merge-templates-stage-1-aux-aux (case template merged tmp mrg) (cond ((null template) (values nil nil)) (t (let ((merged-case (and (null (car merged)) (merge-cases-1 case (car template))))) (cond (merged-case (values (revappend tmp (cons merged-case (cdr template))) (revappend mrg (cons t (cdr merged))))) (t (merge-templates-stage-1-aux-aux case (cdr template) (cdr merged) (cons (car template) tmp) (cons (car merged) mrg)))))))) ;;; In stage 2, try to merge each case of template-1 into as many cases ;;; of template-2 as possible. This stage will always be successful. (defun merge-template-stage-2 (template-1 template-2) (cond ((null template-2) nil) ((null (induction-case-substitutions (car template-2))) (cons (car template-2) (merge-template-stage-2 template-1 (cdr template-2)))) (t (cons (merge-template-stage-2-aux template-1 (car template-2)) (merge-template-stage-2 template-1 (cdr template-2)))))) (defun substitutions-in-template (template) (unless (null template) (append (induction-case-substitutions (car template)) (substitutions-in-template (cdr template))))) (defun bound-variables-in-template (template) (unless (null template) (append (list-of-bound-variables (induction-case-hypothesis (car template))) (bound-variables-in-template (cdr template))))) (defun merge-template-stage-2-aux (template case-2) (multiple-value-bind (result s1 rs rc) (merge-cases-2 (induction-case-hypothesis case-2) (induction-case-substitutions case-2) (substitutions-in-template template) nil nil) (if (null s1) (make-induction-case :tests (induction-case-tests case-2) :substitutions (reverse rs) :calls (reverse rc) :hypothesis (make-series-of-quantification 'all (intersection-eq (unique (bound-variables-in-template template)) (list-of-all-variables result)) result)) case-2))) (defun merge-cases-2 (expr s1 s2 rs rc) (cond ((atom expr) (values expr s1 rs rc)) ((eq (car expr) *induction-pattern*) (let ((s nil) (c nil)) (loop for ss in s2 do (let ((merged (merge-sublis ss (car s1)))) (when (and merged (not (equal (remove-equal-subst merged) (remove-equal-subst (car s1))))) (push merged s) (push (list* *induction-pattern* (gensym) (cdr expr)) c)))) (cond (s (values (cons 'and (revappend c (list expr))) (cdr s1) (append s (cons (car s1) rs)) (append c (cons expr rc)))) (t (values expr (cdr s1) (cons (car s1) rs) (cons expr rc)))))) (t (let ((expr-stack nil) (exp nil) (ts1 s1) (trs rs) (trc rc)) (loop for e in expr do (progn (multiple-value-setq (exp ts1 trs trc) (merge-cases-2 e ts1 s2 trs trc)) (push exp expr-stack))) (values (reverse expr-stack) ts1 trs trc))))) (defun remove-equal-subst (substitution) (remove-if #'(lambda (u) (eq (car u) (cdr u))) substitution)) ;;; Return the merged case if the first case can be merged into the ;;; second case. (defun merge-cases-1 (case-1 case-2) (unless (null (induction-case-substitutions case-2)) (let ((merged-subst (merge-substitutions (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) (and merged-subst (make-induction-case :tests (induction-case-tests case-2) :substitutions merged-subst :calls (induction-case-calls case-2) :hypothesis (make-series-of-quantification 'all (unique (list-of-bound-variables (induction-case-hypothesis case-1))) (induction-case-hypothesis case-2))))))) ;;; Return the merged list of substitutions if the first list of ;;; substitutions can be merged into the second list. (defun merge-substitutions (subst-1 subst-2) (let ((merged-subst (merge-substitutions-aux subst-1 subst-2 nil))) (when merged-subst (revappend merged-subst subst-2)))) (defun merge-substitutions-aux (subst-1 subst-2 merged-subst) (cond ((null subst-1) merged-subst) ((null subst-2) nil) (t (multiple-value-bind (merged updated-subst) (merge-sublis-with-subst (first subst-1) subst-2 nil) (when merged (merge-substitutions-aux (cdr subst-1) updated-subst (cons merged merged-subst))))))) ;;; Return the merged substitution and the modified list of substitutions ;;; if the substitution can be merged into a substitution from the list ;;; of substitutions. The modified list will have the merged substitution ;;; removed. (defun merge-sublis-with-subst (sublis list-of-substs updated-subst) (cond ((null list-of-substs) (values nil nil)) (t (let ((merged (merge-sublis sublis (first list-of-substs)))) (if merged (values merged (revappend updated-subst (cdr list-of-substs))) (merge-sublis-with-subst sublis (cdr list-of-substs) (cons (car list-of-substs) updated-subst))))))) ;;; Return the merged substitution if the first substitution can be ;;; merged into the second substitution. (defun merge-sublis (sublis-1 sublis-2) (let ((overlap (intersection-eq (mapcar #'car sublis-1) (mapcar #'car sublis-2)))) (and overlap (consistent-overlap-p overlap sublis-1 sublis-2) (some #'(lambda (u) (neq u (cdr (assoc-eq u sublis-1)))) overlap) (append sublis-2 (remove-if #'(lambda (u) (member-equal u sublis-2)) sublis-1))))) ;;; Return t if the overlapping symbols are consistently substituted ;;; by the two substitutions (defun consistent-overlap-p (overlap sublis-1 sublis-2) (or (null overlap) (and (equal (assoc-eq (first overlap) sublis-1) (assoc-eq (first overlap) sublis-2)) (consistent-overlap-p (cdr overlap) sublis-1 sublis-2)))) ;;; ----- Flawed Schemes ;;; Remove flawed schemes. If every scheme is flawed, try just removing ;;; all "really flawed" schemes. If all the schemes are really flawed, ;;; none are removed. This is the 3rd and last filtering step. (defun list-of-unflawed-schemes (list-of-schemes) (or (remove-if #'(lambda (u) (scheme-flawed-p u list-of-schemes)) list-of-schemes) (remove-if #'(lambda (u) (scheme-really-flawed-p u list-of-schemes)) list-of-schemes) list-of-schemes)) ;;; Return t if the scheme is flawed with respect to a list of schemes. ;;; This is used for weeding out flawed schemes as described in BM's ACL. (defun scheme-flawed-p (scheme list-of-schemes) (let ((changeables (scheme-changeables scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (or (intersection-eq changeables (scheme-changing s)) (intersection-eq changeables (scheme-unchanging s)))) (return t))))) ;;; Boyer-Moore implementation in thm and nqthm added a second (weaker) ;;; pass in case everything is weeded out by the first pass. We added ;;; our own improvisation to Boyer-Moore's 2nd pass. (defun scheme-really-flawed-p (scheme list-of-schemes) (or (scheme-flawed scheme) ; our own improvisation ;; BM's enhancement in thm and nqthm (let ((changing (scheme-changing scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (intersection-eq changing (scheme-unchanging s))) (return t)))))) ;;; =============== Code to Log Induction =============== ;;; Logs conversion of ;;; (all vs Phi) ;;; to ;;; (all vs (implies H1 Phi)) ;;; where H1 is the "machine" (induction hypothesis) in IF form. (defun log-induction (formula vars machine term measure measured-quants index) (let ((m (genvar (input-variable-p '|)M|))) (m1 (genvar (input-variable-p '|)M1|))) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (h2 (make-h2 measure vars formula))) ;; Start with (all vs Phi) ;; Note that H2 is the strong induction hypothesis for formula ;; using the supplied measure. H1 is the actual instantiated ;; induction hypothesis. (log-induction-phase-1 formula vars h1 h2 index) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-2 formula vars machine term (append (mapcar #'(lambda (u) u 2) vars) (cons 2 (if-test-index))) h1 h2 measured-quants) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies H2 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-3 formula h2 vars measure m m1 (cons 2 (if-test-index))) ;; We now have: ;; (if (= (all vs Phi) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-renames (mapcar #'cons (list-of-leading-universals h2) vars) (list* 2 2 1 2 2 (if-test-index))) (log-label (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))) m measure) ;; (if (= (all vs (if (some m (= m mu[vs])) Phi (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all vs (implies (some m (= m mu[vs])) Phi)) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))) ;; (if (= (all vs (if (some m (= m mu[vs])) (if Phi (true) (false)) (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((expr (make-if (make-some-single m (make-= m measure)) (make-if formula *true* *false*) *true*))) (log-all-uncase-analysis-2 expr (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) ;; We now have: ;; (if (= (all vs (all m (if (= m mu[vs]) Phi (true)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-move-universal-out (length vars) (cons 1 (if-test-index))) (let ((inner-index (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all m (all vs (implies (= m mu[vs]) Phi))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; This is where we apply the INDUCT inference rule. ;; (P m) is (all vs (implies (= m mu[vs]) Phi)). ;; (P m1) is (all vs (implies (= m1 mu[vs]) Phi)). (push-proof-log 'induct (cons 1 (if-test-index)) m1) ;; and get: ;; (if (= (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'compute (if-test-index)) (push-proof-log 'if-true index) ;; We end up with: ;; (all vs (implies H1 Phi)) )) ;;; Apply if-form of the machine to formula (i.e. apply scheme ;;; to formula). (defun apply-machine-formula (machine vars formula) (cond ((true-p machine) *true*) ((if-p machine) (make-if (if-test machine) (apply-machine-formula (if-left machine) vars formula) (apply-machine-formula (if-right machine) vars formula))) ((all-p machine) (make-all (all-vars machine) (apply-machine-formula (all-expr machine) vars formula))) ((and-p machine) (cons 'and (mapcar #'(lambda (u) (apply-machine-formula u vars formula)) (cdr machine)))) (t (sublis-eq (pairlis vars (cdr machine)) formula)))) ;;; Make strong induction hypothesis according to measure, ;;; quantifying over newvars that correspond to vars. (defun make-h2 (measure vars formula) (let* ((newvars (mapcar #'genvar vars)) (substitutions (pairlis vars newvars))) (make-series-of-quantification 'all newvars (make-implies `(m< ,(sublis-eq substitutions measure) ,measure) (sublis-eq substitutions formula))))) ;;; log-induction-phase-1 logs the inferences that converts: ;;; (all vs Phi) ;;; to: ;;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (all vs (implies H1 Phi)) ;;; (all vs Phi)) ;;; (This is the uninteresting phase.) (defun log-induction-phase-1 (formula vars h1 h2 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1))) (let ((qform (make-series-of-quantification 'all vars formula))) (let ((qh1imp (make-series-of-quantification 'all vars (make-implies h1 formula))) (qh1h2imp (make-series-of-quantification 'all vars (make-implies (make-and h1 h2) formula)))) ;; H2 is the strong induction hypothesis. ;; qform = (all vs Phi) ;; qh1imp = (all vs (implies H1 Phi)) ;; qh1h2imp = (all vs (implies (and H1 H2) Phi)) (push-proof-log 'if-equal index (make-= qform qh1h2imp) t) (push-proof-log 'if-equal (if-left-index) (make-= qform qh1imp) t) (log-equality-substitute qform qform qh1imp (cons 2 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index)) (make-= qform qh1h2imp) t) (log-cases-if (make-if (make-= qform qh1h2imp) (make-= qform qh1imp) (make-= qform qh1imp)) nil (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (implies (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi))) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-equal (cons 1 (cons 1 (if-left-index))) qform t) (log-induction-phase-1-aux vars (make-implies h1 formula) qform qh1imp qh1h2imp (list* 1 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; Seems to be this: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (if (true) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (true) ;; (false)) ;; (false)) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-true (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'look-up (list* 1 1 1 (if-left-index)) *true*) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (true)) (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'if-true (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-false (cons 1 (if-left-index))) (push-proof-log 'if-true (if-left-index))))) ;;; log-induction-phase-1-aux logs inferences that converts: ;;; (if (all vs Phi) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi))))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux (vars h1imp qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux))) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) (log-=-true-left-to-if qh1h2imp (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (log-=-true-left-to-if qh1imp (cons 2 (if-left-index))) (push-proof-log 'is-boolean (cons 2 (if-left-index)) t) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (= (all vs Phi) (all vs (implies H1 Phi))))) (log-look-up-false (cons 1 (cons 1 (if-right-index)))) (log-=-false-left-to-if qh1h2imp (cons 1 (if-right-index))) (log-look-up-false (cons 1 (cons 2 (if-right-index)))) (log-=-false-left-to-if qh1imp (cons 2 (if-right-index))) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (log-cases-if (make-if qform (make-implies qh1h2imp qh1imp) (make-implies (make-if qh1h2imp *false* *true*) (make-if qh1imp *false* *true*))) nil index) ;; (and (implies (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)))) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (and-left-index)) (push-proof-log 'is-boolean (cons 2 (and-left-index)) t) ;; (and (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (cons 2 (and-left-index))) (push-proof-log 'is-boolean (cons 2 (cons 2 (and-left-index))) t) ;; (and (if (all vs Phi) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)) ;; (true)) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (log-induction-phase-1-aux-1 vars (and-left-index) h1imp qform qh1imp qh1h2imp) (push-proof-log 'syntax index) ;; (if (true) ;; (if (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) ;; (true) ;; (false)) ;; (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-induction-phase-1-aux-2 vars qform qh1imp qh1h2imp index) ) ;;; log-induction-phase-1-aux-1 logs inferences that converts: ;;; (if (all vs Phi) ;;; (if (all vs (implies (and H1 H2) Phi)) ;;; (all vs (implies H1 Phi)) ;;; (true)) ;;; (true)) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-1 (vars index h1imp qform qh1imp qh1h2imp) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-1))) (let* ((renames (mapcar #'genvar vars)) (renamed-h1imp (sublis-eq (pairlis vars renames) h1imp)) (renamed-qh1imp (sublis-eq (pairlis vars renames) qh1imp))) (log-renames (mapcar #'cons vars renames) (cons 2 (if-left-index))) (log-all-out-lefts vars (if-left-index) qh1h2imp renamed-qh1imp) (log-all-out-lefts vars index qform (universally-quantify renames (make-if qh1h2imp renamed-h1imp *true*))) (let ((inner-index (display-formula-index-aux renames index))) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (cons 1 inner-index)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) (push-proof-log 'syntax (list* 2 2 2 inner-index)) (push-proof-log 'look-up (list* 1 2 2 2 2 inner-index) *true*) (push-proof-log 'if-true (list* 2 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) (dotimes (i (length vars)) i (push-proof-log 'remove-universal index) (push-proof-log 'is-boolean index t)))) ) ;;; log-induction-phase-1-aux-2 logs inferences that converts: ;;; (implies (not (all vs Phi)) ;;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;;; (if (all vs (implies H1 Phi)) (false) (true)))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-2 (vars qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-2))) (push-proof-log 'syntax (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (if (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true))) (push-proof-log 'case-analysis (implies-right-index) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (if (false) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)) ;; (if (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)))) (push-proof-log 'if-false (cons 2 (implies-right-index))) (push-proof-log 'if-true (cons 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false))))) (push-proof-log 'case-analysis (cons 3 (implies-right-index)) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) ;; (if (false) (true) (false)) ;; (if (true) (true) (false))))) (push-proof-log 'if-false (list* 2 3 (implies-right-index))) (push-proof-log 'if-true (list* 3 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let* ((renames (mapcar #'genvar vars)) (substitutions (mapcar #' cons vars renames))) (log-renames substitutions (cons 1 (implies-right-index))) (log-repeat-all-out-tests renames (make-if (sublis-eq substitutions qh1h2imp) *true* (make-if qh1imp *false* *true*)) (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (all vs' (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let ((inner-index (display-formula-index-aux renames (implies-right-index)))) ;; inner-index points to ;; (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (cons 1 inner-index)) (push-proof-log 'syntax (list* 1 1 inner-index)) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 1 3 inner-index))) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-true (cons 3 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if (if Phi (true) (false)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-true (list* 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) ;; (true)) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (list* 1 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if H1' (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) (push-proof-log 'look-up (list* 1 1 1 3 2 2 inner-index) *true*) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if (true) (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) ;; Phi' is boolean? Coerce to make sure. (log-coerce-if-test-to-bool (list* 2 1 1 3 2 2 inner-index)) (log-look-up-false-for-coercion (list* 1 2 1 1 3 2 2 inner-index)) (push-proof-log 'if-true (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi (true) (true)) ;; (true)) ;; (true)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) ;; (true) ;; Finished with inner-index ====== (dotimes (i (length vars)) i (push-proof-log 'remove-universal (implies-right-index)) (push-proof-log 'is-boolean (implies-right-index) t)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'if-equal index))) ) (defun log-all-out-lefts (vars index test left) (unless (null vars) ;; (if test (all () ...) (true)) (log-all-uncase-analysis-2a (make-if test left *true*) index) (log-all-out-lefts (cdr vars) (all-expr-index) test (all-expr left)))) (defun log-repeat-all-out-tests (vars formula index &optional bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) Q) (unless (null vars) (let* ((q (if-right formula)) (coerced-q (make-if q *true* *false*))) ;; either Q is boolean or in boolean context so that Q ;; and (if Q (true) (false)) are equivalent. (log-coerce-expr-for-boolean-or-bool-p q (if-right-index) bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) (if Q (true) (false))) (log-all-uncase-analysis-3 (make-if (if-test formula) *true* coerced-q) index) ;; (all (var1) (if (all (var2) ... P) (true) Q)) (unless (null (cdr vars)) (log-repeat-all-out-tests (cdr vars) (make-if (all-expr (if-test formula)) *true* q) (all-expr-index) (make-context-for-bool-p (make-all (list (car vars)) *true*) index))) ))) ;;; log-induction-phase-2 logs inferences that converts ;;; (implies (and H1 H2) Phi) ;;; to ;;; (implies H2 Phi) ;;; index points to (implies (and H1 H2) Phi) ;;; term is the term that suggested the induction, e.g. (div i j) (defun log-induction-phase-2 (formula vars machine term index h1 h2 measured-quants) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2))) ;; commute H1 and H2 and then convert to if form (log-use-axiom-as-rewrite (make-and h1 h2) 'and.commutative (list (make-= '|)X| h1) (make-= '|)Y| h2)) (implies-left-index)) (push-proof-log 'syntax index) (push-proof-log 'syntax (if-test-index)) ;; (if (if H2 (if H1 (true) (false)) (false)) (if Phi (true) (false)) (true)) (push-proof-log 'case-analysis index 1) ;; (if H2 ;; (if (if H1 (true) (false)) (if Phi (true) (false)) (true)) ;; (if (false) (if Phi (true) (false)) (true))) (log-remove-bool-coercion-from-if-test (if-left-index)) (push-proof-log 'if-false (if-right-index)) ;; At this point we have: ;; (if H2 ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; We now do the interesting part which is to knock off H1 ;; (converting it to (true) with the help of PO). (let* ((po-name (intern (format nil "~A.PO" (car term)) *zk-package*)) (po-args (unique (list-of-free-variables-unexpanded (ufunction-formula (get-event (car term)))))) (orig-po (progn (log-use-axiom (if-left-index) po-name) (ufunction-formula (get-event (car term))))) (po-args-renames (mapcar #'genvar po-args)) (args (ufunction-args (get-event (car term)))) ;; rename inner quantifications of PO (renamed-po (rename-quantified-variables-unexpanded orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index))))) ;; po is the PO applied to the induction term (po (sublis-eq (pairlis args (cdr term)) renamed-po))) (log-renames (mapcar #'cons po-args po-args-renames) (cons 1 (if-left-index))) ;; (if H2 ;; (if quantifiedPO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (linearize-and-log-universal-instantiations (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) ;; At this point quantifiedPO has been transformed by instantiation. ;; (if H2 ;; (if (if PO quantifiedPO (false)) ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) ;; rename back the outer quantification (log-renames (mapcar #'cons po-args-renames po-args) (list* 2 1 (if-left-index))) ;; unrename inner quantification of PO before discarding the axiom (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 2 1 (if-left-index)))) (push-proof-log 'use-axiom (cons 2 (cons 1 (if-left-index))) po-name t) (log-remove-bool-coercion-from-if-test (if-left-index)) ;; (if H2 ;; (if PO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) (log-unnest-implies formula (if-left-index)) ;; At this point we have: ;; (if H2 (implies (and PO H1) Phi) (true)) (let ((expanded-po (expand-formula po (list* 1 1 (if-left-index))))) (log-induction-phase-2-aux formula vars (if-form-machine machine) expanded-po (cons 1 (if-left-index)) h1 h2 measured-quants nil)) ;; We now have (if H2 (implies PO Phi) (true)) (let ((idx (cons 1 (if-left-index)))) (push-proof-log 'if-equal idx `(= ,po ,po) t) ;; PO is now replaced by (if (= PO PO) PO PO) (expand-formula po (list* 1 1 idx)) (push-proof-log 'look-up (cons 2 idx) po) (expand-formula po (list* 2 1 idx)) (push-proof-log 'compute (cons 1 idx)) (push-proof-log 'if-true idx) ;; we now have the unexpanded PO ) (push-proof-log 'syntax (if-left-index)) ;; (if H2 (if PO (if Phi (true) (false)) (true)) (true)) (log-use-axiom (cons 2 (if-left-index)) po-name) (log-renames-unexpanded orig-po renamed-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 1 2 (if-left-index)))) (log-renames (mapcar #'cons po-args po-args-renames) (list* 1 2 (if-left-index))) ;; (if H2 (if PO (if qPO (if Phi (true) (false)) (true)) (true)) (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) ;; (if H2 (if PO (implies qPO Phi) (true)) (true)) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) ;; (if H2 (implies PO (implies qPO Phi)) (true)) (log-unnest-implies formula (if-left-index)) ;; (if H2 (implies (and PO qPO) Phi) (true)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'is-boolean (list* 2 1 (if-left-index)) t) ;; (if H2 (implies (if PO qPO (false)) Phi) (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (log-universal-subsumption (make-if po (make-series-of-quantification 'all po-args-renames (sublis-eq (pairlis po-args po-args-renames) renamed-po)) *false*) (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) (log-renames (mapcar #'cons po-args-renames po-args) (cons 1 (if-left-index))) (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index)))) ;; At this point we have: ;; (if H2 (implies qPO Phi) (true)) (push-proof-log 'use-axiom (cons 1 (if-left-index)) po-name t) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; (if H2 (if Phi (true) (false)) (true)) (push-proof-log 'syntax index t)) ) ;;; Recursively dive into the ``if-form'' machine, until we hit either ;;; (true) or a list of substitutions. ;;; At the top level, it logs conversion of (and PO H1) to PO. ;;; Note that PO is in "if" form. (defvar *debugging-log-induction* nil) (defun log-induction-phase-2-aux (formula vars machine po index h1 h2 measured-quants renames) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux))) (when *debugging-log-induction* (format t "~%Machine: ~S~%" machine) (format t "~%PO: ~S~%" po) (format t "~%H1: ~S~%" h1)) (cond ((true-p machine) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) ((and (if-p po) (if-p machine)) ;; (and (if test leftPO rightPO) (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 1) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) ;; ***** test is not necessarilly known to be boolean! (log-coerce-expr-for-boolean-or-bool-p (if-test h1) (list* 1 2 (if-right-index)) (make-context-for-bool-p h1 (cons 2 (if-right-index)))) (log-look-up-false-for-coercion (list* 1 2 (if-right-index))) ;;(log-look-up-false (cons 1 (cons 2 (if-right-index)))) (push-proof-log 'if-false (cons 2 (if-right-index))) ;; (if test ;; (and leftPO leftH1 rightH1) ;; (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; which is the same as PO ) ((if-p machine) ;; (and PO (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 2) ;; (if test (and PO leftH1) (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) po (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test PO (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) po (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test PO PO) (push-proof-log 'if-equal index) ;; PO ) ((if-p po) ;; (and (if test leftPO rightPO) H1) (push-proof-log 'case-analysis index 1) ;; (if test (and leftPO H1) (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; (push-proof-log 'if-equal index) ;; PO ) ((all-p machine) ;; (and po h1) ;; where h1 is of the form (all (v) expr) (cond ((member-eq (all-var h1) measured-quants) (push-proof-log 'rename-universal (and-right-index) (all-var h1) (all-var po)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) (log-induction-phase-2-aux formula vars (all-expr machine) (all-expr po) (all-expr-index) (subst-eq (all-var po) (all-var h1) (all-expr h1)) h2 measured-quants (cons (cons (all-var h1) (all-var po)) renames))) (t (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (push-proof-log 'remove-universal (and-left-index) (all-vars h1) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO expr)) (log-induction-phase-2-aux formula vars (all-expr machine) po (all-expr-index) (all-expr h1) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)))) ((and-p po) (log-induction-phase-2-aux-and formula vars machine po index h1 h2 measured-quants renames)) ;; BUT because of merging, we might have a conjunction of ;; lists of substitutions ((and-p machine) ;; (and leaf-po h1-is-and) (push-proof-log 'syntax index) ;; (if leaf-po (if (and h1a h1b ...) (true) (false)) (false)) (log-induction-phase-2-aux-aux formula vars machine po (cons 1 (if-left-index)) h1 h2) ;; (if leaf-po (if (true) (true) (false)) (false)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'is-boolean index t) ;; leaf-po ) ;; List of substitutions (t ;; (and leaf-po leaf-h1) (push-proof-log 'syntax index) ;; (if po (if h1 (true) (false)) (false)) (push-proof-log 'if-equal (if-left-index) po t) ;; (if po ;; (if po ;; (if h1 (true) (false)) ;; (if h1 (true) (false))) ;; (false)) (log-if-to-and-or (make-if po (make-if h1 *true* *false*) (make-if h1 *true* *false*)) (if-left-index)) ;; (if po ;; (and (or (not po) (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if (if h1 (true) (false)) (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 3 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if po ;; (and (if (if po (false) (true)) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if po ;; (and (if po ;; (if (false) (true) (if h1 (true) (false))) ;; (if (true) (true) (if h1 (true) (false)))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'if-false (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) ;; (if po ;; (and (if po ;; (if h1 (true) (false)) ;; (true)) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index)) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1) ;; (or PO (if H1 (true) (false)))) ;; (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) ;; (if PO ;; (and (implies PO H1) ;; (or (true) (if H1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (implies PO H!) (true)) (false)) (push-proof-log 'syntax (if-left-index) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1)) ;; (false)) (push-proof-log 'if-equal (if-left-index) h2 t) ;; (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) (if-left-index)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (sublis-eq renames (cdr machine))) (list* 1 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 1 (if-left-index)) *true*) ;; the *true* in make-not is just a fake argument ;; the value is irrelevant for ;; log-remove-bool-coercion-from-inside-connective (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2[vs]) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 1 1 1 1 (if-left-index)) *true*) ;; (if PO ;; (and (if (not (implies (true) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-implies-to-or (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or (not (true)) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 1 1 (if-left-index))) (push-proof-log 'if-true (list* 1 1 1 1 (if-left-index))) (log-or-false 1 2 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or Phi[vs1])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-or-1 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if PO ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 1 1 (if-left-index))) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 3 2 1 (if-left-index)) *true*) (log-implies-to-or (list* 1 1 3 2 1 (if-left-index))) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not PO) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index))) ;; (if PO (and (true) (or H2 (and (implies PO H1)))) (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (true) (true)) (false)) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; At this point we have (if (m< mu[vs1] mu[vs]) (true) (false)) ;; Assuming m< always returns a boolean, remove the boolean ;; coercion. (push-proof-log 'is-boolean index t) ))) (defun log-and-trues (n index) (cond ((> n 2) (push-proof-log 'syntax index) ;; (and (true) (and (true) ...)) (push-proof-log 'syntax index) ;; (if (true) (if (and (true) ...) (true) (false)) (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-and-trues (- n 1) index)) ((= n 2) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) (t ;; (and (true)) or (and) (push-proof-log 'syntax index) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) (defun log-induction-phase-2-aux-and (formula vars machine po index h1 h2 measured-quants renames) ;; (and (and POL POR) (and H1L H1R)) (cond ((and (all-p (and-left machine)) (not (member-eq (all-var (and-left h1)) measured-quants))) ;; (and PO (and (all (v) H1Lexpr) H1R) ;; Need to move quantifier out (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (log-coerce-expr-for-boolean-or-bool-p (and-right h1) (cons 2 (and-right-index)) (make-context-for-bool-p h1 (and-right-index))) ;; (and (if PO (true) (false)) ;; (and (all (v) H1Lexpr) (if H1R (true) (false))))) (push-proof-log 'remove-universal (cons 2 (and-right-index)) (all-vars (and-left h1)) t) ;; (and (if PO (true) (false)) (and (all (v) H1Lexpr) (all (v) H1R))) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'is-boolean (cons 2 (and-right-index)) t) (push-proof-log 'all-case-analysis (and-right-index) t) ;; (and (if PO (true) (false)) (all (v) (if H1Lexpr H1R (false)))) (push-proof-log 'remove-universal (and-left-index) (all-vars (and-left h1)) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if (all (v) PO) ;; (all (v) (if H1Lexpr H1R (false))) ;; (false)) (push-proof-log 'all-case-analysis index t) ;; (all (v) (if PO (if H1Lexpr H1R (false)) (false))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (all-vars (and-left h1)) *true*) index) (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO (if H1Lexpr H1R (false)))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-and po (make-if (all-expr (and-left h1)) (and-right h1) *false*)) (all-expr-index)) (list* 2 2 (all-expr-index))) (push-proof-log 'syntax (cons 2 (all-expr-index)) t) ;; (all (v) (and PO (and H1Lexpr H1R))) (log-induction-phase-2-aux formula vars (make-and (all-expr (and-left machine)) (and-right machine)) po (all-expr-index) (make-and (all-expr (and-left h1)) (and-right h1)) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)) ((and-p (and-left machine)) ;; (and (and POL POR) (and (and H1LL H1LR) H1R)) (log-associate-and-right h1 (and-right-index)) (log-induction-phase-2-aux formula vars (make-and (and-left (and-left machine)) (make-and (and-right (and-left machine)) (and-right machine))) po index (make-and (and-left (and-left h1)) (make-and (and-right (and-left h1)) (and-right h1))) h2 measured-quants renames)) (t ;; (and (and POL POR) (and H1L H1R)) (log-pair-up-ands po h1 index) ;; (and (POL H1L) (POR H1R)) (log-induction-phase-2-aux formula vars (and-left machine) (and-left po) (and-left-index) (and-left h1) h2 measured-quants renames) ;; (and POL (POR H1R)) (log-induction-phase-2-aux formula vars (and-right machine) (and-right po) (and-right-index) (and-right h1) h2 measured-quants renames) ;; (and POL POR) ))) (defun log-induction-phase-2-aux-aux (formula vars machine po index h1 h2) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux-aux))) (cond ((and-p machine) ;; (and h1a h1b ...) (loop for m in (cdr machine) for h in (cdr h1) for i = 1 then (+ i 1) do (log-induction-phase-2-aux-aux formula vars m po (cons i index) h h2)) ;; (log-and-trues (length (cdr machine)) index)) (t ;; h1 (push-proof-log 'if-equal index po t) (log-if-to-and-or (make-if po h1 h1) index) ;; (and (or (not po) h1) (or po h1)) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not po) (true) (if h1 (true) (false))) (or po h1)) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if po (false) (true)) (true) (if h1 (true) (false))) ;; (or po h1)) (push-proof-log 'case-analysis (cons 1 index) 1) (push-proof-log 'if-false (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if po (if h1 (true) (false)) (true)) ;; (or po h1)) (push-proof-log 'syntax (cons 1 index) t) ;; (and (implies po h1) (or po h1)) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) (push-proof-log 'syntax index t) ;; (and (implies po h1)) (push-proof-log 'if-equal index h2 t) ;; (if h2 (and (implies po h1)) (and (implies po h1))) (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) index) ;; (and (or (not h2) (and (implies po h1))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not h2) (true) (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (cdr machine)) (list* 1 1 1 index)) ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 1 index) *true*) ;; (and (if (not (if H2[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 index)) ;; (and (if (not H2[vs1]) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 1 1 1 index) *true*) ;; (and (if (not (implies (true) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 1 index)) ;; (and (if (not (or (not (true)) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 1 index)) (push-proof-log 'if-true (list* 1 1 1 1 index)) ;; (and (if (not (or (false) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 index)) (push-proof-log 'if-false (list* 1 1 1 index)) ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-if-test (list* 1 1 index)) ;; (and (if (if Phi[vs1] (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'case-analysis (cons 1 index) 1) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 3 2 1 index) *true*) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not po) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-or-true 2 2 (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (true)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) (true) (if (true) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-true (list* 3 2 1 index)) (push-proof-log 'if-equal (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if Phi[vs1] (true) (true) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-equal (cons 1 index)) ;; (and (true) (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) ;;; Log the conversion of (and (and a1 a2) (and b1 b2)) to ;;; (and (and a1 b1) (and a2 b2)) (defun log-pair-up-ands (left right index) (let ((a1 (and-left left)) (a2 (and-right left)) (b1 (and-left right)) (b2 (and-right right))) (push-proof-log 'if-equal index a1 t) ;; (if a1 (and (and a1 a2) (and b1 b2)) (and (and a1 a2) (and b1 b2))) (cond ((bool-p a1) (log-look-up-false (list* 1 1 (if-right-index)))) (t (log-coerce-to-bool-inside-connective left 1 (cons 1 (if-right-index))) (log-look-up-false-for-coercion (list* 1 1 (if-right-index))))) (log-and-false 1 2 (cons 1 (if-right-index))) (log-and-false 1 2 (if-right-index)) ;; (if a1 (and (and a1 a2) (and b1 b2)) (false)) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) ;; (if a1 (and (and (true) a2) (and b1 b2)) (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-true (cons 1 (if-left-index))) ;; (if a1 (and (if a2 (true) (false)) (and b1 b2)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and (make-if a2 *true* *false*) right) 1 (if-left-index)) ;; (if a1 (and a2 (and b1 b2)) (false)) (push-proof-log 'if-equal (if-left-index) (and-left right) t) ;; (if a1 (if b1 (and a2 (and b1 b2)) (and a2 (and b1 b2))) (false)) (cond ((bool-p b1) (log-look-up-false (list* 1 2 3 (if-left-index)))) (t (log-coerce-to-bool-inside-connective right 1 (list* 2 3 (if-left-index))) (log-look-up-false-for-coercion (list* 1 2 3 (if-left-index))))) (log-and-false 1 2 (list* 2 3 (if-left-index))) (log-and-false 2 2 (list* 3 (if-left-index))) ;; (if a1 (if b1 (and a2 (and b1 b2)) (false)) (false)) (push-proof-log 'look-up (list* 1 2 2 (if-left-index)) *true*) ;; (if a1 (if b1 (and a2 (and (true) b2)) (false)) (false)) (push-proof-log 'syntax (list* 2 2 (if-left-index))) (push-proof-log 'if-true (list* 2 2 (if-left-index))) ;; (if a1 (if b1 (and a2 (if b2 (true) (false))) (false)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and a2 (make-if b2 *true* *false*)) 2 (cons 2 (if-left-index))) ;; (if a1 (if b1 (and a2 b2) (false)) (false)) (push-proof-log 'if-false (if-right-index) (make-and a2 b2) t) ;; (if a1 (if b1 (and a2 b2) (false)) (if (false) (and a2 b2) (false))) (push-proof-log 'case-analysis index 1 t) ;; (if (if a1 b1 (false)) (and a2 b2) (false)) (log-coerce-if-test-to-bool index) (push-proof-log 'case-analysis (if-test-index) 1) (push-proof-log 'if-false (cons 3 (if-test-index))) ;; (if (if a1 (if b1 (true) (false)) (false)) (and a2 b2) (false)) (push-proof-log 'syntax (if-test-index) t) ;; (if (and a1 b1) (and a2 b2) (false)) (push-proof-log 'is-boolean (if-left-index)) (push-proof-log 'syntax index t) ;; (and (and a1 b1) (and a2 b2)) )) ;;; log-induction-phase-3 logs inferences that convert ;;; (all vs (implies H2 Phi)) ;;; to ;;; (all m (implies (all m1 (implies (m< m1 m) ;;; (all vs1 (implies (= m1 (mu[vs1])) ;;; Phi[vs1])))) ;;; (all vs (implies (= m (mu[vs])) Phi)))) ;;; vs is vars ;;; Phi is formula (defun log-induction-phase-3 (formula h2 vars measure m m1 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-3))) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) index)) (substitutions (mapcar #'cons vars (list-of-leading-universals h2)))) (log-label inner-index m measure) (log-label (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 inner-index)) m1 (sublis-eq substitutions measure)) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true))) (push-proof-log 'is-boolean (cons 2 inner-index)) (push-proof-log 'syntax inner-index t) ;; We now have ;; (all vs (implies (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi))) (push-proof-log 'syntax inner-index) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (if (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1])) ;; (true))) ;; Phi) ;; (true) ;; (false)) ;; (true))) ;; inner-index points to the outer if (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m (make-= m measure)) (make-if (make-implies (universally-quantify vs1 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-implies (make-m< muvs1 measure) phivs1) *true*)) formula) *true* *false*) *true*) inner-index)) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true)))) (let ((idx (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) (push-proof-log 'is-boolean (cons 2 idx))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (if (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true) ;; (false)) ;; (true))) ;; Phi) ;; (true)))) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-if (make-implies (make-m< muvs1 measure) phivs1) *true* *false*) *true*) (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'look-up (list* 1 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m1) (push-proof-log 'look-up (list* 2 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (log-move-universal-out (length vars) index) (log-move-universal-out (length vars) (list* 1 2 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'is-boolean (list* 2 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index) t) ;; We now have: ;; (all m ;; (all vs (implies (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi)))) (log-unnest-implies formula (cons 2 inner-index)) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (let ((left (make-= m measure)) (right (make-all-single m1 (universally-quantify vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (list* 1 2 inner-index)))) ;; (push-proof-log 'commute-and (list* 1 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (implies ;; (and (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (= m (mu[vs]))) ;; Phi))) (push-proof-log 'syntax (list* 1 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (= m (mu[vs])) (true) (false)) ;; (false)) ;; (if Phi (true) (false)) ;; (true)))) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true)))) ;; (repeat-log-all-case-analysis-1 (length vars) (all-expr-index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-all (list m1) (make-series-of-quantification 'all vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))) (make-if (make-if (make-= m measure) *true* *false*) (make-if formula *true* *false*) *true*) *true*) (reverse vars) nil displacement (all-expr-index))) (log-remove-universals (length vars) (cons 3 (all-expr-index))) ;; We now have: ;; (all m ;; (if (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (push-proof-log 'is-boolean (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all m ;; (implies ;; (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true))))) ;; The use of (list* 2 2 inner-index) just happens to work. ;; Should really be (append inner-index '(2 2)) (log-remove-bool-coercion-from-if-test (list* 2 2 inner-index)) (push-proof-log 'syntax (list* 2 2 inner-index) t) ;; We now have: ;; (all m (implies (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'is-boolean (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) t) (log-unnest-implies (sublis-eq substitutions formula) (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) (let* ((muvs1 (sublis-eq substitutions measure)) (left (make-= m1 muvs1)) (right (make-m< m1 m))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))))) ;; (push-proof-log 'commute-and ;; (cons 1 (append (mapcar #'(lambda (u) u 2) vars) ;; (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (implies (and (m< m1 m) (= m1 (mu[vs1]))) ;; Phi[vs1]))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'syntax (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (if (m< m1 m) ;; (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'case-analysis (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) 1) (push-proof-log 'if-false (cons 3 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (m< m1 m) ;; (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (repeat-log-all-case-analysis-1 (length vars) (list* 2 1 2 index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-m< m1 m) (make-if (make-if (make-= m1 muvs1) *true* *false*) (make-if phivs1 *true* *false*) *true*) *true*) (reverse vs1) nil displacement (list* 2 1 2 index))) (log-remove-universals (length vars) (list* 3 2 1 2 index)) ;; We now have: ;; (all m (implies (all m1 ;; (if (m< m1 m) ;; (all vs1 (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true))) ;; (true))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (log-remove-bool-coercion-from-if-test (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index)) t) (push-proof-log 'is-boolean (list* 2 2 1 2 index)) (push-proof-log 'syntax (list* 2 1 2 index) t) ;; We now have: ;; (all m (implies (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi)))) )) ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (defun repeat-log-all-case-analysis-1 (formula reversed-vars processed-vars displacement base-index) (unless (null displacement) ;; (all () (if test left right)) (let ((index (append (cdr displacement) base-index)) (left (make-series-of-quantification 'all processed-vars (if-left formula))) (right (make-series-of-quantification 'all processed-vars (if-right formula)))) (log-all-case-analysis-1 (make-all (list (car reversed-vars)) (make-if (if-test formula) left right)) index) ;; (if test (all (trailingvars) left) (all (trailingvars) right)) (repeat-log-all-case-analysis-1 formula (cdr reversed-vars) (cons (car reversed-vars) processed-vars) (cdr displacement) base-index))) ) (defun log-remove-universals (n index) (unless (zerop n) (log-remove-universals (- n 1) (all-expr-index)) (push-proof-log 'remove-universal index) ;; result is assumed to be Boolean (push-proof-log 'is-boolean index t))) ;;; This is like log-flip-universals except it moves a quantifier out ;;; instead of in. (defun log-move-universal-out (number-of-vars index) (unless (zerop number-of-vars) (log-move-universal-out (- number-of-vars 1) (all-expr-index)) (push-proof-log 'flip-universals index))) ;;; Convert ((tests1 hyp1) (tests2 hyp2) ...) to IF form. (defun if-form-machine (machine) (cond ((null machine) nil) (t (multiple-value-bind (formula rest-machine) (if-form-machine-aux (first (car machine)) 1 (second (car machine)) (cdr machine)) (when (null rest-machine) formula))))) (defun if-form-machine-aux (tests depth hyp machine) (cond ((null tests) (values (or hyp *true*) machine)) (t (let (left right rest-machine) ;; recur to make left (multiple-value-setq (left rest-machine) (if-form-machine-aux (cdr tests) (+ depth 1) hyp machine)) ;; recur to make right (multiple-value-setq (right rest-machine) (if-form-machine-aux (nthcdr depth (first (car rest-machine))) (+ depth 1) (second (car rest-machine)) (cdr rest-machine))) ;; make (if first-test left right) (values (make-if (car tests) left right) rest-machine))))) ;;; Log transformation of (implies H1 formula) to ;;; the result of apply-induction-template-to-formula. (defun log-apply-machine (machine template vars formula index bool-p) (cond ((= (length template) 1) (let ((h1 (substitute-induction-pattern-in-machine machine vars formula))) (when (and-p h1) (really-flatten-ands h1 (implies-left-index))))) (t (log-cases-if-hypothesis machine vars formula index bool-p)))) (defun log-cases-if-hypothesis (machine vars formula index bool-p) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis))) (cond ((if-p machine) ;; (implies (if t1 H1l H1r) Phi) (push-proof-log 'case-analysis index 1) ;; (if t1 (implies H1l Phi) (implies H1r Phi)) (log-cases-if (make-if (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula) (make-implies (substitute-induction-pattern-in-machine (if-right machine) vars formula) formula)) nil index) ;; (and (implies t1 (implies H1l Phi)) (implies (not t1) (implies H1r Phi))) (let ((left-test (if (and-p (if-test machine)) (cdr (if-test machine)) (list (if-test machine))) ) (right-test (cond ((not-p (if-test machine)) (log-not-not (cons 1 (and-right-index))) ;; (and (implies t1 (implies H1l Phi) ;; (implies (if t1test (true) (false)) ;; (implies H1r Phi))) (push-proof-log 'syntax (and-right-index)) ;; (and (implies t1 (implies H1l Phi)) ;; (if (if t1test (true) (false)) ;; (if (implies H1r Phi) (true) (false)) ;; (true))) (log-remove-bool-coercion-from-if-test (and-right-index)) (push-proof-log 'syntax (and-right-index) t) ;; (and (implies t1 (implies H1l Phi)) ;; (implies t1test (implies H1r Phi))) (if (and-p (not-expr (if-test machine))) (cdr (not-expr (if-test machine))) (list (not-expr (if-test machine))))) (t (list (make-not (if-test machine)))))) ;; (and (implies left-test (implies H1l Phi)) ;; (implies right-test (implies H1r Phi))) ;; left is result of processing (implies H1l Phi) (left-list (log-cases-if-hypothesis (if-left machine) vars formula (cons 2 (and-left-index)) (make-context-for-bool-p (make-implies (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-left-index)))) ;; right is result of processing (implies H1r Phi) (right-list (log-cases-if-hypothesis (if-right machine) vars formula (cons 2 (and-right-index)) (make-context-for-bool-p (make-implies (if (not-p (if-test machine)) (not-expr (if-test machine)) (make-not (if-test machine))) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-right-index))))) ;; (and (implies left-test left) ;; (implies right-test right)) (let ((left-result (cond ((= (length left-list) 1) ;; left-list is ((hyp)), ;; left is (implies hyp Phi), ;; (and (implies left-test (implies hyp Phi)) ;; (implies right-test right)) (list (log-cases-if-hypothesis-aux left-test (car left-list) formula (and-left-index))) ;; (and (implies (and left-test hyp) Phi) ;; (implies right-test right)) ) (t ;; left-list is (hyp1 hyp2 ...) ;; left is (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (implies left-test (and (implies hyp1 Phi) ...)) ;; (implies right-test Phi)) (log-cases-implies left-list (and-left-index)) ;; (and (and (implies left-test (implies hyp1 Phi)) ;; (implies left-test (implies hyp2 Phi)) ;; ...) ;; (implies right-test right)) (loop for l in left-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux left-test l formula (cons i (and-left-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (implies right-test right)) ))) (right-result (cond ((= (length right-list) 1) (list (log-cases-if-hypothesis-aux right-test (car right-list) formula (and-right-index)))) (t (log-cases-implies right-list (and-right-index)) (loop for r in right-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux right-test r formula (cons i (and-right-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (and (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...)) )))) ;; Log the AND unexpansions performed by ;; apply-induction-template-to-formula. ;; Seems to expect (and (implies ...) (implies ...)) (really-flatten-ands (make-and (if (= (length left-result) 1) (let ((h (append ; left-test nil (car left-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in left-result collect (let ((h (append ; left-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula))))) (if (= (length right-result) 1) (let ((h (append ; right-test nil (car right-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in right-result collect (let ((h (append ; right-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)))))) index) ;; (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ... ;; (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...) (append left-result right-result)) ;; )) ((true-p machine) ;; (implies (true) Phi) (push-proof-log 'syntax index) (push-proof-log 'if-true index) ;; (if Phi (true) (false)) (when (or (bool-p formula) bool-p) ;; almost certain but just in case (log-remove-coercion-for-boolean-or-bool-p formula index bool-p)) '(())) ((and (consp machine) (eq (car machine) *induction-pattern*)) ;; (P ...) (let ((substs (mapcar #'cons vars (cdr machine)))) (list (list (sublis-eq substs formula))))) ((and-p machine) (list (mapcar #'(lambda (u) (substitute-induction-pattern-in-machine u vars formula)) (cdr machine)))) (t (list (list (substitute-induction-pattern-in-machine machine vars formula)))) ;; (t (list (list machine))) )) (defun log-cases-implies (hyp-list index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-implies))) ;; hyp-list is a list of lists of conjuncts ;; (implies test (and (implies hyp1 Phi) (implies hyp2 Phi) ...)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if test (and (implies hyp1 Phi) (implies hyp2 Phi) ...) (true)) (log-convert-true-to-and (length hyp-list) (if-right-index)) ;; (if test ;; (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (true) (true) ...)) (push-proof-log 'case-analysis index 0 t) ;; (and (if test (implies hyp1 Phi) (true)) ;; (if test (implies hyp2 Phi) (true)) ;; ...) (loop for i from 1 to (length hyp-list) do (progn (push-proof-log 'is-boolean (list* 2 i index)) (push-proof-log 'syntax (cons i index) t))) ;; (and (implies test (implies hyp1 Phi)) ;; (implies test (implies hyp2 Phi)) ;; ...) ) ;;; test is a list of conjuncts ;;; hyp is a list of conjuncts (defun log-cases-if-hypothesis-aux (test hyp formula index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis-aux))) (cond ((null hyp) test) (t ;; (implies test (implies (and hyp) Phi)) (log-unnest-implies formula index) ;; (implies (and test (and hyp)) Phi) ;; Log the AND unexpansions performed by make-induction-lemma-case. (let ((result (really-flatten-ands (list 'and (if (= (length test) 1) (car test) (cons 'and test)) (if (= (length hyp) 1) (car hyp) (cons 'and hyp))) (implies-left-index)))) (cond ((and-p result) (cdr result)) ((and (if-p result) (true-p (if-left result)) (false-p (if-right result)) (bool-p (if-test result))) (push-proof-log 'is-boolean (implies-left-index) t) (list (if-test result))) (t (list result))))))) (defun substitute-induction-pattern-in-machine (machine vars formula) (cond ((consp machine) (cond ((eq (car machine) *induction-pattern*) (let ((subst (mapcar #'cons vars (cdr machine)))) (sublis-eq subst formula))) (t (cons (car machine) (loop for m in (cdr machine) collect (substitute-induction-pattern-in-machine m vars formula)))))) (t machine)))
4064
;;;====================================================================== ;;; | ;;; Copyright (c) 2021, <NAME>, <NAME>, | ;;; <NAME>, <NAME> and <NAME>. | ;;; All Rights Reserved. | ;;; | ;;; Redistribution and use in source and binary forms, with or without | ;;; modification, are permitted provided the following conditions are | ;;; met: | ;;; | ;;; 1. Redistributions of source code must retain the above copyright | ;;; notice, this list of conditions and the following disclaimer. | ;;; 2. Redistributions in binary form must reproduce the above | ;;; copyright notice, this list of conditions and the following | ;;; disclaimer in the documentation and/or other materials provided | ;;; with the distribution. | ;;; | ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ;;; USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ;;; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ;;; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ;;; THE POSSIBILITY OF SUCH DAMAGE. | ;;; | ;;;====================================================================== (in-package "ZK") ;;; Boyer-Moore style induction. ;;; All the heuristics of Boyer-Moore induction plus the concept of ;;; a scheme being inherently flawed when weeding out flawed ;;; induction schemes. ;;; More than half of the code has to do with proof logging. ;;; ----- Structures for use during induction. ;;; Structure for the induction cases. An induction template is just ;;; a list of induction cases. (defstruct (induction-case :named) tests ;list of tests for the case substitutions ;list of substitution lists (one for each recursive call) calls ;list of recursive calls (*p*'s) in hypothesis hypothesis) ;conjunction of *p*'s possibly universally quantified ;;; Structure for representing the induction schemes. (defstruct (scheme :named) template ;induction template for the scheme changing ;changing variables unchanging ;unchanging variables changeables ;changeable variables unchangeables ;unchangeable variables score ;for ranking schemes flawed ;flawed scheme origin) ;term that suggested the induction scheme ;;; ==================== Prover Commands ==================== (defcmd induct (&optional term :display) ((:string "Try to apply an induction scheme to the current subformula. Normally, the induction scheme is heuristically chosen. However, you may explicitly supply a term on which to induct. The term on which to induct does not have to be in the current subformula.")) (let ((formula (display-formula display)) (template nil) (origin nil)) (if (null term) (let ((schemes (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula))))) (when schemes ;; Need to choose a scheme. (let ((scheme (select-induction-scheme schemes))) ;; Set the template. (setq template (scheme-template scheme) origin (scheme-origin scheme))))) (without-proof-logging ;; No need to choose a scheme in this case. (and (parse-formula-phase-1 term) (not (formula-unmentionable-p term)) (subset-p (unique (list-of-free-variables-unexpanded term)) (unique (list-of-free-variables-unexpanded formula))) ;; Set the template. (setq template (third (get-induction-template-for-term (rename-quantified-variables (expand-formula term nil) nil) (unique (list-of-free-variables-unexpanded formula)))) origin term)))) (when template ;; Apply the template. (let* ((vars (unique (list-of-free-variables-unexpanded formula))) (machine (machine-from-template template vars)) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (event (get-event (car origin))) (measured-expressions (mapcar #'(lambda (u v) (and u v)) (ufunction-measured-subset event) (cdr origin))) (measured-positions (mapcar #'(lambda (u) (occurs-in u measured-expressions)) vars)) (measured-quants (measured-quants-in-machine machine measured-positions)) (measure (sublis-eq (pairlis (ufunction-args event) (cdr origin)) (ufunction-measure event)))) (log-induction formula vars machine origin measure measured-quants (display-base-index display)) (push-proof-log 'marker index (list 'checkpoint (make-implies h1 formula))) ;; (implies H1 Phi) where H1 is induction machine in IF form. (log-apply-machine (if-form-machine machine) template vars formula index (make-context-for-bool-p (make-all (last vars) *true*) (cdr index)))) (push-proof-log 'marker index (list 'checkpoint (apply-induction-template-to-formula template formula))) ;; Now really apply the template. (let ((result (unexpand-formula (unrename-quantified-variables (expand-formula (apply-induction-template-to-formula template formula) index) index) index))) (make-display :formula result :explain `((:string "Inducting using the following scheme ...") ;; **** Unrename may be different from above? (:newline) (:formula ,(without-proof-logging (unexpand-formula (unrename-quantified-variables (expand-formula (scheme-description template formula) nil) nil) nil))) (:newline) (:string "produces ..."))))))) ;;; Printable representation of a scheme that goes in a proof detail. (defun scheme-description (induction-template formula) (let* ((vars (sort (unique (list-of-free-variables-unexpanded formula)) #'alphalessp)) (form (cons '*p* vars))) (apply-induction-template-to-formula induction-template form))) (defcmd prove-by-induction (:display) ((:string "Try to prove the current subformula with automatic induction (see") (:help-name induction) (:punctuation ").") (:string "A non-inductive proof is first attempted. If this fails, the theorem prover will try to apply an induction scheme to the formula. The theorem prover may discard the non-inductive proof prior to the induction.")) (let* ((original-formula-worth-inducting (worth-inducting-p (display-formula display))) (success (reduce))) (cond ((literal-p (display-formula *current-display*)) success) ((and success original-formula-worth-inducting) (back) (induct) (reduce) t) ;have succeeded ((worth-inducting-p (display-formula *current-display*)) (induct) (reduce) t) ;induction performed (t success)))) ;;; Decide whether or not we should induct on the formula. (defun worth-inducting-p (formula) (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula)))) ;;; ==================== Supporting Functions ==================== ;;; ----- Functions used to prepare proof logging. ;;; Construct induction machine from template. May be different ;;; from induction machine stored in the struct for the recursive ;;; function, although the format is the same (a list of cases where ;;; each case has a list of assumptions and an induction hypothesis). (defun machine-from-template (template vars) (mapcar #'(lambda (u) (let ((call-substitutions (mapcar #'(lambda (c s) (cons c (sublis-eq s (cons *induction-pattern* vars)))) (induction-case-calls u) (induction-case-substitutions u)))) (list (induction-case-tests u) (sublis-equal call-substitutions (induction-case-hypothesis u))))) template)) ;;; List of bound variables in the hypotheses of the machines that ;;; occur in measured positions, needed for proof logging. (defun measured-quants-in-machine (machine measured-positions) (let ((measured-expressions (loop for call in (list-of-calls *induction-pattern* machine) append (loop for expr in (cdr call) for measured in measured-positions when measured collect expr))) (bound (loop for case in machine append (list-of-bound-variables-unexpanded (second case))))) (remove-if-not #'(lambda (u) (occurs-in u measured-expressions)) bound))) ;;; ==================== Templates ==================== ;;; ----- Apply Template ;;; Take an induction template and a formula, and apply the template ;;; to produce an equivalent formula. (defun apply-induction-template-to-formula (induction-template formula) ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (m) (make-induction-lemma-case m formula)) induction-template) *true*)) ;;; Make an induction case. (defun make-induction-lemma-case (induction-case formula) (let ((induction-hypothesis (substitute-hypothesis (induction-case-substitutions induction-case) (induction-case-calls induction-case) (induction-case-hypothesis induction-case) formula))) (let ((result (make-implies ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (u) (if (and (if-p u) (true-p (if-left u)) (false-p (if-right u))) (if-test u) u)) (append (induction-case-tests induction-case) (list-of-induction-hypotheses induction-hypothesis))) *true*) formula))) result))) (defun list-of-induction-hypotheses (induction-hypothesis) (cond ((and-p induction-hypothesis) (cdr induction-hypothesis)) ((null induction-hypothesis) nil) (t (list induction-hypothesis)))) (defun substitute-hypothesis (subst calls hypo formula) (sublis-equal (pairlis calls (mapcar #'(lambda (u) (sublis-eq u formula)) subst)) hypo)) ;;; ----- Make Template ;;; Make an induction template from a recursive definition and a ;;; term. It is assumed that the template suggested by the recursive ;;; definition applies to the term. (defun construct-induction-template (args subst changeables unchangeables machine) (let ((instantiated-machine (sublis-eq subst machine))) (mapcar #'(lambda (m) (without-proof-logging (let* ((hypothesis (rename-quantified-variables (second m) nil)) (calls (list-of-calls *induction-pattern* hypothesis))) (make-induction-case :tests (first m) :substitutions (construct-induction-substitutions args changeables unchangeables calls) :calls calls :hypothesis hypothesis)))) instantiated-machine))) ;;; Construct the substitutions for the calls of a machine case. (defun construct-induction-substitutions (args changeables unchangeables calls) (when calls (cons (construct-induction-substitution-case args changeables unchangeables (car calls)) (construct-induction-substitutions args changeables unchangeables (cdr calls))))) ;;; Construct the substitution for a call of a machine case. Illegal ;;; substitutions are deleted here. (defun construct-induction-substitution-case (args changeables unchangeables call) (let ((subst (mapcar #'cons args (cdr call))) (substitution nil)) (mapc #'(lambda (u v) (or ;; never substitute unchangeables (member-eq (car u) unchangeables) ;; never substitute non-variables (not (variable-p (car u))) ;;(eq (car u) (cdr u)) (let ((entry (assoc-eq (car u) substitution))) (setq substitution (if (and entry v) (cons u (remove-eq entry substitution)) (cons u substitution)))))) subst changeables) (reverse substitution))) ;;; ----- Changing/Unchangeable Variables. ;;; Given an induction template, return the list of changing arguments ;;; (Boyer-Moore's terminology - from "A Computational Logic"). (defun changing-induction-variables-in-template (induction-template) (and (not (null induction-template)) (unique (union-eq (variables-substituted (induction-case-substitutions (car induction-template))) (changing-induction-variables-in-template (cdr induction-template)))))) ;;; Given a set of substitutions, return a unique list of variables that ;;; are substituted for (with something other than itself). (defun variables-substituted (case-substitutions) (and (not (null case-substitutions)) (unique (union-eq (loop for pair in (car case-substitutions) when (not (eq (car pair) (cdr pair))) collect (car pair)) (variables-substituted (cdr case-substitutions)))))) ;;; List of unchangeables as defined in Boyer & Moore's "A Computational ;;; Logic." These are variables in expressions appearing in measured ;;; positions that cannot change. (defun list-of-unchangeables (measured-positions unchanging-positions term-arguments) (let ((unchangeable-expressions (mapcar #'(lambda (u v w) (and u v w)) measured-positions unchanging-positions term-arguments))) (unique (mapcan #'list-of-free-variables-unexpanded unchangeable-expressions)))) ;;; Return t if the elements of the given list are distinct variables. (defun is-list-of-distinct-variables-p (list-of-expr) (let ((checked-variables nil) (success t)) (dolist (e list-of-expr) (if (or (not (variable-p e)) (member-eq e checked-variables)) (return (setq success nil)) (push e checked-variables))) success)) ;;; =============== Choose Scheme =============== ;;; ----- Called first, get candidate induction schemes. ;;; Collect all induction schemes suggested by terms in the formula. (defun get-induction-schemes (formula free-vars) (and (consp formula) (let ((induction-template (get-induction-template-for-term formula free-vars))) (cond (induction-template (let ((changeables (first induction-template)) (unchangeables (second induction-template)) (template (third induction-template))) (let ((changing (changing-induction-variables-in-template template)) (args (cdr formula))) (cons (make-scheme :template template :changing changing :unchanging (set-difference-equal (unique (loop for x in args append (list-of-free-variables-unexpanded x))) changing) :changeables changeables :unchangeables unchangeables :score (rdiv (length changing) (length args)) ;; Set if inherently flawed. :flawed (flawed-template-p template args) :origin formula) (loop for expr in formula append (get-induction-schemes expr free-vars)))))) (t (loop for expr in formula append (get-induction-schemes expr free-vars))))))) ;;; Construct an induction template for a term when there is an ;;; induction template that applies to the term. (defun get-induction-template-for-term (term free-vars) (and (consp term) (atom (first term)) (let ((name (get-event (first term)))) (and (ufunction-p name) (not (event-inaccessible-p name)) (ufunction-recursive name) (every #'(lambda (v) (occurs-in v free-vars)) (unique (list-of-free-variables-unexpanded term))) (let ((measured-positions (ufunction-measured-subset name)) (unchanging-positions (ufunction-unchangeables name)) (term-arguments (cdr term))) (let ((changeables (mapcar #'(lambda (u v w) (and u (not v) w)) measured-positions unchanging-positions term-arguments)) (unchangeables (list-of-unchangeables measured-positions unchanging-positions term-arguments))) (and (induction-template-applies-p changeables unchangeables) (list (remove-if #'null changeables) unchangeables (construct-induction-template (cdr term) (pairlis (ufunction-args name) (cdr term)) changeables unchangeables (ufunction-machine name)))))))))) ;;; Return t if the changeables are distinct variables and the ;;; intersection of changeables and unchangeables is empty. (defun induction-template-applies-p (changeables unchangeables) (let ((changeable-list (remove-if #'null changeables))) (and (is-list-of-distinct-variables-p changeable-list) (null (intersection-eq changeable-list unchangeables))))) ;;; Code to help determine if an induction scheme is inherently "flawed". ;;; Some cases flawed. (defun flawed-template-p (template args) (some #'(lambda (u) (flawed-template-case u args)) template)) ;;; All calls flawed. (defun flawed-template-case (case args) (let ((calls (induction-case-calls case))) (and calls (every #'(lambda (u) (flawed-template-call u args)) calls)))) ;;; Flawed call. (defun flawed-template-call (call args) (some #'(lambda (u v) (and (not (equal u v)) (not (variable-p v)))) (cdr call) args)) ;;; ----- Select Induction Scheme ;;; Selection goes through 3 filtering steps before a winner is picked: ;;; 1. Remove subsumed schemes (and increase scores of subsuming schemes). ;;; 2. Merge schemes, removing the original schemes merged. ;;; 3. Remove flawed schemes if possible. (defun select-induction-scheme (list-of-schemes) (superimpose-cases (pick-winner (list-of-unflawed-schemes (list-of-merged-schemes (list-of-unsubsumed-schemes list-of-schemes)))))) ;;; Pick an induction scheme with the highest score. (defun pick-winner (list-of-schemes) (let ((champ (first list-of-schemes))) (dolist (challenger (cdr list-of-schemes)) (when (> (scheme-score challenger) (scheme-score champ)) (setq champ challenger))) champ)) ;;; =============== Code for Manipulating Schemes =============== ;;; ----- Superimpose Scheme Cases ;;; Once a winner is picked, superimpose (merge) induction cases that ;;; have the same test (condition). (defun superimpose-cases (scheme) (when scheme (let ((template (scheme-template scheme)) (acc nil)) (dolist (case template) (unless (dolist (c acc) (when (and (subsetp-equal (induction-case-tests c) (induction-case-tests case)) (subsetp-equal (induction-case-tests case) (induction-case-tests c))) (setf (induction-case-substitutions c) (append (induction-case-substitutions c) (induction-case-substitutions case))) (setf (induction-case-calls c) (append (induction-case-calls c) (induction-case-calls case))) (setf (induction-case-hypothesis c) (make-simplified-and (induction-case-hypothesis c) (induction-case-hypothesis case))) (simplify-superimposed-case c) (return t))) (push case acc))) (setf (scheme-template scheme) (reverse acc)))) scheme) (defun simplify-superimposed-case (case) (when (and-p (induction-case-hypothesis case)) (let ((mask (simplify-superimposed-case-aux nil (cdr (induction-case-hypothesis case))))) (setf (induction-case-substitutions case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-substitutions case))) (setf (induction-case-calls case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-calls case))) (setf (induction-case-hypothesis case) (mapcan #'(lambda (x y) (and x (list y))) mask (if (and-p (induction-case-hypothesis case)) (cdr (induction-case-hypothesis case)) (induction-case-hypothesis case)))) (setf (induction-case-hypothesis case) (if (null (cdr (induction-case-hypothesis case))) (car (induction-case-hypothesis case)) (cons 'and (induction-case-hypothesis case))))))) (defun simplify-superimposed-case-aux (acc hyps) (cond ((null hyps) nil) ((member-equal (car hyps) acc) (cons nil (simplify-superimposed-case-aux acc (cdr hyps)))) (t (cons t (simplify-superimposed-case-aux (cons (car hyps) acc) (cdr hyps)))))) ;;; ----- Scheme Subsumption ;;; Given a list of induction schemes, it deletes those that are ;;; subsumed by other schemes. This is the first filtering step. (defun list-of-unsubsumed-schemes (list-of-schemes) (and list-of-schemes (list-of-unsubsumed-schemes-aux (first list-of-schemes) (list-of-unsubsumed-schemes (cdr list-of-schemes)) nil))) (defun list-of-unsubsumed-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((next-scheme (first unprocessed-schemes))) (cond ((scheme-subsumes-scheme-p scheme next-scheme) (list-of-unsubsumed-schemes-aux (make-scheme :template (scheme-template scheme) :changing (scheme-changing scheme) :unchanging (scheme-unchanging scheme) :changeables (scheme-changeables scheme) :unchangeables (scheme-unchangeables scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed scheme) :origin (scheme-origin scheme)) (cdr unprocessed-schemes) processed-schemes)) ((scheme-subsumes-scheme-p next-scheme scheme) (append (cdr unprocessed-schemes) (cons (make-scheme :template (scheme-template next-scheme) :changing (scheme-changing next-scheme) :unchanging (scheme-unchanging next-scheme) :changeables (scheme-changeables next-scheme) :unchangeables (scheme-unchangeables next-scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed next-scheme) :origin (scheme-origin next-scheme)) processed-schemes))) (t (list-of-unsubsumed-schemes-aux scheme (cdr unprocessed-schemes) (cons next-scheme processed-schemes))))))) ;;; Subsumption check for induction schemes as described in ;;; Boyer & Moore's "A Computational Logic." ;;; Return t if the first scheme subsumes the second scheme. (defun scheme-subsumes-scheme-p (scheme-1 scheme-2) (and (subset-p (scheme-changing scheme-2) (scheme-changing scheme-1)) (subset-p (scheme-unchanging scheme-2) (scheme-unchanging scheme-1)) (scheme-cases-subsume-p (scheme-template scheme-1) (scheme-template scheme-2)))) ;;; For cases of a scheme to subsume cases of another scheme each case of ;;; the latter scheme must be subsumed by a unique case of the former scheme. (defun scheme-cases-subsume-p (template-1 template-2) (or (null template-2) (multiple-value-bind (subsumed updated-template) (scheme-case-subsumed-by (first template-2) template-1 nil) (and subsumed (scheme-cases-subsume-p updated-template (cdr template-2)))))) ;;; Determine if a case is subsumed by a another case in a template. ;;; If successful it will return two values: t and the list of cases ;;; in the template minus the case that subsumes the first case. (defun scheme-case-subsumed-by (case template updated-template) (cond ((null template) (values nil updated-template)) ((scheme-single-case-subsumes-p (first template) case) (values t (append (cdr template) updated-template))) (t (scheme-case-subsumed-by case (cdr template) (cons (car template) updated-template))))) ;;; Return t if the first case subsumes the second case. (defun scheme-single-case-subsumes-p (case-1 case-2) (and (subset-p (induction-case-tests case-2) (induction-case-tests case-1)) (substitutions-subsumes-substitutions-p (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) ;;; Return t if a list of substitutions subsumes a second list. (defun substitutions-subsumes-substitutions-p (list-of-sublis-1 list-of-sublis-2) (or (null list-of-sublis-2) (multiple-value-bind (subsumed updated-list) (substitution-subsumed-by-list (first list-of-sublis-2) list-of-sublis-1 nil) (and subsumed (substitutions-subsumes-substitutions-p updated-list (cdr list-of-sublis-2)))))) ;;; Return a success indicator and the modified list of substitutions ;;; if the substitution is subsumed by a substitution in the list. ;;; The modified list will have the subsuming substitution removed. (defun substitution-subsumed-by-list (subst list-of-subst updated-list) (cond ((null list-of-subst) (values nil updated-list)) ((substitution-subsumed-by subst (first list-of-subst)) (values t (append (cdr list-of-subst) updated-list))) (t (substitution-subsumed-by-list subst (cdr list-of-subst) (cons (car list-of-subst) updated-list))))) (defun substitution-subsumed-by (subst1 subst2) (cond ((null subst1) t) (t (let ((match (assoc-eq (caar subst1) subst2))) (and match (expr-occurs (cdar subst1) (cdr match)) (substitution-subsumed-by (cdr subst1) (remove-equal match subst2))))))) ;;; ----- Merging Schemes ;;; Given a list of schemes, it will delete those that can be merged into ;;; other schemes. This is the second filtering step. (defun list-of-merged-schemes (list-of-schemes) (and list-of-schemes (list-of-merged-schemes-aux (first list-of-schemes) (list-of-merged-schemes (cdr list-of-schemes)) nil))) (defun list-of-merged-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((merged (merge-schemes scheme (first unprocessed-schemes)))) (if merged (list-of-merged-schemes-aux merged (append (cdr unprocessed-schemes) processed-schemes) nil) (list-of-merged-schemes-aux scheme (cdr unprocessed-schemes) (cons (first unprocessed-schemes) processed-schemes)))))) ;;; Return the merged scheme if one of the schemes can be merged into ;;; the other scheme. (defun merge-schemes (scheme-1 scheme-2) (and (not (null (intersection-eq (scheme-changing scheme-1) (scheme-changing scheme-2)))) (null (intersection-eq (scheme-unchanging scheme-1) (scheme-changing scheme-2))) (null (intersection-eq (scheme-unchanging scheme-2) (scheme-changing scheme-1))) ;; only merge into a scheme which has no quantified hypothesis (or (make-merged-scheme scheme-2 scheme-1 (merge-templates (scheme-template scheme-2) (scheme-template scheme-1))) (make-merged-scheme scheme-1 scheme-2 (merge-templates (scheme-template scheme-1) (scheme-template scheme-2)))))) (defun make-merged-scheme (scheme-1 scheme-2 merged-template) (and merged-template (make-scheme :template merged-template :changing (unique (union-eq (scheme-changing scheme-1) (scheme-changing scheme-2))) :unchanging (unique (union-eq (scheme-unchanging scheme-1) (scheme-unchanging scheme-2))) :changeables (scheme-changeables scheme-2) :unchangeables (scheme-unchangeables scheme-2) :score (+ (scheme-score scheme-1) (scheme-score scheme-2)) :flawed (or (scheme-flawed scheme-1) (scheme-flawed scheme-2)) :origin (scheme-origin scheme-2)))) ;;; Return the merged template if the first template can be merged into ;;; the second one. (defun merge-templates (template-1 template-2) (and (<= (length template-1) (length template-2)) (let ((template (merge-templates-stage-1 template-1 template-2))) (when template (merge-template-stage-2 template-1 template-2))))) ;;; In stage 1, try to merge each case of the first template into a unique ;;; case of the second template. If successful it will return the merged ;;; template. (defun merge-templates-stage-1 (template-1 template-2) (merge-templates-stage-1-aux template-1 template-2 (mapcar #'(lambda (u) u nil) template-2))) (defun merge-templates-stage-1-aux (template-1 template-2 merged-cases) (cond ((null template-1) template-2) ((null (induction-case-substitutions (car template-1))) (merge-templates-stage-1-aux (cdr template-1) template-2 merged-cases)) (t (multiple-value-bind (template merged) (merge-templates-stage-1-aux-aux (car template-1) template-2 merged-cases nil nil) (when template (merge-templates-stage-1-aux (cdr template-1) template merged)))))) (defun merge-templates-stage-1-aux-aux (case template merged tmp mrg) (cond ((null template) (values nil nil)) (t (let ((merged-case (and (null (car merged)) (merge-cases-1 case (car template))))) (cond (merged-case (values (revappend tmp (cons merged-case (cdr template))) (revappend mrg (cons t (cdr merged))))) (t (merge-templates-stage-1-aux-aux case (cdr template) (cdr merged) (cons (car template) tmp) (cons (car merged) mrg)))))))) ;;; In stage 2, try to merge each case of template-1 into as many cases ;;; of template-2 as possible. This stage will always be successful. (defun merge-template-stage-2 (template-1 template-2) (cond ((null template-2) nil) ((null (induction-case-substitutions (car template-2))) (cons (car template-2) (merge-template-stage-2 template-1 (cdr template-2)))) (t (cons (merge-template-stage-2-aux template-1 (car template-2)) (merge-template-stage-2 template-1 (cdr template-2)))))) (defun substitutions-in-template (template) (unless (null template) (append (induction-case-substitutions (car template)) (substitutions-in-template (cdr template))))) (defun bound-variables-in-template (template) (unless (null template) (append (list-of-bound-variables (induction-case-hypothesis (car template))) (bound-variables-in-template (cdr template))))) (defun merge-template-stage-2-aux (template case-2) (multiple-value-bind (result s1 rs rc) (merge-cases-2 (induction-case-hypothesis case-2) (induction-case-substitutions case-2) (substitutions-in-template template) nil nil) (if (null s1) (make-induction-case :tests (induction-case-tests case-2) :substitutions (reverse rs) :calls (reverse rc) :hypothesis (make-series-of-quantification 'all (intersection-eq (unique (bound-variables-in-template template)) (list-of-all-variables result)) result)) case-2))) (defun merge-cases-2 (expr s1 s2 rs rc) (cond ((atom expr) (values expr s1 rs rc)) ((eq (car expr) *induction-pattern*) (let ((s nil) (c nil)) (loop for ss in s2 do (let ((merged (merge-sublis ss (car s1)))) (when (and merged (not (equal (remove-equal-subst merged) (remove-equal-subst (car s1))))) (push merged s) (push (list* *induction-pattern* (gensym) (cdr expr)) c)))) (cond (s (values (cons 'and (revappend c (list expr))) (cdr s1) (append s (cons (car s1) rs)) (append c (cons expr rc)))) (t (values expr (cdr s1) (cons (car s1) rs) (cons expr rc)))))) (t (let ((expr-stack nil) (exp nil) (ts1 s1) (trs rs) (trc rc)) (loop for e in expr do (progn (multiple-value-setq (exp ts1 trs trc) (merge-cases-2 e ts1 s2 trs trc)) (push exp expr-stack))) (values (reverse expr-stack) ts1 trs trc))))) (defun remove-equal-subst (substitution) (remove-if #'(lambda (u) (eq (car u) (cdr u))) substitution)) ;;; Return the merged case if the first case can be merged into the ;;; second case. (defun merge-cases-1 (case-1 case-2) (unless (null (induction-case-substitutions case-2)) (let ((merged-subst (merge-substitutions (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) (and merged-subst (make-induction-case :tests (induction-case-tests case-2) :substitutions merged-subst :calls (induction-case-calls case-2) :hypothesis (make-series-of-quantification 'all (unique (list-of-bound-variables (induction-case-hypothesis case-1))) (induction-case-hypothesis case-2))))))) ;;; Return the merged list of substitutions if the first list of ;;; substitutions can be merged into the second list. (defun merge-substitutions (subst-1 subst-2) (let ((merged-subst (merge-substitutions-aux subst-1 subst-2 nil))) (when merged-subst (revappend merged-subst subst-2)))) (defun merge-substitutions-aux (subst-1 subst-2 merged-subst) (cond ((null subst-1) merged-subst) ((null subst-2) nil) (t (multiple-value-bind (merged updated-subst) (merge-sublis-with-subst (first subst-1) subst-2 nil) (when merged (merge-substitutions-aux (cdr subst-1) updated-subst (cons merged merged-subst))))))) ;;; Return the merged substitution and the modified list of substitutions ;;; if the substitution can be merged into a substitution from the list ;;; of substitutions. The modified list will have the merged substitution ;;; removed. (defun merge-sublis-with-subst (sublis list-of-substs updated-subst) (cond ((null list-of-substs) (values nil nil)) (t (let ((merged (merge-sublis sublis (first list-of-substs)))) (if merged (values merged (revappend updated-subst (cdr list-of-substs))) (merge-sublis-with-subst sublis (cdr list-of-substs) (cons (car list-of-substs) updated-subst))))))) ;;; Return the merged substitution if the first substitution can be ;;; merged into the second substitution. (defun merge-sublis (sublis-1 sublis-2) (let ((overlap (intersection-eq (mapcar #'car sublis-1) (mapcar #'car sublis-2)))) (and overlap (consistent-overlap-p overlap sublis-1 sublis-2) (some #'(lambda (u) (neq u (cdr (assoc-eq u sublis-1)))) overlap) (append sublis-2 (remove-if #'(lambda (u) (member-equal u sublis-2)) sublis-1))))) ;;; Return t if the overlapping symbols are consistently substituted ;;; by the two substitutions (defun consistent-overlap-p (overlap sublis-1 sublis-2) (or (null overlap) (and (equal (assoc-eq (first overlap) sublis-1) (assoc-eq (first overlap) sublis-2)) (consistent-overlap-p (cdr overlap) sublis-1 sublis-2)))) ;;; ----- Flawed Schemes ;;; Remove flawed schemes. If every scheme is flawed, try just removing ;;; all "really flawed" schemes. If all the schemes are really flawed, ;;; none are removed. This is the 3rd and last filtering step. (defun list-of-unflawed-schemes (list-of-schemes) (or (remove-if #'(lambda (u) (scheme-flawed-p u list-of-schemes)) list-of-schemes) (remove-if #'(lambda (u) (scheme-really-flawed-p u list-of-schemes)) list-of-schemes) list-of-schemes)) ;;; Return t if the scheme is flawed with respect to a list of schemes. ;;; This is used for weeding out flawed schemes as described in BM's ACL. (defun scheme-flawed-p (scheme list-of-schemes) (let ((changeables (scheme-changeables scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (or (intersection-eq changeables (scheme-changing s)) (intersection-eq changeables (scheme-unchanging s)))) (return t))))) ;;; Boyer-Moore implementation in thm and nqthm added a second (weaker) ;;; pass in case everything is weeded out by the first pass. We added ;;; our own improvisation to Boyer-Moore's 2nd pass. (defun scheme-really-flawed-p (scheme list-of-schemes) (or (scheme-flawed scheme) ; our own improvisation ;; BM's enhancement in thm and nqthm (let ((changing (scheme-changing scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (intersection-eq changing (scheme-unchanging s))) (return t)))))) ;;; =============== Code to Log Induction =============== ;;; Logs conversion of ;;; (all vs Phi) ;;; to ;;; (all vs (implies H1 Phi)) ;;; where H1 is the "machine" (induction hypothesis) in IF form. (defun log-induction (formula vars machine term measure measured-quants index) (let ((m (genvar (input-variable-p '|)M|))) (m1 (genvar (input-variable-p '|)M1|))) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (h2 (make-h2 measure vars formula))) ;; Start with (all vs Phi) ;; Note that H2 is the strong induction hypothesis for formula ;; using the supplied measure. H1 is the actual instantiated ;; induction hypothesis. (log-induction-phase-1 formula vars h1 h2 index) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-2 formula vars machine term (append (mapcar #'(lambda (u) u 2) vars) (cons 2 (if-test-index))) h1 h2 measured-quants) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies H2 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-3 formula h2 vars measure m m1 (cons 2 (if-test-index))) ;; We now have: ;; (if (= (all vs Phi) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-renames (mapcar #'cons (list-of-leading-universals h2) vars) (list* 2 2 1 2 2 (if-test-index))) (log-label (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))) m measure) ;; (if (= (all vs (if (some m (= m mu[vs])) Phi (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all vs (implies (some m (= m mu[vs])) Phi)) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))) ;; (if (= (all vs (if (some m (= m mu[vs])) (if Phi (true) (false)) (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((expr (make-if (make-some-single m (make-= m measure)) (make-if formula *true* *false*) *true*))) (log-all-uncase-analysis-2 expr (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) ;; We now have: ;; (if (= (all vs (all m (if (= m mu[vs]) Phi (true)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-move-universal-out (length vars) (cons 1 (if-test-index))) (let ((inner-index (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all m (all vs (implies (= m mu[vs]) Phi))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; This is where we apply the INDUCT inference rule. ;; (P m) is (all vs (implies (= m mu[vs]) Phi)). ;; (P m1) is (all vs (implies (= m1 mu[vs]) Phi)). (push-proof-log 'induct (cons 1 (if-test-index)) m1) ;; and get: ;; (if (= (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'compute (if-test-index)) (push-proof-log 'if-true index) ;; We end up with: ;; (all vs (implies H1 Phi)) )) ;;; Apply if-form of the machine to formula (i.e. apply scheme ;;; to formula). (defun apply-machine-formula (machine vars formula) (cond ((true-p machine) *true*) ((if-p machine) (make-if (if-test machine) (apply-machine-formula (if-left machine) vars formula) (apply-machine-formula (if-right machine) vars formula))) ((all-p machine) (make-all (all-vars machine) (apply-machine-formula (all-expr machine) vars formula))) ((and-p machine) (cons 'and (mapcar #'(lambda (u) (apply-machine-formula u vars formula)) (cdr machine)))) (t (sublis-eq (pairlis vars (cdr machine)) formula)))) ;;; Make strong induction hypothesis according to measure, ;;; quantifying over newvars that correspond to vars. (defun make-h2 (measure vars formula) (let* ((newvars (mapcar #'genvar vars)) (substitutions (pairlis vars newvars))) (make-series-of-quantification 'all newvars (make-implies `(m< ,(sublis-eq substitutions measure) ,measure) (sublis-eq substitutions formula))))) ;;; log-induction-phase-1 logs the inferences that converts: ;;; (all vs Phi) ;;; to: ;;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (all vs (implies H1 Phi)) ;;; (all vs Phi)) ;;; (This is the uninteresting phase.) (defun log-induction-phase-1 (formula vars h1 h2 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1))) (let ((qform (make-series-of-quantification 'all vars formula))) (let ((qh1imp (make-series-of-quantification 'all vars (make-implies h1 formula))) (qh1h2imp (make-series-of-quantification 'all vars (make-implies (make-and h1 h2) formula)))) ;; H2 is the strong induction hypothesis. ;; qform = (all vs Phi) ;; qh1imp = (all vs (implies H1 Phi)) ;; qh1h2imp = (all vs (implies (and H1 H2) Phi)) (push-proof-log 'if-equal index (make-= qform qh1h2imp) t) (push-proof-log 'if-equal (if-left-index) (make-= qform qh1imp) t) (log-equality-substitute qform qform qh1imp (cons 2 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index)) (make-= qform qh1h2imp) t) (log-cases-if (make-if (make-= qform qh1h2imp) (make-= qform qh1imp) (make-= qform qh1imp)) nil (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (implies (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi))) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-equal (cons 1 (cons 1 (if-left-index))) qform t) (log-induction-phase-1-aux vars (make-implies h1 formula) qform qh1imp qh1h2imp (list* 1 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; Seems to be this: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (if (true) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (true) ;; (false)) ;; (false)) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-true (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'look-up (list* 1 1 1 (if-left-index)) *true*) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (true)) (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'if-true (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-false (cons 1 (if-left-index))) (push-proof-log 'if-true (if-left-index))))) ;;; log-induction-phase-1-aux logs inferences that converts: ;;; (if (all vs Phi) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi))))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux (vars h1imp qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux))) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) (log-=-true-left-to-if qh1h2imp (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (log-=-true-left-to-if qh1imp (cons 2 (if-left-index))) (push-proof-log 'is-boolean (cons 2 (if-left-index)) t) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (= (all vs Phi) (all vs (implies H1 Phi))))) (log-look-up-false (cons 1 (cons 1 (if-right-index)))) (log-=-false-left-to-if qh1h2imp (cons 1 (if-right-index))) (log-look-up-false (cons 1 (cons 2 (if-right-index)))) (log-=-false-left-to-if qh1imp (cons 2 (if-right-index))) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (log-cases-if (make-if qform (make-implies qh1h2imp qh1imp) (make-implies (make-if qh1h2imp *false* *true*) (make-if qh1imp *false* *true*))) nil index) ;; (and (implies (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)))) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (and-left-index)) (push-proof-log 'is-boolean (cons 2 (and-left-index)) t) ;; (and (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (cons 2 (and-left-index))) (push-proof-log 'is-boolean (cons 2 (cons 2 (and-left-index))) t) ;; (and (if (all vs Phi) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)) ;; (true)) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (log-induction-phase-1-aux-1 vars (and-left-index) h1imp qform qh1imp qh1h2imp) (push-proof-log 'syntax index) ;; (if (true) ;; (if (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) ;; (true) ;; (false)) ;; (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-induction-phase-1-aux-2 vars qform qh1imp qh1h2imp index) ) ;;; log-induction-phase-1-aux-1 logs inferences that converts: ;;; (if (all vs Phi) ;;; (if (all vs (implies (and H1 H2) Phi)) ;;; (all vs (implies H1 Phi)) ;;; (true)) ;;; (true)) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-1 (vars index h1imp qform qh1imp qh1h2imp) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-1))) (let* ((renames (mapcar #'genvar vars)) (renamed-h1imp (sublis-eq (pairlis vars renames) h1imp)) (renamed-qh1imp (sublis-eq (pairlis vars renames) qh1imp))) (log-renames (mapcar #'cons vars renames) (cons 2 (if-left-index))) (log-all-out-lefts vars (if-left-index) qh1h2imp renamed-qh1imp) (log-all-out-lefts vars index qform (universally-quantify renames (make-if qh1h2imp renamed-h1imp *true*))) (let ((inner-index (display-formula-index-aux renames index))) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (cons 1 inner-index)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) (push-proof-log 'syntax (list* 2 2 2 inner-index)) (push-proof-log 'look-up (list* 1 2 2 2 2 inner-index) *true*) (push-proof-log 'if-true (list* 2 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) (dotimes (i (length vars)) i (push-proof-log 'remove-universal index) (push-proof-log 'is-boolean index t)))) ) ;;; log-induction-phase-1-aux-2 logs inferences that converts: ;;; (implies (not (all vs Phi)) ;;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;;; (if (all vs (implies H1 Phi)) (false) (true)))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-2 (vars qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-2))) (push-proof-log 'syntax (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (if (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true))) (push-proof-log 'case-analysis (implies-right-index) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (if (false) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)) ;; (if (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)))) (push-proof-log 'if-false (cons 2 (implies-right-index))) (push-proof-log 'if-true (cons 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false))))) (push-proof-log 'case-analysis (cons 3 (implies-right-index)) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) ;; (if (false) (true) (false)) ;; (if (true) (true) (false))))) (push-proof-log 'if-false (list* 2 3 (implies-right-index))) (push-proof-log 'if-true (list* 3 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let* ((renames (mapcar #'genvar vars)) (substitutions (mapcar #' cons vars renames))) (log-renames substitutions (cons 1 (implies-right-index))) (log-repeat-all-out-tests renames (make-if (sublis-eq substitutions qh1h2imp) *true* (make-if qh1imp *false* *true*)) (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (all vs' (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let ((inner-index (display-formula-index-aux renames (implies-right-index)))) ;; inner-index points to ;; (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (cons 1 inner-index)) (push-proof-log 'syntax (list* 1 1 inner-index)) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 1 3 inner-index))) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-true (cons 3 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if (if Phi (true) (false)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-true (list* 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) ;; (true)) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (list* 1 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if H1' (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) (push-proof-log 'look-up (list* 1 1 1 3 2 2 inner-index) *true*) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if (true) (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) ;; Phi' is boolean? Coerce to make sure. (log-coerce-if-test-to-bool (list* 2 1 1 3 2 2 inner-index)) (log-look-up-false-for-coercion (list* 1 2 1 1 3 2 2 inner-index)) (push-proof-log 'if-true (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi (true) (true)) ;; (true)) ;; (true)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) ;; (true) ;; Finished with inner-index ====== (dotimes (i (length vars)) i (push-proof-log 'remove-universal (implies-right-index)) (push-proof-log 'is-boolean (implies-right-index) t)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'if-equal index))) ) (defun log-all-out-lefts (vars index test left) (unless (null vars) ;; (if test (all () ...) (true)) (log-all-uncase-analysis-2a (make-if test left *true*) index) (log-all-out-lefts (cdr vars) (all-expr-index) test (all-expr left)))) (defun log-repeat-all-out-tests (vars formula index &optional bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) Q) (unless (null vars) (let* ((q (if-right formula)) (coerced-q (make-if q *true* *false*))) ;; either Q is boolean or in boolean context so that Q ;; and (if Q (true) (false)) are equivalent. (log-coerce-expr-for-boolean-or-bool-p q (if-right-index) bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) (if Q (true) (false))) (log-all-uncase-analysis-3 (make-if (if-test formula) *true* coerced-q) index) ;; (all (var1) (if (all (var2) ... P) (true) Q)) (unless (null (cdr vars)) (log-repeat-all-out-tests (cdr vars) (make-if (all-expr (if-test formula)) *true* q) (all-expr-index) (make-context-for-bool-p (make-all (list (car vars)) *true*) index))) ))) ;;; log-induction-phase-2 logs inferences that converts ;;; (implies (and H1 H2) Phi) ;;; to ;;; (implies H2 Phi) ;;; index points to (implies (and H1 H2) Phi) ;;; term is the term that suggested the induction, e.g. (div i j) (defun log-induction-phase-2 (formula vars machine term index h1 h2 measured-quants) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2))) ;; commute H1 and H2 and then convert to if form (log-use-axiom-as-rewrite (make-and h1 h2) 'and.commutative (list (make-= '|)X| h1) (make-= '|)Y| h2)) (implies-left-index)) (push-proof-log 'syntax index) (push-proof-log 'syntax (if-test-index)) ;; (if (if H2 (if H1 (true) (false)) (false)) (if Phi (true) (false)) (true)) (push-proof-log 'case-analysis index 1) ;; (if H2 ;; (if (if H1 (true) (false)) (if Phi (true) (false)) (true)) ;; (if (false) (if Phi (true) (false)) (true))) (log-remove-bool-coercion-from-if-test (if-left-index)) (push-proof-log 'if-false (if-right-index)) ;; At this point we have: ;; (if H2 ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; We now do the interesting part which is to knock off H1 ;; (converting it to (true) with the help of PO). (let* ((po-name (intern (format nil "~A.PO" (car term)) *zk-package*)) (po-args (unique (list-of-free-variables-unexpanded (ufunction-formula (get-event (car term)))))) (orig-po (progn (log-use-axiom (if-left-index) po-name) (ufunction-formula (get-event (car term))))) (po-args-renames (mapcar #'genvar po-args)) (args (ufunction-args (get-event (car term)))) ;; rename inner quantifications of PO (renamed-po (rename-quantified-variables-unexpanded orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index))))) ;; po is the PO applied to the induction term (po (sublis-eq (pairlis args (cdr term)) renamed-po))) (log-renames (mapcar #'cons po-args po-args-renames) (cons 1 (if-left-index))) ;; (if H2 ;; (if quantifiedPO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (linearize-and-log-universal-instantiations (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) ;; At this point quantifiedPO has been transformed by instantiation. ;; (if H2 ;; (if (if PO quantifiedPO (false)) ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) ;; rename back the outer quantification (log-renames (mapcar #'cons po-args-renames po-args) (list* 2 1 (if-left-index))) ;; unrename inner quantification of PO before discarding the axiom (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 2 1 (if-left-index)))) (push-proof-log 'use-axiom (cons 2 (cons 1 (if-left-index))) po-name t) (log-remove-bool-coercion-from-if-test (if-left-index)) ;; (if H2 ;; (if PO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) (log-unnest-implies formula (if-left-index)) ;; At this point we have: ;; (if H2 (implies (and PO H1) Phi) (true)) (let ((expanded-po (expand-formula po (list* 1 1 (if-left-index))))) (log-induction-phase-2-aux formula vars (if-form-machine machine) expanded-po (cons 1 (if-left-index)) h1 h2 measured-quants nil)) ;; We now have (if H2 (implies PO Phi) (true)) (let ((idx (cons 1 (if-left-index)))) (push-proof-log 'if-equal idx `(= ,po ,po) t) ;; PO is now replaced by (if (= PO PO) PO PO) (expand-formula po (list* 1 1 idx)) (push-proof-log 'look-up (cons 2 idx) po) (expand-formula po (list* 2 1 idx)) (push-proof-log 'compute (cons 1 idx)) (push-proof-log 'if-true idx) ;; we now have the unexpanded PO ) (push-proof-log 'syntax (if-left-index)) ;; (if H2 (if PO (if Phi (true) (false)) (true)) (true)) (log-use-axiom (cons 2 (if-left-index)) po-name) (log-renames-unexpanded orig-po renamed-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 1 2 (if-left-index)))) (log-renames (mapcar #'cons po-args po-args-renames) (list* 1 2 (if-left-index))) ;; (if H2 (if PO (if qPO (if Phi (true) (false)) (true)) (true)) (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) ;; (if H2 (if PO (implies qPO Phi) (true)) (true)) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) ;; (if H2 (implies PO (implies qPO Phi)) (true)) (log-unnest-implies formula (if-left-index)) ;; (if H2 (implies (and PO qPO) Phi) (true)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'is-boolean (list* 2 1 (if-left-index)) t) ;; (if H2 (implies (if PO qPO (false)) Phi) (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (log-universal-subsumption (make-if po (make-series-of-quantification 'all po-args-renames (sublis-eq (pairlis po-args po-args-renames) renamed-po)) *false*) (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) (log-renames (mapcar #'cons po-args-renames po-args) (cons 1 (if-left-index))) (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index)))) ;; At this point we have: ;; (if H2 (implies qPO Phi) (true)) (push-proof-log 'use-axiom (cons 1 (if-left-index)) po-name t) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; (if H2 (if Phi (true) (false)) (true)) (push-proof-log 'syntax index t)) ) ;;; Recursively dive into the ``if-form'' machine, until we hit either ;;; (true) or a list of substitutions. ;;; At the top level, it logs conversion of (and PO H1) to PO. ;;; Note that PO is in "if" form. (defvar *debugging-log-induction* nil) (defun log-induction-phase-2-aux (formula vars machine po index h1 h2 measured-quants renames) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux))) (when *debugging-log-induction* (format t "~%Machine: ~S~%" machine) (format t "~%PO: ~S~%" po) (format t "~%H1: ~S~%" h1)) (cond ((true-p machine) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) ((and (if-p po) (if-p machine)) ;; (and (if test leftPO rightPO) (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 1) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) ;; ***** test is not necessarilly known to be boolean! (log-coerce-expr-for-boolean-or-bool-p (if-test h1) (list* 1 2 (if-right-index)) (make-context-for-bool-p h1 (cons 2 (if-right-index)))) (log-look-up-false-for-coercion (list* 1 2 (if-right-index))) ;;(log-look-up-false (cons 1 (cons 2 (if-right-index)))) (push-proof-log 'if-false (cons 2 (if-right-index))) ;; (if test ;; (and leftPO leftH1 rightH1) ;; (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; which is the same as PO ) ((if-p machine) ;; (and PO (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 2) ;; (if test (and PO leftH1) (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) po (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test PO (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) po (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test PO PO) (push-proof-log 'if-equal index) ;; PO ) ((if-p po) ;; (and (if test leftPO rightPO) H1) (push-proof-log 'case-analysis index 1) ;; (if test (and leftPO H1) (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; (push-proof-log 'if-equal index) ;; PO ) ((all-p machine) ;; (and po h1) ;; where h1 is of the form (all (v) expr) (cond ((member-eq (all-var h1) measured-quants) (push-proof-log 'rename-universal (and-right-index) (all-var h1) (all-var po)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) (log-induction-phase-2-aux formula vars (all-expr machine) (all-expr po) (all-expr-index) (subst-eq (all-var po) (all-var h1) (all-expr h1)) h2 measured-quants (cons (cons (all-var h1) (all-var po)) renames))) (t (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (push-proof-log 'remove-universal (and-left-index) (all-vars h1) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO expr)) (log-induction-phase-2-aux formula vars (all-expr machine) po (all-expr-index) (all-expr h1) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)))) ((and-p po) (log-induction-phase-2-aux-and formula vars machine po index h1 h2 measured-quants renames)) ;; BUT because of merging, we might have a conjunction of ;; lists of substitutions ((and-p machine) ;; (and leaf-po h1-is-and) (push-proof-log 'syntax index) ;; (if leaf-po (if (and h1a h1b ...) (true) (false)) (false)) (log-induction-phase-2-aux-aux formula vars machine po (cons 1 (if-left-index)) h1 h2) ;; (if leaf-po (if (true) (true) (false)) (false)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'is-boolean index t) ;; leaf-po ) ;; List of substitutions (t ;; (and leaf-po leaf-h1) (push-proof-log 'syntax index) ;; (if po (if h1 (true) (false)) (false)) (push-proof-log 'if-equal (if-left-index) po t) ;; (if po ;; (if po ;; (if h1 (true) (false)) ;; (if h1 (true) (false))) ;; (false)) (log-if-to-and-or (make-if po (make-if h1 *true* *false*) (make-if h1 *true* *false*)) (if-left-index)) ;; (if po ;; (and (or (not po) (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if (if h1 (true) (false)) (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 3 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if po ;; (and (if (if po (false) (true)) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if po ;; (and (if po ;; (if (false) (true) (if h1 (true) (false))) ;; (if (true) (true) (if h1 (true) (false)))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'if-false (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) ;; (if po ;; (and (if po ;; (if h1 (true) (false)) ;; (true)) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index)) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1) ;; (or PO (if H1 (true) (false)))) ;; (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) ;; (if PO ;; (and (implies PO H1) ;; (or (true) (if H1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (implies PO H!) (true)) (false)) (push-proof-log 'syntax (if-left-index) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1)) ;; (false)) (push-proof-log 'if-equal (if-left-index) h2 t) ;; (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) (if-left-index)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (sublis-eq renames (cdr machine))) (list* 1 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 1 (if-left-index)) *true*) ;; the *true* in make-not is just a fake argument ;; the value is irrelevant for ;; log-remove-bool-coercion-from-inside-connective (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2[vs]) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 1 1 1 1 (if-left-index)) *true*) ;; (if PO ;; (and (if (not (implies (true) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-implies-to-or (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or (not (true)) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 1 1 (if-left-index))) (push-proof-log 'if-true (list* 1 1 1 1 (if-left-index))) (log-or-false 1 2 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or Phi[vs1])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-or-1 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if PO ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 1 1 (if-left-index))) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 3 2 1 (if-left-index)) *true*) (log-implies-to-or (list* 1 1 3 2 1 (if-left-index))) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not PO) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index))) ;; (if PO (and (true) (or H2 (and (implies PO H1)))) (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (true) (true)) (false)) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; At this point we have (if (m< mu[vs1] mu[vs]) (true) (false)) ;; Assuming m< always returns a boolean, remove the boolean ;; coercion. (push-proof-log 'is-boolean index t) ))) (defun log-and-trues (n index) (cond ((> n 2) (push-proof-log 'syntax index) ;; (and (true) (and (true) ...)) (push-proof-log 'syntax index) ;; (if (true) (if (and (true) ...) (true) (false)) (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-and-trues (- n 1) index)) ((= n 2) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) (t ;; (and (true)) or (and) (push-proof-log 'syntax index) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) (defun log-induction-phase-2-aux-and (formula vars machine po index h1 h2 measured-quants renames) ;; (and (and POL POR) (and H1L H1R)) (cond ((and (all-p (and-left machine)) (not (member-eq (all-var (and-left h1)) measured-quants))) ;; (and PO (and (all (v) H1Lexpr) H1R) ;; Need to move quantifier out (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (log-coerce-expr-for-boolean-or-bool-p (and-right h1) (cons 2 (and-right-index)) (make-context-for-bool-p h1 (and-right-index))) ;; (and (if PO (true) (false)) ;; (and (all (v) H1Lexpr) (if H1R (true) (false))))) (push-proof-log 'remove-universal (cons 2 (and-right-index)) (all-vars (and-left h1)) t) ;; (and (if PO (true) (false)) (and (all (v) H1Lexpr) (all (v) H1R))) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'is-boolean (cons 2 (and-right-index)) t) (push-proof-log 'all-case-analysis (and-right-index) t) ;; (and (if PO (true) (false)) (all (v) (if H1Lexpr H1R (false)))) (push-proof-log 'remove-universal (and-left-index) (all-vars (and-left h1)) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if (all (v) PO) ;; (all (v) (if H1Lexpr H1R (false))) ;; (false)) (push-proof-log 'all-case-analysis index t) ;; (all (v) (if PO (if H1Lexpr H1R (false)) (false))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (all-vars (and-left h1)) *true*) index) (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO (if H1Lexpr H1R (false)))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-and po (make-if (all-expr (and-left h1)) (and-right h1) *false*)) (all-expr-index)) (list* 2 2 (all-expr-index))) (push-proof-log 'syntax (cons 2 (all-expr-index)) t) ;; (all (v) (and PO (and H1Lexpr H1R))) (log-induction-phase-2-aux formula vars (make-and (all-expr (and-left machine)) (and-right machine)) po (all-expr-index) (make-and (all-expr (and-left h1)) (and-right h1)) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)) ((and-p (and-left machine)) ;; (and (and POL POR) (and (and H1LL H1LR) H1R)) (log-associate-and-right h1 (and-right-index)) (log-induction-phase-2-aux formula vars (make-and (and-left (and-left machine)) (make-and (and-right (and-left machine)) (and-right machine))) po index (make-and (and-left (and-left h1)) (make-and (and-right (and-left h1)) (and-right h1))) h2 measured-quants renames)) (t ;; (and (and POL POR) (and H1L H1R)) (log-pair-up-ands po h1 index) ;; (and (POL H1L) (POR H1R)) (log-induction-phase-2-aux formula vars (and-left machine) (and-left po) (and-left-index) (and-left h1) h2 measured-quants renames) ;; (and POL (POR H1R)) (log-induction-phase-2-aux formula vars (and-right machine) (and-right po) (and-right-index) (and-right h1) h2 measured-quants renames) ;; (and POL POR) ))) (defun log-induction-phase-2-aux-aux (formula vars machine po index h1 h2) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux-aux))) (cond ((and-p machine) ;; (and h1a h1b ...) (loop for m in (cdr machine) for h in (cdr h1) for i = 1 then (+ i 1) do (log-induction-phase-2-aux-aux formula vars m po (cons i index) h h2)) ;; (log-and-trues (length (cdr machine)) index)) (t ;; h1 (push-proof-log 'if-equal index po t) (log-if-to-and-or (make-if po h1 h1) index) ;; (and (or (not po) h1) (or po h1)) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not po) (true) (if h1 (true) (false))) (or po h1)) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if po (false) (true)) (true) (if h1 (true) (false))) ;; (or po h1)) (push-proof-log 'case-analysis (cons 1 index) 1) (push-proof-log 'if-false (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if po (if h1 (true) (false)) (true)) ;; (or po h1)) (push-proof-log 'syntax (cons 1 index) t) ;; (and (implies po h1) (or po h1)) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) (push-proof-log 'syntax index t) ;; (and (implies po h1)) (push-proof-log 'if-equal index h2 t) ;; (if h2 (and (implies po h1)) (and (implies po h1))) (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) index) ;; (and (or (not h2) (and (implies po h1))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not h2) (true) (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (cdr machine)) (list* 1 1 1 index)) ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 1 index) *true*) ;; (and (if (not (if H2[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 index)) ;; (and (if (not H2[vs1]) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 1 1 1 index) *true*) ;; (and (if (not (implies (true) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 1 index)) ;; (and (if (not (or (not (true)) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 1 index)) (push-proof-log 'if-true (list* 1 1 1 1 index)) ;; (and (if (not (or (false) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 index)) (push-proof-log 'if-false (list* 1 1 1 index)) ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-if-test (list* 1 1 index)) ;; (and (if (if Phi[vs1] (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'case-analysis (cons 1 index) 1) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 3 2 1 index) *true*) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not po) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-or-true 2 2 (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (true)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) (true) (if (true) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-true (list* 3 2 1 index)) (push-proof-log 'if-equal (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if Phi[vs1] (true) (true) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-equal (cons 1 index)) ;; (and (true) (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) ;;; Log the conversion of (and (and a1 a2) (and b1 b2)) to ;;; (and (and a1 b1) (and a2 b2)) (defun log-pair-up-ands (left right index) (let ((a1 (and-left left)) (a2 (and-right left)) (b1 (and-left right)) (b2 (and-right right))) (push-proof-log 'if-equal index a1 t) ;; (if a1 (and (and a1 a2) (and b1 b2)) (and (and a1 a2) (and b1 b2))) (cond ((bool-p a1) (log-look-up-false (list* 1 1 (if-right-index)))) (t (log-coerce-to-bool-inside-connective left 1 (cons 1 (if-right-index))) (log-look-up-false-for-coercion (list* 1 1 (if-right-index))))) (log-and-false 1 2 (cons 1 (if-right-index))) (log-and-false 1 2 (if-right-index)) ;; (if a1 (and (and a1 a2) (and b1 b2)) (false)) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) ;; (if a1 (and (and (true) a2) (and b1 b2)) (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-true (cons 1 (if-left-index))) ;; (if a1 (and (if a2 (true) (false)) (and b1 b2)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and (make-if a2 *true* *false*) right) 1 (if-left-index)) ;; (if a1 (and a2 (and b1 b2)) (false)) (push-proof-log 'if-equal (if-left-index) (and-left right) t) ;; (if a1 (if b1 (and a2 (and b1 b2)) (and a2 (and b1 b2))) (false)) (cond ((bool-p b1) (log-look-up-false (list* 1 2 3 (if-left-index)))) (t (log-coerce-to-bool-inside-connective right 1 (list* 2 3 (if-left-index))) (log-look-up-false-for-coercion (list* 1 2 3 (if-left-index))))) (log-and-false 1 2 (list* 2 3 (if-left-index))) (log-and-false 2 2 (list* 3 (if-left-index))) ;; (if a1 (if b1 (and a2 (and b1 b2)) (false)) (false)) (push-proof-log 'look-up (list* 1 2 2 (if-left-index)) *true*) ;; (if a1 (if b1 (and a2 (and (true) b2)) (false)) (false)) (push-proof-log 'syntax (list* 2 2 (if-left-index))) (push-proof-log 'if-true (list* 2 2 (if-left-index))) ;; (if a1 (if b1 (and a2 (if b2 (true) (false))) (false)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and a2 (make-if b2 *true* *false*)) 2 (cons 2 (if-left-index))) ;; (if a1 (if b1 (and a2 b2) (false)) (false)) (push-proof-log 'if-false (if-right-index) (make-and a2 b2) t) ;; (if a1 (if b1 (and a2 b2) (false)) (if (false) (and a2 b2) (false))) (push-proof-log 'case-analysis index 1 t) ;; (if (if a1 b1 (false)) (and a2 b2) (false)) (log-coerce-if-test-to-bool index) (push-proof-log 'case-analysis (if-test-index) 1) (push-proof-log 'if-false (cons 3 (if-test-index))) ;; (if (if a1 (if b1 (true) (false)) (false)) (and a2 b2) (false)) (push-proof-log 'syntax (if-test-index) t) ;; (if (and a1 b1) (and a2 b2) (false)) (push-proof-log 'is-boolean (if-left-index)) (push-proof-log 'syntax index t) ;; (and (and a1 b1) (and a2 b2)) )) ;;; log-induction-phase-3 logs inferences that convert ;;; (all vs (implies H2 Phi)) ;;; to ;;; (all m (implies (all m1 (implies (m< m1 m) ;;; (all vs1 (implies (= m1 (mu[vs1])) ;;; Phi[vs1])))) ;;; (all vs (implies (= m (mu[vs])) Phi)))) ;;; vs is vars ;;; Phi is formula (defun log-induction-phase-3 (formula h2 vars measure m m1 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-3))) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) index)) (substitutions (mapcar #'cons vars (list-of-leading-universals h2)))) (log-label inner-index m measure) (log-label (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 inner-index)) m1 (sublis-eq substitutions measure)) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true))) (push-proof-log 'is-boolean (cons 2 inner-index)) (push-proof-log 'syntax inner-index t) ;; We now have ;; (all vs (implies (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi))) (push-proof-log 'syntax inner-index) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (if (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1])) ;; (true))) ;; Phi) ;; (true) ;; (false)) ;; (true))) ;; inner-index points to the outer if (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m (make-= m measure)) (make-if (make-implies (universally-quantify vs1 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-implies (make-m< muvs1 measure) phivs1) *true*)) formula) *true* *false*) *true*) inner-index)) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true)))) (let ((idx (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) (push-proof-log 'is-boolean (cons 2 idx))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (if (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true) ;; (false)) ;; (true))) ;; Phi) ;; (true)))) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-if (make-implies (make-m< muvs1 measure) phivs1) *true* *false*) *true*) (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'look-up (list* 1 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m1) (push-proof-log 'look-up (list* 2 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (log-move-universal-out (length vars) index) (log-move-universal-out (length vars) (list* 1 2 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'is-boolean (list* 2 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index) t) ;; We now have: ;; (all m ;; (all vs (implies (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi)))) (log-unnest-implies formula (cons 2 inner-index)) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (let ((left (make-= m measure)) (right (make-all-single m1 (universally-quantify vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (list* 1 2 inner-index)))) ;; (push-proof-log 'commute-and (list* 1 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (implies ;; (and (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (= m (mu[vs]))) ;; Phi))) (push-proof-log 'syntax (list* 1 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (= m (mu[vs])) (true) (false)) ;; (false)) ;; (if Phi (true) (false)) ;; (true)))) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true)))) ;; (repeat-log-all-case-analysis-1 (length vars) (all-expr-index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-all (list m1) (make-series-of-quantification 'all vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))) (make-if (make-if (make-= m measure) *true* *false*) (make-if formula *true* *false*) *true*) *true*) (reverse vars) nil displacement (all-expr-index))) (log-remove-universals (length vars) (cons 3 (all-expr-index))) ;; We now have: ;; (all m ;; (if (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (push-proof-log 'is-boolean (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all m ;; (implies ;; (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true))))) ;; The use of (list* 2 2 inner-index) just happens to work. ;; Should really be (append inner-index '(2 2)) (log-remove-bool-coercion-from-if-test (list* 2 2 inner-index)) (push-proof-log 'syntax (list* 2 2 inner-index) t) ;; We now have: ;; (all m (implies (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'is-boolean (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) t) (log-unnest-implies (sublis-eq substitutions formula) (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) (let* ((muvs1 (sublis-eq substitutions measure)) (left (make-= m1 muvs1)) (right (make-m< m1 m))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))))) ;; (push-proof-log 'commute-and ;; (cons 1 (append (mapcar #'(lambda (u) u 2) vars) ;; (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (implies (and (m< m1 m) (= m1 (mu[vs1]))) ;; Phi[vs1]))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'syntax (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (if (m< m1 m) ;; (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'case-analysis (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) 1) (push-proof-log 'if-false (cons 3 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (m< m1 m) ;; (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (repeat-log-all-case-analysis-1 (length vars) (list* 2 1 2 index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-m< m1 m) (make-if (make-if (make-= m1 muvs1) *true* *false*) (make-if phivs1 *true* *false*) *true*) *true*) (reverse vs1) nil displacement (list* 2 1 2 index))) (log-remove-universals (length vars) (list* 3 2 1 2 index)) ;; We now have: ;; (all m (implies (all m1 ;; (if (m< m1 m) ;; (all vs1 (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true))) ;; (true))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (log-remove-bool-coercion-from-if-test (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index)) t) (push-proof-log 'is-boolean (list* 2 2 1 2 index)) (push-proof-log 'syntax (list* 2 1 2 index) t) ;; We now have: ;; (all m (implies (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi)))) )) ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (defun repeat-log-all-case-analysis-1 (formula reversed-vars processed-vars displacement base-index) (unless (null displacement) ;; (all () (if test left right)) (let ((index (append (cdr displacement) base-index)) (left (make-series-of-quantification 'all processed-vars (if-left formula))) (right (make-series-of-quantification 'all processed-vars (if-right formula)))) (log-all-case-analysis-1 (make-all (list (car reversed-vars)) (make-if (if-test formula) left right)) index) ;; (if test (all (trailingvars) left) (all (trailingvars) right)) (repeat-log-all-case-analysis-1 formula (cdr reversed-vars) (cons (car reversed-vars) processed-vars) (cdr displacement) base-index))) ) (defun log-remove-universals (n index) (unless (zerop n) (log-remove-universals (- n 1) (all-expr-index)) (push-proof-log 'remove-universal index) ;; result is assumed to be Boolean (push-proof-log 'is-boolean index t))) ;;; This is like log-flip-universals except it moves a quantifier out ;;; instead of in. (defun log-move-universal-out (number-of-vars index) (unless (zerop number-of-vars) (log-move-universal-out (- number-of-vars 1) (all-expr-index)) (push-proof-log 'flip-universals index))) ;;; Convert ((tests1 hyp1) (tests2 hyp2) ...) to IF form. (defun if-form-machine (machine) (cond ((null machine) nil) (t (multiple-value-bind (formula rest-machine) (if-form-machine-aux (first (car machine)) 1 (second (car machine)) (cdr machine)) (when (null rest-machine) formula))))) (defun if-form-machine-aux (tests depth hyp machine) (cond ((null tests) (values (or hyp *true*) machine)) (t (let (left right rest-machine) ;; recur to make left (multiple-value-setq (left rest-machine) (if-form-machine-aux (cdr tests) (+ depth 1) hyp machine)) ;; recur to make right (multiple-value-setq (right rest-machine) (if-form-machine-aux (nthcdr depth (first (car rest-machine))) (+ depth 1) (second (car rest-machine)) (cdr rest-machine))) ;; make (if first-test left right) (values (make-if (car tests) left right) rest-machine))))) ;;; Log transformation of (implies H1 formula) to ;;; the result of apply-induction-template-to-formula. (defun log-apply-machine (machine template vars formula index bool-p) (cond ((= (length template) 1) (let ((h1 (substitute-induction-pattern-in-machine machine vars formula))) (when (and-p h1) (really-flatten-ands h1 (implies-left-index))))) (t (log-cases-if-hypothesis machine vars formula index bool-p)))) (defun log-cases-if-hypothesis (machine vars formula index bool-p) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis))) (cond ((if-p machine) ;; (implies (if t1 H1l H1r) Phi) (push-proof-log 'case-analysis index 1) ;; (if t1 (implies H1l Phi) (implies H1r Phi)) (log-cases-if (make-if (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula) (make-implies (substitute-induction-pattern-in-machine (if-right machine) vars formula) formula)) nil index) ;; (and (implies t1 (implies H1l Phi)) (implies (not t1) (implies H1r Phi))) (let ((left-test (if (and-p (if-test machine)) (cdr (if-test machine)) (list (if-test machine))) ) (right-test (cond ((not-p (if-test machine)) (log-not-not (cons 1 (and-right-index))) ;; (and (implies t1 (implies H1l Phi) ;; (implies (if t1test (true) (false)) ;; (implies H1r Phi))) (push-proof-log 'syntax (and-right-index)) ;; (and (implies t1 (implies H1l Phi)) ;; (if (if t1test (true) (false)) ;; (if (implies H1r Phi) (true) (false)) ;; (true))) (log-remove-bool-coercion-from-if-test (and-right-index)) (push-proof-log 'syntax (and-right-index) t) ;; (and (implies t1 (implies H1l Phi)) ;; (implies t1test (implies H1r Phi))) (if (and-p (not-expr (if-test machine))) (cdr (not-expr (if-test machine))) (list (not-expr (if-test machine))))) (t (list (make-not (if-test machine)))))) ;; (and (implies left-test (implies H1l Phi)) ;; (implies right-test (implies H1r Phi))) ;; left is result of processing (implies H1l Phi) (left-list (log-cases-if-hypothesis (if-left machine) vars formula (cons 2 (and-left-index)) (make-context-for-bool-p (make-implies (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-left-index)))) ;; right is result of processing (implies H1r Phi) (right-list (log-cases-if-hypothesis (if-right machine) vars formula (cons 2 (and-right-index)) (make-context-for-bool-p (make-implies (if (not-p (if-test machine)) (not-expr (if-test machine)) (make-not (if-test machine))) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-right-index))))) ;; (and (implies left-test left) ;; (implies right-test right)) (let ((left-result (cond ((= (length left-list) 1) ;; left-list is ((hyp)), ;; left is (implies hyp Phi), ;; (and (implies left-test (implies hyp Phi)) ;; (implies right-test right)) (list (log-cases-if-hypothesis-aux left-test (car left-list) formula (and-left-index))) ;; (and (implies (and left-test hyp) Phi) ;; (implies right-test right)) ) (t ;; left-list is (hyp1 hyp2 ...) ;; left is (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (implies left-test (and (implies hyp1 Phi) ...)) ;; (implies right-test Phi)) (log-cases-implies left-list (and-left-index)) ;; (and (and (implies left-test (implies hyp1 Phi)) ;; (implies left-test (implies hyp2 Phi)) ;; ...) ;; (implies right-test right)) (loop for l in left-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux left-test l formula (cons i (and-left-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (implies right-test right)) ))) (right-result (cond ((= (length right-list) 1) (list (log-cases-if-hypothesis-aux right-test (car right-list) formula (and-right-index)))) (t (log-cases-implies right-list (and-right-index)) (loop for r in right-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux right-test r formula (cons i (and-right-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (and (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...)) )))) ;; Log the AND unexpansions performed by ;; apply-induction-template-to-formula. ;; Seems to expect (and (implies ...) (implies ...)) (really-flatten-ands (make-and (if (= (length left-result) 1) (let ((h (append ; left-test nil (car left-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in left-result collect (let ((h (append ; left-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula))))) (if (= (length right-result) 1) (let ((h (append ; right-test nil (car right-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in right-result collect (let ((h (append ; right-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)))))) index) ;; (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ... ;; (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...) (append left-result right-result)) ;; )) ((true-p machine) ;; (implies (true) Phi) (push-proof-log 'syntax index) (push-proof-log 'if-true index) ;; (if Phi (true) (false)) (when (or (bool-p formula) bool-p) ;; almost certain but just in case (log-remove-coercion-for-boolean-or-bool-p formula index bool-p)) '(())) ((and (consp machine) (eq (car machine) *induction-pattern*)) ;; (P ...) (let ((substs (mapcar #'cons vars (cdr machine)))) (list (list (sublis-eq substs formula))))) ((and-p machine) (list (mapcar #'(lambda (u) (substitute-induction-pattern-in-machine u vars formula)) (cdr machine)))) (t (list (list (substitute-induction-pattern-in-machine machine vars formula)))) ;; (t (list (list machine))) )) (defun log-cases-implies (hyp-list index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-implies))) ;; hyp-list is a list of lists of conjuncts ;; (implies test (and (implies hyp1 Phi) (implies hyp2 Phi) ...)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if test (and (implies hyp1 Phi) (implies hyp2 Phi) ...) (true)) (log-convert-true-to-and (length hyp-list) (if-right-index)) ;; (if test ;; (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (true) (true) ...)) (push-proof-log 'case-analysis index 0 t) ;; (and (if test (implies hyp1 Phi) (true)) ;; (if test (implies hyp2 Phi) (true)) ;; ...) (loop for i from 1 to (length hyp-list) do (progn (push-proof-log 'is-boolean (list* 2 i index)) (push-proof-log 'syntax (cons i index) t))) ;; (and (implies test (implies hyp1 Phi)) ;; (implies test (implies hyp2 Phi)) ;; ...) ) ;;; test is a list of conjuncts ;;; hyp is a list of conjuncts (defun log-cases-if-hypothesis-aux (test hyp formula index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis-aux))) (cond ((null hyp) test) (t ;; (implies test (implies (and hyp) Phi)) (log-unnest-implies formula index) ;; (implies (and test (and hyp)) Phi) ;; Log the AND unexpansions performed by make-induction-lemma-case. (let ((result (really-flatten-ands (list 'and (if (= (length test) 1) (car test) (cons 'and test)) (if (= (length hyp) 1) (car hyp) (cons 'and hyp))) (implies-left-index)))) (cond ((and-p result) (cdr result)) ((and (if-p result) (true-p (if-left result)) (false-p (if-right result)) (bool-p (if-test result))) (push-proof-log 'is-boolean (implies-left-index) t) (list (if-test result))) (t (list result))))))) (defun substitute-induction-pattern-in-machine (machine vars formula) (cond ((consp machine) (cond ((eq (car machine) *induction-pattern*) (let ((subst (mapcar #'cons vars (cdr machine)))) (sublis-eq subst formula))) (t (cons (car machine) (loop for m in (cdr machine) collect (substitute-induction-pattern-in-machine m vars formula)))))) (t machine)))
true
;;;====================================================================== ;;; | ;;; Copyright (c) 2021, PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, | ;;; PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI. | ;;; All Rights Reserved. | ;;; | ;;; Redistribution and use in source and binary forms, with or without | ;;; modification, are permitted provided the following conditions are | ;;; met: | ;;; | ;;; 1. Redistributions of source code must retain the above copyright | ;;; notice, this list of conditions and the following disclaimer. | ;;; 2. Redistributions in binary form must reproduce the above | ;;; copyright notice, this list of conditions and the following | ;;; disclaimer in the documentation and/or other materials provided | ;;; with the distribution. | ;;; | ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ;;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ;;; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ;;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND | ;;; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ;;; USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ;;; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ;;; IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | ;;; THE POSSIBILITY OF SUCH DAMAGE. | ;;; | ;;;====================================================================== (in-package "ZK") ;;; Boyer-Moore style induction. ;;; All the heuristics of Boyer-Moore induction plus the concept of ;;; a scheme being inherently flawed when weeding out flawed ;;; induction schemes. ;;; More than half of the code has to do with proof logging. ;;; ----- Structures for use during induction. ;;; Structure for the induction cases. An induction template is just ;;; a list of induction cases. (defstruct (induction-case :named) tests ;list of tests for the case substitutions ;list of substitution lists (one for each recursive call) calls ;list of recursive calls (*p*'s) in hypothesis hypothesis) ;conjunction of *p*'s possibly universally quantified ;;; Structure for representing the induction schemes. (defstruct (scheme :named) template ;induction template for the scheme changing ;changing variables unchanging ;unchanging variables changeables ;changeable variables unchangeables ;unchangeable variables score ;for ranking schemes flawed ;flawed scheme origin) ;term that suggested the induction scheme ;;; ==================== Prover Commands ==================== (defcmd induct (&optional term :display) ((:string "Try to apply an induction scheme to the current subformula. Normally, the induction scheme is heuristically chosen. However, you may explicitly supply a term on which to induct. The term on which to induct does not have to be in the current subformula.")) (let ((formula (display-formula display)) (template nil) (origin nil)) (if (null term) (let ((schemes (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula))))) (when schemes ;; Need to choose a scheme. (let ((scheme (select-induction-scheme schemes))) ;; Set the template. (setq template (scheme-template scheme) origin (scheme-origin scheme))))) (without-proof-logging ;; No need to choose a scheme in this case. (and (parse-formula-phase-1 term) (not (formula-unmentionable-p term)) (subset-p (unique (list-of-free-variables-unexpanded term)) (unique (list-of-free-variables-unexpanded formula))) ;; Set the template. (setq template (third (get-induction-template-for-term (rename-quantified-variables (expand-formula term nil) nil) (unique (list-of-free-variables-unexpanded formula)))) origin term)))) (when template ;; Apply the template. (let* ((vars (unique (list-of-free-variables-unexpanded formula))) (machine (machine-from-template template vars)) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (event (get-event (car origin))) (measured-expressions (mapcar #'(lambda (u v) (and u v)) (ufunction-measured-subset event) (cdr origin))) (measured-positions (mapcar #'(lambda (u) (occurs-in u measured-expressions)) vars)) (measured-quants (measured-quants-in-machine machine measured-positions)) (measure (sublis-eq (pairlis (ufunction-args event) (cdr origin)) (ufunction-measure event)))) (log-induction formula vars machine origin measure measured-quants (display-base-index display)) (push-proof-log 'marker index (list 'checkpoint (make-implies h1 formula))) ;; (implies H1 Phi) where H1 is induction machine in IF form. (log-apply-machine (if-form-machine machine) template vars formula index (make-context-for-bool-p (make-all (last vars) *true*) (cdr index)))) (push-proof-log 'marker index (list 'checkpoint (apply-induction-template-to-formula template formula))) ;; Now really apply the template. (let ((result (unexpand-formula (unrename-quantified-variables (expand-formula (apply-induction-template-to-formula template formula) index) index) index))) (make-display :formula result :explain `((:string "Inducting using the following scheme ...") ;; **** Unrename may be different from above? (:newline) (:formula ,(without-proof-logging (unexpand-formula (unrename-quantified-variables (expand-formula (scheme-description template formula) nil) nil) nil))) (:newline) (:string "produces ..."))))))) ;;; Printable representation of a scheme that goes in a proof detail. (defun scheme-description (induction-template formula) (let* ((vars (sort (unique (list-of-free-variables-unexpanded formula)) #'alphalessp)) (form (cons '*p* vars))) (apply-induction-template-to-formula induction-template form))) (defcmd prove-by-induction (:display) ((:string "Try to prove the current subformula with automatic induction (see") (:help-name induction) (:punctuation ").") (:string "A non-inductive proof is first attempted. If this fails, the theorem prover will try to apply an induction scheme to the formula. The theorem prover may discard the non-inductive proof prior to the induction.")) (let* ((original-formula-worth-inducting (worth-inducting-p (display-formula display))) (success (reduce))) (cond ((literal-p (display-formula *current-display*)) success) ((and success original-formula-worth-inducting) (back) (induct) (reduce) t) ;have succeeded ((worth-inducting-p (display-formula *current-display*)) (induct) (reduce) t) ;induction performed (t success)))) ;;; Decide whether or not we should induct on the formula. (defun worth-inducting-p (formula) (get-induction-schemes formula (unique (list-of-free-variables-unexpanded formula)))) ;;; ==================== Supporting Functions ==================== ;;; ----- Functions used to prepare proof logging. ;;; Construct induction machine from template. May be different ;;; from induction machine stored in the struct for the recursive ;;; function, although the format is the same (a list of cases where ;;; each case has a list of assumptions and an induction hypothesis). (defun machine-from-template (template vars) (mapcar #'(lambda (u) (let ((call-substitutions (mapcar #'(lambda (c s) (cons c (sublis-eq s (cons *induction-pattern* vars)))) (induction-case-calls u) (induction-case-substitutions u)))) (list (induction-case-tests u) (sublis-equal call-substitutions (induction-case-hypothesis u))))) template)) ;;; List of bound variables in the hypotheses of the machines that ;;; occur in measured positions, needed for proof logging. (defun measured-quants-in-machine (machine measured-positions) (let ((measured-expressions (loop for call in (list-of-calls *induction-pattern* machine) append (loop for expr in (cdr call) for measured in measured-positions when measured collect expr))) (bound (loop for case in machine append (list-of-bound-variables-unexpanded (second case))))) (remove-if-not #'(lambda (u) (occurs-in u measured-expressions)) bound))) ;;; ==================== Templates ==================== ;;; ----- Apply Template ;;; Take an induction template and a formula, and apply the template ;;; to produce an equivalent formula. (defun apply-induction-template-to-formula (induction-template formula) ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (m) (make-induction-lemma-case m formula)) induction-template) *true*)) ;;; Make an induction case. (defun make-induction-lemma-case (induction-case formula) (let ((induction-hypothesis (substitute-hypothesis (induction-case-substitutions induction-case) (induction-case-calls induction-case) (induction-case-hypothesis induction-case) formula))) (let ((result (make-implies ;; Note that the logging of AND expansions will be performed by ;; log-cases-if-hypothesis (add-simplified-conjuncts (mapcar #'(lambda (u) (if (and (if-p u) (true-p (if-left u)) (false-p (if-right u))) (if-test u) u)) (append (induction-case-tests induction-case) (list-of-induction-hypotheses induction-hypothesis))) *true*) formula))) result))) (defun list-of-induction-hypotheses (induction-hypothesis) (cond ((and-p induction-hypothesis) (cdr induction-hypothesis)) ((null induction-hypothesis) nil) (t (list induction-hypothesis)))) (defun substitute-hypothesis (subst calls hypo formula) (sublis-equal (pairlis calls (mapcar #'(lambda (u) (sublis-eq u formula)) subst)) hypo)) ;;; ----- Make Template ;;; Make an induction template from a recursive definition and a ;;; term. It is assumed that the template suggested by the recursive ;;; definition applies to the term. (defun construct-induction-template (args subst changeables unchangeables machine) (let ((instantiated-machine (sublis-eq subst machine))) (mapcar #'(lambda (m) (without-proof-logging (let* ((hypothesis (rename-quantified-variables (second m) nil)) (calls (list-of-calls *induction-pattern* hypothesis))) (make-induction-case :tests (first m) :substitutions (construct-induction-substitutions args changeables unchangeables calls) :calls calls :hypothesis hypothesis)))) instantiated-machine))) ;;; Construct the substitutions for the calls of a machine case. (defun construct-induction-substitutions (args changeables unchangeables calls) (when calls (cons (construct-induction-substitution-case args changeables unchangeables (car calls)) (construct-induction-substitutions args changeables unchangeables (cdr calls))))) ;;; Construct the substitution for a call of a machine case. Illegal ;;; substitutions are deleted here. (defun construct-induction-substitution-case (args changeables unchangeables call) (let ((subst (mapcar #'cons args (cdr call))) (substitution nil)) (mapc #'(lambda (u v) (or ;; never substitute unchangeables (member-eq (car u) unchangeables) ;; never substitute non-variables (not (variable-p (car u))) ;;(eq (car u) (cdr u)) (let ((entry (assoc-eq (car u) substitution))) (setq substitution (if (and entry v) (cons u (remove-eq entry substitution)) (cons u substitution)))))) subst changeables) (reverse substitution))) ;;; ----- Changing/Unchangeable Variables. ;;; Given an induction template, return the list of changing arguments ;;; (Boyer-Moore's terminology - from "A Computational Logic"). (defun changing-induction-variables-in-template (induction-template) (and (not (null induction-template)) (unique (union-eq (variables-substituted (induction-case-substitutions (car induction-template))) (changing-induction-variables-in-template (cdr induction-template)))))) ;;; Given a set of substitutions, return a unique list of variables that ;;; are substituted for (with something other than itself). (defun variables-substituted (case-substitutions) (and (not (null case-substitutions)) (unique (union-eq (loop for pair in (car case-substitutions) when (not (eq (car pair) (cdr pair))) collect (car pair)) (variables-substituted (cdr case-substitutions)))))) ;;; List of unchangeables as defined in Boyer & Moore's "A Computational ;;; Logic." These are variables in expressions appearing in measured ;;; positions that cannot change. (defun list-of-unchangeables (measured-positions unchanging-positions term-arguments) (let ((unchangeable-expressions (mapcar #'(lambda (u v w) (and u v w)) measured-positions unchanging-positions term-arguments))) (unique (mapcan #'list-of-free-variables-unexpanded unchangeable-expressions)))) ;;; Return t if the elements of the given list are distinct variables. (defun is-list-of-distinct-variables-p (list-of-expr) (let ((checked-variables nil) (success t)) (dolist (e list-of-expr) (if (or (not (variable-p e)) (member-eq e checked-variables)) (return (setq success nil)) (push e checked-variables))) success)) ;;; =============== Choose Scheme =============== ;;; ----- Called first, get candidate induction schemes. ;;; Collect all induction schemes suggested by terms in the formula. (defun get-induction-schemes (formula free-vars) (and (consp formula) (let ((induction-template (get-induction-template-for-term formula free-vars))) (cond (induction-template (let ((changeables (first induction-template)) (unchangeables (second induction-template)) (template (third induction-template))) (let ((changing (changing-induction-variables-in-template template)) (args (cdr formula))) (cons (make-scheme :template template :changing changing :unchanging (set-difference-equal (unique (loop for x in args append (list-of-free-variables-unexpanded x))) changing) :changeables changeables :unchangeables unchangeables :score (rdiv (length changing) (length args)) ;; Set if inherently flawed. :flawed (flawed-template-p template args) :origin formula) (loop for expr in formula append (get-induction-schemes expr free-vars)))))) (t (loop for expr in formula append (get-induction-schemes expr free-vars))))))) ;;; Construct an induction template for a term when there is an ;;; induction template that applies to the term. (defun get-induction-template-for-term (term free-vars) (and (consp term) (atom (first term)) (let ((name (get-event (first term)))) (and (ufunction-p name) (not (event-inaccessible-p name)) (ufunction-recursive name) (every #'(lambda (v) (occurs-in v free-vars)) (unique (list-of-free-variables-unexpanded term))) (let ((measured-positions (ufunction-measured-subset name)) (unchanging-positions (ufunction-unchangeables name)) (term-arguments (cdr term))) (let ((changeables (mapcar #'(lambda (u v w) (and u (not v) w)) measured-positions unchanging-positions term-arguments)) (unchangeables (list-of-unchangeables measured-positions unchanging-positions term-arguments))) (and (induction-template-applies-p changeables unchangeables) (list (remove-if #'null changeables) unchangeables (construct-induction-template (cdr term) (pairlis (ufunction-args name) (cdr term)) changeables unchangeables (ufunction-machine name)))))))))) ;;; Return t if the changeables are distinct variables and the ;;; intersection of changeables and unchangeables is empty. (defun induction-template-applies-p (changeables unchangeables) (let ((changeable-list (remove-if #'null changeables))) (and (is-list-of-distinct-variables-p changeable-list) (null (intersection-eq changeable-list unchangeables))))) ;;; Code to help determine if an induction scheme is inherently "flawed". ;;; Some cases flawed. (defun flawed-template-p (template args) (some #'(lambda (u) (flawed-template-case u args)) template)) ;;; All calls flawed. (defun flawed-template-case (case args) (let ((calls (induction-case-calls case))) (and calls (every #'(lambda (u) (flawed-template-call u args)) calls)))) ;;; Flawed call. (defun flawed-template-call (call args) (some #'(lambda (u v) (and (not (equal u v)) (not (variable-p v)))) (cdr call) args)) ;;; ----- Select Induction Scheme ;;; Selection goes through 3 filtering steps before a winner is picked: ;;; 1. Remove subsumed schemes (and increase scores of subsuming schemes). ;;; 2. Merge schemes, removing the original schemes merged. ;;; 3. Remove flawed schemes if possible. (defun select-induction-scheme (list-of-schemes) (superimpose-cases (pick-winner (list-of-unflawed-schemes (list-of-merged-schemes (list-of-unsubsumed-schemes list-of-schemes)))))) ;;; Pick an induction scheme with the highest score. (defun pick-winner (list-of-schemes) (let ((champ (first list-of-schemes))) (dolist (challenger (cdr list-of-schemes)) (when (> (scheme-score challenger) (scheme-score champ)) (setq champ challenger))) champ)) ;;; =============== Code for Manipulating Schemes =============== ;;; ----- Superimpose Scheme Cases ;;; Once a winner is picked, superimpose (merge) induction cases that ;;; have the same test (condition). (defun superimpose-cases (scheme) (when scheme (let ((template (scheme-template scheme)) (acc nil)) (dolist (case template) (unless (dolist (c acc) (when (and (subsetp-equal (induction-case-tests c) (induction-case-tests case)) (subsetp-equal (induction-case-tests case) (induction-case-tests c))) (setf (induction-case-substitutions c) (append (induction-case-substitutions c) (induction-case-substitutions case))) (setf (induction-case-calls c) (append (induction-case-calls c) (induction-case-calls case))) (setf (induction-case-hypothesis c) (make-simplified-and (induction-case-hypothesis c) (induction-case-hypothesis case))) (simplify-superimposed-case c) (return t))) (push case acc))) (setf (scheme-template scheme) (reverse acc)))) scheme) (defun simplify-superimposed-case (case) (when (and-p (induction-case-hypothesis case)) (let ((mask (simplify-superimposed-case-aux nil (cdr (induction-case-hypothesis case))))) (setf (induction-case-substitutions case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-substitutions case))) (setf (induction-case-calls case) (mapcan #'(lambda (x y) (and x (list y))) mask (induction-case-calls case))) (setf (induction-case-hypothesis case) (mapcan #'(lambda (x y) (and x (list y))) mask (if (and-p (induction-case-hypothesis case)) (cdr (induction-case-hypothesis case)) (induction-case-hypothesis case)))) (setf (induction-case-hypothesis case) (if (null (cdr (induction-case-hypothesis case))) (car (induction-case-hypothesis case)) (cons 'and (induction-case-hypothesis case))))))) (defun simplify-superimposed-case-aux (acc hyps) (cond ((null hyps) nil) ((member-equal (car hyps) acc) (cons nil (simplify-superimposed-case-aux acc (cdr hyps)))) (t (cons t (simplify-superimposed-case-aux (cons (car hyps) acc) (cdr hyps)))))) ;;; ----- Scheme Subsumption ;;; Given a list of induction schemes, it deletes those that are ;;; subsumed by other schemes. This is the first filtering step. (defun list-of-unsubsumed-schemes (list-of-schemes) (and list-of-schemes (list-of-unsubsumed-schemes-aux (first list-of-schemes) (list-of-unsubsumed-schemes (cdr list-of-schemes)) nil))) (defun list-of-unsubsumed-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((next-scheme (first unprocessed-schemes))) (cond ((scheme-subsumes-scheme-p scheme next-scheme) (list-of-unsubsumed-schemes-aux (make-scheme :template (scheme-template scheme) :changing (scheme-changing scheme) :unchanging (scheme-unchanging scheme) :changeables (scheme-changeables scheme) :unchangeables (scheme-unchangeables scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed scheme) :origin (scheme-origin scheme)) (cdr unprocessed-schemes) processed-schemes)) ((scheme-subsumes-scheme-p next-scheme scheme) (append (cdr unprocessed-schemes) (cons (make-scheme :template (scheme-template next-scheme) :changing (scheme-changing next-scheme) :unchanging (scheme-unchanging next-scheme) :changeables (scheme-changeables next-scheme) :unchangeables (scheme-unchangeables next-scheme) :score (+ (scheme-score scheme) (scheme-score next-scheme)) :flawed (scheme-flawed next-scheme) :origin (scheme-origin next-scheme)) processed-schemes))) (t (list-of-unsubsumed-schemes-aux scheme (cdr unprocessed-schemes) (cons next-scheme processed-schemes))))))) ;;; Subsumption check for induction schemes as described in ;;; Boyer & Moore's "A Computational Logic." ;;; Return t if the first scheme subsumes the second scheme. (defun scheme-subsumes-scheme-p (scheme-1 scheme-2) (and (subset-p (scheme-changing scheme-2) (scheme-changing scheme-1)) (subset-p (scheme-unchanging scheme-2) (scheme-unchanging scheme-1)) (scheme-cases-subsume-p (scheme-template scheme-1) (scheme-template scheme-2)))) ;;; For cases of a scheme to subsume cases of another scheme each case of ;;; the latter scheme must be subsumed by a unique case of the former scheme. (defun scheme-cases-subsume-p (template-1 template-2) (or (null template-2) (multiple-value-bind (subsumed updated-template) (scheme-case-subsumed-by (first template-2) template-1 nil) (and subsumed (scheme-cases-subsume-p updated-template (cdr template-2)))))) ;;; Determine if a case is subsumed by a another case in a template. ;;; If successful it will return two values: t and the list of cases ;;; in the template minus the case that subsumes the first case. (defun scheme-case-subsumed-by (case template updated-template) (cond ((null template) (values nil updated-template)) ((scheme-single-case-subsumes-p (first template) case) (values t (append (cdr template) updated-template))) (t (scheme-case-subsumed-by case (cdr template) (cons (car template) updated-template))))) ;;; Return t if the first case subsumes the second case. (defun scheme-single-case-subsumes-p (case-1 case-2) (and (subset-p (induction-case-tests case-2) (induction-case-tests case-1)) (substitutions-subsumes-substitutions-p (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) ;;; Return t if a list of substitutions subsumes a second list. (defun substitutions-subsumes-substitutions-p (list-of-sublis-1 list-of-sublis-2) (or (null list-of-sublis-2) (multiple-value-bind (subsumed updated-list) (substitution-subsumed-by-list (first list-of-sublis-2) list-of-sublis-1 nil) (and subsumed (substitutions-subsumes-substitutions-p updated-list (cdr list-of-sublis-2)))))) ;;; Return a success indicator and the modified list of substitutions ;;; if the substitution is subsumed by a substitution in the list. ;;; The modified list will have the subsuming substitution removed. (defun substitution-subsumed-by-list (subst list-of-subst updated-list) (cond ((null list-of-subst) (values nil updated-list)) ((substitution-subsumed-by subst (first list-of-subst)) (values t (append (cdr list-of-subst) updated-list))) (t (substitution-subsumed-by-list subst (cdr list-of-subst) (cons (car list-of-subst) updated-list))))) (defun substitution-subsumed-by (subst1 subst2) (cond ((null subst1) t) (t (let ((match (assoc-eq (caar subst1) subst2))) (and match (expr-occurs (cdar subst1) (cdr match)) (substitution-subsumed-by (cdr subst1) (remove-equal match subst2))))))) ;;; ----- Merging Schemes ;;; Given a list of schemes, it will delete those that can be merged into ;;; other schemes. This is the second filtering step. (defun list-of-merged-schemes (list-of-schemes) (and list-of-schemes (list-of-merged-schemes-aux (first list-of-schemes) (list-of-merged-schemes (cdr list-of-schemes)) nil))) (defun list-of-merged-schemes-aux (scheme unprocessed-schemes processed-schemes) (if (null unprocessed-schemes) (cons scheme processed-schemes) (let ((merged (merge-schemes scheme (first unprocessed-schemes)))) (if merged (list-of-merged-schemes-aux merged (append (cdr unprocessed-schemes) processed-schemes) nil) (list-of-merged-schemes-aux scheme (cdr unprocessed-schemes) (cons (first unprocessed-schemes) processed-schemes)))))) ;;; Return the merged scheme if one of the schemes can be merged into ;;; the other scheme. (defun merge-schemes (scheme-1 scheme-2) (and (not (null (intersection-eq (scheme-changing scheme-1) (scheme-changing scheme-2)))) (null (intersection-eq (scheme-unchanging scheme-1) (scheme-changing scheme-2))) (null (intersection-eq (scheme-unchanging scheme-2) (scheme-changing scheme-1))) ;; only merge into a scheme which has no quantified hypothesis (or (make-merged-scheme scheme-2 scheme-1 (merge-templates (scheme-template scheme-2) (scheme-template scheme-1))) (make-merged-scheme scheme-1 scheme-2 (merge-templates (scheme-template scheme-1) (scheme-template scheme-2)))))) (defun make-merged-scheme (scheme-1 scheme-2 merged-template) (and merged-template (make-scheme :template merged-template :changing (unique (union-eq (scheme-changing scheme-1) (scheme-changing scheme-2))) :unchanging (unique (union-eq (scheme-unchanging scheme-1) (scheme-unchanging scheme-2))) :changeables (scheme-changeables scheme-2) :unchangeables (scheme-unchangeables scheme-2) :score (+ (scheme-score scheme-1) (scheme-score scheme-2)) :flawed (or (scheme-flawed scheme-1) (scheme-flawed scheme-2)) :origin (scheme-origin scheme-2)))) ;;; Return the merged template if the first template can be merged into ;;; the second one. (defun merge-templates (template-1 template-2) (and (<= (length template-1) (length template-2)) (let ((template (merge-templates-stage-1 template-1 template-2))) (when template (merge-template-stage-2 template-1 template-2))))) ;;; In stage 1, try to merge each case of the first template into a unique ;;; case of the second template. If successful it will return the merged ;;; template. (defun merge-templates-stage-1 (template-1 template-2) (merge-templates-stage-1-aux template-1 template-2 (mapcar #'(lambda (u) u nil) template-2))) (defun merge-templates-stage-1-aux (template-1 template-2 merged-cases) (cond ((null template-1) template-2) ((null (induction-case-substitutions (car template-1))) (merge-templates-stage-1-aux (cdr template-1) template-2 merged-cases)) (t (multiple-value-bind (template merged) (merge-templates-stage-1-aux-aux (car template-1) template-2 merged-cases nil nil) (when template (merge-templates-stage-1-aux (cdr template-1) template merged)))))) (defun merge-templates-stage-1-aux-aux (case template merged tmp mrg) (cond ((null template) (values nil nil)) (t (let ((merged-case (and (null (car merged)) (merge-cases-1 case (car template))))) (cond (merged-case (values (revappend tmp (cons merged-case (cdr template))) (revappend mrg (cons t (cdr merged))))) (t (merge-templates-stage-1-aux-aux case (cdr template) (cdr merged) (cons (car template) tmp) (cons (car merged) mrg)))))))) ;;; In stage 2, try to merge each case of template-1 into as many cases ;;; of template-2 as possible. This stage will always be successful. (defun merge-template-stage-2 (template-1 template-2) (cond ((null template-2) nil) ((null (induction-case-substitutions (car template-2))) (cons (car template-2) (merge-template-stage-2 template-1 (cdr template-2)))) (t (cons (merge-template-stage-2-aux template-1 (car template-2)) (merge-template-stage-2 template-1 (cdr template-2)))))) (defun substitutions-in-template (template) (unless (null template) (append (induction-case-substitutions (car template)) (substitutions-in-template (cdr template))))) (defun bound-variables-in-template (template) (unless (null template) (append (list-of-bound-variables (induction-case-hypothesis (car template))) (bound-variables-in-template (cdr template))))) (defun merge-template-stage-2-aux (template case-2) (multiple-value-bind (result s1 rs rc) (merge-cases-2 (induction-case-hypothesis case-2) (induction-case-substitutions case-2) (substitutions-in-template template) nil nil) (if (null s1) (make-induction-case :tests (induction-case-tests case-2) :substitutions (reverse rs) :calls (reverse rc) :hypothesis (make-series-of-quantification 'all (intersection-eq (unique (bound-variables-in-template template)) (list-of-all-variables result)) result)) case-2))) (defun merge-cases-2 (expr s1 s2 rs rc) (cond ((atom expr) (values expr s1 rs rc)) ((eq (car expr) *induction-pattern*) (let ((s nil) (c nil)) (loop for ss in s2 do (let ((merged (merge-sublis ss (car s1)))) (when (and merged (not (equal (remove-equal-subst merged) (remove-equal-subst (car s1))))) (push merged s) (push (list* *induction-pattern* (gensym) (cdr expr)) c)))) (cond (s (values (cons 'and (revappend c (list expr))) (cdr s1) (append s (cons (car s1) rs)) (append c (cons expr rc)))) (t (values expr (cdr s1) (cons (car s1) rs) (cons expr rc)))))) (t (let ((expr-stack nil) (exp nil) (ts1 s1) (trs rs) (trc rc)) (loop for e in expr do (progn (multiple-value-setq (exp ts1 trs trc) (merge-cases-2 e ts1 s2 trs trc)) (push exp expr-stack))) (values (reverse expr-stack) ts1 trs trc))))) (defun remove-equal-subst (substitution) (remove-if #'(lambda (u) (eq (car u) (cdr u))) substitution)) ;;; Return the merged case if the first case can be merged into the ;;; second case. (defun merge-cases-1 (case-1 case-2) (unless (null (induction-case-substitutions case-2)) (let ((merged-subst (merge-substitutions (induction-case-substitutions case-1) (induction-case-substitutions case-2)))) (and merged-subst (make-induction-case :tests (induction-case-tests case-2) :substitutions merged-subst :calls (induction-case-calls case-2) :hypothesis (make-series-of-quantification 'all (unique (list-of-bound-variables (induction-case-hypothesis case-1))) (induction-case-hypothesis case-2))))))) ;;; Return the merged list of substitutions if the first list of ;;; substitutions can be merged into the second list. (defun merge-substitutions (subst-1 subst-2) (let ((merged-subst (merge-substitutions-aux subst-1 subst-2 nil))) (when merged-subst (revappend merged-subst subst-2)))) (defun merge-substitutions-aux (subst-1 subst-2 merged-subst) (cond ((null subst-1) merged-subst) ((null subst-2) nil) (t (multiple-value-bind (merged updated-subst) (merge-sublis-with-subst (first subst-1) subst-2 nil) (when merged (merge-substitutions-aux (cdr subst-1) updated-subst (cons merged merged-subst))))))) ;;; Return the merged substitution and the modified list of substitutions ;;; if the substitution can be merged into a substitution from the list ;;; of substitutions. The modified list will have the merged substitution ;;; removed. (defun merge-sublis-with-subst (sublis list-of-substs updated-subst) (cond ((null list-of-substs) (values nil nil)) (t (let ((merged (merge-sublis sublis (first list-of-substs)))) (if merged (values merged (revappend updated-subst (cdr list-of-substs))) (merge-sublis-with-subst sublis (cdr list-of-substs) (cons (car list-of-substs) updated-subst))))))) ;;; Return the merged substitution if the first substitution can be ;;; merged into the second substitution. (defun merge-sublis (sublis-1 sublis-2) (let ((overlap (intersection-eq (mapcar #'car sublis-1) (mapcar #'car sublis-2)))) (and overlap (consistent-overlap-p overlap sublis-1 sublis-2) (some #'(lambda (u) (neq u (cdr (assoc-eq u sublis-1)))) overlap) (append sublis-2 (remove-if #'(lambda (u) (member-equal u sublis-2)) sublis-1))))) ;;; Return t if the overlapping symbols are consistently substituted ;;; by the two substitutions (defun consistent-overlap-p (overlap sublis-1 sublis-2) (or (null overlap) (and (equal (assoc-eq (first overlap) sublis-1) (assoc-eq (first overlap) sublis-2)) (consistent-overlap-p (cdr overlap) sublis-1 sublis-2)))) ;;; ----- Flawed Schemes ;;; Remove flawed schemes. If every scheme is flawed, try just removing ;;; all "really flawed" schemes. If all the schemes are really flawed, ;;; none are removed. This is the 3rd and last filtering step. (defun list-of-unflawed-schemes (list-of-schemes) (or (remove-if #'(lambda (u) (scheme-flawed-p u list-of-schemes)) list-of-schemes) (remove-if #'(lambda (u) (scheme-really-flawed-p u list-of-schemes)) list-of-schemes) list-of-schemes)) ;;; Return t if the scheme is flawed with respect to a list of schemes. ;;; This is used for weeding out flawed schemes as described in BM's ACL. (defun scheme-flawed-p (scheme list-of-schemes) (let ((changeables (scheme-changeables scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (or (intersection-eq changeables (scheme-changing s)) (intersection-eq changeables (scheme-unchanging s)))) (return t))))) ;;; Boyer-Moore implementation in thm and nqthm added a second (weaker) ;;; pass in case everything is weeded out by the first pass. We added ;;; our own improvisation to Boyer-Moore's 2nd pass. (defun scheme-really-flawed-p (scheme list-of-schemes) (or (scheme-flawed scheme) ; our own improvisation ;; BM's enhancement in thm and nqthm (let ((changing (scheme-changing scheme))) (dolist (s list-of-schemes) (when (and (not (eq scheme s)) (intersection-eq changing (scheme-unchanging s))) (return t)))))) ;;; =============== Code to Log Induction =============== ;;; Logs conversion of ;;; (all vs Phi) ;;; to ;;; (all vs (implies H1 Phi)) ;;; where H1 is the "machine" (induction hypothesis) in IF form. (defun log-induction (formula vars machine term measure measured-quants index) (let ((m (genvar (input-variable-p '|)M|))) (m1 (genvar (input-variable-p '|)M1|))) (h1 (apply-machine-formula (if-form-machine machine) vars formula)) (h2 (make-h2 measure vars formula))) ;; Start with (all vs Phi) ;; Note that H2 is the strong induction hypothesis for formula ;; using the supplied measure. H1 is the actual instantiated ;; induction hypothesis. (log-induction-phase-1 formula vars h1 h2 index) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-2 formula vars machine term (append (mapcar #'(lambda (u) u 2) vars) (cons 2 (if-test-index))) h1 h2 measured-quants) ;; We now have: ;; (if (= (all vs Phi) (all vs (implies H2 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-induction-phase-3 formula h2 vars measure m m1 (cons 2 (if-test-index))) ;; We now have: ;; (if (= (all vs Phi) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-renames (mapcar #'cons (list-of-leading-universals h2) vars) (list* 2 2 1 2 2 (if-test-index))) (log-label (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))) m measure) ;; (if (= (all vs (if (some m (= m mu[vs])) Phi (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all vs (implies (some m (= m mu[vs])) Phi)) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))) ;; (if (= (all vs (if (some m (= m mu[vs])) (if Phi (true) (false)) (true))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (let ((expr (make-if (make-some-single m (make-= m measure)) (make-if formula *true* *false*) *true*))) (log-all-uncase-analysis-2 expr (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index))))) ;; We now have: ;; (if (= (all vs (all m (if (= m mu[vs]) Phi (true)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (log-move-universal-out (length vars) (cons 1 (if-test-index))) (let ((inner-index (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (cons 1 (if-test-index)))))) (if (bool-p formula) (push-proof-log 'is-boolean (cons 2 inner-index)) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (last vars) *true*) (cdr inner-index)) (cons 2 inner-index))) (push-proof-log 'syntax inner-index t)) ;; We now have: ;; (if (= (all m (all vs (implies (= m mu[vs]) Phi))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; This is where we apply the INDUCT inference rule. ;; (P m) is (all vs (implies (= m mu[vs]) Phi)). ;; (P m1) is (all vs (implies (= m1 mu[vs]) Phi)). (push-proof-log 'induct (cons 1 (if-test-index)) m1) ;; and get: ;; (if (= (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (all m (implies ;; (all m1 (implies (m< m1 m) ;; (all vs (implies (= m1 (mu[vs])) ;; Phi)))) ;; (all vs (implies (= m (mu[vs])) Phi))))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) (push-proof-log 'compute (if-test-index)) (push-proof-log 'if-true index) ;; We end up with: ;; (all vs (implies H1 Phi)) )) ;;; Apply if-form of the machine to formula (i.e. apply scheme ;;; to formula). (defun apply-machine-formula (machine vars formula) (cond ((true-p machine) *true*) ((if-p machine) (make-if (if-test machine) (apply-machine-formula (if-left machine) vars formula) (apply-machine-formula (if-right machine) vars formula))) ((all-p machine) (make-all (all-vars machine) (apply-machine-formula (all-expr machine) vars formula))) ((and-p machine) (cons 'and (mapcar #'(lambda (u) (apply-machine-formula u vars formula)) (cdr machine)))) (t (sublis-eq (pairlis vars (cdr machine)) formula)))) ;;; Make strong induction hypothesis according to measure, ;;; quantifying over newvars that correspond to vars. (defun make-h2 (measure vars formula) (let* ((newvars (mapcar #'genvar vars)) (substitutions (pairlis vars newvars))) (make-series-of-quantification 'all newvars (make-implies `(m< ,(sublis-eq substitutions measure) ,measure) (sublis-eq substitutions formula))))) ;;; log-induction-phase-1 logs the inferences that converts: ;;; (all vs Phi) ;;; to: ;;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (all vs (implies H1 Phi)) ;;; (all vs Phi)) ;;; (This is the uninteresting phase.) (defun log-induction-phase-1 (formula vars h1 h2 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1))) (let ((qform (make-series-of-quantification 'all vars formula))) (let ((qh1imp (make-series-of-quantification 'all vars (make-implies h1 formula))) (qh1h2imp (make-series-of-quantification 'all vars (make-implies (make-and h1 h2) formula)))) ;; H2 is the strong induction hypothesis. ;; qform = (all vs Phi) ;; qh1imp = (all vs (implies H1 Phi)) ;; qh1h2imp = (all vs (implies (and H1 H2) Phi)) (push-proof-log 'if-equal index (make-= qform qh1h2imp) t) (push-proof-log 'if-equal (if-left-index) (make-= qform qh1imp) t) (log-equality-substitute qform qform qh1imp (cons 2 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index)) (make-= qform qh1h2imp) t) (log-cases-if (make-if (make-= qform qh1h2imp) (make-= qform qh1imp) (make-= qform qh1imp)) nil (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (implies (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi))) ;; (all vs (implies H1 Phi))) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-equal (cons 1 (cons 1 (if-left-index))) qform t) (log-induction-phase-1-aux vars (make-implies h1 formula) qform qh1imp qh1h2imp (list* 1 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; Seems to be this: ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (and (true) ;; (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (if (true) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (true) ;; (false)) ;; (false)) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) (push-proof-log 'if-true (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (= (all vs Phi) ;; (all vs (implies (and H1 H2) Phi)))) ;; (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'look-up (list* 1 1 1 (if-left-index)) *true*) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (if (implies (not (true)) (all vs (implies H1 Phi))) ;; (all vs (implies H1 Phi)) ;; (all vs Phi)) ;; (all vs Phi)) ;; (if (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (...) ;; (all vs Phi)) (push-proof-log 'syntax (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'if-true (cons 1 (cons 1 (if-left-index)))) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-false (cons 1 (if-left-index))) (push-proof-log 'if-true (if-left-index))))) ;;; log-induction-phase-1-aux logs inferences that converts: ;;; (if (all vs Phi) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi)))) ;;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;;; (= (all vs Phi) (all vs (implies H1 Phi))))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux (vars h1imp qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux))) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) (log-=-true-left-to-if qh1h2imp (cons 1 (if-left-index))) (push-proof-log 'is-boolean (cons 1 (if-left-index)) t) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (log-=-true-left-to-if qh1imp (cons 2 (if-left-index))) (push-proof-log 'is-boolean (cons 2 (if-left-index)) t) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (= (all vs Phi) (all vs (implies (and H1 H2) Phi))) ;; (= (all vs Phi) (all vs (implies H1 Phi))))) (log-look-up-false (cons 1 (cons 1 (if-right-index)))) (log-=-false-left-to-if qh1h2imp (cons 1 (if-right-index))) (log-look-up-false (cons 1 (cons 2 (if-right-index)))) (log-=-false-left-to-if qh1imp (cons 2 (if-right-index))) ;; (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (log-cases-if (make-if qform (make-implies qh1h2imp qh1imp) (make-implies (make-if qh1h2imp *false* *true*) (make-if qh1imp *false* *true*))) nil index) ;; (and (implies (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)))) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (and-left-index)) (push-proof-log 'is-boolean (cons 2 (and-left-index)) t) ;; (and (if (all vs Phi) ;; (implies (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi))) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (push-proof-log 'syntax (cons 2 (and-left-index))) (push-proof-log 'is-boolean (cons 2 (cons 2 (and-left-index))) t) ;; (and (if (all vs Phi) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (all vs (implies H1 Phi)) ;; (true)) ;; (true)) ;; (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true))))) (log-induction-phase-1-aux-1 vars (and-left-index) h1imp qform qh1imp qh1h2imp) (push-proof-log 'syntax index) ;; (if (true) ;; (if (implies (not (all vs Phi)) ;; (implies (if (all vs (implies (and H1 H2) Phi)) ;; (false) ;; (true)) ;; (if (all vs (implies H1 Phi)) (false) (true)))) ;; (true) ;; (false)) ;; (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-induction-phase-1-aux-2 vars qform qh1imp qh1h2imp index) ) ;;; log-induction-phase-1-aux-1 logs inferences that converts: ;;; (if (all vs Phi) ;;; (if (all vs (implies (and H1 H2) Phi)) ;;; (all vs (implies H1 Phi)) ;;; (true)) ;;; (true)) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-1 (vars index h1imp qform qh1imp qh1h2imp) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-1))) (let* ((renames (mapcar #'genvar vars)) (renamed-h1imp (sublis-eq (pairlis vars renames) h1imp)) (renamed-qh1imp (sublis-eq (pairlis vars renames) qh1imp))) (log-renames (mapcar #'cons vars renames) (cons 2 (if-left-index))) (log-all-out-lefts vars (if-left-index) qh1h2imp renamed-qh1imp) (log-all-out-lefts vars index qform (universally-quantify renames (make-if qh1h2imp renamed-h1imp *true*))) (let ((inner-index (display-formula-index-aux renames index))) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (cons 1 inner-index)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) (push-proof-log 'syntax (list* 2 2 2 inner-index)) (push-proof-log 'look-up (list* 1 2 2 2 2 inner-index) *true*) (push-proof-log 'if-true (list* 2 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 2 inner-index)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) (dotimes (i (length vars)) i (push-proof-log 'remove-universal index) (push-proof-log 'is-boolean index t)))) ) ;;; log-induction-phase-1-aux-2 logs inferences that converts: ;;; (implies (not (all vs Phi)) ;;; (implies (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;;; (if (all vs (implies H1 Phi)) (false) (true)))) ;;; to: ;;; (true). (defun log-induction-phase-1-aux-2 (vars qform qh1imp qh1h2imp index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-1-aux-2))) (push-proof-log 'syntax (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (if (if (all vs (implies (and H1 H2) Phi)) (false) (true)) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true))) (push-proof-log 'case-analysis (implies-right-index) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (if (false) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)) ;; (if (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false)) ;; (true)))) (push-proof-log 'if-false (cons 2 (implies-right-index))) (push-proof-log 'if-true (cons 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (if (all vs (implies H1 Phi)) (false) (true)) ;; (true) ;; (false))))) (push-proof-log 'case-analysis (cons 3 (implies-right-index)) 1) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) ;; (if (false) (true) (false)) ;; (if (true) (true) (false))))) (push-proof-log 'if-false (list* 2 3 (implies-right-index))) (push-proof-log 'if-true (list* 3 3 (implies-right-index))) ;; (implies (not (all vs Phi)) ;; (if (all vs (implies (and H1 H2) Phi)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let* ((renames (mapcar #'genvar vars)) (substitutions (mapcar #' cons vars renames))) (log-renames substitutions (cons 1 (implies-right-index))) (log-repeat-all-out-tests renames (make-if (sublis-eq substitutions qh1h2imp) *true* (make-if qh1imp *false* *true*)) (implies-right-index)) ;; (implies (not (all vs Phi)) ;; (all vs' (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true)))) (let ((inner-index (display-formula-index-aux renames (implies-right-index)))) ;; inner-index points to ;; (if (implies (and H1 H2) Phi) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (cons 1 inner-index)) (push-proof-log 'syntax (list* 1 1 inner-index)) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (implies H1 Phi)) (false) (true))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 1 3 inner-index))) ;; (if (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-true (cons 3 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if (if Phi (true) (false)) ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-true (list* 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; (if (if H1 (if H2 (true) (false)) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) (push-proof-log 'case-analysis inner-index 1) (push-proof-log 'if-false (cons 3 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false) ;; (true))) ;; (true)) ;; (true)) (linearize-and-log-universal-instantiations (mapcar #'make-= vars renames) (list* 1 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if H1' (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) (push-proof-log 'look-up (list* 1 1 1 3 2 2 inner-index) *true*) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi ;; (true) ;; (if (if (if (true) (if Phi' (true) (false)) (true)) ;; (all vs (if H1 (if Phi (true) (false)) (true))) ;; (false)) ;; (false) ;; (true))) ;; (true)) ;; (true)) ;; Phi' is boolean? Coerce to make sure. (log-coerce-if-test-to-bool (list* 2 1 1 3 2 2 inner-index)) (log-look-up-false-for-coercion (list* 1 2 1 1 3 2 2 inner-index)) (push-proof-log 'if-true (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 1 3 2 2 inner-index)) (push-proof-log 'if-false (list* 3 2 2 inner-index)) ;; (if H1 ;; (if (if H2 (true) (false)) ;; (if Phi (true) (true)) ;; (true)) ;; (true)) (push-proof-log 'if-equal (list* 2 2 inner-index)) (push-proof-log 'if-equal (cons 2 inner-index)) (push-proof-log 'if-equal inner-index) ;; (true) ;; Finished with inner-index ====== (dotimes (i (length vars)) i (push-proof-log 'remove-universal (implies-right-index)) (push-proof-log 'is-boolean (implies-right-index) t)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'if-equal index))) ) (defun log-all-out-lefts (vars index test left) (unless (null vars) ;; (if test (all () ...) (true)) (log-all-uncase-analysis-2a (make-if test left *true*) index) (log-all-out-lefts (cdr vars) (all-expr-index) test (all-expr left)))) (defun log-repeat-all-out-tests (vars formula index &optional bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) Q) (unless (null vars) (let* ((q (if-right formula)) (coerced-q (make-if q *true* *false*))) ;; either Q is boolean or in boolean context so that Q ;; and (if Q (true) (false)) are equivalent. (log-coerce-expr-for-boolean-or-bool-p q (if-right-index) bool-p) ;; (if (all (var1) (all (var2) ... P)) (true) (if Q (true) (false))) (log-all-uncase-analysis-3 (make-if (if-test formula) *true* coerced-q) index) ;; (all (var1) (if (all (var2) ... P) (true) Q)) (unless (null (cdr vars)) (log-repeat-all-out-tests (cdr vars) (make-if (all-expr (if-test formula)) *true* q) (all-expr-index) (make-context-for-bool-p (make-all (list (car vars)) *true*) index))) ))) ;;; log-induction-phase-2 logs inferences that converts ;;; (implies (and H1 H2) Phi) ;;; to ;;; (implies H2 Phi) ;;; index points to (implies (and H1 H2) Phi) ;;; term is the term that suggested the induction, e.g. (div i j) (defun log-induction-phase-2 (formula vars machine term index h1 h2 measured-quants) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2))) ;; commute H1 and H2 and then convert to if form (log-use-axiom-as-rewrite (make-and h1 h2) 'and.commutative (list (make-= '|)X| h1) (make-= '|)Y| h2)) (implies-left-index)) (push-proof-log 'syntax index) (push-proof-log 'syntax (if-test-index)) ;; (if (if H2 (if H1 (true) (false)) (false)) (if Phi (true) (false)) (true)) (push-proof-log 'case-analysis index 1) ;; (if H2 ;; (if (if H1 (true) (false)) (if Phi (true) (false)) (true)) ;; (if (false) (if Phi (true) (false)) (true))) (log-remove-bool-coercion-from-if-test (if-left-index)) (push-proof-log 'if-false (if-right-index)) ;; At this point we have: ;; (if H2 ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; We now do the interesting part which is to knock off H1 ;; (converting it to (true) with the help of PO). (let* ((po-name (intern (format nil "~A.PO" (car term)) *zk-package*)) (po-args (unique (list-of-free-variables-unexpanded (ufunction-formula (get-event (car term)))))) (orig-po (progn (log-use-axiom (if-left-index) po-name) (ufunction-formula (get-event (car term))))) (po-args-renames (mapcar #'genvar po-args)) (args (ufunction-args (get-event (car term)))) ;; rename inner quantifications of PO (renamed-po (rename-quantified-variables-unexpanded orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index))))) ;; po is the PO applied to the induction term (po (sublis-eq (pairlis args (cdr term)) renamed-po))) (log-renames (mapcar #'cons po-args po-args-renames) (cons 1 (if-left-index))) ;; (if H2 ;; (if quantifiedPO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (linearize-and-log-universal-instantiations (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) ;; At this point quantifiedPO has been transformed by instantiation. ;; (if H2 ;; (if (if PO quantifiedPO (false)) ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) ;; rename back the outer quantification (log-renames (mapcar #'cons po-args-renames po-args) (list* 2 1 (if-left-index))) ;; unrename inner quantification of PO before discarding the axiom (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 2 1 (if-left-index)))) (push-proof-log 'use-axiom (cons 2 (cons 1 (if-left-index))) po-name t) (log-remove-bool-coercion-from-if-test (if-left-index)) ;; (if H2 ;; (if PO ;; (if H1 ;; (if Phi (true) (false)) ;; (true)) ;; (true)) ;; (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) (log-unnest-implies formula (if-left-index)) ;; At this point we have: ;; (if H2 (implies (and PO H1) Phi) (true)) (let ((expanded-po (expand-formula po (list* 1 1 (if-left-index))))) (log-induction-phase-2-aux formula vars (if-form-machine machine) expanded-po (cons 1 (if-left-index)) h1 h2 measured-quants nil)) ;; We now have (if H2 (implies PO Phi) (true)) (let ((idx (cons 1 (if-left-index)))) (push-proof-log 'if-equal idx `(= ,po ,po) t) ;; PO is now replaced by (if (= PO PO) PO PO) (expand-formula po (list* 1 1 idx)) (push-proof-log 'look-up (cons 2 idx) po) (expand-formula po (list* 2 1 idx)) (push-proof-log 'compute (cons 1 idx)) (push-proof-log 'if-true idx) ;; we now have the unexpanded PO ) (push-proof-log 'syntax (if-left-index)) ;; (if H2 (if PO (if Phi (true) (false)) (true)) (true)) (log-use-axiom (cons 2 (if-left-index)) po-name) (log-renames-unexpanded orig-po renamed-po (append (mapcar #'(lambda (u) u 2) po-args) (list* 1 2 (if-left-index)))) (log-renames (mapcar #'cons po-args po-args-renames) (list* 1 2 (if-left-index))) ;; (if H2 (if PO (if qPO (if Phi (true) (false)) (true)) (true)) (true)) (push-proof-log 'syntax (cons 2 (if-left-index)) t) ;; (if H2 (if PO (implies qPO Phi) (true)) (true)) (push-proof-log 'is-boolean (cons 2 (if-left-index))) (push-proof-log 'syntax (if-left-index) t) ;; (if H2 (implies PO (implies qPO Phi)) (true)) (log-unnest-implies formula (if-left-index)) ;; (if H2 (implies (and PO qPO) Phi) (true)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'is-boolean (list* 2 1 (if-left-index)) t) ;; (if H2 (implies (if PO qPO (false)) Phi) (true)) (let ((substitutions (pairlis (sublis-eq (pairlis po-args po-args-renames) args) (cdr term)))) (log-universal-subsumption (make-if po (make-series-of-quantification 'all po-args-renames (sublis-eq (pairlis po-args po-args-renames) renamed-po)) *false*) (mapcar #'(lambda (u) (make-= u (cdr (assoc-eq u substitutions)))) po-args-renames) (cons 1 (if-left-index)))) (log-renames (mapcar #'cons po-args-renames po-args) (cons 1 (if-left-index))) (log-renames-unexpanded renamed-po orig-po (append (mapcar #'(lambda (u) u 2) po-args) (cons 1 (if-left-index)))) ;; At this point we have: ;; (if H2 (implies qPO Phi) (true)) (push-proof-log 'use-axiom (cons 1 (if-left-index)) po-name t) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; (if H2 (if Phi (true) (false)) (true)) (push-proof-log 'syntax index t)) ) ;;; Recursively dive into the ``if-form'' machine, until we hit either ;;; (true) or a list of substitutions. ;;; At the top level, it logs conversion of (and PO H1) to PO. ;;; Note that PO is in "if" form. (defvar *debugging-log-induction* nil) (defun log-induction-phase-2-aux (formula vars machine po index h1 h2 measured-quants renames) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux))) (when *debugging-log-induction* (format t "~%Machine: ~S~%" machine) (format t "~%PO: ~S~%" po) (format t "~%H1: ~S~%" h1)) (cond ((true-p machine) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) ((and (if-p po) (if-p machine)) ;; (and (if test leftPO rightPO) (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 1) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) (push-proof-log 'look-up (cons 1 (cons 2 (if-left-index))) *true*) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if test ;; (and leftPO (if test leftH1 rightH1)) ;; (and rightPO (if test leftH1 rightH1))) ;; ***** test is not necessarilly known to be boolean! (log-coerce-expr-for-boolean-or-bool-p (if-test h1) (list* 1 2 (if-right-index)) (make-context-for-bool-p h1 (cons 2 (if-right-index)))) (log-look-up-false-for-coercion (list* 1 2 (if-right-index))) ;;(log-look-up-false (cons 1 (cons 2 (if-right-index)))) (push-proof-log 'if-false (cons 2 (if-right-index))) ;; (if test ;; (and leftPO leftH1 rightH1) ;; (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; which is the same as PO ) ((if-p machine) ;; (and PO (if test leftH1 rightH1)) (push-proof-log 'case-analysis index 2) ;; (if test (and PO leftH1) (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-left machine) po (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test PO (and PO rightH1)) (log-induction-phase-2-aux formula vars (if-right machine) po (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test PO PO) (push-proof-log 'if-equal index) ;; PO ) ((if-p po) ;; (and (if test leftPO rightPO) H1) (push-proof-log 'case-analysis index 1) ;; (if test (and leftPO H1) (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-left po) (if-left-index) (if-left h1) h2 measured-quants renames) ;; (if test leftPO (and rightPO H1)) (log-induction-phase-2-aux formula vars machine (if-right po) (if-right-index) (if-right h1) h2 measured-quants renames) ;; (if test leftPO rightPO) ;; (push-proof-log 'if-equal index) ;; PO ) ((all-p machine) ;; (and po h1) ;; where h1 is of the form (all (v) expr) (cond ((member-eq (all-var h1) measured-quants) (push-proof-log 'rename-universal (and-right-index) (all-var h1) (all-var po)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) (log-induction-phase-2-aux formula vars (all-expr machine) (all-expr po) (all-expr-index) (subst-eq (all-var po) (all-var h1) (all-expr h1)) h2 measured-quants (cons (cons (all-var h1) (all-var po)) renames))) (t (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (push-proof-log 'remove-universal (and-left-index) (all-vars h1) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) (push-proof-log 'all-case-analysis index t) (log-coerce-expr-for-boolean-or-bool-p (all-expr h1) (cons 2 (all-expr-index)) (make-context-for-bool-p (make-all (all-vars h1) *true*) index)) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO expr)) (log-induction-phase-2-aux formula vars (all-expr machine) po (all-expr-index) (all-expr h1) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)))) ((and-p po) (log-induction-phase-2-aux-and formula vars machine po index h1 h2 measured-quants renames)) ;; BUT because of merging, we might have a conjunction of ;; lists of substitutions ((and-p machine) ;; (and leaf-po h1-is-and) (push-proof-log 'syntax index) ;; (if leaf-po (if (and h1a h1b ...) (true) (false)) (false)) (log-induction-phase-2-aux-aux formula vars machine po (cons 1 (if-left-index)) h1 h2) ;; (if leaf-po (if (true) (true) (false)) (false)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'is-boolean index t) ;; leaf-po ) ;; List of substitutions (t ;; (and leaf-po leaf-h1) (push-proof-log 'syntax index) ;; (if po (if h1 (true) (false)) (false)) (push-proof-log 'if-equal (if-left-index) po t) ;; (if po ;; (if po ;; (if h1 (true) (false)) ;; (if h1 (true) (false))) ;; (false)) (log-if-to-and-or (make-if po (make-if h1 *true* *false*) (make-if h1 *true* *false*)) (if-left-index)) ;; (if po ;; (and (or (not po) (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if (if h1 (true) (false)) (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 3 1 (if-left-index))) ;; (if po ;; (and (if (not po) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if po ;; (and (if (if po (false) (true)) ;; (true) ;; (if h1 (true) (false))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if po ;; (and (if po ;; (if (false) (true) (if h1 (true) (false))) ;; (if (true) (true) (if h1 (true) (false)))) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'if-false (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) ;; (if po ;; (and (if po ;; (if h1 (true) (false)) ;; (true)) ;; (or po (if h1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 1 (if-left-index)) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1) ;; (or PO (if H1 (true) (false)))) ;; (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) ;; (if PO ;; (and (implies PO H1) ;; (or (true) (if H1 (true) (false)))) ;; (false)) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (implies PO H!) (true)) (false)) (push-proof-log 'syntax (if-left-index) t) ;; At this point, we have ;; (if PO ;; (and (implies PO H1)) ;; (false)) (push-proof-log 'if-equal (if-left-index) h2 t) ;; (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) (if-left-index)) (push-proof-log 'syntax (cons 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (sublis-eq renames (cdr machine))) (list* 1 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 1 (if-left-index)) *true*) ;; the *true* in make-not is just a fake argument ;; the value is irrelevant for ;; log-remove-bool-coercion-from-inside-connective (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 (if-left-index))) ;; At this point, we have ;; (if PO ;; (and (if (not H2[vs]) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 1 1 1 1 (if-left-index)) *true*) ;; (if PO ;; (and (if (not (implies (true) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-implies-to-or (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or (not (true)) Phi[vs])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 1 1 (if-left-index))) (push-proof-log 'if-true (list* 1 1 1 1 (if-left-index))) (log-or-false 1 2 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (or Phi[vs1])) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-or-1 (list* 1 1 1 (if-left-index))) ;; (if PO ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 (if-left-index))) ;; (if PO ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (log-remove-bool-coercion-from-if-test (list* 1 1 (if-left-index))) (push-proof-log 'case-analysis (cons 1 (if-left-index)) 1) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies PO H1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'look-up (list* 2 1 1 3 2 1 (if-left-index)) *true*) (log-implies-to-or (list* 1 1 3 2 1 (if-left-index))) ;; (if PO ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not PO) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies PO H1)) (true) (false)))) ;; (or H2 (and (implies PO H1)))) ;; (false)) (push-proof-log 'syntax (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 1 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 1 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'syntax (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 1 3 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 2 1 (if-left-index))) (push-proof-log 'if-equal (list* 2 1 (if-left-index))) (push-proof-log 'if-true (list* 3 1 (if-left-index))) (push-proof-log 'if-equal (cons 1 (if-left-index))) ;; (if PO (and (true) (or H2 (and (implies PO H1)))) (false)) (push-proof-log 'look-up (list* 1 2 (if-left-index)) *true*) (push-proof-log 'syntax (cons 2 (if-left-index))) (push-proof-log 'if-true (cons 2 (if-left-index))) ;; (if PO (and (true) (true)) (false)) (push-proof-log 'syntax (if-left-index)) (push-proof-log 'if-true (if-left-index)) (push-proof-log 'if-true (if-left-index)) ;; At this point we have (if (m< mu[vs1] mu[vs]) (true) (false)) ;; Assuming m< always returns a boolean, remove the boolean ;; coercion. (push-proof-log 'is-boolean index t) ))) (defun log-and-trues (n index) (cond ((> n 2) (push-proof-log 'syntax index) ;; (and (true) (and (true) ...)) (push-proof-log 'syntax index) ;; (if (true) (if (and (true) ...) (true) (false)) (false)) (push-proof-log 'if-true index) (push-proof-log 'is-boolean index t) (log-and-trues (- n 1) index)) ((= n 2) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ;; (true) ) (t ;; (and (true)) or (and) (push-proof-log 'syntax index) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) (defun log-induction-phase-2-aux-and (formula vars machine po index h1 h2 measured-quants renames) ;; (and (and POL POR) (and H1L H1R)) (cond ((and (all-p (and-left machine)) (not (member-eq (all-var (and-left h1)) measured-quants))) ;; (and PO (and (all (v) H1Lexpr) H1R) ;; Need to move quantifier out (log-coerce-expr-for-boolean-or-bool-p po (and-left-index) (make-context-for-bool-p (make-and po h1) index)) (log-coerce-expr-for-boolean-or-bool-p (and-right h1) (cons 2 (and-right-index)) (make-context-for-bool-p h1 (and-right-index))) ;; (and (if PO (true) (false)) ;; (and (all (v) H1Lexpr) (if H1R (true) (false))))) (push-proof-log 'remove-universal (cons 2 (and-right-index)) (all-vars (and-left h1)) t) ;; (and (if PO (true) (false)) (and (all (v) H1Lexpr) (all (v) H1R))) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'is-boolean (cons 2 (and-right-index)) t) (push-proof-log 'all-case-analysis (and-right-index) t) ;; (and (if PO (true) (false)) (all (v) (if H1Lexpr H1R (false)))) (push-proof-log 'remove-universal (and-left-index) (all-vars (and-left h1)) t) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if (all (v) PO) ;; (all (v) (if H1Lexpr H1R (false))) ;; (false)) (push-proof-log 'all-case-analysis index t) ;; (all (v) (if PO (if H1Lexpr H1R (false)) (false))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-all (all-vars (and-left h1)) *true*) index) (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all (v) (and PO (if H1Lexpr H1R (false)))) (log-coerce-expr-in-boolean-context (make-context-for-bool-p (make-and po (make-if (all-expr (and-left h1)) (and-right h1) *false*)) (all-expr-index)) (list* 2 2 (all-expr-index))) (push-proof-log 'syntax (cons 2 (all-expr-index)) t) ;; (all (v) (and PO (and H1Lexpr H1R))) (log-induction-phase-2-aux formula vars (make-and (all-expr (and-left machine)) (and-right machine)) po (all-expr-index) (make-and (all-expr (and-left h1)) (and-right h1)) h2 measured-quants renames) ;; (all (v) PO) (push-proof-log 'remove-universal index) ;; *** Assumes PO is always Boolean. (push-proof-log 'is-boolean index t)) ((and-p (and-left machine)) ;; (and (and POL POR) (and (and H1LL H1LR) H1R)) (log-associate-and-right h1 (and-right-index)) (log-induction-phase-2-aux formula vars (make-and (and-left (and-left machine)) (make-and (and-right (and-left machine)) (and-right machine))) po index (make-and (and-left (and-left h1)) (make-and (and-right (and-left h1)) (and-right h1))) h2 measured-quants renames)) (t ;; (and (and POL POR) (and H1L H1R)) (log-pair-up-ands po h1 index) ;; (and (POL H1L) (POR H1R)) (log-induction-phase-2-aux formula vars (and-left machine) (and-left po) (and-left-index) (and-left h1) h2 measured-quants renames) ;; (and POL (POR H1R)) (log-induction-phase-2-aux formula vars (and-right machine) (and-right po) (and-right-index) (and-right h1) h2 measured-quants renames) ;; (and POL POR) ))) (defun log-induction-phase-2-aux-aux (formula vars machine po index h1 h2) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-2-aux-aux))) (cond ((and-p machine) ;; (and h1a h1b ...) (loop for m in (cdr machine) for h in (cdr h1) for i = 1 then (+ i 1) do (log-induction-phase-2-aux-aux formula vars m po (cons i index) h h2)) ;; (log-and-trues (length (cdr machine)) index)) (t ;; h1 (push-proof-log 'if-equal index po t) (log-if-to-and-or (make-if po h1 h1) index) ;; (and (or (not po) h1) (or po h1)) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not po) (true) (if h1 (true) (false))) (or po h1)) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if po (false) (true)) (true) (if h1 (true) (false))) ;; (or po h1)) (push-proof-log 'case-analysis (cons 1 index) 1) (push-proof-log 'if-false (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if po (if h1 (true) (false)) (true)) ;; (or po h1)) (push-proof-log 'syntax (cons 1 index) t) ;; (and (implies po h1) (or po h1)) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) (push-proof-log 'syntax index t) ;; (and (implies po h1)) (push-proof-log 'if-equal index h2 t) ;; (if h2 (and (implies po h1)) (and (implies po h1))) (log-if-to-and-or (make-if h2 (list 'and (make-implies po h1)) (list 'and (make-implies po h1))) index) ;; (and (or (not h2) (and (implies po h1))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (cons 1 index)) ;; (and (if (not h2) (true) (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (linearize-and-log-universal-instantiations (mapcar #'make-= (list-of-leading-universals h2) (cdr machine)) (list* 1 1 1 index)) ;; (and (if (not (if H2[vs] H2 (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 1 index) *true*) ;; (and (if (not (if H2[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-inside-connective (make-not *true*) 1 (list* 1 1 index)) ;; (and (if (not H2[vs1]) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 1 1 1 index) *true*) ;; (and (if (not (implies (true) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 1 index)) ;; (and (if (not (or (not (true)) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 1 index)) (push-proof-log 'if-true (list* 1 1 1 1 index)) ;; (and (if (not (or (false) Phi[vs1])) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 1 index)) (push-proof-log 'if-false (list* 1 1 1 index)) ;; (and (if (not (if Phi[vs1] (true) (false))) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 1 index)) ;; (and (if (if (if Phi[vs1] (true) (false)) (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (log-remove-bool-coercion-from-if-test (list* 1 1 index)) ;; (and (if (if Phi[vs1] (false) (true)) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'case-analysis (cons 1 index) 1) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po h1)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 2 1 1 3 2 1 index) *true*) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (implies po (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-implies-to-or (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (or (not po) (true))) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (log-or-true 2 2 (list* 1 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) ;; (true) ;; (if (and (true)) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'syntax (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) (push-proof-log 'if-true (list* 1 3 2 1 index)) ;; (and (if Phi[vs1] ;; (if (false) (true) (if (true) (true) (false))) ;; (if (true) ;; (true) ;; (if (and (implies po h1)) (true) (false)))) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-true (list* 3 2 1 index)) (push-proof-log 'if-equal (list* 2 1 index)) (push-proof-log 'if-true (list* 3 1 index)) ;; (and (if Phi[vs1] (true) (true) ;; (or h2 (and (implies po h1)))) (push-proof-log 'if-equal (cons 1 index)) ;; (and (true) (or h2 (and (implies po h1)))) (push-proof-log 'look-up (list* 1 2 index) *true*) (push-proof-log 'syntax (and-right-index)) (push-proof-log 'if-true (and-right-index)) ;; (and (true) (true)) (push-proof-log 'syntax index) (push-proof-log 'if-true index) (push-proof-log 'if-true index) ))) ;;; Log the conversion of (and (and a1 a2) (and b1 b2)) to ;;; (and (and a1 b1) (and a2 b2)) (defun log-pair-up-ands (left right index) (let ((a1 (and-left left)) (a2 (and-right left)) (b1 (and-left right)) (b2 (and-right right))) (push-proof-log 'if-equal index a1 t) ;; (if a1 (and (and a1 a2) (and b1 b2)) (and (and a1 a2) (and b1 b2))) (cond ((bool-p a1) (log-look-up-false (list* 1 1 (if-right-index)))) (t (log-coerce-to-bool-inside-connective left 1 (cons 1 (if-right-index))) (log-look-up-false-for-coercion (list* 1 1 (if-right-index))))) (log-and-false 1 2 (cons 1 (if-right-index))) (log-and-false 1 2 (if-right-index)) ;; (if a1 (and (and a1 a2) (and b1 b2)) (false)) (push-proof-log 'look-up (cons 1 (cons 1 (if-left-index))) *true*) ;; (if a1 (and (and (true) a2) (and b1 b2)) (false)) (push-proof-log 'syntax (cons 1 (if-left-index))) (push-proof-log 'if-true (cons 1 (if-left-index))) ;; (if a1 (and (if a2 (true) (false)) (and b1 b2)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and (make-if a2 *true* *false*) right) 1 (if-left-index)) ;; (if a1 (and a2 (and b1 b2)) (false)) (push-proof-log 'if-equal (if-left-index) (and-left right) t) ;; (if a1 (if b1 (and a2 (and b1 b2)) (and a2 (and b1 b2))) (false)) (cond ((bool-p b1) (log-look-up-false (list* 1 2 3 (if-left-index)))) (t (log-coerce-to-bool-inside-connective right 1 (list* 2 3 (if-left-index))) (log-look-up-false-for-coercion (list* 1 2 3 (if-left-index))))) (log-and-false 1 2 (list* 2 3 (if-left-index))) (log-and-false 2 2 (list* 3 (if-left-index))) ;; (if a1 (if b1 (and a2 (and b1 b2)) (false)) (false)) (push-proof-log 'look-up (list* 1 2 2 (if-left-index)) *true*) ;; (if a1 (if b1 (and a2 (and (true) b2)) (false)) (false)) (push-proof-log 'syntax (list* 2 2 (if-left-index))) (push-proof-log 'if-true (list* 2 2 (if-left-index))) ;; (if a1 (if b1 (and a2 (if b2 (true) (false))) (false)) (false)) (log-remove-bool-coercion-from-inside-connective-strict (make-and a2 (make-if b2 *true* *false*)) 2 (cons 2 (if-left-index))) ;; (if a1 (if b1 (and a2 b2) (false)) (false)) (push-proof-log 'if-false (if-right-index) (make-and a2 b2) t) ;; (if a1 (if b1 (and a2 b2) (false)) (if (false) (and a2 b2) (false))) (push-proof-log 'case-analysis index 1 t) ;; (if (if a1 b1 (false)) (and a2 b2) (false)) (log-coerce-if-test-to-bool index) (push-proof-log 'case-analysis (if-test-index) 1) (push-proof-log 'if-false (cons 3 (if-test-index))) ;; (if (if a1 (if b1 (true) (false)) (false)) (and a2 b2) (false)) (push-proof-log 'syntax (if-test-index) t) ;; (if (and a1 b1) (and a2 b2) (false)) (push-proof-log 'is-boolean (if-left-index)) (push-proof-log 'syntax index t) ;; (and (and a1 b1) (and a2 b2)) )) ;;; log-induction-phase-3 logs inferences that convert ;;; (all vs (implies H2 Phi)) ;;; to ;;; (all m (implies (all m1 (implies (m< m1 m) ;;; (all vs1 (implies (= m1 (mu[vs1])) ;;; Phi[vs1])))) ;;; (all vs (implies (= m (mu[vs])) Phi)))) ;;; vs is vars ;;; Phi is formula (defun log-induction-phase-3 (formula h2 vars measure m m1 index) (when *debug-checker* (push-proof-log 'marker index '(log-induction-phase-3))) (let ((inner-index (append (mapcar #'(lambda (u) u 2) vars) index)) (substitutions (mapcar #'cons vars (list-of-leading-universals h2)))) (log-label inner-index m measure) (log-label (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 inner-index)) m1 (sublis-eq substitutions measure)) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true))) (push-proof-log 'is-boolean (cons 2 inner-index)) (push-proof-log 'syntax inner-index t) ;; We now have ;; (all vs (implies (some m (= m (mu[vs]))) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi))) (push-proof-log 'syntax inner-index) ;; We now have ;; (all vs (if (some m (= m (mu[vs]))) ;; (if (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1])) ;; (true))) ;; Phi) ;; (true) ;; (false)) ;; (true))) ;; inner-index points to the outer if (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m (make-= m measure)) (make-if (make-implies (universally-quantify vs1 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-implies (make-m< muvs1 measure) phivs1) *true*)) formula) *true* *false*) *true*) inner-index)) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true))) ;; Phi) ;; (true)))) (let ((idx (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) (push-proof-log 'is-boolean (cons 2 idx))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 (if (some m1 (= m1 (mu[vs1]))) ;; (if (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true) ;; (false)) ;; (true))) ;; Phi) ;; (true)))) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (log-all-uncase-analysis-2 (make-if (make-some-single m1 (make-= m1 muvs1)) (make-if (make-implies (make-m< muvs1 measure) phivs1) *true* *false*) *true*) (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index)))) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< (mu[vs1]) (mu[vs])) ;; Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'look-up (list* 1 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m1) (push-proof-log 'look-up (list* 2 1 2 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 1 2 2 inner-index))) m) ;; We now have: ;; (all vs ;; (all m (if (= m (mu[vs])) ;; (implies ;; (all vs1 ;; (all m1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (log-move-universal-out (length vars) index) (log-move-universal-out (length vars) (list* 1 2 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi) ;; (true)))) (push-proof-log 'is-boolean (list* 2 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index) t) ;; We now have: ;; (all m ;; (all vs (implies (= m (mu[vs])) ;; (implies ;; (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; Phi)))) (log-unnest-implies formula (cons 2 inner-index)) (let ((muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula)) (vs1 (list-of-leading-universals h2))) (let ((left (make-= m measure)) (right (make-all-single m1 (universally-quantify vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (list* 1 2 inner-index)))) ;; (push-proof-log 'commute-and (list* 1 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (implies ;; (and (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (= m (mu[vs]))) ;; Phi))) (push-proof-log 'syntax (list* 1 2 inner-index)) (push-proof-log 'syntax (cons 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (= m (mu[vs])) (true) (false)) ;; (false)) ;; (if Phi (true) (false)) ;; (true)))) (push-proof-log 'case-analysis (cons 2 inner-index) 1) (push-proof-log 'if-false (list* 3 2 inner-index)) ;; We now have: ;; (all m ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true)))) ;; (repeat-log-all-case-analysis-1 (length vars) (all-expr-index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-all (list m1) (make-series-of-quantification 'all vs1 (make-if (make-= m1 muvs1) (make-implies (make-m< m1 m) phivs1) *true*))) (make-if (make-if (make-= m measure) *true* *false*) (make-if formula *true* *false*) *true*) *true*) (reverse vars) nil displacement (all-expr-index))) (log-remove-universals (length vars) (cons 3 (all-expr-index))) ;; We now have: ;; (all m ;; (if (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (push-proof-log 'is-boolean (cons 2 (all-expr-index))) (push-proof-log 'syntax (all-expr-index) t) ;; (all m ;; (implies ;; (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true))))) ;; The use of (list* 2 2 inner-index) just happens to work. ;; Should really be (append inner-index '(2 2)) (log-remove-bool-coercion-from-if-test (list* 2 2 inner-index)) (push-proof-log 'syntax (list* 2 2 inner-index) t) ;; We now have: ;; (all m (implies (all m1 (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'is-boolean (cons 2 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) t) (log-unnest-implies (sublis-eq substitutions formula) (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) (let* ((muvs1 (sublis-eq substitutions measure)) (left (make-= m1 muvs1)) (right (make-m< m1 m))) (log-use-axiom-as-rewrite (make-and left right) 'and.commutative (list (make-= '|)X| left) (make-= '|)Y| right)) (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))))) ;; (push-proof-log 'commute-and ;; (cons 1 (append (mapcar #'(lambda (u) u 2) vars) ;; (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (implies (and (m< m1 m) (= m1 (mu[vs1]))) ;; Phi[vs1]))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'syntax (cons 1 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (if (m< m1 m) ;; (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (push-proof-log 'case-analysis (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)) 1) (push-proof-log 'if-false (cons 3 (append (mapcar #'(lambda (u) u 2) vars) (list* 2 1 2 index)))) ;; We now have: ;; (all m (implies (all m1 ;; (all vs1 (if (m< m1 m) ;; (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true)) ;; (true)))) ;; (all vs (implies (= m (mu[vs])) Phi)))) ;; (repeat-log-all-case-analysis-1 (length vars) (list* 2 1 2 index)) (let ((displacement (mapcar #'(lambda (u) u 2) vars)) (vs1 (list-of-leading-universals h2)) (muvs1 (sublis-eq substitutions measure)) (phivs1 (sublis-eq substitutions formula))) (repeat-log-all-case-analysis-1 (make-if (make-m< m1 m) (make-if (make-if (make-= m1 muvs1) *true* *false*) (make-if phivs1 *true* *false*) *true*) *true*) (reverse vs1) nil displacement (list* 2 1 2 index))) (log-remove-universals (length vars) (list* 3 2 1 2 index)) ;; We now have: ;; (all m (implies (all m1 ;; (if (m< m1 m) ;; (all vs1 (if (if (= m1 (mu[vs1])) ;; (true) ;; (false)) ;; (if Phi[vs1] (true) (false)) ;; (true))) ;; (true))) ;; (all vs (implies (= m (mu[vs])) Phi)))) (log-remove-bool-coercion-from-if-test (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index))) (push-proof-log 'syntax (append (mapcar #'(lambda (u) u 2) vars) (list* 2 2 1 2 index)) t) (push-proof-log 'is-boolean (list* 2 2 1 2 index)) (push-proof-log 'syntax (list* 2 1 2 index) t) ;; We now have: ;; (all m (implies (all m1 (implies (m< m1 m) ;; (all vs1 (implies (= m1 (mu[vs1])) ;; Phi[vs1])))) ;; (all vs (implies (= m (mu[vs])) Phi)))) )) ;; (all vs (if (all m1 ;; (all vs1 (if (= m1 (mu[vs1])) ;; (implies (m< m1 m) Phi[vs1]) ;; (true)))) ;; (if (if (= m (mu[vs])) (true) (false)) ;; (if Phi (true) (false)) ;; (true)) ;; (true))) (defun repeat-log-all-case-analysis-1 (formula reversed-vars processed-vars displacement base-index) (unless (null displacement) ;; (all () (if test left right)) (let ((index (append (cdr displacement) base-index)) (left (make-series-of-quantification 'all processed-vars (if-left formula))) (right (make-series-of-quantification 'all processed-vars (if-right formula)))) (log-all-case-analysis-1 (make-all (list (car reversed-vars)) (make-if (if-test formula) left right)) index) ;; (if test (all (trailingvars) left) (all (trailingvars) right)) (repeat-log-all-case-analysis-1 formula (cdr reversed-vars) (cons (car reversed-vars) processed-vars) (cdr displacement) base-index))) ) (defun log-remove-universals (n index) (unless (zerop n) (log-remove-universals (- n 1) (all-expr-index)) (push-proof-log 'remove-universal index) ;; result is assumed to be Boolean (push-proof-log 'is-boolean index t))) ;;; This is like log-flip-universals except it moves a quantifier out ;;; instead of in. (defun log-move-universal-out (number-of-vars index) (unless (zerop number-of-vars) (log-move-universal-out (- number-of-vars 1) (all-expr-index)) (push-proof-log 'flip-universals index))) ;;; Convert ((tests1 hyp1) (tests2 hyp2) ...) to IF form. (defun if-form-machine (machine) (cond ((null machine) nil) (t (multiple-value-bind (formula rest-machine) (if-form-machine-aux (first (car machine)) 1 (second (car machine)) (cdr machine)) (when (null rest-machine) formula))))) (defun if-form-machine-aux (tests depth hyp machine) (cond ((null tests) (values (or hyp *true*) machine)) (t (let (left right rest-machine) ;; recur to make left (multiple-value-setq (left rest-machine) (if-form-machine-aux (cdr tests) (+ depth 1) hyp machine)) ;; recur to make right (multiple-value-setq (right rest-machine) (if-form-machine-aux (nthcdr depth (first (car rest-machine))) (+ depth 1) (second (car rest-machine)) (cdr rest-machine))) ;; make (if first-test left right) (values (make-if (car tests) left right) rest-machine))))) ;;; Log transformation of (implies H1 formula) to ;;; the result of apply-induction-template-to-formula. (defun log-apply-machine (machine template vars formula index bool-p) (cond ((= (length template) 1) (let ((h1 (substitute-induction-pattern-in-machine machine vars formula))) (when (and-p h1) (really-flatten-ands h1 (implies-left-index))))) (t (log-cases-if-hypothesis machine vars formula index bool-p)))) (defun log-cases-if-hypothesis (machine vars formula index bool-p) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis))) (cond ((if-p machine) ;; (implies (if t1 H1l H1r) Phi) (push-proof-log 'case-analysis index 1) ;; (if t1 (implies H1l Phi) (implies H1r Phi)) (log-cases-if (make-if (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula) (make-implies (substitute-induction-pattern-in-machine (if-right machine) vars formula) formula)) nil index) ;; (and (implies t1 (implies H1l Phi)) (implies (not t1) (implies H1r Phi))) (let ((left-test (if (and-p (if-test machine)) (cdr (if-test machine)) (list (if-test machine))) ) (right-test (cond ((not-p (if-test machine)) (log-not-not (cons 1 (and-right-index))) ;; (and (implies t1 (implies H1l Phi) ;; (implies (if t1test (true) (false)) ;; (implies H1r Phi))) (push-proof-log 'syntax (and-right-index)) ;; (and (implies t1 (implies H1l Phi)) ;; (if (if t1test (true) (false)) ;; (if (implies H1r Phi) (true) (false)) ;; (true))) (log-remove-bool-coercion-from-if-test (and-right-index)) (push-proof-log 'syntax (and-right-index) t) ;; (and (implies t1 (implies H1l Phi)) ;; (implies t1test (implies H1r Phi))) (if (and-p (not-expr (if-test machine))) (cdr (not-expr (if-test machine))) (list (not-expr (if-test machine))))) (t (list (make-not (if-test machine)))))) ;; (and (implies left-test (implies H1l Phi)) ;; (implies right-test (implies H1r Phi))) ;; left is result of processing (implies H1l Phi) (left-list (log-cases-if-hypothesis (if-left machine) vars formula (cons 2 (and-left-index)) (make-context-for-bool-p (make-implies (if-test machine) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-left-index)))) ;; right is result of processing (implies H1r Phi) (right-list (log-cases-if-hypothesis (if-right machine) vars formula (cons 2 (and-right-index)) (make-context-for-bool-p (make-implies (if (not-p (if-test machine)) (not-expr (if-test machine)) (make-not (if-test machine))) (make-implies (substitute-induction-pattern-in-machine (if-left machine) vars formula) formula)) (and-right-index))))) ;; (and (implies left-test left) ;; (implies right-test right)) (let ((left-result (cond ((= (length left-list) 1) ;; left-list is ((hyp)), ;; left is (implies hyp Phi), ;; (and (implies left-test (implies hyp Phi)) ;; (implies right-test right)) (list (log-cases-if-hypothesis-aux left-test (car left-list) formula (and-left-index))) ;; (and (implies (and left-test hyp) Phi) ;; (implies right-test right)) ) (t ;; left-list is (hyp1 hyp2 ...) ;; left is (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (implies left-test (and (implies hyp1 Phi) ...)) ;; (implies right-test Phi)) (log-cases-implies left-list (and-left-index)) ;; (and (and (implies left-test (implies hyp1 Phi)) ;; (implies left-test (implies hyp2 Phi)) ;; ...) ;; (implies right-test right)) (loop for l in left-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux left-test l formula (cons i (and-left-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (implies right-test right)) ))) (right-result (cond ((= (length right-list) 1) (list (log-cases-if-hypothesis-aux right-test (car right-list) formula (and-right-index)))) (t (log-cases-implies right-list (and-right-index)) (loop for r in right-list for i = 1 then (+ i 1) collect (log-cases-if-hypothesis-aux right-test r formula (cons i (and-right-index)))) ;; (and (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ...) ;; (and (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...)) )))) ;; Log the AND unexpansions performed by ;; apply-induction-template-to-formula. ;; Seems to expect (and (implies ...) (implies ...)) (really-flatten-ands (make-and (if (= (length left-result) 1) (let ((h (append ; left-test nil (car left-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in left-result collect (let ((h (append ; left-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula))))) (if (= (length right-result) 1) (let ((h (append ; right-test nil (car right-result)))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)) (cons 'and (loop for hyps in right-result collect (let ((h (append ; right-test nil hyps))) (make-implies (if (> (length h) 1) (cons 'and h) (car h)) formula)))))) index) ;; (and (implies (and left-test hyp1) Phi) ;; (implies (and left-test hyp2) Phi) ;; ... ;; (implies (and right-test rhyp1) Phi) ;; (implies (and right-test rhyp2) Phi) ;; ...) (append left-result right-result)) ;; )) ((true-p machine) ;; (implies (true) Phi) (push-proof-log 'syntax index) (push-proof-log 'if-true index) ;; (if Phi (true) (false)) (when (or (bool-p formula) bool-p) ;; almost certain but just in case (log-remove-coercion-for-boolean-or-bool-p formula index bool-p)) '(())) ((and (consp machine) (eq (car machine) *induction-pattern*)) ;; (P ...) (let ((substs (mapcar #'cons vars (cdr machine)))) (list (list (sublis-eq substs formula))))) ((and-p machine) (list (mapcar #'(lambda (u) (substitute-induction-pattern-in-machine u vars formula)) (cdr machine)))) (t (list (list (substitute-induction-pattern-in-machine machine vars formula)))) ;; (t (list (list machine))) )) (defun log-cases-implies (hyp-list index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-implies))) ;; hyp-list is a list of lists of conjuncts ;; (implies test (and (implies hyp1 Phi) (implies hyp2 Phi) ...)) (push-proof-log 'syntax index) (push-proof-log 'is-boolean (if-left-index) t) ;; (if test (and (implies hyp1 Phi) (implies hyp2 Phi) ...) (true)) (log-convert-true-to-and (length hyp-list) (if-right-index)) ;; (if test ;; (and (implies hyp1 Phi) (implies hyp2 Phi) ...) ;; (and (true) (true) ...)) (push-proof-log 'case-analysis index 0 t) ;; (and (if test (implies hyp1 Phi) (true)) ;; (if test (implies hyp2 Phi) (true)) ;; ...) (loop for i from 1 to (length hyp-list) do (progn (push-proof-log 'is-boolean (list* 2 i index)) (push-proof-log 'syntax (cons i index) t))) ;; (and (implies test (implies hyp1 Phi)) ;; (implies test (implies hyp2 Phi)) ;; ...) ) ;;; test is a list of conjuncts ;;; hyp is a list of conjuncts (defun log-cases-if-hypothesis-aux (test hyp formula index) (when *debug-checker* (push-proof-log 'marker index '(log-cases-if-hypothesis-aux))) (cond ((null hyp) test) (t ;; (implies test (implies (and hyp) Phi)) (log-unnest-implies formula index) ;; (implies (and test (and hyp)) Phi) ;; Log the AND unexpansions performed by make-induction-lemma-case. (let ((result (really-flatten-ands (list 'and (if (= (length test) 1) (car test) (cons 'and test)) (if (= (length hyp) 1) (car hyp) (cons 'and hyp))) (implies-left-index)))) (cond ((and-p result) (cdr result)) ((and (if-p result) (true-p (if-left result)) (false-p (if-right result)) (bool-p (if-test result))) (push-proof-log 'is-boolean (implies-left-index) t) (list (if-test result))) (t (list result))))))) (defun substitute-induction-pattern-in-machine (machine vars formula) (cond ((consp machine) (cond ((eq (car machine) *induction-pattern*) (let ((subst (mapcar #'cons vars (cdr machine)))) (sublis-eq subst formula))) (t (cons (car machine) (loop for m in (cdr machine) collect (substitute-induction-pattern-in-machine m vars formula)))))) (t machine)))
[ { "context": "#|\n Copyright 2013 Robert Burghart\n\n Licensed under the Apache License, Version 2.", "end": 36, "score": 0.9998708963394165, "start": 21, "tag": "NAME", "value": "Robert Burghart" } ]
src/Graphics/constants.lisp
JesterSks/Lunette
1
#| Copyright 2013 Robert Burghart Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |# (in-package :Lunette.Graphics) ;;; Built-in GDI Objects (define-constant WHITE_BRUSH 0) (define-constant LTGRAY_BRUSH 1) (define-constant GRAY_BRUSH 2) (define-constant DKGRAY_BRUSH 3) (define-constant BLACK_BRUSH 4) (define-constant NULL_BRUSH 5) (define-constant HOLLOW_BRUSH NULL_BRUSH) (define-constant WHITE_PEN 6) (define-constant BLACK_PEN 7) (define-constant NULL_PEN 8) (define-constant OEM_FIXED_FONT 10) (define-constant ANSI_FIXED_FONT 11) (define-constant ANSI_VAR_FONT 12) (define-constant SYSTEM_FONT 13) (define-constant DEVICE_DEFAULT_FONT 14) (define-constant DEFAULT_PALETTE 15) (define-constant SYSTEM_FIXED_FONT 16) (define-constant DEFAULT_GUI_FONT 17) (define-constant DC_BRUSH 18) (define-constant DC_PEN 19) (define-constant STOCK_LAST 19) ;;; Brush hash styles (define-constant HS_HORIZONTAL 0) ; ----- (define-constant HS_VERTICAL 1) ; ||||| (define-constant HS_FDIAGONAL 2) ; \\\\\ (define-constant HS_BDIAGONAL 3) ; ///// (define-constant HS_CROSS 4) ; +++++ (define-constant HS_DIAGCROSS 5) ; xxxxx (define-constant HS_API_MAX 12) ;;; Pen styles (define-constant PS_SOLID 0) (define-constant PS_DASH 1) ; ------- (define-constant PS_DOT 2) ; ....... (define-constant PS_DASHDOT 3) ; _._._._ (define-constant PS_DASHDOTDOT 4) ; _.._.._ (define-constant PS_NULL 5) (define-constant PS_INSIDEFRAME 6) (define-constant PS_USERSTYLE 7) (define-constant PS_ALTERNATE 8) (define-constant PS_STYLE_MASK #x0000000F) ;;; Binary raster operations (define-constant R2_BLACK 1) ; 0 (define-constant R2_NOTMERGEPEN 2) ; DPon (define-constant R2_MASKNOTPEN 3) ; DPna (define-constant R2_NOTCOPYPEN 4) ; PN (define-constant R2_MASKPENNOT 5) ; PDna (define-constant R2_NOT 6) ; Dn (define-constant R2_XORPEN 7) ; DPx (define-constant R2_NOTMASKPEN 8) ; DPan (define-constant R2_MASKPEN 9) ; DPa (define-constant R2_NOTXORPEN 10) ; DPxn (define-constant R2_NOP 11) ; D (define-constant R2_MERGENOTPEN 12) ; DPno (define-constant R2_COPYPEN 13) ; P (define-constant R2_MERGEPENNOT 14) ; PDno (define-constant R2_MERGEPEN 15) ; DPo (define-constant R2_WHITE 16) ; 1 (define-constant R2_LAST 16) ;;; Background modes (define-constant TRANSPARENT 1) (define-constant OPAQUE 2) (define-constant BKMODE_LAST 2) ;;; Poly fill modes (define-constant ALTERNATE 1) (define-constant WINDING 2) (define-constant POLYFILL_LAST 2) ;;; PolyDraw constants (define-constant PT_CLOSEFIGURE #x01) (define-constant PT_LINETO #x02) (define-constant PT_BEZIERTO #x04) (define-constant PT_MOVETO #x06) ;;; Mapping Modes (define-constant MM_TEXT 1) (define-constant MM_LOMETRIC 2) (define-constant MM_HIMETRIC 3) (define-constant MM_LOENGLISH 4) (define-constant MM_HIENGLISH 5) (define-constant MM_TWIPS 6) (define-constant MM_ISOTROPIC 7) (define-constant MM_ANISOTROPIC 8) (define-constant MM_MIN MM_TEXT) (define-constant MM_MAX MM_ANISOTROPIC) (define-constant MM_MAX_FIXEDSCALE MM_TWIPS) ;;; Color Types (define-constant CTLCOLOR_MSGBOX 0) (define-constant CTLCOLOR_EDIT 1) (define-constant CTLCOLOR_LISTBOX 2) (define-constant CTLCOLOR_BTN 3) (define-constant CTLCOLOR_DLG 4) (define-constant CTLCOLOR_SCROLLBAR 5) (define-constant CTLCOLOR_STATIC 6) (define-constant CTLCOLOR_MAX 7) (define-constant COLOR_SCROLLBAR 0) (define-constant COLOR_BACKGROUND 1) (define-constant COLOR_ACTIVECAPTION 2) (define-constant COLOR_INACTIVECAPTION 3) (define-constant COLOR_MENU 4) (define-constant COLOR_WINDOW 5) (define-constant COLOR_WINDOWFRAME 6) (define-constant COLOR_MENUTEXT 7) (define-constant COLOR_WINDOWTEXT 8) (define-constant COLOR_CAPTIONTEXT 9) (define-constant COLOR_ACTIVEBORDER 10) (define-constant COLOR_INACTIVEBORDER 11) (define-constant COLOR_APPWORKSPACE 12) (define-constant COLOR_HIGHLIGHT 13) (define-constant COLOR_HIGHLIGHTTEXT 14) (define-constant COLOR_BTNFACE 15) (define-constant COLOR_BTNSHADOW 16) (define-constant COLOR_GRAYTEXT 17) (define-constant COLOR_BTNTEXT 18) (define-constant COLOR_INACTIVECAPTIONTEXT 19) (define-constant COLOR_BTNHIGHLIGHT 20) (define-constant COLOR_3DDKSHADOW 21) (define-constant COLOR_3DLIGHT 22) (define-constant COLOR_INFOTEXT 23) (define-constant COLOR_INFOBK 24) (define-constant COLOR_HOTLIGHT 26) (define-constant COLOR_GRADIENTACTIVECAPTION 27) (define-constant COLOR_GRADIENTINACTIVECAPTION 28) (define-constant COLOR_MENUHILIGHT 29) (define-constant COLOR_MENUBAR 30) (define-constant COLOR_DESKTOP COLOR_BACKGROUND) (define-constant COLOR_3DFACE COLOR_BTNFACE) (define-constant COLOR_3DSHADOW COLOR_BTNSHADOW) (define-constant COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT) ;;; Owner draw state (define-constant ODS_SELECTED #x0001) (define-constant ODS_GRAYED #x0002) (define-constant ODS_DISABLED #x0004) (define-constant ODS_CHECKED #x0008) (define-constant ODS_FOCUS #x0010) (define-constant ODS_DEFAULT #x0020) (define-constant ODS_COMBOBOXEDIT #x1000) (define-constant ODS_HOTLIGHT #x0040) (define-constant ODS_INACTIVE #x0080) (define-constant ODS_NOACCEL #x0100) (define-constant ODS_NOFOCUSRECT #x0200)
67991
#| Copyright 2013 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |# (in-package :Lunette.Graphics) ;;; Built-in GDI Objects (define-constant WHITE_BRUSH 0) (define-constant LTGRAY_BRUSH 1) (define-constant GRAY_BRUSH 2) (define-constant DKGRAY_BRUSH 3) (define-constant BLACK_BRUSH 4) (define-constant NULL_BRUSH 5) (define-constant HOLLOW_BRUSH NULL_BRUSH) (define-constant WHITE_PEN 6) (define-constant BLACK_PEN 7) (define-constant NULL_PEN 8) (define-constant OEM_FIXED_FONT 10) (define-constant ANSI_FIXED_FONT 11) (define-constant ANSI_VAR_FONT 12) (define-constant SYSTEM_FONT 13) (define-constant DEVICE_DEFAULT_FONT 14) (define-constant DEFAULT_PALETTE 15) (define-constant SYSTEM_FIXED_FONT 16) (define-constant DEFAULT_GUI_FONT 17) (define-constant DC_BRUSH 18) (define-constant DC_PEN 19) (define-constant STOCK_LAST 19) ;;; Brush hash styles (define-constant HS_HORIZONTAL 0) ; ----- (define-constant HS_VERTICAL 1) ; ||||| (define-constant HS_FDIAGONAL 2) ; \\\\\ (define-constant HS_BDIAGONAL 3) ; ///// (define-constant HS_CROSS 4) ; +++++ (define-constant HS_DIAGCROSS 5) ; xxxxx (define-constant HS_API_MAX 12) ;;; Pen styles (define-constant PS_SOLID 0) (define-constant PS_DASH 1) ; ------- (define-constant PS_DOT 2) ; ....... (define-constant PS_DASHDOT 3) ; _._._._ (define-constant PS_DASHDOTDOT 4) ; _.._.._ (define-constant PS_NULL 5) (define-constant PS_INSIDEFRAME 6) (define-constant PS_USERSTYLE 7) (define-constant PS_ALTERNATE 8) (define-constant PS_STYLE_MASK #x0000000F) ;;; Binary raster operations (define-constant R2_BLACK 1) ; 0 (define-constant R2_NOTMERGEPEN 2) ; DPon (define-constant R2_MASKNOTPEN 3) ; DPna (define-constant R2_NOTCOPYPEN 4) ; PN (define-constant R2_MASKPENNOT 5) ; PDna (define-constant R2_NOT 6) ; Dn (define-constant R2_XORPEN 7) ; DPx (define-constant R2_NOTMASKPEN 8) ; DPan (define-constant R2_MASKPEN 9) ; DPa (define-constant R2_NOTXORPEN 10) ; DPxn (define-constant R2_NOP 11) ; D (define-constant R2_MERGENOTPEN 12) ; DPno (define-constant R2_COPYPEN 13) ; P (define-constant R2_MERGEPENNOT 14) ; PDno (define-constant R2_MERGEPEN 15) ; DPo (define-constant R2_WHITE 16) ; 1 (define-constant R2_LAST 16) ;;; Background modes (define-constant TRANSPARENT 1) (define-constant OPAQUE 2) (define-constant BKMODE_LAST 2) ;;; Poly fill modes (define-constant ALTERNATE 1) (define-constant WINDING 2) (define-constant POLYFILL_LAST 2) ;;; PolyDraw constants (define-constant PT_CLOSEFIGURE #x01) (define-constant PT_LINETO #x02) (define-constant PT_BEZIERTO #x04) (define-constant PT_MOVETO #x06) ;;; Mapping Modes (define-constant MM_TEXT 1) (define-constant MM_LOMETRIC 2) (define-constant MM_HIMETRIC 3) (define-constant MM_LOENGLISH 4) (define-constant MM_HIENGLISH 5) (define-constant MM_TWIPS 6) (define-constant MM_ISOTROPIC 7) (define-constant MM_ANISOTROPIC 8) (define-constant MM_MIN MM_TEXT) (define-constant MM_MAX MM_ANISOTROPIC) (define-constant MM_MAX_FIXEDSCALE MM_TWIPS) ;;; Color Types (define-constant CTLCOLOR_MSGBOX 0) (define-constant CTLCOLOR_EDIT 1) (define-constant CTLCOLOR_LISTBOX 2) (define-constant CTLCOLOR_BTN 3) (define-constant CTLCOLOR_DLG 4) (define-constant CTLCOLOR_SCROLLBAR 5) (define-constant CTLCOLOR_STATIC 6) (define-constant CTLCOLOR_MAX 7) (define-constant COLOR_SCROLLBAR 0) (define-constant COLOR_BACKGROUND 1) (define-constant COLOR_ACTIVECAPTION 2) (define-constant COLOR_INACTIVECAPTION 3) (define-constant COLOR_MENU 4) (define-constant COLOR_WINDOW 5) (define-constant COLOR_WINDOWFRAME 6) (define-constant COLOR_MENUTEXT 7) (define-constant COLOR_WINDOWTEXT 8) (define-constant COLOR_CAPTIONTEXT 9) (define-constant COLOR_ACTIVEBORDER 10) (define-constant COLOR_INACTIVEBORDER 11) (define-constant COLOR_APPWORKSPACE 12) (define-constant COLOR_HIGHLIGHT 13) (define-constant COLOR_HIGHLIGHTTEXT 14) (define-constant COLOR_BTNFACE 15) (define-constant COLOR_BTNSHADOW 16) (define-constant COLOR_GRAYTEXT 17) (define-constant COLOR_BTNTEXT 18) (define-constant COLOR_INACTIVECAPTIONTEXT 19) (define-constant COLOR_BTNHIGHLIGHT 20) (define-constant COLOR_3DDKSHADOW 21) (define-constant COLOR_3DLIGHT 22) (define-constant COLOR_INFOTEXT 23) (define-constant COLOR_INFOBK 24) (define-constant COLOR_HOTLIGHT 26) (define-constant COLOR_GRADIENTACTIVECAPTION 27) (define-constant COLOR_GRADIENTINACTIVECAPTION 28) (define-constant COLOR_MENUHILIGHT 29) (define-constant COLOR_MENUBAR 30) (define-constant COLOR_DESKTOP COLOR_BACKGROUND) (define-constant COLOR_3DFACE COLOR_BTNFACE) (define-constant COLOR_3DSHADOW COLOR_BTNSHADOW) (define-constant COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT) ;;; Owner draw state (define-constant ODS_SELECTED #x0001) (define-constant ODS_GRAYED #x0002) (define-constant ODS_DISABLED #x0004) (define-constant ODS_CHECKED #x0008) (define-constant ODS_FOCUS #x0010) (define-constant ODS_DEFAULT #x0020) (define-constant ODS_COMBOBOXEDIT #x1000) (define-constant ODS_HOTLIGHT #x0040) (define-constant ODS_INACTIVE #x0080) (define-constant ODS_NOACCEL #x0100) (define-constant ODS_NOFOCUSRECT #x0200)
true
#| Copyright 2013 PI:NAME:<NAME>END_PI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |# (in-package :Lunette.Graphics) ;;; Built-in GDI Objects (define-constant WHITE_BRUSH 0) (define-constant LTGRAY_BRUSH 1) (define-constant GRAY_BRUSH 2) (define-constant DKGRAY_BRUSH 3) (define-constant BLACK_BRUSH 4) (define-constant NULL_BRUSH 5) (define-constant HOLLOW_BRUSH NULL_BRUSH) (define-constant WHITE_PEN 6) (define-constant BLACK_PEN 7) (define-constant NULL_PEN 8) (define-constant OEM_FIXED_FONT 10) (define-constant ANSI_FIXED_FONT 11) (define-constant ANSI_VAR_FONT 12) (define-constant SYSTEM_FONT 13) (define-constant DEVICE_DEFAULT_FONT 14) (define-constant DEFAULT_PALETTE 15) (define-constant SYSTEM_FIXED_FONT 16) (define-constant DEFAULT_GUI_FONT 17) (define-constant DC_BRUSH 18) (define-constant DC_PEN 19) (define-constant STOCK_LAST 19) ;;; Brush hash styles (define-constant HS_HORIZONTAL 0) ; ----- (define-constant HS_VERTICAL 1) ; ||||| (define-constant HS_FDIAGONAL 2) ; \\\\\ (define-constant HS_BDIAGONAL 3) ; ///// (define-constant HS_CROSS 4) ; +++++ (define-constant HS_DIAGCROSS 5) ; xxxxx (define-constant HS_API_MAX 12) ;;; Pen styles (define-constant PS_SOLID 0) (define-constant PS_DASH 1) ; ------- (define-constant PS_DOT 2) ; ....... (define-constant PS_DASHDOT 3) ; _._._._ (define-constant PS_DASHDOTDOT 4) ; _.._.._ (define-constant PS_NULL 5) (define-constant PS_INSIDEFRAME 6) (define-constant PS_USERSTYLE 7) (define-constant PS_ALTERNATE 8) (define-constant PS_STYLE_MASK #x0000000F) ;;; Binary raster operations (define-constant R2_BLACK 1) ; 0 (define-constant R2_NOTMERGEPEN 2) ; DPon (define-constant R2_MASKNOTPEN 3) ; DPna (define-constant R2_NOTCOPYPEN 4) ; PN (define-constant R2_MASKPENNOT 5) ; PDna (define-constant R2_NOT 6) ; Dn (define-constant R2_XORPEN 7) ; DPx (define-constant R2_NOTMASKPEN 8) ; DPan (define-constant R2_MASKPEN 9) ; DPa (define-constant R2_NOTXORPEN 10) ; DPxn (define-constant R2_NOP 11) ; D (define-constant R2_MERGENOTPEN 12) ; DPno (define-constant R2_COPYPEN 13) ; P (define-constant R2_MERGEPENNOT 14) ; PDno (define-constant R2_MERGEPEN 15) ; DPo (define-constant R2_WHITE 16) ; 1 (define-constant R2_LAST 16) ;;; Background modes (define-constant TRANSPARENT 1) (define-constant OPAQUE 2) (define-constant BKMODE_LAST 2) ;;; Poly fill modes (define-constant ALTERNATE 1) (define-constant WINDING 2) (define-constant POLYFILL_LAST 2) ;;; PolyDraw constants (define-constant PT_CLOSEFIGURE #x01) (define-constant PT_LINETO #x02) (define-constant PT_BEZIERTO #x04) (define-constant PT_MOVETO #x06) ;;; Mapping Modes (define-constant MM_TEXT 1) (define-constant MM_LOMETRIC 2) (define-constant MM_HIMETRIC 3) (define-constant MM_LOENGLISH 4) (define-constant MM_HIENGLISH 5) (define-constant MM_TWIPS 6) (define-constant MM_ISOTROPIC 7) (define-constant MM_ANISOTROPIC 8) (define-constant MM_MIN MM_TEXT) (define-constant MM_MAX MM_ANISOTROPIC) (define-constant MM_MAX_FIXEDSCALE MM_TWIPS) ;;; Color Types (define-constant CTLCOLOR_MSGBOX 0) (define-constant CTLCOLOR_EDIT 1) (define-constant CTLCOLOR_LISTBOX 2) (define-constant CTLCOLOR_BTN 3) (define-constant CTLCOLOR_DLG 4) (define-constant CTLCOLOR_SCROLLBAR 5) (define-constant CTLCOLOR_STATIC 6) (define-constant CTLCOLOR_MAX 7) (define-constant COLOR_SCROLLBAR 0) (define-constant COLOR_BACKGROUND 1) (define-constant COLOR_ACTIVECAPTION 2) (define-constant COLOR_INACTIVECAPTION 3) (define-constant COLOR_MENU 4) (define-constant COLOR_WINDOW 5) (define-constant COLOR_WINDOWFRAME 6) (define-constant COLOR_MENUTEXT 7) (define-constant COLOR_WINDOWTEXT 8) (define-constant COLOR_CAPTIONTEXT 9) (define-constant COLOR_ACTIVEBORDER 10) (define-constant COLOR_INACTIVEBORDER 11) (define-constant COLOR_APPWORKSPACE 12) (define-constant COLOR_HIGHLIGHT 13) (define-constant COLOR_HIGHLIGHTTEXT 14) (define-constant COLOR_BTNFACE 15) (define-constant COLOR_BTNSHADOW 16) (define-constant COLOR_GRAYTEXT 17) (define-constant COLOR_BTNTEXT 18) (define-constant COLOR_INACTIVECAPTIONTEXT 19) (define-constant COLOR_BTNHIGHLIGHT 20) (define-constant COLOR_3DDKSHADOW 21) (define-constant COLOR_3DLIGHT 22) (define-constant COLOR_INFOTEXT 23) (define-constant COLOR_INFOBK 24) (define-constant COLOR_HOTLIGHT 26) (define-constant COLOR_GRADIENTACTIVECAPTION 27) (define-constant COLOR_GRADIENTINACTIVECAPTION 28) (define-constant COLOR_MENUHILIGHT 29) (define-constant COLOR_MENUBAR 30) (define-constant COLOR_DESKTOP COLOR_BACKGROUND) (define-constant COLOR_3DFACE COLOR_BTNFACE) (define-constant COLOR_3DSHADOW COLOR_BTNSHADOW) (define-constant COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT) (define-constant COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT) ;;; Owner draw state (define-constant ODS_SELECTED #x0001) (define-constant ODS_GRAYED #x0002) (define-constant ODS_DISABLED #x0004) (define-constant ODS_CHECKED #x0008) (define-constant ODS_FOCUS #x0010) (define-constant ODS_DEFAULT #x0020) (define-constant ODS_COMBOBOXEDIT #x1000) (define-constant ODS_HOTLIGHT #x0040) (define-constant ODS_INACTIVE #x0080) (define-constant ODS_NOACCEL #x0100) (define-constant ODS_NOFOCUSRECT #x0200)
[ { "context": " ;;;\n;;; Original author: Ben Wagner ;;;\n;;; ", "end": 469, "score": 0.9998432993888855, "start": 459, "tag": "NAME", "value": "Ben Wagner" } ]
tests/lisp-reference-tests.lisp
zeldacl/cl-protobufs
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; ;;; Free Software published under an MIT-like license. See LICENSE ;;; ;;; ;;; ;;; Copyright (c) 2012 Google, Inc. All rights reserved. ;;; ;;; ;;; ;;; Original author: Ben Wagner ;;; ;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "PROTO-TEST") (define-test cross-package-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-package-unittest1::package_test1)) (message-with-cross-package-reference (find-by-name "MessageWithCrossPackageReference" (proto-messages schema))) (baz (find-by-name "baz" (proto-fields message-with-cross-package-reference))) (bonk (find-by-name "bonk" (proto-fields message-with-cross-package-reference))) (bam (find-by-name "bam" (proto-fields message-with-cross-package-reference))) (bing (find-by-name "bing" (proto-fields message-with-cross-package-reference))) (message-with-cross-package-extension (find-by-name "MessageWithCrossPackageExtension" (proto-messages schema))) (boo (find-by-name "boo" (proto-fields message-with-cross-package-extension))) (service-with-cross-package-input-output (find-by-name "ServiceWithCrossPackageInputOutput" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-cross-package-input-output))) (beep (find-by-name "Beep" (proto-methods service-with-cross-package-input-output))) (message-in-other-package-extend (find-by-name "MessageInOtherPackage" (proto-messages message-with-cross-package-extension))) (baa (find-by-name "baa" (proto-extended-fields message-in-other-package-extend)))) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class baz)) (assert-equal 'protobuf-package-unittest2::enum-in-other-package (proto-class bonk)) (assert-equal 'protobuf-package-unittest1::message-defined-in-both-packages (proto-class bam)) (assert-equal 'protobuf-package-unittest2::message-defined-in-both-packages (proto-class bing)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class boo)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-input-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-output-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-input-type beep)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-output-type beep)) (assert-equal 'protobuf-package-unittest1::baa (proto-value baa)))) (let* ((orig1 (make-instance 'protobuf-package-unittest1::message-with-cross-package-reference :baz (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123) :bonk :bar :bam (make-instance 'protobuf-package-unittest1::message-defined-in-both-packages :boom "bomb") :bing (make-instance 'protobuf-package-unittest2::message-defined-in-both-packages :bang "gun"))) (orig2 (let ((extended-obj (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123))) (setf (protobuf-package-unittest1::baa extended-obj) 456) (make-instance 'protobuf-package-unittest1::message-with-cross-package-extension :boo extended-obj))) (bytes1 (serialize-object-to-bytes orig1 'protobuf-package-unittest1::message-with-cross-package-reference)) (bytes2 (serialize-object-to-bytes orig2 'protobuf-package-unittest1::message-with-cross-package-extension)) (new1 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-reference bytes1)) (new2 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-extension bytes2))) (assert-true (typep (protobuf-package-unittest1::baz new1) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::baz new1))) (assert-equal :bar (protobuf-package-unittest1::bonk new1)) (assert-equal "bomb" (protobuf-package-unittest1::boom (protobuf-package-unittest1::bam new1))) (assert-equal "gun" (protobuf-package-unittest2::bang (protobuf-package-unittest1::bing new1))) (assert-true (typep (protobuf-package-unittest1::boo new2) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::boo new2))) (assert-equal 456 (protobuf-package-unittest1::baa (protobuf-package-unittest1::boo new2))))) (define-test forward-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-forward-reference-unittest::forward_reference)) (message-with-forward-reference (find-by-name "MessageWithForwardReference" (proto-messages schema))) (foo (find-by-name "foo" (proto-fields message-with-forward-reference))) (bar (find-by-name "bar" (proto-fields message-with-forward-reference))) (service-with-forward-reference (find-by-name "ServiceWithForwardReference" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-forward-reference))) (beep (find-by-name "Beep" (proto-methods service-with-forward-reference)))) (assert-equal 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class (proto-class foo)) (assert-equal 'protobuf-forward-reference-unittest::ENUM-W-OVERRIDDEN-LISP-CLASS (proto-class bar)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-input-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-output-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-input-type beep)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-output-type beep)))) (let* ((orig (make-instance 'protobuf-forward-reference-unittest::message-with-forward-reference :foo (make-instance 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class :baz 123) :bar :baa)) (bytes (serialize-object-to-bytes orig 'protobuf-forward-reference-unittest::message-with-forward-reference)) (new (deserialize-object 'protobuf-forward-reference-unittest::message-with-forward-reference bytes))) (assert-true (typep (protobuf-forward-reference-unittest::foo new) 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class)) (assert-equal 123 (protobuf-forward-reference-unittest::baz (protobuf-forward-reference-unittest::foo new))) (assert-equal :baa (protobuf-forward-reference-unittest::bar new)))) (defparameter *test-proto-preamble* "syntax = \"proto2\"; package proto_test; message DefinedMessage { optional string foo = 1; } ") (define-test undefined-types-test () (labels ((parse-schema-containing (string) (with-input-from-string (s (concatenate 'string *test-proto-preamble* string)) (parse-schema-from-stream s ;; Parsing from a string doesn't produce a name, so supply ;; it :name "proto_test" :class 'dummy :conc-name nil))) (parse-message-with-field-type (type) (parse-schema-containing (format nil "message MessageWithUndefinedFieldType {~%~ ~& optional ~A bar = 1;~%~ }~%" type))) (parse-service-with-rpc (rpc) (parse-schema-containing (format nil "service ServiceWithUndefinedMethodType {~%~ ~& ~A~%~ }~%" rpc))) (poor-mans-assert-regex-equal (expected-strings actual-string) (assert-true (loop with index = 0 for expected-string in expected-strings as position = (search expected-string actual-string :start2 index) always position do (setf index (+ position (length expected-string)))))) (method-test-assertions (condition where method-lisp-name method-proto-name type) (poor-mans-assert-regex-equal (list (format nil "Undefined type: ~A type for RPC " where) (format nil "~A" method-lisp-name) "in service " "ServiceWithUndefinedMethodType" (format nil "has unknown type ~A" type)) (let ((*package* (find-package :proto-test))) ;; The format string for the condition includes @< ... @> which justifies ;; and might introduce a newline which would cause a mismatch. So ;; replace that by a space (substitute #\space #\newline (princ-to-string condition) :test #'char-equal))) (assert-equal type (error-type-name condition)) (assert-equal method-proto-name (proto-name (error-method condition)))) (do-method-input-test (input-type) (let ((condition (assert-error undefined-input-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedInput (~A) ~ returns (DefinedMessage);" input-type))))) (method-test-assertions condition "Input" "METHOD-WITH-UNDEFINED-INPUT" "MethodWithUndefinedInput" input-type))) (do-method-output-test (output-type) (let ((condition (assert-error undefined-output-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedOutput (DefinedMessage) ~ returns (~A);" output-type))))) (method-test-assertions condition "Output" "METHOD-WITH-UNDEFINED-OUTPUT" "MethodWithUndefinedOutput" output-type))) (do-method-stream-test (stream-type) (let ((condition (assert-error undefined-stream-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedStream (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"~A\";~ ~& };" stream-type))))) (method-test-assertions condition "Stream" "METHOD-WITH-UNDEFINED-STREAM" "MethodWithUndefinedStream" stream-type)))) (parse-message-with-field-type "int32") (do-field-test "int") (parse-message-with-field-type "DefinedMessage") (do-field-test "UndefinedMessage") (do-field-test "other_package.DefinedMessage") (parse-service-with-rpc "rpc MethodWithDefinedInputOutput (DefinedMessage) returns (DefinedMessage);") (do-method-input-test "UndefinedMessage") ;; my understanding is that primitive types are not allowed for method input/output; if this is ;; incorrect, change to "int" (do-method-input-test "int32") (do-method-input-test "other_package.DefinedMessage") (do-method-output-test "UndefinedMessage") (do-method-output-test "int32") (do-method-output-test "other_package.DefinedMessage") ;; stream_type is required to be fully qualified (parse-service-with-rpc (format nil "rpc MethodWithDefinedInputOutput (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"proto_test.DefinedMessage\";~ ~& };")) (do-method-stream-test "proto_test.UndefinedMessage") (do-method-stream-test "int32") (do-method-stream-test "other_package.DefinedMessage"))) (define-test-suite lisp-reference-tests () (cross-package-reference-test forward-reference-test undefined-types-test)) (register-test 'lisp-reference-tests)
8471
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; ;;; Free Software published under an MIT-like license. See LICENSE ;;; ;;; ;;; ;;; Copyright (c) 2012 Google, Inc. All rights reserved. ;;; ;;; ;;; ;;; Original author: <NAME> ;;; ;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "PROTO-TEST") (define-test cross-package-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-package-unittest1::package_test1)) (message-with-cross-package-reference (find-by-name "MessageWithCrossPackageReference" (proto-messages schema))) (baz (find-by-name "baz" (proto-fields message-with-cross-package-reference))) (bonk (find-by-name "bonk" (proto-fields message-with-cross-package-reference))) (bam (find-by-name "bam" (proto-fields message-with-cross-package-reference))) (bing (find-by-name "bing" (proto-fields message-with-cross-package-reference))) (message-with-cross-package-extension (find-by-name "MessageWithCrossPackageExtension" (proto-messages schema))) (boo (find-by-name "boo" (proto-fields message-with-cross-package-extension))) (service-with-cross-package-input-output (find-by-name "ServiceWithCrossPackageInputOutput" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-cross-package-input-output))) (beep (find-by-name "Beep" (proto-methods service-with-cross-package-input-output))) (message-in-other-package-extend (find-by-name "MessageInOtherPackage" (proto-messages message-with-cross-package-extension))) (baa (find-by-name "baa" (proto-extended-fields message-in-other-package-extend)))) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class baz)) (assert-equal 'protobuf-package-unittest2::enum-in-other-package (proto-class bonk)) (assert-equal 'protobuf-package-unittest1::message-defined-in-both-packages (proto-class bam)) (assert-equal 'protobuf-package-unittest2::message-defined-in-both-packages (proto-class bing)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class boo)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-input-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-output-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-input-type beep)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-output-type beep)) (assert-equal 'protobuf-package-unittest1::baa (proto-value baa)))) (let* ((orig1 (make-instance 'protobuf-package-unittest1::message-with-cross-package-reference :baz (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123) :bonk :bar :bam (make-instance 'protobuf-package-unittest1::message-defined-in-both-packages :boom "bomb") :bing (make-instance 'protobuf-package-unittest2::message-defined-in-both-packages :bang "gun"))) (orig2 (let ((extended-obj (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123))) (setf (protobuf-package-unittest1::baa extended-obj) 456) (make-instance 'protobuf-package-unittest1::message-with-cross-package-extension :boo extended-obj))) (bytes1 (serialize-object-to-bytes orig1 'protobuf-package-unittest1::message-with-cross-package-reference)) (bytes2 (serialize-object-to-bytes orig2 'protobuf-package-unittest1::message-with-cross-package-extension)) (new1 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-reference bytes1)) (new2 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-extension bytes2))) (assert-true (typep (protobuf-package-unittest1::baz new1) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::baz new1))) (assert-equal :bar (protobuf-package-unittest1::bonk new1)) (assert-equal "bomb" (protobuf-package-unittest1::boom (protobuf-package-unittest1::bam new1))) (assert-equal "gun" (protobuf-package-unittest2::bang (protobuf-package-unittest1::bing new1))) (assert-true (typep (protobuf-package-unittest1::boo new2) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::boo new2))) (assert-equal 456 (protobuf-package-unittest1::baa (protobuf-package-unittest1::boo new2))))) (define-test forward-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-forward-reference-unittest::forward_reference)) (message-with-forward-reference (find-by-name "MessageWithForwardReference" (proto-messages schema))) (foo (find-by-name "foo" (proto-fields message-with-forward-reference))) (bar (find-by-name "bar" (proto-fields message-with-forward-reference))) (service-with-forward-reference (find-by-name "ServiceWithForwardReference" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-forward-reference))) (beep (find-by-name "Beep" (proto-methods service-with-forward-reference)))) (assert-equal 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class (proto-class foo)) (assert-equal 'protobuf-forward-reference-unittest::ENUM-W-OVERRIDDEN-LISP-CLASS (proto-class bar)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-input-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-output-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-input-type beep)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-output-type beep)))) (let* ((orig (make-instance 'protobuf-forward-reference-unittest::message-with-forward-reference :foo (make-instance 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class :baz 123) :bar :baa)) (bytes (serialize-object-to-bytes orig 'protobuf-forward-reference-unittest::message-with-forward-reference)) (new (deserialize-object 'protobuf-forward-reference-unittest::message-with-forward-reference bytes))) (assert-true (typep (protobuf-forward-reference-unittest::foo new) 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class)) (assert-equal 123 (protobuf-forward-reference-unittest::baz (protobuf-forward-reference-unittest::foo new))) (assert-equal :baa (protobuf-forward-reference-unittest::bar new)))) (defparameter *test-proto-preamble* "syntax = \"proto2\"; package proto_test; message DefinedMessage { optional string foo = 1; } ") (define-test undefined-types-test () (labels ((parse-schema-containing (string) (with-input-from-string (s (concatenate 'string *test-proto-preamble* string)) (parse-schema-from-stream s ;; Parsing from a string doesn't produce a name, so supply ;; it :name "proto_test" :class 'dummy :conc-name nil))) (parse-message-with-field-type (type) (parse-schema-containing (format nil "message MessageWithUndefinedFieldType {~%~ ~& optional ~A bar = 1;~%~ }~%" type))) (parse-service-with-rpc (rpc) (parse-schema-containing (format nil "service ServiceWithUndefinedMethodType {~%~ ~& ~A~%~ }~%" rpc))) (poor-mans-assert-regex-equal (expected-strings actual-string) (assert-true (loop with index = 0 for expected-string in expected-strings as position = (search expected-string actual-string :start2 index) always position do (setf index (+ position (length expected-string)))))) (method-test-assertions (condition where method-lisp-name method-proto-name type) (poor-mans-assert-regex-equal (list (format nil "Undefined type: ~A type for RPC " where) (format nil "~A" method-lisp-name) "in service " "ServiceWithUndefinedMethodType" (format nil "has unknown type ~A" type)) (let ((*package* (find-package :proto-test))) ;; The format string for the condition includes @< ... @> which justifies ;; and might introduce a newline which would cause a mismatch. So ;; replace that by a space (substitute #\space #\newline (princ-to-string condition) :test #'char-equal))) (assert-equal type (error-type-name condition)) (assert-equal method-proto-name (proto-name (error-method condition)))) (do-method-input-test (input-type) (let ((condition (assert-error undefined-input-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedInput (~A) ~ returns (DefinedMessage);" input-type))))) (method-test-assertions condition "Input" "METHOD-WITH-UNDEFINED-INPUT" "MethodWithUndefinedInput" input-type))) (do-method-output-test (output-type) (let ((condition (assert-error undefined-output-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedOutput (DefinedMessage) ~ returns (~A);" output-type))))) (method-test-assertions condition "Output" "METHOD-WITH-UNDEFINED-OUTPUT" "MethodWithUndefinedOutput" output-type))) (do-method-stream-test (stream-type) (let ((condition (assert-error undefined-stream-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedStream (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"~A\";~ ~& };" stream-type))))) (method-test-assertions condition "Stream" "METHOD-WITH-UNDEFINED-STREAM" "MethodWithUndefinedStream" stream-type)))) (parse-message-with-field-type "int32") (do-field-test "int") (parse-message-with-field-type "DefinedMessage") (do-field-test "UndefinedMessage") (do-field-test "other_package.DefinedMessage") (parse-service-with-rpc "rpc MethodWithDefinedInputOutput (DefinedMessage) returns (DefinedMessage);") (do-method-input-test "UndefinedMessage") ;; my understanding is that primitive types are not allowed for method input/output; if this is ;; incorrect, change to "int" (do-method-input-test "int32") (do-method-input-test "other_package.DefinedMessage") (do-method-output-test "UndefinedMessage") (do-method-output-test "int32") (do-method-output-test "other_package.DefinedMessage") ;; stream_type is required to be fully qualified (parse-service-with-rpc (format nil "rpc MethodWithDefinedInputOutput (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"proto_test.DefinedMessage\";~ ~& };")) (do-method-stream-test "proto_test.UndefinedMessage") (do-method-stream-test "int32") (do-method-stream-test "other_package.DefinedMessage"))) (define-test-suite lisp-reference-tests () (cross-package-reference-test forward-reference-test undefined-types-test)) (register-test 'lisp-reference-tests)
true
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; ;;; Free Software published under an MIT-like license. See LICENSE ;;; ;;; ;;; ;;; Copyright (c) 2012 Google, Inc. All rights reserved. ;;; ;;; ;;; ;;; Original author: PI:NAME:<NAME>END_PI ;;; ;;; ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "PROTO-TEST") (define-test cross-package-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-package-unittest1::package_test1)) (message-with-cross-package-reference (find-by-name "MessageWithCrossPackageReference" (proto-messages schema))) (baz (find-by-name "baz" (proto-fields message-with-cross-package-reference))) (bonk (find-by-name "bonk" (proto-fields message-with-cross-package-reference))) (bam (find-by-name "bam" (proto-fields message-with-cross-package-reference))) (bing (find-by-name "bing" (proto-fields message-with-cross-package-reference))) (message-with-cross-package-extension (find-by-name "MessageWithCrossPackageExtension" (proto-messages schema))) (boo (find-by-name "boo" (proto-fields message-with-cross-package-extension))) (service-with-cross-package-input-output (find-by-name "ServiceWithCrossPackageInputOutput" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-cross-package-input-output))) (beep (find-by-name "Beep" (proto-methods service-with-cross-package-input-output))) (message-in-other-package-extend (find-by-name "MessageInOtherPackage" (proto-messages message-with-cross-package-extension))) (baa (find-by-name "baa" (proto-extended-fields message-in-other-package-extend)))) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class baz)) (assert-equal 'protobuf-package-unittest2::enum-in-other-package (proto-class bonk)) (assert-equal 'protobuf-package-unittest1::message-defined-in-both-packages (proto-class bam)) (assert-equal 'protobuf-package-unittest2::message-defined-in-both-packages (proto-class bing)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-class boo)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-input-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-output-type bloop)) (assert-equal 'protobuf-package-unittest1::message-with-cross-package-reference (proto-input-type beep)) (assert-equal 'protobuf-package-unittest2::message-in-other-package (proto-output-type beep)) (assert-equal 'protobuf-package-unittest1::baa (proto-value baa)))) (let* ((orig1 (make-instance 'protobuf-package-unittest1::message-with-cross-package-reference :baz (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123) :bonk :bar :bam (make-instance 'protobuf-package-unittest1::message-defined-in-both-packages :boom "bomb") :bing (make-instance 'protobuf-package-unittest2::message-defined-in-both-packages :bang "gun"))) (orig2 (let ((extended-obj (make-instance 'protobuf-package-unittest2::message-in-other-package :foo 123))) (setf (protobuf-package-unittest1::baa extended-obj) 456) (make-instance 'protobuf-package-unittest1::message-with-cross-package-extension :boo extended-obj))) (bytes1 (serialize-object-to-bytes orig1 'protobuf-package-unittest1::message-with-cross-package-reference)) (bytes2 (serialize-object-to-bytes orig2 'protobuf-package-unittest1::message-with-cross-package-extension)) (new1 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-reference bytes1)) (new2 (deserialize-object 'protobuf-package-unittest1::message-with-cross-package-extension bytes2))) (assert-true (typep (protobuf-package-unittest1::baz new1) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::baz new1))) (assert-equal :bar (protobuf-package-unittest1::bonk new1)) (assert-equal "bomb" (protobuf-package-unittest1::boom (protobuf-package-unittest1::bam new1))) (assert-equal "gun" (protobuf-package-unittest2::bang (protobuf-package-unittest1::bing new1))) (assert-true (typep (protobuf-package-unittest1::boo new2) 'protobuf-package-unittest2::message-in-other-package)) (assert-equal 123 (protobuf-package-unittest2::foo (protobuf-package-unittest1::boo new2))) (assert-equal 456 (protobuf-package-unittest1::baa (protobuf-package-unittest1::boo new2))))) (define-test forward-reference-test () (flet ((find-by-name (name proto-objects) (find name proto-objects :key #'proto-name :test #'string=))) (let* ((schema (find-schema 'protobuf-forward-reference-unittest::forward_reference)) (message-with-forward-reference (find-by-name "MessageWithForwardReference" (proto-messages schema))) (foo (find-by-name "foo" (proto-fields message-with-forward-reference))) (bar (find-by-name "bar" (proto-fields message-with-forward-reference))) (service-with-forward-reference (find-by-name "ServiceWithForwardReference" (proto-services schema))) (bloop (find-by-name "Bloop" (proto-methods service-with-forward-reference))) (beep (find-by-name "Beep" (proto-methods service-with-forward-reference)))) (assert-equal 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class (proto-class foo)) (assert-equal 'protobuf-forward-reference-unittest::ENUM-W-OVERRIDDEN-LISP-CLASS (proto-class bar)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-input-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-output-type bloop)) (assert-equal 'protobuf-forward-reference-unittest::MESSAGE-WITH-FORWARD-REFERENCE (proto-input-type beep)) (assert-equal 'protobuf-forward-reference-unittest::MSG-W-OVERRIDDEN-LISP-CLASS (proto-output-type beep)))) (let* ((orig (make-instance 'protobuf-forward-reference-unittest::message-with-forward-reference :foo (make-instance 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class :baz 123) :bar :baa)) (bytes (serialize-object-to-bytes orig 'protobuf-forward-reference-unittest::message-with-forward-reference)) (new (deserialize-object 'protobuf-forward-reference-unittest::message-with-forward-reference bytes))) (assert-true (typep (protobuf-forward-reference-unittest::foo new) 'protobuf-forward-reference-unittest::msg-w-overridden-lisp-class)) (assert-equal 123 (protobuf-forward-reference-unittest::baz (protobuf-forward-reference-unittest::foo new))) (assert-equal :baa (protobuf-forward-reference-unittest::bar new)))) (defparameter *test-proto-preamble* "syntax = \"proto2\"; package proto_test; message DefinedMessage { optional string foo = 1; } ") (define-test undefined-types-test () (labels ((parse-schema-containing (string) (with-input-from-string (s (concatenate 'string *test-proto-preamble* string)) (parse-schema-from-stream s ;; Parsing from a string doesn't produce a name, so supply ;; it :name "proto_test" :class 'dummy :conc-name nil))) (parse-message-with-field-type (type) (parse-schema-containing (format nil "message MessageWithUndefinedFieldType {~%~ ~& optional ~A bar = 1;~%~ }~%" type))) (parse-service-with-rpc (rpc) (parse-schema-containing (format nil "service ServiceWithUndefinedMethodType {~%~ ~& ~A~%~ }~%" rpc))) (poor-mans-assert-regex-equal (expected-strings actual-string) (assert-true (loop with index = 0 for expected-string in expected-strings as position = (search expected-string actual-string :start2 index) always position do (setf index (+ position (length expected-string)))))) (method-test-assertions (condition where method-lisp-name method-proto-name type) (poor-mans-assert-regex-equal (list (format nil "Undefined type: ~A type for RPC " where) (format nil "~A" method-lisp-name) "in service " "ServiceWithUndefinedMethodType" (format nil "has unknown type ~A" type)) (let ((*package* (find-package :proto-test))) ;; The format string for the condition includes @< ... @> which justifies ;; and might introduce a newline which would cause a mismatch. So ;; replace that by a space (substitute #\space #\newline (princ-to-string condition) :test #'char-equal))) (assert-equal type (error-type-name condition)) (assert-equal method-proto-name (proto-name (error-method condition)))) (do-method-input-test (input-type) (let ((condition (assert-error undefined-input-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedInput (~A) ~ returns (DefinedMessage);" input-type))))) (method-test-assertions condition "Input" "METHOD-WITH-UNDEFINED-INPUT" "MethodWithUndefinedInput" input-type))) (do-method-output-test (output-type) (let ((condition (assert-error undefined-output-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedOutput (DefinedMessage) ~ returns (~A);" output-type))))) (method-test-assertions condition "Output" "METHOD-WITH-UNDEFINED-OUTPUT" "MethodWithUndefinedOutput" output-type))) (do-method-stream-test (stream-type) (let ((condition (assert-error undefined-stream-type (parse-service-with-rpc (format nil "rpc MethodWithUndefinedStream (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"~A\";~ ~& };" stream-type))))) (method-test-assertions condition "Stream" "METHOD-WITH-UNDEFINED-STREAM" "MethodWithUndefinedStream" stream-type)))) (parse-message-with-field-type "int32") (do-field-test "int") (parse-message-with-field-type "DefinedMessage") (do-field-test "UndefinedMessage") (do-field-test "other_package.DefinedMessage") (parse-service-with-rpc "rpc MethodWithDefinedInputOutput (DefinedMessage) returns (DefinedMessage);") (do-method-input-test "UndefinedMessage") ;; my understanding is that primitive types are not allowed for method input/output; if this is ;; incorrect, change to "int" (do-method-input-test "int32") (do-method-input-test "other_package.DefinedMessage") (do-method-output-test "UndefinedMessage") (do-method-output-test "int32") (do-method-output-test "other_package.DefinedMessage") ;; stream_type is required to be fully qualified (parse-service-with-rpc (format nil "rpc MethodWithDefinedInputOutput (DefinedMessage) ~ returns (DefinedMessage) {~ ~& option stream_type = \"proto_test.DefinedMessage\";~ ~& };")) (do-method-stream-test "proto_test.UndefinedMessage") (do-method-stream-test "int32") (do-method-stream-test "other_package.DefinedMessage"))) (define-test-suite lisp-reference-tests () (cross-package-reference-test forward-reference-test undefined-types-test)) (register-test 'lisp-reference-tests)
[ { "context": "(defsystem \"roswell\"\n :version \"19.1.10.96\"\n :author \"SANO Masatoshi\"\n :license \"MIT\"\n :d", "end": 43, "score": 0.9927765130996704, "start": 33, "tag": "IP_ADDRESS", "value": "19.1.10.96" }, { "context": "stem \"roswell\"\n :version \"19.1.10.96\"\n :author \"SANO Masatoshi\"\n :license \"MIT\"\n :depends-on (\"simple-date-tim", "end": 70, "score": 0.999815821647644, "start": 56, "tag": "NAME", "value": "SANO Masatoshi" } ]
roswell.asd
jsjolen/roswell
0
(defsystem "roswell" :version "19.1.10.96" :author "SANO Masatoshi" :license "MIT" :depends-on ("simple-date-time" "split-sequence" "plump" "zip") :components ((:module "lisp" :components ((:file "install-allegro" :depends-on ("util-install-quicklisp")) (:file "install-abcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-cmu-bin" :depends-on ("util-install-quicklisp")) (:file "install-ccl-bin" :depends-on ("util-install-quicklisp")) (:file "install-clisp" :depends-on ("install+ffcall" "install+sigsegv")) (:file "install-ecl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-quicklisp" :depends-on ("util-install-quicklisp")) (:file "install+ffcall" :depends-on ("util-install-quicklisp")) (:file "install+7zip" :depends-on ("util-install-quicklisp")) (:file "install+msys2" :depends-on ("util-install-quicklisp")) (:file "install+sigsegv" :depends-on ("util-install-quicklisp")) (:file "util-install-quicklisp" :depends-on ("system")) (:file "system" :depends-on ("util-install")) (:file "util-install" :depends-on ("locations")) (:file "locations" :depends-on ("util")) (:file "util-swank" :depends-on ("util")) (:file "util" :depends-on ("init")) (:file "init")))) :description "a command line tool to install and manage Common Lisp implementations damn easily." :long-description #.(uiop:read-file-string (merge-pathnames #p"README.md" (or *load-pathname* *compile-file-pathname*))) :in-order-to ((test-op (test-op :roswell/test)))) (defsystem "roswell/test" :depends-on (:prove) :components ((:module "t" :components ((:file "ros")))) :perform (test-op :after (op c) #+quickisp(ql:quickload :prove-asdf) #-asdf(asdf:load-system :prove-asdf) (uiop:symbol-call :prove-asdf :run-test-system c) (asdf:clear-system c)))
73684
(defsystem "roswell" :version "192.168.3.11" :author "<NAME>" :license "MIT" :depends-on ("simple-date-time" "split-sequence" "plump" "zip") :components ((:module "lisp" :components ((:file "install-allegro" :depends-on ("util-install-quicklisp")) (:file "install-abcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-cmu-bin" :depends-on ("util-install-quicklisp")) (:file "install-ccl-bin" :depends-on ("util-install-quicklisp")) (:file "install-clisp" :depends-on ("install+ffcall" "install+sigsegv")) (:file "install-ecl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-quicklisp" :depends-on ("util-install-quicklisp")) (:file "install+ffcall" :depends-on ("util-install-quicklisp")) (:file "install+7zip" :depends-on ("util-install-quicklisp")) (:file "install+msys2" :depends-on ("util-install-quicklisp")) (:file "install+sigsegv" :depends-on ("util-install-quicklisp")) (:file "util-install-quicklisp" :depends-on ("system")) (:file "system" :depends-on ("util-install")) (:file "util-install" :depends-on ("locations")) (:file "locations" :depends-on ("util")) (:file "util-swank" :depends-on ("util")) (:file "util" :depends-on ("init")) (:file "init")))) :description "a command line tool to install and manage Common Lisp implementations damn easily." :long-description #.(uiop:read-file-string (merge-pathnames #p"README.md" (or *load-pathname* *compile-file-pathname*))) :in-order-to ((test-op (test-op :roswell/test)))) (defsystem "roswell/test" :depends-on (:prove) :components ((:module "t" :components ((:file "ros")))) :perform (test-op :after (op c) #+quickisp(ql:quickload :prove-asdf) #-asdf(asdf:load-system :prove-asdf) (uiop:symbol-call :prove-asdf :run-test-system c) (asdf:clear-system c)))
true
(defsystem "roswell" :version "PI:IP_ADDRESS:192.168.3.11END_PI" :author "PI:NAME:<NAME>END_PI" :license "MIT" :depends-on ("simple-date-time" "split-sequence" "plump" "zip") :components ((:module "lisp" :components ((:file "install-allegro" :depends-on ("util-install-quicklisp")) (:file "install-abcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-cmu-bin" :depends-on ("util-install-quicklisp")) (:file "install-ccl-bin" :depends-on ("util-install-quicklisp")) (:file "install-clisp" :depends-on ("install+ffcall" "install+sigsegv")) (:file "install-ecl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl" :depends-on ("util-install-quicklisp")) (:file "install-sbcl-bin" :depends-on ("util-install-quicklisp")) (:file "install-quicklisp" :depends-on ("util-install-quicklisp")) (:file "install+ffcall" :depends-on ("util-install-quicklisp")) (:file "install+7zip" :depends-on ("util-install-quicklisp")) (:file "install+msys2" :depends-on ("util-install-quicklisp")) (:file "install+sigsegv" :depends-on ("util-install-quicklisp")) (:file "util-install-quicklisp" :depends-on ("system")) (:file "system" :depends-on ("util-install")) (:file "util-install" :depends-on ("locations")) (:file "locations" :depends-on ("util")) (:file "util-swank" :depends-on ("util")) (:file "util" :depends-on ("init")) (:file "init")))) :description "a command line tool to install and manage Common Lisp implementations damn easily." :long-description #.(uiop:read-file-string (merge-pathnames #p"README.md" (or *load-pathname* *compile-file-pathname*))) :in-order-to ((test-op (test-op :roswell/test)))) (defsystem "roswell/test" :depends-on (:prove) :components ((:module "t" :components ((:file "ros")))) :perform (test-op :after (op c) #+quickisp(ql:quickload :prove-asdf) #-asdf(asdf:load-system :prove-asdf) (uiop:symbol-call :prove-asdf :run-test-system c) (asdf:clear-system c)))
[ { "context": "d bit-vector remainder\n;\n; Copyright (C) 2008-2011 Eric Smith and Stanford University\n; Copyright (C) 2013-2020", "end": 68, "score": 0.9995907545089722, "start": 58, "tag": "NAME", "value": "Eric Smith" }, { "context": "ense. See the file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;", "end": 229, "score": 0.9996168613433838, "start": 219, "tag": "NAME", "value": "Eric Smith" }, { "context": " file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 253, "score": 0.9999339580535889, "start": 231, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/bv/sbvrem.lisp
ayazhafiz/acl2
0
; Signed bit-vector remainder ; ; Copyright (C) 2008-2011 Eric Smith and Stanford University ; Copyright (C) 2013-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "bvchop") (include-book "logext") (include-book "bvmod") (include-book "unsigned-byte-p-forced") (local (include-book "kestrel/library-wrappers/ihs-logops-lemmas" :dir :system)) (local (include-book "kestrel/library-wrappers/ihs-quotient-remainder-lemmas" :dir :system)) ;drop ;fixme make sure this is what i want and that it matches what java does (defund sbvrem (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (equal (bvchop n y) 0)))) (bvchop n (rem (logext n x) (logext n y))) ; (bvchop n (- x (* (truncate (logext n x) (logext n y)) y))) ) (defthm unsigned-byte-p-of-sbvrem (implies (<= size size2) (equal (unsigned-byte-p size2 (sbvrem size x y)) (natp size2))) :hints (("Goal" :in-theory (e/d (sbvrem) ( ;TRUNCATE-BECOMES-FLOOR-GEN4 TRUNCATE-TYPE ;UNSIGNED-BYTE-P-RESOLVER ))))) (defthm natp-of-sbvrem (natp (sbvrem size x y))) (defthm integerp-of-sbvrem (integerp (sbvrem size x y))) ;destructor elim happens ;or just rely on (:rewrite sbvrem-when-positive)? ;fixme gen! (defthm equal-of-0-and-sbvrem-when-small (implies (and (equal width 32) ;fixme (natp x) (unsigned-byte-p (+ -1 width) n) (< x n) (posp width) ) (equal (equal 0 (sbvrem width x n)) (equal 0 x))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg2 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size (bvchop size1 x) y) (sbvrem size x y))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg3 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size y (bvchop size1 x)) (sbvrem size y x))) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm unsigned-byte-p-forced-of-sbvrem (equal (unsigned-byte-p-forced size (sbvrem size x y)) (natp size)) :hints (("Goal" :in-theory (enable unsigned-byte-p-forced natp sbvrem)))) ;todo: move? (defund sbvmoddown (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (EQUAL (LOGEXT N Y) 0))) ;rephrase in terms of bvchop? ) (bvchop n (mod (logext n x) (logext n y)))) (defthm sbvrem-of-0-arg1 (equal (sbvrem 0 x y) 0) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-0-arg2 (equal (sbvrem size 0 y) 0) :hints (("Goal" :in-theory (e/d (sbvrem truncate) (REM-=-0 TRUNCATE-=-X/Y))))) ;do not remove. this helps justify the translation to STP. (defthm sbvrem-of-0-arg3 (equal (sbvrem size x 0) (bvchop size x)) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-1-arg3 (equal (sbvrem size x 1) 0) :hints (("Goal" :cases ((posp size)) :in-theory (enable sbvrem))))
53089
; Signed bit-vector remainder ; ; Copyright (C) 2008-2011 <NAME> and Stanford University ; Copyright (C) 2013-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "bvchop") (include-book "logext") (include-book "bvmod") (include-book "unsigned-byte-p-forced") (local (include-book "kestrel/library-wrappers/ihs-logops-lemmas" :dir :system)) (local (include-book "kestrel/library-wrappers/ihs-quotient-remainder-lemmas" :dir :system)) ;drop ;fixme make sure this is what i want and that it matches what java does (defund sbvrem (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (equal (bvchop n y) 0)))) (bvchop n (rem (logext n x) (logext n y))) ; (bvchop n (- x (* (truncate (logext n x) (logext n y)) y))) ) (defthm unsigned-byte-p-of-sbvrem (implies (<= size size2) (equal (unsigned-byte-p size2 (sbvrem size x y)) (natp size2))) :hints (("Goal" :in-theory (e/d (sbvrem) ( ;TRUNCATE-BECOMES-FLOOR-GEN4 TRUNCATE-TYPE ;UNSIGNED-BYTE-P-RESOLVER ))))) (defthm natp-of-sbvrem (natp (sbvrem size x y))) (defthm integerp-of-sbvrem (integerp (sbvrem size x y))) ;destructor elim happens ;or just rely on (:rewrite sbvrem-when-positive)? ;fixme gen! (defthm equal-of-0-and-sbvrem-when-small (implies (and (equal width 32) ;fixme (natp x) (unsigned-byte-p (+ -1 width) n) (< x n) (posp width) ) (equal (equal 0 (sbvrem width x n)) (equal 0 x))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg2 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size (bvchop size1 x) y) (sbvrem size x y))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg3 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size y (bvchop size1 x)) (sbvrem size y x))) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm unsigned-byte-p-forced-of-sbvrem (equal (unsigned-byte-p-forced size (sbvrem size x y)) (natp size)) :hints (("Goal" :in-theory (enable unsigned-byte-p-forced natp sbvrem)))) ;todo: move? (defund sbvmoddown (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (EQUAL (LOGEXT N Y) 0))) ;rephrase in terms of bvchop? ) (bvchop n (mod (logext n x) (logext n y)))) (defthm sbvrem-of-0-arg1 (equal (sbvrem 0 x y) 0) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-0-arg2 (equal (sbvrem size 0 y) 0) :hints (("Goal" :in-theory (e/d (sbvrem truncate) (REM-=-0 TRUNCATE-=-X/Y))))) ;do not remove. this helps justify the translation to STP. (defthm sbvrem-of-0-arg3 (equal (sbvrem size x 0) (bvchop size x)) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-1-arg3 (equal (sbvrem size x 1) 0) :hints (("Goal" :cases ((posp size)) :in-theory (enable sbvrem))))
true
; Signed bit-vector remainder ; ; Copyright (C) 2008-2011 PI:NAME:<NAME>END_PI and Stanford University ; Copyright (C) 2013-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") (include-book "bvchop") (include-book "logext") (include-book "bvmod") (include-book "unsigned-byte-p-forced") (local (include-book "kestrel/library-wrappers/ihs-logops-lemmas" :dir :system)) (local (include-book "kestrel/library-wrappers/ihs-quotient-remainder-lemmas" :dir :system)) ;drop ;fixme make sure this is what i want and that it matches what java does (defund sbvrem (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (equal (bvchop n y) 0)))) (bvchop n (rem (logext n x) (logext n y))) ; (bvchop n (- x (* (truncate (logext n x) (logext n y)) y))) ) (defthm unsigned-byte-p-of-sbvrem (implies (<= size size2) (equal (unsigned-byte-p size2 (sbvrem size x y)) (natp size2))) :hints (("Goal" :in-theory (e/d (sbvrem) ( ;TRUNCATE-BECOMES-FLOOR-GEN4 TRUNCATE-TYPE ;UNSIGNED-BYTE-P-RESOLVER ))))) (defthm natp-of-sbvrem (natp (sbvrem size x y))) (defthm integerp-of-sbvrem (integerp (sbvrem size x y))) ;destructor elim happens ;or just rely on (:rewrite sbvrem-when-positive)? ;fixme gen! (defthm equal-of-0-and-sbvrem-when-small (implies (and (equal width 32) ;fixme (natp x) (unsigned-byte-p (+ -1 width) n) (< x n) (posp width) ) (equal (equal 0 (sbvrem width x n)) (equal 0 x))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg2 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size (bvchop size1 x) y) (sbvrem size x y))) :hints (("Goal" :in-theory (enable sbvrem)))) ;do not remove (helps justify the translation to STP) (defthm sbvrem-of-bvchop-arg3 (implies (and (<= size size1) (posp size) (integerp size1)) (equal (sbvrem size y (bvchop size1 x)) (sbvrem size y x))) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm unsigned-byte-p-forced-of-sbvrem (equal (unsigned-byte-p-forced size (sbvrem size x y)) (natp size)) :hints (("Goal" :in-theory (enable unsigned-byte-p-forced natp sbvrem)))) ;todo: move? (defund sbvmoddown (n x y) (declare (type integer x y) (type (integer 1 *) n) (xargs :guard (not (EQUAL (LOGEXT N Y) 0))) ;rephrase in terms of bvchop? ) (bvchop n (mod (logext n x) (logext n y)))) (defthm sbvrem-of-0-arg1 (equal (sbvrem 0 x y) 0) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-0-arg2 (equal (sbvrem size 0 y) 0) :hints (("Goal" :in-theory (e/d (sbvrem truncate) (REM-=-0 TRUNCATE-=-X/Y))))) ;do not remove. this helps justify the translation to STP. (defthm sbvrem-of-0-arg3 (equal (sbvrem size x 0) (bvchop size x)) :hints (("Goal" :in-theory (enable sbvrem)))) (defthm sbvrem-of-1-arg3 (equal (sbvrem size x 1) 0) :hints (("Goal" :cases ((posp size)) :in-theory (enable sbvrem))))
[ { "context": "ms of AI Programming\n;;;; Copyright (c) 1991, 1996 Peter Norvig\n\n(requires \"tutor\")\n\n(defexamples 1 \"Introduction", "end": 130, "score": 0.9998288154602051, "start": 118, "tag": "NAME", "value": "Peter Norvig" }, { "context": "an example of computation on lists:\"\n ((append '(Pat Kim) '(Robin Sandy)) => (PAT KIM ROBIN SANDY) @ 6)\n ", "end": 682, "score": 0.998968243598938, "start": 675, "tag": "NAME", "value": "Pat Kim" }, { "context": "of computation on lists:\"\n ((append '(Pat Kim) '(Robin Sandy)) => (PAT KIM ROBIN SANDY) @ 6)\n \"The quote mark", "end": 697, "score": 0.9997550845146179, "start": 686, "tag": "NAME", "value": "Robin Sandy" }, { "context": " functions\"\n (:section \"1.4 Lists\")\n ((setf p '(John Q Public)) @ 10)\n ((first p))\n ((rest p))\n ((s", "end": 915, "score": 0.9790955781936646, "start": 911, "tag": "NAME", "value": "John" }, { "context": "\n ((last-name p) => PUBLIC @ 13)\n ((last-name '(Rex Morgan MD)) => MD)\n ((last-name '(Spot)) => SPOT)\n ((last", "end": 1511, "score": 0.9850953221321106, "start": 1498, "tag": "NAME", "value": "Rex Morgan MD" }, { "context": "'(Rex Morgan MD)) => MD)\n ((last-name '(Spot)) => SPOT)\n ((last-name '(Aristotle)) => ARISTOTLE)\n \"We ", "end": 1551, "score": 0.9350281953811646, "start": 1547, "tag": "NAME", "value": "SPOT" }, { "context": ")\n ((last-name '(Spot)) => SPOT)\n ((last-name '(Aristotle)) => ARISTOTLE)\n \"We can also define the functio", "end": 1578, "score": 0.9993813037872314, "start": 1569, "tag": "NAME", "value": "Aristotle" }, { "context": "e '(Spot)) => SPOT)\n ((last-name '(Aristotle)) => ARISTOTLE)\n \"We can also define the function first-name.\"\n", "end": 1593, "score": 0.9990131855010986, "start": 1584, "tag": "NAME", "value": "ARISTOTLE" }, { "context": "first-name explicitly.\"\n (p)\n ((first-name p) => JOHN)\n ((first-name '(Wilma Flintstone)) => WILMA)\n ", "end": 1800, "score": 0.999586284160614, "start": 1796, "tag": "NAME", "value": "JOHN" }, { "context": " (p)\n ((first-name p) => JOHN)\n ((first-name '(Wilma Flintstone)) => WILMA)\n ((setf names '((John Q Public) (Mal", "end": 1835, "score": 0.9998498558998108, "start": 1819, "tag": "NAME", "value": "Wilma Flintstone" }, { "context": "p) => JOHN)\n ((first-name '(Wilma Flintstone)) => WILMA)\n ((setf names '((John Q Public) (Malcolm X)\n ", "end": 1846, "score": 0.9992628693580627, "start": 1841, "tag": "NAME", "value": "WILMA" }, { "context": " '(Wilma Flintstone)) => WILMA)\n ((setf names '((John Q Public) (Malcolm X)\n (Admiral Grace Murray ", "end": 1879, "score": 0.9959618449211121, "start": 1866, "tag": "NAME", "value": "John Q Public" }, { "context": "one)) => WILMA)\n ((setf names '((John Q Public) (Malcolm X)\n (Admiral Grace Murray Hopper) (Spo", "end": 1891, "score": 0.999633252620697, "start": 1882, "tag": "NAME", "value": "Malcolm X" }, { "context": "ames '((John Q Public) (Malcolm X)\n (Admiral Grace Murray Hopper) (Spot) \n (Aristotle) (A A Milne) (Z", "end": 1935, "score": 0.9998757839202881, "start": 1908, "tag": "NAME", "value": "Admiral Grace Murray Hopper" }, { "context": "miral Grace Murray Hopper) (Spot) \n (Aristotle) (A A Milne) (Z Z Top)\n (Sir Larry O", "end": 1969, "score": 0.9976242780685425, "start": 1960, "tag": "NAME", "value": "Aristotle" }, { "context": "Murray Hopper) (Spot) \n (Aristotle) (A A Milne) (Z Z Top)\n (Sir Larry Olivier) (Mis", "end": 1981, "score": 0.9900252819061279, "start": 1972, "tag": "NAME", "value": "A A Milne" }, { "context": " (Aristotle) (A A Milne) (Z Z Top)\n (Sir Larry Olivier) (Miss Scarlet))) @ 14)\n ((first-name (first nam", "end": 2025, "score": 0.9998412728309631, "start": 2008, "tag": "NAME", "value": "Sir Larry Olivier" }, { "context": "lne) (Z Z Top)\n (Sir Larry Olivier) (Miss Scarlet))) @ 14)\n ((first-name (first names)) => JOHN)\n ", "end": 2040, "score": 0.9995196461677551, "start": 2028, "tag": "NAME", "value": "Miss Scarlet" }, { "context": " Scarlet))) @ 14)\n ((first-name (first names)) => JOHN)\n (:section \"1.6 Using Functions\")\n \"Consider t", "end": 2087, "score": 0.9992818236351013, "start": 2083, "tag": "NAME", "value": "JOHN" }, { "context": "\n ((mapcar #'first-name names))\n ((first-name '(Madam Major General Paula Jones)) => PAULA)\n \"We can s", "end": 2947, "score": 0.9370700120925903, "start": 2942, "tag": "NAME", "value": "Madam" }, { "context": "-name names))\n ((first-name '(Madam Major General Paula Jones)) => PAULA)\n \"We can see how this works by traci", "end": 2973, "score": 0.9993874430656433, "start": 2962, "tag": "NAME", "value": "Paula Jones" }, { "context": "(first-name '(Madam Major General Paula Jones)) => PAULA)\n \"We can see how this works by tracing the exec", "end": 2984, "score": 0.9847468733787537, "start": 2979, "tag": "NAME", "value": "PAULA" }, { "context": "st-name:\"\n ((trace first-name))\n ((first-name '(John Q Public)) => JOHN @ 17)\n ((first-name '(Madam Major Gene", "end": 3109, "score": 0.9956082701683044, "start": 3096, "tag": "NAME", "value": "John Q Public" }, { "context": " '(John Q Public)) => JOHN @ 17)\n ((first-name '(Madam Major General Paula Jones)) => PAULA)\n ((untrace first-name))\n", "end": 3162, "score": 0.9918909072875977, "start": 3143, "tag": "NAME", "value": "Madam Major General" }, { "context": "=> JOHN @ 17)\n ((first-name '(Madam Major General Paula Jones)) => PAULA)\n ((untrace first-name))\n (:section ", "end": 3174, "score": 0.9664090871810913, "start": 3163, "tag": "NAME", "value": "Paula Jones" }, { "context": " \"The General problem Solver, developed in 1957 by Alan Newell and Herbert\"\n \"Simon, embodied a grandiose visio", "end": 9243, "score": 0.9998859167098999, "start": 9232, "tag": "NAME", "value": "Alan Newell" }, { "context": "oblem Solver, developed in 1957 by Alan Newell and Herbert\"\n \"Simon, embodied a grandiose vision: a single ", "end": 9255, "score": 0.9997575283050537, "start": 9248, "tag": "NAME", "value": "Herbert" }, { "context": " developed in 1957 by Alan Newell and Herbert\"\n \"Simon, embodied a grandiose vision: a single computer p", "end": 9265, "score": 0.9874714612960815, "start": 9260, "tag": "NAME", "value": "Simon" }, { "context": ".\"\n ((pat-match '((?* ?p) need (?* ?x))\n\t '(Mr Hulot and I need a vacation)) @ 160)\n (:section \"5.4 T", "end": 19087, "score": 0.836348831653595, "start": 19079, "tag": "NAME", "value": "Mr Hulot" }, { "context": "r early language understanding program, written by Daniel\"\n \"Bobrow in 1964. It was designed to read and ", "end": 23723, "score": 0.8858022093772888, "start": 23717, "tag": "NAME", "value": "Daniel" }, { "context": "xamples\")\n ((student '(If the number of customers Tom gets is twice the square of\n 20 % of th", "end": 24308, "score": 0.9792232513427734, "start": 24305, "tag": "NAME", "value": "Tom" }, { "context": ",|\n then what is the number of customers Tom gets ?)) => nil @ 231)\n ((student '(The daily co", "end": 24503, "score": 0.9230963587760925, "start": 24500, "tag": "NAME", "value": "Tom" }, { "context": "nto the data base with the <- macro\"\n ((<- (likes Kim Robin)) @ 350)\n ((<- (likes Sandy Lee)))\n ((<- (likes", "end": 30780, "score": 0.9944265484809875, "start": 30771, "tag": "NAME", "value": "Kim Robin" }, { "context": "ro\"\n ((<- (likes Kim Robin)) @ 350)\n ((<- (likes Sandy Lee)))\n ((<- (likes Sandy Kim)))\n ((<- (likes Robin", "end": 30813, "score": 0.9959418177604675, "start": 30804, "tag": "NAME", "value": "Sandy Lee" }, { "context": ")) @ 350)\n ((<- (likes Sandy Lee)))\n ((<- (likes Sandy Kim)))\n ((<- (likes Robin cats)))\n \"We can also", "end": 30836, "score": 0.9992449283599854, "start": 30831, "tag": "NAME", "value": "Sandy" }, { "context": "50)\n ((<- (likes Sandy Lee)))\n ((<- (likes Sandy Kim)))\n ((<- (likes Robin cats)))\n \"We can also ent", "end": 30840, "score": 0.9771315455436707, "start": 30837, "tag": "NAME", "value": "Kim" }, { "context": "dy Lee)))\n ((<- (likes Sandy Kim)))\n ((<- (likes Robin cats)))\n \"We can also enter rules, which state c", "end": 30863, "score": 0.9996440410614014, "start": 30858, "tag": "NAME", "value": "Robin" }, { "context": "ules, which state contingent facts.\"\n ((<- (likes Sandy ?x) (likes ?x cats)) @ 351)\n ((<- (likes Kim ?x)", "end": 30950, "score": 0.999199628829956, "start": 30945, "tag": "NAME", "value": "Sandy" }, { "context": "es Sandy ?x) (likes ?x cats)) @ 351)\n ((<- (likes Kim ?x) (likes ?x Lee) (likes ?x Kim)))\n\n (:section ", "end": 30996, "score": 0.9992590546607971, "start": 30993, "tag": "NAME", "value": "Kim" }, { "context": "s ?x cats)) @ 351)\n ((<- (likes Kim ?x) (likes ?x Lee) (likes ?x Kim)))\n\n (:section \"11.2 Idea 2: Unif", "end": 31014, "score": 0.9958910346031189, "start": 31011, "tag": "NAME", "value": "Lee" }, { "context": "51)\n ((<- (likes Kim ?x) (likes ?x Lee) (likes ?x Kim)))\n\n (:section \"11.2 Idea 2: Unification of Logi", "end": 31029, "score": 0.9885081648826599, "start": 31026, "tag": "NAME", "value": "Kim" }, { "context": "63)\n \"Now we can ask some queries:\"\n ((?- (likes Sandy ?who)) @ 365)\n ((?- (likes ?who Sandy)))\n ((?- ", "end": 32233, "score": 0.9976485967636108, "start": 32228, "tag": "NAME", "value": "Sandy" }, { "context": "((?- (likes Sandy ?who)) @ 365)\n ((?- (likes ?who Sandy)))\n ((?- (likes Robin Lee)))\n ((?- (likes ?x ?y", "end": 32272, "score": 0.9969161748886108, "start": 32267, "tag": "NAME", "value": "Sandy" }, { "context": ") @ 365)\n ((?- (likes ?who Sandy)))\n ((?- (likes Robin Lee)))\n ((?- (likes ?x ?y) (likes ?y ?x)) @ 366)\n\n ", "end": 32299, "score": 0.9982879161834717, "start": 32290, "tag": "NAME", "value": "Robin Lee" }, { "context": "yet covered is 'object-oriented programming'.\"\n \"Peter Wegner (1987) proposes the following formula as a defini", "end": 35572, "score": 0.9995735287666321, "start": 35560, "tag": "NAME", "value": "Peter Wegner" }, { "context": " ((requires \"clos\"))\n ((setf acct (new-account \"J. Random Customer\" 1000.00)) @ 438)\n ((send acct 'withdraw 500.00)", "end": 35819, "score": 0.7935951948165894, "start": 35801, "tag": "NAME", "value": "J. Random Customer" }, { "context": "posit 123.45) => 623.45)\n ((send acct 'name) => \"J. Random Customer\")\n ((send acct 'balance) => 623.45)\n\n (:section", "end": 35965, "score": 0.89458167552948, "start": 35947, "tag": "NAME", "value": "J. Random Customer" }, { "context": " defined by this macro:\"\n ((setf acct2 (account \"A. User\" 2000.00)))\n ((deposit acct2 42.00) => 2042", "end": 36566, "score": 0.7918241024017334, "start": 36565, "tag": "NAME", "value": "A" }, { "context": "efined by this macro:\"\n ((setf acct2 (account \"A. User\" 2000.00)))\n ((deposit acct2 42.00) => 2042.0)\n ", "end": 36572, "score": 0.5495762825012207, "start": 36568, "tag": "USERNAME", "value": "User" }, { "context": ":balance 5000.00\n :name \"Fred\")) @ 446)\n ((name* a1) => \"Fred\")\n ((balance* a", "end": 38224, "score": 0.9998621344566345, "start": 38220, "tag": "NAME", "value": "Fred" }, { "context": " :name \"Fred\")) @ 446)\n ((name* a1) => \"Fred\")\n ((balance* a1) => 5000.0)\n ((interest-rate* ", "end": 38257, "score": 0.9998531937599182, "start": 38253, "tag": "NAME", "value": "Fred" }, { "context": "'limited-account\n :name \"A. Thrifty Spender\"\n :balance 500.00 :limit", "end": 38782, "score": 0.9998480677604675, "start": 38764, "tag": "NAME", "value": "A. Thrifty Spender" }, { "context": "e 500.00 :limit 100.00)) @ 447)\n ((name* a2) => \"A. Thrifty Spender\")\n ((withdraw* a2 200.00) => OVER-LIMIT)\n ((wit", "end": 38885, "score": 0.9997845888137817, "start": 38867, "tag": "NAME", "value": "A. Thrifty Spender" }, { "context": "ouns, verbs, adjectives, and names.\"\n ((parser '(John liked Mary)) @ 664 =>\n ((S (NP (NAME JOHN))\n (V", "end": 54311, "score": 0.8821039199829102, "start": 54301, "tag": "NAME", "value": "John liked" }, { "context": "s, adjectives, and names.\"\n ((parser '(John liked Mary)) @ 664 =>\n ((S (NP (NAME JOHN))\n (VP (V ", "end": 54316, "score": 0.9959962368011475, "start": 54312, "tag": "NAME", "value": "Mary" }, { "context": "rser '(John liked Mary)) @ 664 =>\n ((S (NP (NAME JOHN))\n (VP (V LIKED) (NP (NAME MARY))))))\n ((p", "end": 54349, "score": 0.9923849701881409, "start": 54345, "tag": "NAME", "value": "JOHN" }, { "context": "(S (NP (NAME JOHN))\n (VP (V LIKED) (NP (NAME MARY))))))\n ((parser '(Dana liked Dale)) @ 665 =>\n ", "end": 54387, "score": 0.9877368211746216, "start": 54383, "tag": "NAME", "value": "MARY" }, { "context": " (VP (V LIKED) (NP (NAME MARY))))))\n ((parser '(Dana liked Dale)) @ 665 =>\n ((S (NP (NAME DANA))\n (V", "end": 54417, "score": 0.8113657832145691, "start": 54407, "tag": "NAME", "value": "Dana liked" }, { "context": "IKED) (NP (NAME MARY))))))\n ((parser '(Dana liked Dale)) @ 665 =>\n ((S (NP (NAME DANA))\n (VP (V ", "end": 54422, "score": 0.9927812814712524, "start": 54418, "tag": "NAME", "value": "Dale" }, { "context": "rser '(Dana liked Dale)) @ 665 =>\n ((S (NP (NAME DANA))\n (VP (V LIKED) (NP (NAME DALE))))))\n \"We", "end": 54455, "score": 0.9923704266548157, "start": 54451, "tag": "NAME", "value": "DANA" }, { "context": "see the parser works as well with words it knows (John and Mary)\"\n \"as with new words (Dana and Dale), ", "end": 54560, "score": 0.9981233477592468, "start": 54556, "tag": "NAME", "value": "John" }, { "context": "parser works as well with words it knows (John and Mary)\"\n \"as with new words (Dana and Dale), which it ", "end": 54569, "score": 0.9914534091949463, "start": 54565, "tag": "NAME", "value": "Mary" }, { "context": "s it knows (John and Mary)\"\n \"as with new words (Dana and Dale), which it can recognize as names\"\n \"be", "end": 54598, "score": 0.9932252764701843, "start": 54594, "tag": "NAME", "value": "Dana" }, { "context": "ws (John and Mary)\"\n \"as with new words (Dana and Dale), which it can recognize as names\"\n \"because of ", "end": 54607, "score": 0.9558672308921814, "start": 54603, "tag": "NAME", "value": "Dale" }, { "context": "nput \";;;;\")\n \"If we want the interpretation of 'Terry kisses Jean' to be\"\n \"(kiss Terry Jean) not ((lambda (x) (ki", "end": 59269, "score": 0.9973249435424805, "start": 59252, "tag": "NAME", "value": "Terry kisses Jean" }, { "context": "erpretation of 'Terry kisses Jean' to be\"\n \"(kiss Terry Jean) not ((lambda (x) (kiss x Jean)) Terry), the", "end": 59292, "score": 0.9968055486679077, "start": 59287, "tag": "NAME", "value": "Terry" }, { "context": "ation of 'Terry kisses Jean' to be\"\n \"(kiss Terry Jean) not ((lambda (x) (kiss x Jean)) Terry), then we ", "end": 59297, "score": 0.9792114496231079, "start": 59293, "tag": "NAME", "value": "Jean" }, { "context": " be\"\n \"(kiss Terry Jean) not ((lambda (x) (kiss x Jean)) Terry), then we need\"\n \"a way to unify semanti", "end": 59328, "score": 0.7357825040817261, "start": 59324, "tag": "NAME", "value": "Jean" }, { "context": "\"(kiss Terry Jean) not ((lambda (x) (kiss x Jean)) Terry), then we need\"\n \"a way to unify semantic compon", "end": 59336, "score": 0.7200807929039001, "start": 59331, "tag": "NAME", "value": "Terry" }, { "context": "sem)\n\t (Noun ?agr ?noun-sem)))\n\n ((rule (Name 3sg Terry) --> (:word Terry)))\n ((rule (Name 3sg Jean)", "end": 60253, "score": 0.9470685720443726, "start": 60252, "tag": "NAME", "value": "T" }, { "context": "m)\n\t (Noun ?agr ?noun-sem)))\n\n ((rule (Name 3sg Terry) --> (:word Terry)))\n ((rule (Name 3sg Jean) --", "end": 60257, "score": 0.4429149329662323, "start": 60253, "tag": "NAME", "value": "erry" }, { "context": " 3sg Terry) --> (:word Terry)))\n ((rule (Name 3sg Jean) --> (:word Jean)))\n\n ((rule (Noun 3sg (young m", "end": 60302, "score": 0.9877716302871704, "start": 60298, "tag": "NAME", "value": "Jean" }, { "context": "word Terry)))\n ((rule (Name 3sg Jean) --> (:word Jean)))\n\n ((rule (Noun 3sg (young male human)) ", "end": 60320, "score": 0.5223654508590698, "start": 60316, "tag": "NAME", "value": "Jean" }, { "context": "ssed the girls) ())) :input \";.\")\n ((?- (S ?sem (Terry kissed the girl) ())) :input \";.\")\n ((?- (S ?sem", "end": 60954, "score": 0.9952892065048218, "start": 60949, "tag": "NAME", "value": "Terry" }, { "context": "isses the boys) ())) :input \";.\")\n ((?- (S ?sem (Terry kissed a girls) ())) :input \";.\")\n ((?- (S ?sem ", "end": 61072, "score": 0.9944664239883423, "start": 61067, "tag": "NAME", "value": "Terry" }, { "context": "kissed a girls) ())) :input \";.\")\n ((?- (S ?sem (Terry sleeps Jean) ())) :input \";.\")\n\n (:section \"20.4", "end": 61128, "score": 0.9967010021209717, "start": 61123, "tag": "NAME", "value": "Terry" }, { "context": "rd that)\n\t (VP ?agr ?x ?rel)))\n\n ((rule (Name 3sg Terry) --> (:word Terry)))\n ((rule", "end": 63828, "score": 0.9075906276702881, "start": 63823, "tag": "NAME", "value": "Terry" }, { "context": " (Name 3sg Terry) --> (:word Terry)))\n ((rule (Name 3sg Jean) ", "end": 63866, "score": 0.42419731616973877, "start": 63862, "tag": "NAME", "value": "erry" }, { "context": " --> (:word Terry)))\n ((rule (Name 3sg Jean) --> (:word Jean)))\n ((rule", "end": 63893, "score": 0.9917279481887817, "start": 63889, "tag": "NAME", "value": "Jean" }, { "context": "rd sees verb ?infl ?senses)) :input \".\")\n ((try S John promised Kim to persuade Lee to sleep) :input \";;", "end": 64686, "score": 0.932451069355011, "start": 64682, "tag": "NAME", "value": "John" }, { "context": "infl ?senses)) :input \".\")\n ((try S John promised Kim to persuade Lee to sleep) :input \";;;.\")\n (:sect", "end": 64699, "score": 0.9588340520858765, "start": 64696, "tag": "NAME", "value": "Kim" }, { "context": "input \".\")\n ((try S John promised Kim to persuade Lee to sleep) :input \";;;.\")\n (:section \"21.14 Examp", "end": 64715, "score": 0.6529980301856995, "start": 64712, "tag": "NAME", "value": "Lee" }, { "context": ")\n (:section \"21.14 Examples\")\n ((try S When did John promise Kim to persuade Lee to sleep) \n @ 746 :", "end": 64794, "score": 0.9735723733901978, "start": 64790, "tag": "NAME", "value": "John" }, { "context": " \"21.14 Examples\")\n ((try S When did John promise Kim to persuade Lee to sleep) \n @ 746 :input \";;;.\"", "end": 64806, "score": 0.971396803855896, "start": 64803, "tag": "NAME", "value": "Kim" }, { "context": "\")\n ((try S When did John promise Kim to persuade Lee to sleep) \n @ 746 :input \";;;.\")\n ((try S Kim ", "end": 64822, "score": 0.787839412689209, "start": 64819, "tag": "NAME", "value": "Lee" } ]
src/examples.lisp
ckabwe/paip
10
;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*- ;;;; Code from Paradigms of AI Programming ;;;; Copyright (c) 1991, 1996 Peter Norvig (requires "tutor") (defexamples 1 "Introduction to Lisp" "This chapter is for people with little or no experince in Lisp." "Intermediate or advanced readers can skim or skip this chapter." "" "Lisp expressions are in prefix notation: the operator first." ((+ 2 2) => 4 @ 4) ((+ 1 2 3 4 5 6 7 8 9 10) => 55 @ 5) "This is Lisp for (900 + 900 + 90 + 9) - (5000 + 500 + 50 + 5)" ((- (+ 9000 900 90 9) (+ 5000 500 50 5)) => 4444) (:section "1.1 Symbolic Computation") "This is an example of computation on lists:" ((append '(Pat Kim) '(Robin Sandy)) => (PAT KIM ROBIN SANDY) @ 6) "The quote mark instructs Lisp to treat the list as data." ('(pat Kim) => (PAT KIM)) "Let's look at some more list processing functions" (:section "1.4 Lists") ((setf p '(John Q Public)) @ 10) ((first p)) ((rest p)) ((second p)) ((third p)) ((fourth p)) ((length p)) "It is also possible to build up new lists" (p @ 11) ((cons 'Mr p)) ((cons (first p) (rest p))) ((setf town (list 'Anytown 'USA))) ((list p 'of town 'may 'have 'already 'won!)) ((append p '(of) town '(may have already won))) (p) (:section "1.5 Defining New Functions") "The special form DEFUN stands for 'define function.'" "It is used here to define a new function called last-name:" ((requires "intro")) ((last-name p) => PUBLIC @ 13) ((last-name '(Rex Morgan MD)) => MD) ((last-name '(Spot)) => SPOT) ((last-name '(Aristotle)) => ARISTOTLE) "We can also define the function first-name." "Even though the definition is trivial (it is the same as FIRST)," "it is good practice to define first-name explicitly." (p) ((first-name p) => JOHN) ((first-name '(Wilma Flintstone)) => WILMA) ((setf names '((John Q Public) (Malcolm X) (Admiral Grace Murray Hopper) (Spot) (Aristotle) (A A Milne) (Z Z Top) (Sir Larry Olivier) (Miss Scarlet))) @ 14) ((first-name (first names)) => JOHN) (:section "1.6 Using Functions") "Consider the following expression, which can be used to test LAST-NAME:" ((mapcar #'last-name names)) "The #' notation maps the name of a function to the function itself." ((mapcar #'- '(1 2 3 4)) @ 15) ((mapcar #'+ '(1 2 3 4) '(10 20 30 40))) "Now that we understand mapcar, let's use it to test FIRST-NAME:" ((mapcar #'first-name names)) "Suppose we wanted a version of FIRST-NAME that ignored titles like Miss:" ((defparameter *titles* '(Mr Mrs Miss Ms Sir Madam Dr Admiral Major General) "A list of titles that can appear at the start of a name.")) ((defun first-name (name) "Select the first name from a name represented as a list." (if (member (first name) *titles*) (first-name (rest name)) (first name))) @ 16) ((mapcar #'first-name names)) ((first-name '(Madam Major General Paula Jones)) => PAULA) "We can see how this works by tracing the execution of first-name:" ((trace first-name)) ((first-name '(John Q Public)) => JOHN @ 17) ((first-name '(Madam Major General Paula Jones)) => PAULA) ((untrace first-name)) (:section "1.7 Higher-Order Functions") ((apply #'+ '(1 2 3 4)) => 10) ((apply #'append '((1 2 3) (a b c)))) "Now we define a new function, self-and-double, and apply it to arguments." ((defun self-and-double (x) (list x (+ x x)))) ((self-and-double 3) => (3 6)) ((apply #'self-and-double '(3)) => (3 6)) "Now let's return to the mapping functions:" ((mapcar #'self-and-double '(1 10 300))) ((mappend #'self-and-double '(1 10 300))) "FUNCALL is similar to APPLY; it too takes a function as its" "first argument and applies the function to a list of arguments," "but in the case of FUNCALL, the arguments are listed separately:" ((funcall #'+ 2 3) => 5 @ 20) ((apply #'+ '(2 3)) => 5) ) (defexamples 2 "A Simple Lisp Program" "This chapter shows how to combine the basic functions and" "special forms of Lisp into a complete program" "The program generates random English sentences." (:section "2.2 A Straightforward Solution") "We can test the program by generating a few random sentences." "(Note that since these are random, you won't get the same ones" "as in the book.)" ((requires "simple")) ((sentence) @ 36) ((sentence) @ 36) ((sentence) @ 36) ((noun-phrase)) ((verb-phrase)) ((trace sentence noun-phrase verb-phrase article noun verb) @ 37) ((sentence)) ((untrace)) (:section "2.3 A Rule-Based Solution") "An alternative implementation concentrates on making it easy" "to write grammar rules." ((generate 'sentence) @ 41) ((generate 'sentence) @ 41) ((generate 'noun-phrase) @ 41) ((generate 'verb-phrase) @ 41) "One advantage of this approach is its easier to change grammars." ((setf *grammar* *bigger-grammar*) @ 43) ((generate 'sentence)) ((generate 'sentence)) "Another advantage is that the same data (grammar) can be used" "for more than one purpose. Consider generate-tree:" ((generate-tree 'sentence) @ 45)) (defexamples 3 "Overview of Lisp" "This chapter briefly covers the most important special forms and" "functions in Lisp." (:section "3.2 Special Forms") "Start with functions and special forms for repetition:" "First, functions like MAPCAR can apply to any number of lists:" ((mapcar #'- '(1 2 3)) => (-1 -2 -3) @ 61) ((mapcar #'+ '(1 2) '(10 20) '(100 200)) => (111 222)) "Second, many of the functions accept keywords:" ((remove 1 '(1 2 3 2 1 0 -1)) => (2 3 2 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :key #'abs) => (2 3 2 0) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :test #'<) => (1 1 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :start 4) => (1 2 3 2 0 -1) @ 61) "Third, some have corresponding -IF or -IF-NOT versions:" ((remove-if #'oddp '(1 2 3 2 1 0 -1)) => (2 2 0)) ((remove-if-not #'oddp '(1 2 3 2 1 0 -1)) => (1 3 1 -1)) "The forms TRACE and UNTRACE are used to control debugging info:" ((requires "overview")) ((trace length9) @ 65) ((length9 '(1 b c)) => 3) ((untrace length9)) ((length9 '(1 b c)) => 3) (:section "3.7 Functions on Trees") ((setf tree '((a b) ((c)) (d e))) @ 76) ((tree-equal tree (copy-tree tree)) => t) ((same-shape-tree tree '((1 2) ((3)) (4 5))) => t) ((same-shape-tree tree '((1 2) (3) (4 5))) => nil) "There are two functions for substituting a new expression into a tree:" ((subst 'new 'old '(old ((very old)))) => (NEW ((VERY NEW)))) ((sublis '((old . new)) '(old ((very old)))) => (NEW ((VERY NEW)))) ((subst 'new 'old 'old) => NEW) "Here is an example:" ((english->french '(hello my friend - how are you today?)) => (bonjour mon ami - comment va tu today?) @ 77) (:section "3.10 Destructive Functions") "Consider the following:" ((setq x '(a b c)) @ 80) ((setq y '(1 2 3))) ((nconc x y) => (a b c 1 2 3)) (x => (a b c 1 2 3)) (y => (1 2 3)) "NCONC computes the same result as APPEND, but it alters the first argument." "It is called a 'destructive' function." "There is quite a conceptual load on the programmer who uses NCONC." "The advantage of NCONC is that it doesn't use any storage." "" (:section "3.11 Overview of Data Types") "The function TYPE-OF returns the type of its argument." ((type-of 123) => fixnum @ 82) ((typep 123 'fixnum) => t) ((typep 123 'integer) => t) ((typep 123.0 'integer) => nil) ((subtypep 'fixnum 'integer) => t) (:section "3.12 Input/Output") "FORMAT is the main function for formatted output:" ((format t "hello, world") @ 84) ((format t "~&~a plus ~s is ~f" "two" "two" 4)) ((let ((numbers '( 1 2 3 4 5))) (format t "~&~{~r~^ plus ~} is ~@r" numbers (apply #'+ numbers)))) (:section "3.13 Debugging tools") ((documentation 'first 'function) @ 87) ((documentation 'pi 'variable)) (:section "3.14 Antibugging Tools") ((defun f (n) (dotimes (i n) nil)) @ 90) ((time (f 10000))) ((compile 'f)) ((time (f 10000))) (:section "3.15 Evaluation") "The following five forms are equivalent:" ((+ 1 2 3 4) => 10 @ 91) ((funcall #'+ 1 2 3 4) => 10 @ 91) ((apply #'+ '(1 2 3 4)) => 10 @ 91) ((apply #'+ 1 2 '(3 4)) => 10 @ 91) ((eval '(+ 1 2 3 4)) => 10 @ 91) (:section "3.16 Closures") "In the general case, a function consists of the body of the function" "coupled with any free lexical variables that the function references." "Consider the example:" ((mapcar (adder 3) '(1 3 10)) => (4 6 13) @ 92) ((mapcar (adder 10) '(1 3 10)) => (11 13 20) @ 92) "In the following, two calls to BANK-ACCOUNT create two different closures," "each with a separate value for the lexical variable BALANCE." ((setf my-account (bank-account 500.00)) @ 92) ((setf your-account (bank-account 250.00)) @ 93) ((funcall my-account 'withdraw 75.00) => 425.0) ((funcall your-account 'deposit 250.00) => 500.0) ((funcall your-account 'withdraw 100.00) => 400.0) ((funcall my-account 'withdraw 25.00) => 400.0) "This style of programming is covered in more detail in chapter 13." ) (defexamples 4 "GPS: The General Problem Solver" "The General problem Solver, developed in 1957 by Alan Newell and Herbert" "Simon, embodied a grandiose vision: a single computer program that could" "solve ANY problem. GPS caused quite a stir ..." (:section "4.4 Stage 4: test") ((requires "gps1")) "Here are some examples of using GPS" "The first example works with a complex chain of steps." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school) *school-ops*) => SOLVED @ 118) "The next example fails because there is no way to make the car work," "because we can't contact the shop to get the battery fixed." ((gps '(son-at-home car-needs-battery have-money) '(son-at-school) *school-ops*) => NIL) "The third example is easy, because the car is currently working." ((gps '(son-at-home car-works) '(son-at-school) *school-ops*) => SOLVED) (:section "4.7 The Clobbered Sibling Goal Problem") "In the next example, GPS incorrectly reports success, when in fact it has" "spent the money on the battery, and thus should fail." ((gps '(son-at-home have-money car-works) '(have-money son-at-school) *school-ops*) => SOLVED @ 120) "The bug is that when (EVERY #'ACHIEVE GOALS) returns true, it means all the" "goals were achieved in turn, but they might not still be all true." (:section "4.8 The Leaping before You Look Problem") "What happens if we move the HAVE-MONEY goal to the end?" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school) *school-ops*) => SOLVED @ 121) "GPS returns nil, but only after executing all the actions." "I call this the 'leaping before you look' problem, because if you asked" "the program to solve for the two goals (JUMP-OFF-CLIFF LAND-SAFELY) it" "would happily jump first, only to discover that it had no operator to land" "safely. This is less than prudent behavior." (:section "4.9 The Recursive Subgoal Problem") "We won't show the problem (because it gets into an infinite loop)," "but we will add the new operator to the *school-ops*; we'll use it later." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*) @ 122) (:section "4.11 GPS Version 2: A More General problem Solver") "At this point we are ready to put together a new version of GPS with" "solutions for the 'running around the block,' 'prerequisite clobbers" "sibling goal,' 'leaping before you look,' and 'recursive subgoal' problems." "The most important change is that, instead of printing a message when each" "operator is applied, we will instead have GPS return the resulting state." ((requires "gps")) "We use the list of operators that includes the 'asking the shop their" "phone number' operator." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*)) ((use *school-ops*) => 7 @ 130) "First we make sure the new version works on some of the examples that" "version 1 worked on:" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) "We can see what is going on here by turning on debugging temporarily:" ((debug :gps)) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) ((undebug)) "Here is another old example:" ((gps '(son-at-home car-works) '(son-at-school)) => ((START) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 132) "Now we see that version 2 can handle the three cases version 1 got wrong." "In each case the program avoids an infinite loop, and also avoids leaping" "before it looks." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school)) => NIL) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school have-money)) => NIL) ((gps '(son-at-home car-needs-battery have-money) '(son-at-school)) => NIL) "Finally, we see the new GPS also works on trivial problems:" ((gps '(son-at-home) '(son-at-home)) => ((START))) (:section "4.12 The New Domain Problem: Monkey and Bananas") "To show that GPS is at all general, we have to make it work in different" "domains. We start with a 'classic' AI problem: Monkey and Bananas" ((use *banana-ops*) => 6 @ 133) "We pose the problem of becoming not-hungry, given an initial state." "GPS can find a solution to this problem:" ((GPS '(at-door on-floor has-ball hungry chair-at-door) '(not-hungry)) => ((START) (EXECUTING PUSH-CHAIR-FROM-DOOR-TO-MIDDLE-ROOM) (EXECUTING CLIMB-ON-CHAIR) (EXECUTING DROP-BALL) (EXECUTING GRASP-BANANAS) (EXECUTING EAT-BANANAS)) @ 133) "Notice we did not need to make any changes at all to the GPS program." "We just used a different set of operators." (:section "4.13 The Maze Searching Domain") "Next we will consider another 'classic' problem, maze searching." "We will assume a particular maze, diagrammed on page 134." ((use *maze-ops*) => 48 @ 134) ((gps '((at 1)) '((at 25))) @ 135) "We can define FIND-PATH to use the results of a GPS search:" ((find-path 1 25) @ 136 => (1 2 3 4 9 8 7 12 11 16 17 22 23 24 19 20 25)) ((find-path 1 1) => (1)) ((equal (find-path 1 25) (reverse (find-path 25 1))) => T) (:section "4.14 The Blocks World Domain") "Another domain that has attracted more than its share of attention in AI" "circles is the blocks world domain." ((use (make-block-ops '(a b))) => 4 @ 137) "The simplest possible problem is stacking one block on another." ((gps '((a on table) (b on table) (space on a) (space on b) (space on table)) '((a on b) (b on table))) => ((START) (EXECUTING (MOVE A FROM TABLE TO B)))) "Here is a slightly more complex problem: inverting a stack of two blocks." "This time we show the debugging output:" ((debug :gps) @ 138) ((gps '((a on b) (b on table) (space on a) (space on table)) '((b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO A)))) ((undebug)) "Now we move on to the three block world." ((use (make-block-ops '(a b c))) => 18) "We try some problems:" ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table)) '((c on table) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 141) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) @ 141 => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((c on b) (b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) "The Sussman Anomaly" ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 142) ((gps start '((a on b) (b on c))) => NIL) ((gps start '((b on c) (a on b))) => NIL) (:section "4.16 The Not Looking after You Don't Leap Problem") ((use (push (op 'taxi-son-to-school :preconds '(son-at-home have-money) :add-list '(son-at-school) :del-list '(son-at-home have-money)) *school-ops*)) @ 143) ((debug :gps)) ((gps '(son-at-home have-money car-works) '(son-at-school have-money)) => NIL) ((undebug)) ) (defexamples 5 "Eliza: Dialog with a Machine" "ELIZA was one of the first programs to feature English output as well as input." "The program was named after the heroine of Pygmalion, who was taught to" "speak proper English by a dedicated teacher." (:section "5.2 Pattern Matching") ((requires "eliza1")) "The hard part is the notion of pattern matching and transformation." "All symbols beginning with ? are variables for the pattern matcher." "First we see how to substitute variable/value pairs into expressions:" ((sublis '((?X . vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 156) "Now a version of pat-match that works with such pairs:" ((pat-match '(I need a ?x) '(I need a vacation)) @ 158) "Showing how to plug it in:" ((sublis (pat-match '(I need a ?x) '(I need a vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 159) ((pat-match '(I need a ?x) '(I really need a vacation)) => nil) ((pat-match '(this is easy) '(this is easy)) => ((t . t))) ((pat-match '(?x is ?x) '((2 + 2) is 4)) => nil) ((pat-match '(?x is ?x) '((2 + 2) is (2 + 2))) => ((?x 2 + 2))) ((pat-match '(?P need . ?X) '(I need a long vacation)) => ((?X a long vacation) (?P . I))) (:section "5.3 Segment Pattern Matching") "We show how to have a variable that will match more than one element." "We call these segment variables, and denote them (?* name)." ((pat-match '((?* ?p) need (?* ?x)) '(Mr Hulot and I need a vacation)) @ 160) (:section "5.4 The Eliza Program: A Rule-Based Translator") ((requires "eliza")) "We can't show you an interactive ELIZA session, because the replies are" "random, and thus change every time. You can experiment on your own by" "evaluating (ELIZA) and typing in your end of the conversation. Type (good bye) when you are done." ) (defexamples 6 "Building Software Tools" "In chapters 4 and 5 we were concerned with buildinng two particular" "programs, GPS and ELIZA. In this chapter, we will reexamine those" "two programs to discover some common patterns. Those patterns will be" "abstracted out to form reusable software tools." (:section "6.2 A Pattern-Matching tool") ((requires "patmatch")) ((pat-match '(x = (?is ?n numberp)) '(x = 34)) => ((?n . 34)) @ 179) ((pat-match '(x = (?is ?n numberp)) '(x = x)) => NIL) ((pat-match '(?x (?or < = >) ?y) '(3 < 4)) => ((?Y . 4) (?X . 3))) ((pat-match '(x = (?and (?is ?n numberp) (?is ?n oddp))) '(x = 3)) => ((?N . 3))) ((pat-match '(?x /= (?not ?x)) '(3 /= 4)) => ((?X . 3)) @ 180) ((pat-match '(?x > ?y (?if (> ?x ?y))) '(4 > 3)) => ((?Y . 3) (?X . 4))) ((pat-match '(a (?* ?x) d) '(a b c d)) => ((?X B C)) @ 185) ((pat-match '(a (?* ?x) (?* ?y) d) '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(a (?* ?x) (?* ?y) ?x ?y) '(a b c d (b c) (d))) => ((?Y D) (?X B C)) @ 186) ((pat-match '(?x ?op ?y is ?z (?if (eql (funcall ?op ?x ?y) ?z))) '(3 + 4 is 7)) => ((?Z . 7) (?Y . 4) (?OP . +) (?X . 3))) ((pat-match '(?x ?op ?y (?if (funcall ?op ?x ?y))) '(3 > 4)) => NIL) ((pat-match-abbrev '?x* '(?* ?x)) => (?* ?X) @ 187) ((pat-match-abbrev '?y* '(?* ?y)) => (?* ?Y)) ((setf axyd (expand-pat-match-abbrev '(a ?x* ?y* d))) => (A (?* ?X) (?* ?Y) D)) ((pat-match axyd '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(((?* ?x) (?* ?y)) ?x ?y) '((a b c d) (a b) (c d))) => NIL) ((requires "eliza-pm")) (:section "6.4 A Set of Searching Tools") ((requires "search")) ((debug :search) @ 192) "We can search through the binary tree, looking for, say, 12 as the goal." "With breadth-first search this would yield an infinite loop, so we won't" "do it. Breadth-first search works better:" ((breadth-first-search 1 (is 12) 'binary-tree) => 12 @ 193) ((depth-first-search 1 (is 12) (finite-binary-tree 15)) => 12 @ 193) "Guiding the Search" "Best-first search takes an additional argument which estimates how close" "we are to the goal. We call this the cost function." ((best-first-search 1 (is 12) #'binary-tree (diff 12)) => 12 @ 195) ((best-first-search 1 (is 12) #'binary-tree (price-is-right 12)) => 12) "The function beam-search is just like best-first-search, except that after" "we sort the states, we then take only the first beam-width states." ((beam-search 1 (is 12) #'binary-tree (price-is-right 12) 2) => 12) "As a concrete example of a problem that can be solved by search," "consider planning a flight across North America in a plane whose range is" "limited to 1000 kilometers. Here we plan a trip from SF to Boston." ((path-state (trip (city 'san-francisco) (city 'boston))) => (BOSTON 71.05 42.21) @ 199) ((path-state (trip (city 'boston) (city 'san-francisco))) => (SAN-FRANCISCO 122.26 37.47)) ((undebug :search)) ((show-city-path (trip (city 'san-francisco) (city 'boston) 1)) @ 201) ((show-city-path (trip (city 'boston) (city 'san-francisco) 1))) ((show-city-path (trip (city 'boston) (city 'san-francisco) 3)) @ 202) ((iter-wide-search 1 (is 12) (finite-binary-tree 15) (diff 12)) => 12 @ 205) ((tree-search '(1) (is 6) #'next2 #'prepend) => 6 @ 208) ((graph-search '(1) (is 6) #'next2 #'prepend) => 6) ((path-states (a*-search (list (make-path :state 1)) (is 6) #'next2 #'(lambda (x y) 1) (diff 6))) => (6 5 3 1) @ 210) (:section "6.5 GPS as Search") ((requires "gps-srch")) ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 213) ((use (make-block-ops '(a b c))) => 18) ((search-gps start '((a on b) (b on c))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 213) ((search-gps start '((b on c) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B)))) ) (defexamples 7 "STUDENT: Solving Algebra Word Problems" "STUDENT was another early language understanding program, written by Daniel" "Bobrow in 1964. It was designed to read and solve the kind of word" "problems found in high school algebra books." (:section "7.1 Translating English into Equations") ((requires "student")) ((translate-to-expression '(if z is 3 |,| what is twice z)) => ((= z 3) (= what (* 2 z))) @ 222) (:section "7.2 Solving Algebra Equations") ((trace isolate solve) @ 229) ((solve-equations '((= (+ 3 4) (* (- 5 (+ 2 x)) 7)) (= (+ (* 3 x) y) 12))) => nil) ((untrace isolate solve)) (:section "7.3 Examples") ((student '(If the number of customers Tom gets is twice the square of 20 % of the number of advertisements he runs |,| and the number of advertisements is 45 |,| then what is the number of customers Tom gets ?)) => nil @ 231) ((student '(The daily cost of living for a group is the overhead cost plus the running cost for each person times the number of people in the group |.| This cost for one group equals $ 100 |,| and the number of people in the group is 40 |.| If the overhead cost is 10 times the running cost |,| find the overhead and running cost for each person |.|))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 4 feet tall |,| how old is Fran ?))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 0 feet tall |,| how old is Fran ?))) ) (defexamples 8 "Symbolic Mathematics: A Simplification Program" "'Symbolic mathematics' is to numerical mathematics as algebra is to" "arithmetic: it deals with variables and expressions, not just numbers." "This chapter develops a program that simplifies algebraic expressions." "We then show that differentiation and even integration can be seen as" "special cases of 'simplification.' (Note that we replace calls to the" "interactive function SIMPLIFIER with calls to the function SIMP.)" (:section "8.2 Simplification Rules") ((requires "macsymar")) ((simp '(2 + 2)) => 4 @ 245) ((simp '(5 * 20 + 30 + 7)) => 137 ) ((simp '(5 * x - (4 + 1) * x)) => 0 ) ((simp '(y / z * (5 * x - (4 + 1) * x))) => 0 ) ((simp '((4 - 3) * x + (y / y - 1) * z)) => X ) ((simp '(1 * f(x) + 0)) => (F X) ) (:section "8.3 Associativity and Commutativity") ((simp '(3 * 2 * x)) => (6 * X) @ 247) ((simp '(2 * x * x * 3)) => (6 * (X ^ 2)) ) ((simp '(2 * x * 3 * y * 4 * z * 5 * 6)) => (720 * (X * (Y * Z))) ) ((simp '(3 + x + 4 + x)) => ((2 * X) + 7) ) ((simp '(2 * x * 3 * x * 4 * (1 / x) * 5 * 6)) => (720 * X)) (:section "8.4 Logs, Trig, and Differentiation") ((simp '(d (x + x) / d x)) => 2 @ 250) ((simp '(d (a * x ^ 2 + b * x + c) / d x)) => ((2 * (A * X)) + B) ) "For the next one, note we had an error in the first printing of the book;" "the sign was reversed on the (d (u / v) ...) rule." ((simp '(d ((a * x ^ 2 + b * x + c) / x) / d x)) => (((X * ((2 * (A * X)) + B)) - ((A * (X ^ 2)) + ((B * X) + C))) / (X ^ 2))) ((simp '(log ((d (x + x) / d x) / 2))) => 0 ) ((simp '(log(x + x) - log x)) => (LOG 2)) ((simp '(x ^ cos pi)) => (1 / X) ) "These next two examples were also affected by the (d (u / v) ...) rule." ((simp '(d (3 * x + (cos x) / x) / d x)) => ((((X * (- (SIN X))) - (COS X)) / (X ^ 2)) + 3)) ((simp '(d ((cos x) / x) / d x)) => (((X * (- (SIN X))) - (COS X)) / (X ^ 2))) ((simp '(d (3 * x ^ 2 + 2 * x + 1) / d x)) => ((6 * X) + 2)) ((simp '(sin(x + x) ^ 2 + cos(d x ^ 2 / d x) ^ 2)) => 1 ) ((simp '(sin(x + x) * sin(d x ^ 2 / d x) + cos(2 * x) * cos(x * d 2 * y / d y))) => 1 ) (:section "8.5 Limits of Rule-Based Approaches") "In this section we return to some examples that pose problems." "For the following, we would prefer (2 * (x + y))" ((simp '(x + y + y + x)) => (X + (Y + (Y + X)))) "For the following, we would prefer (7 * X) and (Y + (8 * X)), respectively:" ((simp '(3 * x + 4 * x)) => ((3 * X) + (4 * X))) ((simp '(3 * x + y + x + 4 * x)) => ((3 * X) + (Y + (X + (4 * X)))) ) "In chapter 15, we develop a new version of the program that handles this problem." (:section "8.6 Integration") ((set-simp-fn 'Int #'(lambda (exp) (integrate (exp-lhs exp) (exp-rhs exp)))) @ 258) ((simp '(Int x * sin(x ^ 2) d x)) => (1/2 * (- (COS (X ^ 2)))) ) ((simp '(Int ((3 * x ^ 3) - 1 / (3 * x ^ 3)) d x)) => ((3 * ((X ^ 4) / 4)) - (1/3 * ((X ^ -2) / -2))) ) ((simp '(Int (3 * x + 2) ^ -2/3 d x)) => (((3 * X) + 2) ^ 1/3) ) ((simp '(Int sin(x) ^ 2 * cos(x) d x)) => (((SIN X) ^ 3) / 3) ) ((simp '(Int sin(x) / (1 + cos(x)) d x)) => (-1 * (LOG ((COS X) + 1))) ) ((simp '(Int (2 * x + 1) / (x ^ 2 + x - 1) d x)) => (LOG ((X ^ 2) + (X - 1))) ) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (8 * ((1/3 * (((X ^ 3) + 2) ^ -2)) / -2)) ) ((set-simp-fn 'Int #'(lambda (exp) (unfactorize (factorize (integrate (exp-lhs exp) (exp-rhs exp)))))) @ 259) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (-4/3 * (((X ^ 3) + 2) ^ -2)) ) ) (defexamples 9 "Efficiency Issues" "One of the reasons Lisp has enjoyed a long history is because it is an" "ideal language for what is called rapid-prototyping or rapid development." "Most real AI programs deal with large amounts of data. Thus, efficiency" "is important. This chapter shows some ways to make programs efficient." (:section "9.1 Caching Results of Previous Computations: Memoization") ((defun fib (n) (if (<= n 1) 1 (+ (fib (- n 1)) (fib (- n 2))))) @ 269) ((setf memo-fib (memo #'fib)) @ 270) ((trace fib)) ((funcall memo-fib 3) => 3 @ 270) ((funcall memo-fib 3) => 3) ((untrace fib)) ((memoize 'fib) @ 272) ((trace fib)) ((fib 5) => 8) ((fib 5) => 8) ((fib 6) => 13) ((untrace fib)) ) (defexamples 10 "Low-Level Efficiency Issues" "The efficiency techniques of the previous chapter all involved fairly" "significant changes to an algorithm. But what happens when you are already" "using the best imaginable algorithms, and performance is still a problem?" (:section "10.1 Use Declarations") "Compare these functions with and without declarations:" ((defun f (x y) (declare (fixnum x y) (optimize (safety 0) (speed 3))) (the fixnum (+ x y))) @ 318) ((defun g (x y) (+ x y))) "Here is the disassembled code for f and g:" ((disassemble 'f)) ((disassemble 'g) @ 319) ) (defexamples 11 "Logic Programming" "The idea behind logic programming is that the programmer should state the" "relationships that describe a problem and its solution." "In this chapter we develop an interpreter for the Prolog language." (:section "11.1 Idea 1: A Uniform Data Base") ((requires "prolog1")) "First let's make sure we're dealing with a brand new database." ((clear-db)) "Facts are entered into the data base with the <- macro" ((<- (likes Kim Robin)) @ 350) ((<- (likes Sandy Lee))) ((<- (likes Sandy Kim))) ((<- (likes Robin cats))) "We can also enter rules, which state contingent facts." ((<- (likes Sandy ?x) (likes ?x cats)) @ 351) ((<- (likes Kim ?x) (likes ?x Lee) (likes ?x Kim))) (:section "11.2 Idea 2: Unification of Logic Variables") ((requires "unify")) ((pat-match '(?x + ?y) '(2 + 1)) => ((?y . 1) (?x . 2)) @ 352) ((unify '(?x + 1) '(2 + ?y)) => ((?y . 1) (?x . 2))) ((unify '(f ?x) '(f ?y)) => ((?x . ?y))) ((unify '(?a + ?a = 0) '(?x + ?y = ?y)) => ((?y . 0) (?x . ?y) (?a . ?x))) ((unifier '(?a + ?a = 0) '(?x + ?y = ?y)) => (0 + 0 = 0)) "Let's try UNIFY on some (more) examples:" ((unify '(?x ?y a) '(?y ?x ?x)) => ((?y . a) (?x . ?y)) @ 357) ((unify '?x '(f ?x)) => nil) ((unify 'a 'a) => ((t . t))) "Here are some examples of UNIFIER:" ((unifier '(?x ?y a) '(?y ?x ?x)) => (a a a)) ((unifier '((?a * ?x ^ 2) + (?b * ?x) + ?c) '(?z + (4 * 5) + 3)) => ((?a * 5 ^ 2) + (4 * 5) + 3)) "Programming with Prolog" "First we define the MEMBER relation in Prolog:" ((<- (member ?item (?item . ?rest))) @ 358) ((<- (member ?item (?x . ?rest)) (member ?item ?rest))) "Now we can make some queries:" ((?- (member 2 (1 2 3)))) ((?- (member 2 (1 2 3 2 1)))) ((?- (member ?x (1 2 3)))) "Let's add one more rule to the Sandy and the cats facts:" ((<- (likes ?x ?x)) @ 363) "Now we can ask some queries:" ((?- (likes Sandy ?who)) @ 365) ((?- (likes ?who Sandy))) ((?- (likes Robin Lee))) ((?- (likes ?x ?y) (likes ?y ?x)) @ 366) (:section "11.3 Idea 3: Automatic Backtracking") "Now we load the version that does automatic backtracking one step at a time" "as opposed to the previous version, which collects all answers at once." "Since we don't want to involve you, the user, in typing input to move on" "to the next step, we supply the input (a ; or a .) as in the book." "Unfortunately, it is not specified in Common Lisp whether read-char echoes" "the character it reads, so you may or may not see the ; and . characters." ((requires "prolog")) "Let's add the definition of the relation LENGTH:" ((<- (length () 0)) @ 370) ((<- (length (?x . ?y) (1+ ?n)) (length ?y ?n))) "Here are some queries:" ((?- (length (a b c d) ?n)) :input ";") ((?- (length ?list (1+ (1+ 0)))) :input ";") ((?- (length ?list ?n)) :input ";;.") ((?- (length ?l (1+ (1+ 0))) (member a ?l)) :input ";;") "(We won't try the example that leads to an infinite loop.)" (:section "11.4 The Zebra Puzzle") "First we define the NEXTO and IRIGHT (to the immediate right) relations:" ((<- (nextto ?x ?y ?list) (iright ?x ?y ?list)) @ 374) ((<- (nextto ?x ?y ?list) (iright ?y ?x ?list))) ((<- (iright ?left ?right (?left ?right . ?rest)))) ((<- (iright ?left ?right (?x . ?rest)) (iright ?left ?right ?rest))) ((<- (= ?x ?x))) "Now we define the zebra puzzle:" ((<- (zebra ?h ?w ?z) ;; Each house is of the form: ;; (house nationality pet cigarette drink house-color) (= ?h ((house norwegian ? ? ? ?) ;1,10 ? (house ? ? ? milk ?) ? ?)) ; 9 (member (house englishman ? ? ? red) ?h) ; 2 (member (house spaniard dog ? ? ?) ?h) ; 3 (member (house ? ? ? coffee green) ?h) ; 4 (member (house ukrainian ? ? tea ?) ?h) ; 5 (iright (house ? ? ? ? ivory) ; 6 (house ? ? ? ? green) ?h) (member (house ? snails winston ? ?) ?h) ; 7 (member (house ? ? kools ? yellow) ?h) ; 8 (nextto (house ? ? chesterfield ? ?) ;11 (house ? fox ? ? ?) ?h) (nextto (house ? ? kools ? ?) ;12 (house ? horse ? ? ?) ?h) (member (house ? ? luckystrike oj ?) ?h) ;13 (member (house japanese ? parliaments ? ?) ?h) ;14 (nextto (house norwegian ? ? ? ?) ;15 (house ? ? ? ? blue) ?h) (member (house ?w ? ? water ?) ?h) ;Q1 (member (house ?z zebra ? ? ?) ?h))) ;Q2 "If you want to test this out, run the following query:" " ((?- (zebra ?houses ?water-drinker ?zebra-owner)))" "It is not included as an example because it takes a minute or so to run." ) (defexamples 12 "Compiling Logic Programs" "This chapter presents a compiler that translates from Prolog to Lisp." "Unfortunatley, there's not much to see in terms of examples." "But we load the files for you, in case you want to play with them." ((requires "prologc1" "prologc2" "prologcp")) ((prolog-compile 'likes) @ 389) ((prolog-compile 'member)) ) (defexamples 13 "Object Oriented Programming" "It is only natural that a wide range of programming styles have been" "introduced to attack the wide range of problems in this book." "One style not yet covered is 'object-oriented programming'." "Peter Wegner (1987) proposes the following formula as a definition:" "Object-orientation = Objects + Classes + Inheritance" (:section "13.2 Objects") "Now we're ready to get started." ((requires "clos")) ((setf acct (new-account "J. Random Customer" 1000.00)) @ 438) ((send acct 'withdraw 500.00) => 500.0) ((send acct 'deposit 123.45) => 623.45) ((send acct 'name) => "J. Random Customer") ((send acct 'balance) => 623.45) (:section "13.4 Classes") "Now we define the class ACCOUNT with the define-class macro." ((define-class account (name &optional (balance 0.00)) ((interest-rate .06)) (withdraw (amt) (if (<= amt balance) (decf balance amt) 'insufficient-funds)) (deposit (amt) (incf balance amt)) (balance () balance) (name () name) (interest () (incf balance (* interest-rate balance)))) @ 440) "Here are the generic functions defined by this macro:" ((setf acct2 (account "A. User" 2000.00))) ((deposit acct2 42.00) => 2042.0) ((interest acct2) => 2164.52) ((balance acct2) => 2164.52 @ 441) ((balance acct) => 623.45) (:section "13.5 Delegation") ((define-class password-account (password acct) () (change-password (pass new-pass) (if (equal pass password) (setf password new-pass) 'wrong-password)) (otherwise (pass &rest args) (if (equal pass password) (apply message acct args) 'wrong-password)))) "Now we see how the class PASSWORD-ACCOUNT can be used to provide protection" "for an existing account:" ((setf acct3 (password-account "secret" acct2)) @ 441) ((balance acct3 "secret") => 2164.52) ((withdraw acct3 "guess" 2000.00) => WRONG-PASSWORD) ((withdraw acct3 "secret" 2000.00) => 164.52) (:section "13.7 CLOS: The Common Lisp Object System") "Because some Lisp implementations can't convert a structure class into" "a CLOS class, nor convert a regular function into a generic function," "we use the names account*, name*, balance*, interest-rate*. If you were" "doing a real application, not just some examples, you would choose one" "implementation and get to use the regular names." ; ?????? some problems here ((defclass account* () ((name :initarg :name :reader name*) (balance :initarg :balance :initform 0.00 :accessor balance*) (interest-rate :allocation :class :initform .06 :reader interest-rate*))) @ 445) ((setf a1 (make-instance 'account* :balance 5000.00 :name "Fred")) @ 446) ((name* a1) => "Fred") ((balance* a1) => 5000.0) ((interest-rate* a1) => 0.06) ((defmethod withdraw* ((acct account*) amt) (if (< amt (balance* acct)) (decf (balance* acct) amt) 'insufficient-funds)) @ 446) ((defclass limited-account (account*) ((limit :initarg :limit :reader limit)))) ((defmethod withdraw* ((acct limited-account) amt) (if (> amt (limit acct)) 'over-limit (call-next-method)))) ((setf a2 (make-instance 'limited-account :name "A. Thrifty Spender" :balance 500.00 :limit 100.00)) @ 447) ((name* a2) => "A. Thrifty Spender") ((withdraw* a2 200.00) => OVER-LIMIT) ((withdraw* a2 20.00) => 480.0) (:section "13.8 A CLOS Example: Searching Tools") ((defclass problem () ((states :initarg :states :accessor problem-states))) @ 449) ((defmethod searcher ((prob problem)) "Find a state that solves the search problem." (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) (searcher prob))))) ((defmethod current-state ((prob problem)) "The current state is the first of the possible states." (first (problem-states prob)))) ((defmethod pop-state ((prob problem)) "Remove and return the current state." (pop (problem-states prob)))) ((defmethod no-states-p ((prob problem)) "Are there any more unexplored states?" (null (problem-states prob)))) ((defmethod searcher :before ((prob problem)) (dbg 'search "~&;; Search: ~a" (problem-states prob))) @ 450) ((defclass eql-problem (problem) ((goal :initarg :goal :reader problem-goal)))) ((defmethod goal-p ((prob eql-problem)) (eql (current-state prob) (problem-goal prob)))) ((defclass dfs-problem (problem) () (:documentation "Depth-first search problem."))) ((defclass bfs-problem (problem) () (:documentation "Breadth-first search problem."))) ((defmethod problem-combiner ((prob dfs-problem) new old) "Depth-first search looks at new states first." (append new old))) ((defmethod problem-combiner ((prob bfs-problem) new old) "Depth-first search looks at old states first." (append old new))) ((defclass binary-tree-problem (problem) ()) @ 451) ((defmethod problem-successors ((prob binary-tree-problem) state) (let ((n (* 2 state))) (list n (+ n 1))))) ((defclass binary-tree-eql-bfs-problem (binary-tree-problem eql-problem bfs-problem) ())) ((setf p1 (make-instance 'binary-tree-eql-bfs-problem :states '(1) :goal 12))) ((searcher p1) => 12) ((defclass best-problem (problem) () (:documentation "A Best-first search problem.")) @ 452) ((defmethod problem-combiner ((prob best-problem) new old) "Best-first search sorts new and old according to cost-fn." (sort (append new old) #'< :key #'(lambda (state) (cost-fn prob state))))) ((defmethod cost-fn ((prob eql-problem) state) (abs (- state (problem-goal prob))))) ((defclass beam-problem (problem) ((beam-width :initarg :beam-width :initform nil :reader problem-beam-width)))) ((defmethod problem-combiner :around ((prob beam-problem) new old) (let ((combined (call-next-method))) (subseq combined 0 (min (problem-beam-width prob) (length combined)))))) ((defclass binary-tree-eql-best-beam-problem (binary-tree-problem eql-problem best-problem beam-problem) ())) ((setf p3 (make-instance 'binary-tree-eql-best-beam-problem :states '(1) :goal 12 :beam-width 3))) ((searcher p3) => 12) ((defclass trip-problem (binary-tree-eql-best-beam-problem) ((beam-width :initform 1))) @ 453) ((defmethod cost-fn ((prob trip-problem) city) (air-distance (problem-goal prob) city))) ((defmethod problem-successors ((prob trip-problem) city) (neighbors city))) ((setf p4 (make-instance 'trip-problem :states (list (city 'new-york)) :goal (city 'san-francisco)))) ((searcher p4) => (SAN-FRANCISCO 122.26 37.47)) (:section "13.9 Is CLOS Object-oriented?") ((defmethod conc ((x null) y) y) @ 454) ((defmethod conc (x (y null)) x)) ((defmethod conc ((x list) (y list)) (cons (first x) (conc (rest x) y)))) ((defmethod conc ((x vector) (y vector)) (let ((vect (make-array (+ (length x) (length y))))) (replace vect x) (replace vect y :start1 (length x))))) ((conc nil '(a b c)) => (A B C) @ 455) ((conc '(a b c) nil) => (A B C)) ((conc '(a b c) '(d e f)) => (A B C D E F)) ((conc '#(a b c) '#(d e f)) => #(A B C D E F)) ) (defexamples 14 "Knowledge Representation and Reasoning" "In this chapter we explore means of indexing facts so that they can be" "retrieved and reasoned with efficiently." "Section 14.1 to 14.7 discuss problems with logical reasoning systems" "such as Prolog." (:section "14.8 A Solution to the Indexing Problem") "Here we show how to index facts in a kind of table that makes it easy to" "add, delete, and retrieve entries. We will develop an extension of the" "trie or discrimination tree data structure built in section 10.5 (page 344)." ((requires "krep1")) "Now we define a function to test the indexing routine. Compare the output" "with figure 14.1 on page 474." ((test-index) @ 478) "Here is an example of fetching from the index" ((fetch '(p ? c)) @ 480 => (((P B C) (P A C)) ((P A ?X)))) "We can make a change to rename variables before indexing facts." ((defun index (key) "Store key in a dtree node. Key must be (predicate . args); it is stored in the predicate's dtree." (dtree-index key (rename-variables key) ; store unique vars (get-dtree (predicate key)))) @ 481) "We have to reindex:" ((test-index)) "We are now ready to test the retrieval mechanism:" ((fetch '(p ?x c)) @ 481) ((retrieve '(p ?x c)) @ 481) ((retrieve-matches '(p ?x c)) => ((P A C) (P A C) (P B C))) ((retrieve-matches '(p ?x (?fn c))) => ((P A (?FN C)) (P A (F C)) (P B (F C)))) ((query-bind (?x ?fn) '(p ?x (?fn c)) (format t "~&P holds between ~a and ~a of c." ?x ?fn)) @ 482) (:section "14.10 Solutions to the Expressiveness Problems") "In this section we introduce a frame-like language, using the primitives" "sub, rel, ind, val, and and." ((requires "krep")) "We add some facts about dogs and bears, both as individuals and species:" ((add-fact '(sub dog animal)) @ 488) ((add-fact '(sub bear animal))) ((add-fact '(ind Fido dog))) ((add-fact '(ind Yogi bear))) ((add-fact '(val color Yogi brown))) ((add-fact '(val color Fido golden))) ((add-fact '(val latin-name bear ursidae))) ((add-fact '(val latin-name dog canis-familiaris))) "Now retrieve-fact is used to answer three questions: What kinds of animals" "are there?" ((retrieve-fact '(sub ?kind animal)) => (((?KIND . DOG)) ((?KIND . BEAR)))) "What are the Latin names of each kind of animal?" ((retrieve-fact '(and (sub ?kind animal) (val latin-name ?kind ?latin))) => (((?LATIN . CANIS-FAMILIARIS) (?KIND . DOG)) ((?LATIN . URSIDAE) (?KIND . BEAR)))) "What are the colors of each individual bear?" ((retrieve-fact '(and (ind ?x bear) (val color ?x ?c))) @ 489 => (((?C . BROWN) (?X . YOGI)))) ((test-bears) @ 492) ) (defexamples 15 "Symbolic Mathematics with Canonical Forms" "This chapter uses a canonical representation for polynomials" "to achieve a more efficient program than the rules-based one in Chapter 8." (:section "15.1 A Canonical Form for Polynomials") ((requires "cmacsyma")) "We represent polynomials as vectors, with the variable in element 0," "and the coefficients starting in element 1 and going up from there." "Here is the representation of 5x^3 + 10x^2 + 20x + 30" ('#(x 30 20 10 5) @ 511) "Here are some examples (without the interactive loop):" ((canon '(3 + x + 4 - x)) => 7 @ 521) ((canon '(x + y + y + x)) => ((2 * x) + (2 * y))) ((canon '(3 * x + 4 * x)) => (7 * x)) ((canon '(3 * x + y + x + 4 * x)) => ((8 * x) + y)) ((canon '((x + 1) ^ 10)) => ((x ^ 10) + (10 * (x ^ 9)) + (45 * (x ^ 8)) + (120 * (x ^ 7)) + (210 * (x ^ 6)) + (252 * (x ^ 5)) + (210 * (x ^ 4)) + (120 * (x ^ 3)) + (45 * (x ^ 2)) + (10 * x) + 1)) ((canon '((x + 1) ^ 10 - (x - 1) ^ 10)) => ((20 * (x ^ 8)) + (240 * (x ^ 7)) + (504 * (x ^ 5)) + (240 * (x ^ 3)) + (20 * x))) ((canon '(d (3 * x ^ 2 + 2 * x + 1) / d x)) @ 522 => ((6 * x) + 2)) ((canon '(d (z + 3 * x + 3 * z * x ^ 2 + z ^ 2 * x ^ 3) / d z)) => (((2 * z) * (x ^ 3)) + (3 * (x ^ 2)) + 1))) (defexamples 16 "Expert Systems" "In this chapter we develop an expert system shell, and give it a few rules" "about infectious disease, thus duplicating some of the Mycin system." ((requires "mycin-r")) "Because this is an interactive system, we can't show the interaction here." "You can try it yourself by evaluating (mycin)" ) (defexamples 17 "Line Diagram Labelling by Constraint Satisfaction" "In this chapter we look at the line-diagram labeling problem: Given a list" "of lines and the vertexes at which they intersect, how can we determine" "what the lines represent?" ((requires "waltz")) (:section "17.2 Combining Constraints and Searching") "First let's test that we can find the possible labelings for a vertex class:" ((possible-labelings 'Y) @ 574 => ((+ + +) (- - -) (L R -) (- L R) (R - L))) "Notice how matrix-transpose works:" ((matrix-transpose (possible-labelings 'Y)) => ((+ - L - R) (+ - R L -) (+ - - R L))) ((defdiagram cube (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f L d c) (g L b d)) @ 575) (:section "17.3 Labelling Diagrams") "We are now ready to try labelling diagrams. First the cube:" ((print-labelings (diagram 'cube)) @ 577) "The cube should have given four solutions." "We can get down to one solution by grounding line GD:" ((print-labelings (ground (diagram 'cube) 'g 'd)) @ 580) "For the more complex cube on a plate, we get similar results;" "Four interpretations, which turn to one after grounding line KM:" ((defdiagram cube-on-plate (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f Y d c i) (g Y b d h) (h W l g j) (i W f m j) (j Y h i k) (k W m l j) (l L h k) (m L k i)) @ 581) ((print-labelings (ground (diagram 'cube-on-plate) 'k 'm)) @ 582) "It is interesting to try the algorithm on an 'impossible' diagram." "It turns out the algorithm correctly finds no interpretation for this" "well-known illusion:" ((defdiagram poiuyt (a L b g) (b L j a) (c L d l) (d L h c) (e L f i) (f L k e) (g L a l) (h L l d) (i L e k) (j L k b) (k W j i f) (l W h g c)) @ 583) ((print-labelings (diagram 'poiuyt)) @ 583) "Now we try a more complex diagram:" ((defdiagram tower (a Y b c d) (n L q o) (b W g e a) (o W y j n) (c W e f a) (p L r i) (d W f g a) (q W n s w) (e L c b) (r W s p x) (f Y d c i) (s L r q) (g Y b d h) (t W w x z) (h W l g j) (u W x y z) (i W f m p) (v W y w z) (j Y h o k) (w Y t v q) (k W m l j) (x Y r u t) (l L h k) (y Y v u o) (m L k i) (z Y t u v)) @ 584) ((print-labelings (ground (diagram 'tower) 'l 'k)) @ 584)) (defexamples 18 "Search and the Game of Othello" "In this chapter we will develop a simplified Othello-playing program." "It will not be a champion, but is much better than beginning players." (:section "18.2 Representation Choices") ((requires "othello")) "First, we see that our choices for representing the board seem to work:" ((print-board (initial-board)) @ 604) "Now we can compare the weighted squares and count difference strategies" "by playing two games, alternating who goes first. The NIL as third argument" "means don't print the board after each move." ((othello (maximizer #'weighted-squares) (maximizer #'count-difference) nil) @ 610) ((othello (maximizer #'count-difference) (maximizer #'weighted-squares) nil)) (:section "18.4 Searching Ahead: Minimax") "We can test the minimax strategy, and see that searching ahead 3 ply is" "indeed better than looking at only 1 ply. We can follow the whole game" ((othello (minimax-searcher 3 #'count-difference) (maximizer #'count-difference)) @ 614 => 53) (:section "18.5 Smarter Searching: Alpha-Beta Search") "The following should produce the same result, only faster:" ((othello (alpha-beta-searcher 3 #'count-difference) (maximizer #'count-difference) nil) => 53) (:section "18.8 Playing a Series of Games") "A single game is not enough to establish that one strategy is better than" "another. The function RANDOM-OTHELLO-SERIES allows two strategies to" "compete in a series of games." ((requires "othello2")) ((random-othello-series (alpha-beta-searcher 2 #'weighted-squares) (alpha-beta-searcher 2 #'modified-weighted-squares) 5) @ 628) "Here is a comparison of five strategies that search only 1 ply." "To save time, we run 2 pairs of games each, not 5 pairs." ((round-robin (list (maximizer #'count-difference) (maximizer #'mobility) (maximizer #'weighted-squares) (maximizer #'modified-weighted-squares) #'random-strategy) 2 10 '(count-difference mobility weighted modified-weighted random)) @ 629) "Now we compare alpha-beta searchers at 3 ply for 1 pair of games each." "In the book it was 4 ply for 5 pairs each, but that takes too long." ((round-robin (list (alpha-beta-searcher 3 #'count-difference) (alpha-beta-searcher 3 #'weighted-squares) (alpha-beta-searcher 3 #'modified-weighted-squares) #'random-strategy) 1 10 '(count-difference weighted modified-weighted random))) ) (defexamples 19 "Introduction to Natural Language" "This chapter is a brief introduction to natural language processing." (:section "19.1 Parsing with a Phrase-Structure Grammar") "We start with the grammar defined on page 39 for the GENERATE program." "I include 'noun' and 'verb' as nouns in the grammar *grammar3*" ((requires "syntax1")) (*grammar3* @ 657) ((use *grammar3*)) ((parser '(the table)) => ((NP (ART THE) (NOUN TABLE)))) ((parser '(the ball hit the table)) => ((SENTENCE (NP (ART THE) (NOUN BALL)) (VP (VERB HIT) (NP (ART THE) (NOUN TABLE)))))) ((parser '(the noun took the verb)) => ((SENTENCE (NP (ART THE) (NOUN NOUN)) (VP (VERB TOOK) (NP (ART THE) (NOUN VERB)))))) "The range of sentences we can parse is quite limited." "The following grammar includes a wider variety." (*grammar4* @ 661) ((use *grammar4*)) ((parser '(The man hit the table with the ball)) => ((S (NP (D THE) (N MAN)) (VP (VP (V HIT) (NP (D THE) (N TABLE))) (PP (P WITH) (NP (D THE) (N BALL))))) (S (NP (D THE) (N MAN)) (VP (V HIT) (NP (NP (D THE) (N TABLE)) (PP (P WITH) (NP (D THE) (N BALL)))))))) "Here we see a phrase that is ambiguous between a sentence and a noun phrase:" ((parser '(the orange saw)) @ 662 => ((S (NP (D THE) (N ORANGE)) (VP (V SAW))) (NP (D THE) (A+ (A ORANGE)) (N SAW)))) (:section "19.4 The Unknown-Word Problem") "As it stands, the parser cannot deal with unknown words." "One way of treating unknown words is to allow them to be any of the" "'open-class' categories--nouns, verbs, adjectives, and names." ((parser '(John liked Mary)) @ 664 => ((S (NP (NAME JOHN)) (VP (V LIKED) (NP (NAME MARY)))))) ((parser '(Dana liked Dale)) @ 665 => ((S (NP (NAME DANA)) (VP (V LIKED) (NP (NAME DALE)))))) "We see the parser works as well with words it knows (John and Mary)" "as with new words (Dana and Dale), which it can recognize as names" "because of their position in the sentence." ((parser '(the rab zaggled the woogly quax)) => ((S (NP (D THE) (N RAB)) (VP (V ZAGGLED) (NP (D THE) (A+ (A WOOGLY)) (N QUAX)))))) ((parser '(the slithy toves gymbled)) => ((S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NAME GYMBLED)))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (V GYMBLED))) (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)))) ((parser '(the slithy toves gymbled on the wabe)) => ((S (NP (D THE) (N SLITHY)) (VP (VP (V TOVES) (NP (NAME GYMBLED))) (PP (P ON) (NP (D THE) (N WABE))))) (S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NP (NAME GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (VP (V GYMBLED)) (PP (P ON) (NP (D THE) (N WABE))))) (NP (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (:section "19.5 Parsing into a Semantic Representation") ((requires "syntax2")) "Syntactic parse trees of a sentence may be interesting, but by themselves" "they're not very useful. We use sentences to communicate ideas, not to" "display grammatical structures." "" "Imagine a compact disc player for which you can punch buttons like" "'play 1 to 5 without 3'. We will define such a language." "The meaning of a sentence in the language is the list of tracks played." (*grammar5* @ 667) ((use *grammar5*)) ((meanings '(1 to 5 without 3)) @ 669 => ((1 2 4 5))) ((meanings '(1 to 4 and 7 to 9)) => ((1 2 3 4 7 8 9))) ((meanings '(1 to 6 without 3 and 4)) => ((1 2 4 5 6) (1 2 5 6))) "The example '1 to 6 without 3 and 4' is ambiguous." "The syntactic ambiguity leads to a semantic ambiguity." "We can define a new grammar that eliminates some ambiguities:" (*grammar6* @ 669) ((use *grammar6*)) "With this new grammar, we can get single interpretations out of most inputs" ((meanings '(1 to 6 without 3 and 4)) => ((1 2 5 6))) ((meanings '(1 and 3 to 7 and 9 without 5 and 6)) => ((1 3 4 7 9))) ((meanings '(1 and 3 to 7 and 9 without 5 and 2)) => ((1 3 4 6 7 9 2))) ((meanings '(1 9 8 to 2 0 1)) => ((198 199 200 201))) ((meanings '(1 2 3)) => (123 (123))) (:section "19.6 Parsing with Preferences") ((requires "syntax3")) "We need some compromise between the permissive grammar, which generated" "all possible parses, and the restrictive grammar, which eliminates too" "many parses. To get the 'best' interpretation we will need not only a" "new grammar, we will also need to modify the program to compare the" "relative worth of candidate interpretations." (*grammar7* @ 673) ((use *grammar7*)) "We will need a way to show off the prefernce rankings:" ((all-parses '(1 to 6 without 3 and 4)) @ 675) ((all-parses '(1 and 3 to 7 and 9 without 5 and 6))) ((all-parses '(1 and 3 to 7 and 9 without 5 and 2)) @ 676) "In each case, the preference rules are able to assign higher scores to" "more reasonable interpretations. What we really want is to pick the best." "Here we see some examples:" ((meaning '(1 to 5 without 3 and 4)) => (1 2 5)) ((meaning '(1 to 5 without 3 and 6)) => (1 2 4 5 6)) ((meaning '(1 to 5 without 3 and 6 shuffled))) ((meaning '([ 1 to 5 without [ 3 and 6 ] ] reversed)) => (5 4 2 1)) ((meaning '(1 to 5 to 9)) => NIL) ) (defexamples 20 "Unification Grammars" "Prolog was invented as a formalism to describe the grammar of French." "It is still useful to view a grammar as a set of logic programming clauses." "This chapter describes how that can be done." ((requires "unifgram")) (:section "20.3 A Simple Grammar in DCG Format") "Here is the trivial grammar from page 688 in DCG format:" ((clear-db)) ((rule (S (?pred ?subj)) --> (NP ?agr ?subj) (VP ?agr ?pred)) @ 692) ((rule (NP ?agr (?det ?n)) --> (Det ?agr ?det) (N ?agr ?n))) ((rule (NP 3sg (the male)) --> (:word he)) @ 693) ((rule (NP ~3sg (some objects)) --> (:word they))) ((rule (VP 3sg sleep) --> (:word sleeps))) ((rule (VP ~3sg sleep) --> (:word sleep))) ((rule (Det ?any the) --> (:word the))) ((rule (N 3sg (young male human)) --> (:word boy))) ((rule (N 3sg (young female human)) --> (:word girl))) "We can parse some of the sentences from page 689 (but in DCG format)." "Parsing:" ((?- (S ?sem (He sleeps) ())) :input ".") "Generating:" ((?- (S (sleep (the male)) ?words ())) :input ".") "Enumerating:" ((?- (S ?sem ?words ())) :input ";;;;") "If we want the interpretation of 'Terry kisses Jean' to be" "(kiss Terry Jean) not ((lambda (x) (kiss x Jean)) Terry), then we need" "a way to unify semantic components together. Here's one way:" ((clear-db)) ((rule (S ?pred) --> (NP ?agr ?subj) (VP ?agr ?subj ?pred)) @ 694) ((rule (VP ?agr ?subj ?pred) --> (Verb/tr ?agr ?subj ?pred ?obj) (NP ?any-agr ?obj))) ((rule (VP ?agr ?subj ?pred) --> (Verb/intr ?agr ?subj ?pred))) ((rule (Verb/tr ~3sg ?x (kiss ?x ?y) ?y) --> (:word kiss))) ((rule (Verb/tr 3sg ?x (kiss ?x ?y) ?y) --> (:word kisses))) ((rule (Verb/tr ?any ?x (kiss ?x ?y) ?y) --> (:word kissed))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) "Here are the rules for noun phrases and nouns" ((rule (NP ?agr ?sem) --> (Name ?agr ?sem))) ((rule (NP ?agr (?det-sem ?noun-sem)) --> (Det ?agr ?det-sem) (Noun ?agr ?noun-sem))) ((rule (Name 3sg Terry) --> (:word Terry))) ((rule (Name 3sg Jean) --> (:word Jean))) ((rule (Noun 3sg (young male human)) --> (:word boy)) @ 695) ((rule (Noun 3sg (young female human)) --> (:word girl))) ((rule (Noun ~3sg (group (young male human))) --> (:word boys))) ((rule (Noun ~3sg (group (young female human))) --> (:word girls))) ((rule (Det ?any the) --> (:word the))) ((rule (Det 3sg a) --> (:word a))) "This grammar and lexicon generates more sentences, although it is still" "rather limited. Here are some examples:" ((?- (S ?sem (The boys kiss a girl) ())) @ 695 :input ";.") ((?- (S ?sem (The girls kissed the girls) ())) :input ";.") ((?- (S ?sem (Terry kissed the girl) ())) :input ";.") ((?- (S ?sem (The girls kisses the boys) ())) :input ";.") ((?- (S ?sem (Terry kissed a girls) ())) :input ";.") ((?- (S ?sem (Terry sleeps Jean) ())) :input ";.") (:section "20.4 A DCG Grammar with Quantifiers") ((clear-db)) ((rule (Det ?any ?x ?p ?q (the ?x (and ?p ?q))) --> (:word the)) @ 697) ((rule (Det 3sg ?x ?p ?q (exists ?x (and ?p ?q))) --> (:word a))) ((rule (Det 3sg ?x ?p ?q (all ?x (-> ?p ?q))) --> (:word every))) ((rule (Noun 3sg ?x (picture ?x)) --> (:word picture)) @ 698) ((rule (Noun 3sg ?x (story ?x)) --> (:word story))) ((rule (Noun 3sg ?x (and (young ?x) (male ?x) (human ?x))) --> (:word boy))) ((rule (NP ?agr ?x ?pred ?pred) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?pred ?np) --> (Det ?agr ?x ?noun&rel ?pred ?np) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?noun ?noun&rel))) ((rule (rel-clause ?agr ?x ?np ?np) --> )) ((rule (rel-clause ?agr ?x ?np (and ?np ?rel)) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Verb/tr ~3sg ?x ?y (paint ?x ?y)) --> (:word paint)) @ 699) ((rule (Verb/tr 3sg ?x ?y (paint ?x ?y)) --> (:word paints))) ((rule (Verb/tr ?any ?x ?y (paint ?x ?y)) --> (:word painted))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) ((rule (Verb/intr 3sg ?x (sells ?x)) --> (:word sells))) ((rule (Verb/intr 3sg ?x (stinks ?x)) --> (:word stinks))) ((rule (VP ?agr ?x ?vp) --> (Verb/tr ?agr ?x ?obj ?verb) (NP ?any-agr ?obj ?verb ?vp))) ((rule (VP ?agr ?x ?vp) --> (Verb/intr ?agr ?x ?vp))) ((rule (S ?np) --> (NP ?agr ?x ?vp ?np) (VP ?agr ?x ?vp))) "Now we define a function to show the output from a query." "In the book, you just saw the output of such a function." ((defun do-s (words) (top-level-prove `((S ?sem ,words ()))))) ((do-s '(Every picture paints a story)) :input "." @ 699) ((do-s '(Every boy that paints a picture sleeps)) :input ".") ((do-s '(Every boy that sleeps paints a picture)) :input ".") ((do-s '(Every boy that paints a picture that sells paints a picture that stinks)) :input "." @ 700) (:section "20.5 Preserving Quantifier Scope Ambiguity") ((clear-db)) ((rule (S (and ?np ?vp)) --> (NP ?agr ?x ?np) (VP ?agr ?x ?vp)) @ 701) ((rule (VP ?agr ?x (and ?verb ?obj)) --> (Verb/tr ?agr ?x ?o ?verb) (NP ?any-agr ?o ?obj))) ((rule (VP ?agr ?x ?verb) --> (Verb/intr ?agr ?x ?verb))) ((rule (NP ?agr ?name t) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?det) --> (Det ?agr ?x (and ?noun ?rel) ?det) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?rel))) ((rule (rel-clause ?agr ?x t) --> )) ((rule (rel-clause ?agr ?x ?rel) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Name 3sg Terry) --> (:word Terry))) ((rule (Name 3sg Jean) --> (:word Jean))) ((rule (Det 3sg ?x ?restr (all ?x ?restr)) --> (:word every))) ((rule (Noun 3sg ?x (man ?x)) --> (:word man))) ((rule (Verb/tr 3sg ?x ?y (love ?x ?y)) --> (:word loves))) ((rule (Verb/intr 3sg ?x (lives ?x)) --> (:word lives))) ((rule (Det 3sg ?x ?res (exists ?x ?res)) --> (:word a))) ((rule (Noun 3sg ?x (woman ?x)) --> (:word woman))) "Here is an example of the new representation:" ((do-s '(every man loves a woman)) :input "." @ 701) ) (defexamples 21 "A Grammar of English" ((if (boundp 'clear-db) (clear-db)) @ 715) ((requires "grammar" "lexicon")) ((prolog-compile-symbols)) (:section "21.10 Word Categories") ((?- (word sees verb ?infl ?senses)) :input ".") ((try S John promised Kim to persuade Lee to sleep) :input ";;;.") (:section "21.14 Examples") ((try S When did John promise Kim to persuade Lee to sleep) @ 746 :input ";;;.") ((try S Kim would not have been looking for Lee) @ 747 :input ";;;.") ((try s It should not surprise you that Kim does not like Lee) :input ";;;.") ) (defexamples 22 "Scheme: An Uncommon Lisp" "This chapter presents the Scheme dialect of Lisp and an interpreter for it." "Understanding the interpreter can give you a better appreciation of Lisp." (:section "22.1 A Scheme Interpreter") ((requires "interp1")) "We're ready to try out the interpreter. Note we provide an argument" "to avoid going into a read-eval-print loop with SCHEME. This is a new" "functionality, no in the book, added to make these examples easier." ((scheme '(+ 2 2)) @ 760 => 4 ) ((scheme '((if (= 1 2) * +) 3 4)) => 7) ((scheme '((if (= 1 1) * +) 3 4)) => 12 @ 761) ((scheme '(set! fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))))) ((scheme '(fact 5)) => 120) ((scheme '(set! table (lambda (f start end) (if (<= start end) (begin (write (list start (f start))) (newline) (table f (+ start 1) end))))))) ((scheme '(table fact 1 10)) => NIL ) ((scheme '(table (lambda (x) (* x x x)) 5 10)) => NIL) (:section "22.2 Syntactic Extension with Macros") "Scheme has a number of special forms that were not listed above." "These can be implemented by macros (although macros are not officially" "part of Scheme). We can test out the macro facility:" ((scheme-macro-expand '(and p q)) => (IF P (AND Q)) @ 765) ((scheme-macro-expand '(and q)) => Q) ((scheme-macro-expand '(let ((x 1) (y 2)) (+ x y))) => ((LAMBDA (X Y) (+ X Y)) 1 2)) ((scheme-macro-expand '(letrec ((even? (lambda (x) (or (= x 0) (odd? (- x 1))))) (odd? (lambda (x) (even? (- x 1))))) (even? z)))) "Now let's look at uses of the macros DEFINE and LET*" ((scheme '(define (reverse l) (if (null? l) nil (append (reverse (cdr l)) (list (car l)))))) => REVERSE) ((scheme '(reverse '(a b c d))) => (D C B A)) ((scheme '(let* ((x 5) (y (+ x x))) (if (or (= x 0) (and (< 0 y) (< y 20))) (list x y) (+ y x)))) => (5 10)) (:section "22.4 Throw, Catch, and Call/cc") ((requires "interp3")) "Non-local flow of control is provided in Scheme with a very general and" "powerful procedure, CALL-WITH-CURRENT-CONTINUATION, which is often" "abbreviated CALL/CC. Here are some examples:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 300))))) @ 770 => 321) "The above example ignores CC and computes (+ 1 (+ 20 300))" "The next example does make use of CC:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 (cc 300)))))) => 301) "The above passes 300 to CC, thus bypassing the addition of 20." "It effectively throws 300 out to the catch point established by call/cc." ) (defexamples 23 "Compiling Lisp" "Compilers are simple to write and useful to know about." "In this chapter we develop a simple compiler for Scheme." "" ((requires "compile1")) "Now we are ready to show the simple compiler at work:" ((comp-show '(if (= x y) (f (g x)) (h x y (h 1 2)))) @ 791) "Here are some places where a compiler could do better than an interpreter" "(although our compiler currently does not):" ((comp-show '(begin "doc" (write x) y)) @ 792) "We should not have to push 'doc' on the stack just to pop it off." "Here's another example:" ((comp-show '(begin (+ (* a x) (f x)) x))) "Here's an example using local variables:" ((comp-show '((lambda (x) ((lambda (y z) (f x y z)) 3 x)) 4)) @ 794) (:section "23.1 A Properly Tail-Recursive Compiler") "Notice the two new instructions, CALLJ and SAVE" ((requires "compile2")) "First we see how nested function calls work:" ((comp-show '(f (g x))) @ 796) "In the next example we see that unneeded constants and variables in BEGIN" "expressions are ignored:" ((comp-show '(begin "doc" x (f x) y)) @ 797) ((comp-show '(begin (+ (* a x) (f x)) x))) "Here are some examples of IF expressions:" ((comp-show '(if p (+ x y) (* x y))) @ 801) "If we put the same code inside a BEGIN we get something quite different:" ((comp-show '(begin (if p (+ x y) (* x y)) z)) @ 802) "Here are some more examples of the compiler at work:" ((comp-show '(if (null? (car l)) (f (+ (* a x) b)) (g (/ x 2)))) @ 806) ((comp-show '(define (last1 l) (if (null? (cdr l)) (car l) (last1 (cdr l))))) @ 807) ((comp-show '(define (length l) (if (null? l) 0 (+ 1 (length (cdr l)))))) @ 808) "Of course, it is possible to write LENGTH in tail-recursive fashion:" ((comp-show '(define (length l) (letrec ((len (lambda (l n) (if (null? l) n (len (rest l) (+ n 1)))))) (len l 0))))) (:section "23.4 A Peephole Optimizer") "In this section we investigate a simple technique that will generate" "slightly better code in cases where the compiler is less than perfect." ((requires "compile3" "compopt")) ((comp-show '(begin (if (if t 1 (f x)) (set! x 2)) x)) @ 818) )
76200
;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*- ;;;; Code from Paradigms of AI Programming ;;;; Copyright (c) 1991, 1996 <NAME> (requires "tutor") (defexamples 1 "Introduction to Lisp" "This chapter is for people with little or no experince in Lisp." "Intermediate or advanced readers can skim or skip this chapter." "" "Lisp expressions are in prefix notation: the operator first." ((+ 2 2) => 4 @ 4) ((+ 1 2 3 4 5 6 7 8 9 10) => 55 @ 5) "This is Lisp for (900 + 900 + 90 + 9) - (5000 + 500 + 50 + 5)" ((- (+ 9000 900 90 9) (+ 5000 500 50 5)) => 4444) (:section "1.1 Symbolic Computation") "This is an example of computation on lists:" ((append '(<NAME>) '(<NAME>)) => (PAT KIM ROBIN SANDY) @ 6) "The quote mark instructs Lisp to treat the list as data." ('(pat Kim) => (PAT KIM)) "Let's look at some more list processing functions" (:section "1.4 Lists") ((setf p '(<NAME> Q Public)) @ 10) ((first p)) ((rest p)) ((second p)) ((third p)) ((fourth p)) ((length p)) "It is also possible to build up new lists" (p @ 11) ((cons 'Mr p)) ((cons (first p) (rest p))) ((setf town (list 'Anytown 'USA))) ((list p 'of town 'may 'have 'already 'won!)) ((append p '(of) town '(may have already won))) (p) (:section "1.5 Defining New Functions") "The special form DEFUN stands for 'define function.'" "It is used here to define a new function called last-name:" ((requires "intro")) ((last-name p) => PUBLIC @ 13) ((last-name '(<NAME>)) => MD) ((last-name '(Spot)) => <NAME>) ((last-name '(<NAME>)) => <NAME>) "We can also define the function first-name." "Even though the definition is trivial (it is the same as FIRST)," "it is good practice to define first-name explicitly." (p) ((first-name p) => <NAME>) ((first-name '(<NAME>)) => <NAME>) ((setf names '((<NAME>) (<NAME>) (<NAME>) (Spot) (<NAME>) (<NAME>) (Z Z Top) (<NAME>) (<NAME>))) @ 14) ((first-name (first names)) => <NAME>) (:section "1.6 Using Functions") "Consider the following expression, which can be used to test LAST-NAME:" ((mapcar #'last-name names)) "The #' notation maps the name of a function to the function itself." ((mapcar #'- '(1 2 3 4)) @ 15) ((mapcar #'+ '(1 2 3 4) '(10 20 30 40))) "Now that we understand mapcar, let's use it to test FIRST-NAME:" ((mapcar #'first-name names)) "Suppose we wanted a version of FIRST-NAME that ignored titles like Miss:" ((defparameter *titles* '(Mr Mrs Miss Ms Sir Madam Dr Admiral Major General) "A list of titles that can appear at the start of a name.")) ((defun first-name (name) "Select the first name from a name represented as a list." (if (member (first name) *titles*) (first-name (rest name)) (first name))) @ 16) ((mapcar #'first-name names)) ((first-name '(<NAME> Major General <NAME>)) => <NAME>) "We can see how this works by tracing the execution of first-name:" ((trace first-name)) ((first-name '(<NAME>)) => JOHN @ 17) ((first-name '(<NAME> <NAME>)) => PAULA) ((untrace first-name)) (:section "1.7 Higher-Order Functions") ((apply #'+ '(1 2 3 4)) => 10) ((apply #'append '((1 2 3) (a b c)))) "Now we define a new function, self-and-double, and apply it to arguments." ((defun self-and-double (x) (list x (+ x x)))) ((self-and-double 3) => (3 6)) ((apply #'self-and-double '(3)) => (3 6)) "Now let's return to the mapping functions:" ((mapcar #'self-and-double '(1 10 300))) ((mappend #'self-and-double '(1 10 300))) "FUNCALL is similar to APPLY; it too takes a function as its" "first argument and applies the function to a list of arguments," "but in the case of FUNCALL, the arguments are listed separately:" ((funcall #'+ 2 3) => 5 @ 20) ((apply #'+ '(2 3)) => 5) ) (defexamples 2 "A Simple Lisp Program" "This chapter shows how to combine the basic functions and" "special forms of Lisp into a complete program" "The program generates random English sentences." (:section "2.2 A Straightforward Solution") "We can test the program by generating a few random sentences." "(Note that since these are random, you won't get the same ones" "as in the book.)" ((requires "simple")) ((sentence) @ 36) ((sentence) @ 36) ((sentence) @ 36) ((noun-phrase)) ((verb-phrase)) ((trace sentence noun-phrase verb-phrase article noun verb) @ 37) ((sentence)) ((untrace)) (:section "2.3 A Rule-Based Solution") "An alternative implementation concentrates on making it easy" "to write grammar rules." ((generate 'sentence) @ 41) ((generate 'sentence) @ 41) ((generate 'noun-phrase) @ 41) ((generate 'verb-phrase) @ 41) "One advantage of this approach is its easier to change grammars." ((setf *grammar* *bigger-grammar*) @ 43) ((generate 'sentence)) ((generate 'sentence)) "Another advantage is that the same data (grammar) can be used" "for more than one purpose. Consider generate-tree:" ((generate-tree 'sentence) @ 45)) (defexamples 3 "Overview of Lisp" "This chapter briefly covers the most important special forms and" "functions in Lisp." (:section "3.2 Special Forms") "Start with functions and special forms for repetition:" "First, functions like MAPCAR can apply to any number of lists:" ((mapcar #'- '(1 2 3)) => (-1 -2 -3) @ 61) ((mapcar #'+ '(1 2) '(10 20) '(100 200)) => (111 222)) "Second, many of the functions accept keywords:" ((remove 1 '(1 2 3 2 1 0 -1)) => (2 3 2 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :key #'abs) => (2 3 2 0) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :test #'<) => (1 1 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :start 4) => (1 2 3 2 0 -1) @ 61) "Third, some have corresponding -IF or -IF-NOT versions:" ((remove-if #'oddp '(1 2 3 2 1 0 -1)) => (2 2 0)) ((remove-if-not #'oddp '(1 2 3 2 1 0 -1)) => (1 3 1 -1)) "The forms TRACE and UNTRACE are used to control debugging info:" ((requires "overview")) ((trace length9) @ 65) ((length9 '(1 b c)) => 3) ((untrace length9)) ((length9 '(1 b c)) => 3) (:section "3.7 Functions on Trees") ((setf tree '((a b) ((c)) (d e))) @ 76) ((tree-equal tree (copy-tree tree)) => t) ((same-shape-tree tree '((1 2) ((3)) (4 5))) => t) ((same-shape-tree tree '((1 2) (3) (4 5))) => nil) "There are two functions for substituting a new expression into a tree:" ((subst 'new 'old '(old ((very old)))) => (NEW ((VERY NEW)))) ((sublis '((old . new)) '(old ((very old)))) => (NEW ((VERY NEW)))) ((subst 'new 'old 'old) => NEW) "Here is an example:" ((english->french '(hello my friend - how are you today?)) => (bonjour mon ami - comment va tu today?) @ 77) (:section "3.10 Destructive Functions") "Consider the following:" ((setq x '(a b c)) @ 80) ((setq y '(1 2 3))) ((nconc x y) => (a b c 1 2 3)) (x => (a b c 1 2 3)) (y => (1 2 3)) "NCONC computes the same result as APPEND, but it alters the first argument." "It is called a 'destructive' function." "There is quite a conceptual load on the programmer who uses NCONC." "The advantage of NCONC is that it doesn't use any storage." "" (:section "3.11 Overview of Data Types") "The function TYPE-OF returns the type of its argument." ((type-of 123) => fixnum @ 82) ((typep 123 'fixnum) => t) ((typep 123 'integer) => t) ((typep 123.0 'integer) => nil) ((subtypep 'fixnum 'integer) => t) (:section "3.12 Input/Output") "FORMAT is the main function for formatted output:" ((format t "hello, world") @ 84) ((format t "~&~a plus ~s is ~f" "two" "two" 4)) ((let ((numbers '( 1 2 3 4 5))) (format t "~&~{~r~^ plus ~} is ~@r" numbers (apply #'+ numbers)))) (:section "3.13 Debugging tools") ((documentation 'first 'function) @ 87) ((documentation 'pi 'variable)) (:section "3.14 Antibugging Tools") ((defun f (n) (dotimes (i n) nil)) @ 90) ((time (f 10000))) ((compile 'f)) ((time (f 10000))) (:section "3.15 Evaluation") "The following five forms are equivalent:" ((+ 1 2 3 4) => 10 @ 91) ((funcall #'+ 1 2 3 4) => 10 @ 91) ((apply #'+ '(1 2 3 4)) => 10 @ 91) ((apply #'+ 1 2 '(3 4)) => 10 @ 91) ((eval '(+ 1 2 3 4)) => 10 @ 91) (:section "3.16 Closures") "In the general case, a function consists of the body of the function" "coupled with any free lexical variables that the function references." "Consider the example:" ((mapcar (adder 3) '(1 3 10)) => (4 6 13) @ 92) ((mapcar (adder 10) '(1 3 10)) => (11 13 20) @ 92) "In the following, two calls to BANK-ACCOUNT create two different closures," "each with a separate value for the lexical variable BALANCE." ((setf my-account (bank-account 500.00)) @ 92) ((setf your-account (bank-account 250.00)) @ 93) ((funcall my-account 'withdraw 75.00) => 425.0) ((funcall your-account 'deposit 250.00) => 500.0) ((funcall your-account 'withdraw 100.00) => 400.0) ((funcall my-account 'withdraw 25.00) => 400.0) "This style of programming is covered in more detail in chapter 13." ) (defexamples 4 "GPS: The General Problem Solver" "The General problem Solver, developed in 1957 by <NAME> and <NAME>" "<NAME>, embodied a grandiose vision: a single computer program that could" "solve ANY problem. GPS caused quite a stir ..." (:section "4.4 Stage 4: test") ((requires "gps1")) "Here are some examples of using GPS" "The first example works with a complex chain of steps." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school) *school-ops*) => SOLVED @ 118) "The next example fails because there is no way to make the car work," "because we can't contact the shop to get the battery fixed." ((gps '(son-at-home car-needs-battery have-money) '(son-at-school) *school-ops*) => NIL) "The third example is easy, because the car is currently working." ((gps '(son-at-home car-works) '(son-at-school) *school-ops*) => SOLVED) (:section "4.7 The Clobbered Sibling Goal Problem") "In the next example, GPS incorrectly reports success, when in fact it has" "spent the money on the battery, and thus should fail." ((gps '(son-at-home have-money car-works) '(have-money son-at-school) *school-ops*) => SOLVED @ 120) "The bug is that when (EVERY #'ACHIEVE GOALS) returns true, it means all the" "goals were achieved in turn, but they might not still be all true." (:section "4.8 The Leaping before You Look Problem") "What happens if we move the HAVE-MONEY goal to the end?" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school) *school-ops*) => SOLVED @ 121) "GPS returns nil, but only after executing all the actions." "I call this the 'leaping before you look' problem, because if you asked" "the program to solve for the two goals (JUMP-OFF-CLIFF LAND-SAFELY) it" "would happily jump first, only to discover that it had no operator to land" "safely. This is less than prudent behavior." (:section "4.9 The Recursive Subgoal Problem") "We won't show the problem (because it gets into an infinite loop)," "but we will add the new operator to the *school-ops*; we'll use it later." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*) @ 122) (:section "4.11 GPS Version 2: A More General problem Solver") "At this point we are ready to put together a new version of GPS with" "solutions for the 'running around the block,' 'prerequisite clobbers" "sibling goal,' 'leaping before you look,' and 'recursive subgoal' problems." "The most important change is that, instead of printing a message when each" "operator is applied, we will instead have GPS return the resulting state." ((requires "gps")) "We use the list of operators that includes the 'asking the shop their" "phone number' operator." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*)) ((use *school-ops*) => 7 @ 130) "First we make sure the new version works on some of the examples that" "version 1 worked on:" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) "We can see what is going on here by turning on debugging temporarily:" ((debug :gps)) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) ((undebug)) "Here is another old example:" ((gps '(son-at-home car-works) '(son-at-school)) => ((START) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 132) "Now we see that version 2 can handle the three cases version 1 got wrong." "In each case the program avoids an infinite loop, and also avoids leaping" "before it looks." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school)) => NIL) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school have-money)) => NIL) ((gps '(son-at-home car-needs-battery have-money) '(son-at-school)) => NIL) "Finally, we see the new GPS also works on trivial problems:" ((gps '(son-at-home) '(son-at-home)) => ((START))) (:section "4.12 The New Domain Problem: Monkey and Bananas") "To show that GPS is at all general, we have to make it work in different" "domains. We start with a 'classic' AI problem: Monkey and Bananas" ((use *banana-ops*) => 6 @ 133) "We pose the problem of becoming not-hungry, given an initial state." "GPS can find a solution to this problem:" ((GPS '(at-door on-floor has-ball hungry chair-at-door) '(not-hungry)) => ((START) (EXECUTING PUSH-CHAIR-FROM-DOOR-TO-MIDDLE-ROOM) (EXECUTING CLIMB-ON-CHAIR) (EXECUTING DROP-BALL) (EXECUTING GRASP-BANANAS) (EXECUTING EAT-BANANAS)) @ 133) "Notice we did not need to make any changes at all to the GPS program." "We just used a different set of operators." (:section "4.13 The Maze Searching Domain") "Next we will consider another 'classic' problem, maze searching." "We will assume a particular maze, diagrammed on page 134." ((use *maze-ops*) => 48 @ 134) ((gps '((at 1)) '((at 25))) @ 135) "We can define FIND-PATH to use the results of a GPS search:" ((find-path 1 25) @ 136 => (1 2 3 4 9 8 7 12 11 16 17 22 23 24 19 20 25)) ((find-path 1 1) => (1)) ((equal (find-path 1 25) (reverse (find-path 25 1))) => T) (:section "4.14 The Blocks World Domain") "Another domain that has attracted more than its share of attention in AI" "circles is the blocks world domain." ((use (make-block-ops '(a b))) => 4 @ 137) "The simplest possible problem is stacking one block on another." ((gps '((a on table) (b on table) (space on a) (space on b) (space on table)) '((a on b) (b on table))) => ((START) (EXECUTING (MOVE A FROM TABLE TO B)))) "Here is a slightly more complex problem: inverting a stack of two blocks." "This time we show the debugging output:" ((debug :gps) @ 138) ((gps '((a on b) (b on table) (space on a) (space on table)) '((b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO A)))) ((undebug)) "Now we move on to the three block world." ((use (make-block-ops '(a b c))) => 18) "We try some problems:" ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table)) '((c on table) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 141) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) @ 141 => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((c on b) (b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) "The Sussman Anomaly" ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 142) ((gps start '((a on b) (b on c))) => NIL) ((gps start '((b on c) (a on b))) => NIL) (:section "4.16 The Not Looking after You Don't Leap Problem") ((use (push (op 'taxi-son-to-school :preconds '(son-at-home have-money) :add-list '(son-at-school) :del-list '(son-at-home have-money)) *school-ops*)) @ 143) ((debug :gps)) ((gps '(son-at-home have-money car-works) '(son-at-school have-money)) => NIL) ((undebug)) ) (defexamples 5 "Eliza: Dialog with a Machine" "ELIZA was one of the first programs to feature English output as well as input." "The program was named after the heroine of Pygmalion, who was taught to" "speak proper English by a dedicated teacher." (:section "5.2 Pattern Matching") ((requires "eliza1")) "The hard part is the notion of pattern matching and transformation." "All symbols beginning with ? are variables for the pattern matcher." "First we see how to substitute variable/value pairs into expressions:" ((sublis '((?X . vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 156) "Now a version of pat-match that works with such pairs:" ((pat-match '(I need a ?x) '(I need a vacation)) @ 158) "Showing how to plug it in:" ((sublis (pat-match '(I need a ?x) '(I need a vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 159) ((pat-match '(I need a ?x) '(I really need a vacation)) => nil) ((pat-match '(this is easy) '(this is easy)) => ((t . t))) ((pat-match '(?x is ?x) '((2 + 2) is 4)) => nil) ((pat-match '(?x is ?x) '((2 + 2) is (2 + 2))) => ((?x 2 + 2))) ((pat-match '(?P need . ?X) '(I need a long vacation)) => ((?X a long vacation) (?P . I))) (:section "5.3 Segment Pattern Matching") "We show how to have a variable that will match more than one element." "We call these segment variables, and denote them (?* name)." ((pat-match '((?* ?p) need (?* ?x)) '(<NAME> and I need a vacation)) @ 160) (:section "5.4 The Eliza Program: A Rule-Based Translator") ((requires "eliza")) "We can't show you an interactive ELIZA session, because the replies are" "random, and thus change every time. You can experiment on your own by" "evaluating (ELIZA) and typing in your end of the conversation. Type (good bye) when you are done." ) (defexamples 6 "Building Software Tools" "In chapters 4 and 5 we were concerned with buildinng two particular" "programs, GPS and ELIZA. In this chapter, we will reexamine those" "two programs to discover some common patterns. Those patterns will be" "abstracted out to form reusable software tools." (:section "6.2 A Pattern-Matching tool") ((requires "patmatch")) ((pat-match '(x = (?is ?n numberp)) '(x = 34)) => ((?n . 34)) @ 179) ((pat-match '(x = (?is ?n numberp)) '(x = x)) => NIL) ((pat-match '(?x (?or < = >) ?y) '(3 < 4)) => ((?Y . 4) (?X . 3))) ((pat-match '(x = (?and (?is ?n numberp) (?is ?n oddp))) '(x = 3)) => ((?N . 3))) ((pat-match '(?x /= (?not ?x)) '(3 /= 4)) => ((?X . 3)) @ 180) ((pat-match '(?x > ?y (?if (> ?x ?y))) '(4 > 3)) => ((?Y . 3) (?X . 4))) ((pat-match '(a (?* ?x) d) '(a b c d)) => ((?X B C)) @ 185) ((pat-match '(a (?* ?x) (?* ?y) d) '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(a (?* ?x) (?* ?y) ?x ?y) '(a b c d (b c) (d))) => ((?Y D) (?X B C)) @ 186) ((pat-match '(?x ?op ?y is ?z (?if (eql (funcall ?op ?x ?y) ?z))) '(3 + 4 is 7)) => ((?Z . 7) (?Y . 4) (?OP . +) (?X . 3))) ((pat-match '(?x ?op ?y (?if (funcall ?op ?x ?y))) '(3 > 4)) => NIL) ((pat-match-abbrev '?x* '(?* ?x)) => (?* ?X) @ 187) ((pat-match-abbrev '?y* '(?* ?y)) => (?* ?Y)) ((setf axyd (expand-pat-match-abbrev '(a ?x* ?y* d))) => (A (?* ?X) (?* ?Y) D)) ((pat-match axyd '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(((?* ?x) (?* ?y)) ?x ?y) '((a b c d) (a b) (c d))) => NIL) ((requires "eliza-pm")) (:section "6.4 A Set of Searching Tools") ((requires "search")) ((debug :search) @ 192) "We can search through the binary tree, looking for, say, 12 as the goal." "With breadth-first search this would yield an infinite loop, so we won't" "do it. Breadth-first search works better:" ((breadth-first-search 1 (is 12) 'binary-tree) => 12 @ 193) ((depth-first-search 1 (is 12) (finite-binary-tree 15)) => 12 @ 193) "Guiding the Search" "Best-first search takes an additional argument which estimates how close" "we are to the goal. We call this the cost function." ((best-first-search 1 (is 12) #'binary-tree (diff 12)) => 12 @ 195) ((best-first-search 1 (is 12) #'binary-tree (price-is-right 12)) => 12) "The function beam-search is just like best-first-search, except that after" "we sort the states, we then take only the first beam-width states." ((beam-search 1 (is 12) #'binary-tree (price-is-right 12) 2) => 12) "As a concrete example of a problem that can be solved by search," "consider planning a flight across North America in a plane whose range is" "limited to 1000 kilometers. Here we plan a trip from SF to Boston." ((path-state (trip (city 'san-francisco) (city 'boston))) => (BOSTON 71.05 42.21) @ 199) ((path-state (trip (city 'boston) (city 'san-francisco))) => (SAN-FRANCISCO 122.26 37.47)) ((undebug :search)) ((show-city-path (trip (city 'san-francisco) (city 'boston) 1)) @ 201) ((show-city-path (trip (city 'boston) (city 'san-francisco) 1))) ((show-city-path (trip (city 'boston) (city 'san-francisco) 3)) @ 202) ((iter-wide-search 1 (is 12) (finite-binary-tree 15) (diff 12)) => 12 @ 205) ((tree-search '(1) (is 6) #'next2 #'prepend) => 6 @ 208) ((graph-search '(1) (is 6) #'next2 #'prepend) => 6) ((path-states (a*-search (list (make-path :state 1)) (is 6) #'next2 #'(lambda (x y) 1) (diff 6))) => (6 5 3 1) @ 210) (:section "6.5 GPS as Search") ((requires "gps-srch")) ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 213) ((use (make-block-ops '(a b c))) => 18) ((search-gps start '((a on b) (b on c))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 213) ((search-gps start '((b on c) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B)))) ) (defexamples 7 "STUDENT: Solving Algebra Word Problems" "STUDENT was another early language understanding program, written by <NAME>" "Bobrow in 1964. It was designed to read and solve the kind of word" "problems found in high school algebra books." (:section "7.1 Translating English into Equations") ((requires "student")) ((translate-to-expression '(if z is 3 |,| what is twice z)) => ((= z 3) (= what (* 2 z))) @ 222) (:section "7.2 Solving Algebra Equations") ((trace isolate solve) @ 229) ((solve-equations '((= (+ 3 4) (* (- 5 (+ 2 x)) 7)) (= (+ (* 3 x) y) 12))) => nil) ((untrace isolate solve)) (:section "7.3 Examples") ((student '(If the number of customers <NAME> gets is twice the square of 20 % of the number of advertisements he runs |,| and the number of advertisements is 45 |,| then what is the number of customers <NAME> gets ?)) => nil @ 231) ((student '(The daily cost of living for a group is the overhead cost plus the running cost for each person times the number of people in the group |.| This cost for one group equals $ 100 |,| and the number of people in the group is 40 |.| If the overhead cost is 10 times the running cost |,| find the overhead and running cost for each person |.|))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 4 feet tall |,| how old is Fran ?))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 0 feet tall |,| how old is Fran ?))) ) (defexamples 8 "Symbolic Mathematics: A Simplification Program" "'Symbolic mathematics' is to numerical mathematics as algebra is to" "arithmetic: it deals with variables and expressions, not just numbers." "This chapter develops a program that simplifies algebraic expressions." "We then show that differentiation and even integration can be seen as" "special cases of 'simplification.' (Note that we replace calls to the" "interactive function SIMPLIFIER with calls to the function SIMP.)" (:section "8.2 Simplification Rules") ((requires "macsymar")) ((simp '(2 + 2)) => 4 @ 245) ((simp '(5 * 20 + 30 + 7)) => 137 ) ((simp '(5 * x - (4 + 1) * x)) => 0 ) ((simp '(y / z * (5 * x - (4 + 1) * x))) => 0 ) ((simp '((4 - 3) * x + (y / y - 1) * z)) => X ) ((simp '(1 * f(x) + 0)) => (F X) ) (:section "8.3 Associativity and Commutativity") ((simp '(3 * 2 * x)) => (6 * X) @ 247) ((simp '(2 * x * x * 3)) => (6 * (X ^ 2)) ) ((simp '(2 * x * 3 * y * 4 * z * 5 * 6)) => (720 * (X * (Y * Z))) ) ((simp '(3 + x + 4 + x)) => ((2 * X) + 7) ) ((simp '(2 * x * 3 * x * 4 * (1 / x) * 5 * 6)) => (720 * X)) (:section "8.4 Logs, Trig, and Differentiation") ((simp '(d (x + x) / d x)) => 2 @ 250) ((simp '(d (a * x ^ 2 + b * x + c) / d x)) => ((2 * (A * X)) + B) ) "For the next one, note we had an error in the first printing of the book;" "the sign was reversed on the (d (u / v) ...) rule." ((simp '(d ((a * x ^ 2 + b * x + c) / x) / d x)) => (((X * ((2 * (A * X)) + B)) - ((A * (X ^ 2)) + ((B * X) + C))) / (X ^ 2))) ((simp '(log ((d (x + x) / d x) / 2))) => 0 ) ((simp '(log(x + x) - log x)) => (LOG 2)) ((simp '(x ^ cos pi)) => (1 / X) ) "These next two examples were also affected by the (d (u / v) ...) rule." ((simp '(d (3 * x + (cos x) / x) / d x)) => ((((X * (- (SIN X))) - (COS X)) / (X ^ 2)) + 3)) ((simp '(d ((cos x) / x) / d x)) => (((X * (- (SIN X))) - (COS X)) / (X ^ 2))) ((simp '(d (3 * x ^ 2 + 2 * x + 1) / d x)) => ((6 * X) + 2)) ((simp '(sin(x + x) ^ 2 + cos(d x ^ 2 / d x) ^ 2)) => 1 ) ((simp '(sin(x + x) * sin(d x ^ 2 / d x) + cos(2 * x) * cos(x * d 2 * y / d y))) => 1 ) (:section "8.5 Limits of Rule-Based Approaches") "In this section we return to some examples that pose problems." "For the following, we would prefer (2 * (x + y))" ((simp '(x + y + y + x)) => (X + (Y + (Y + X)))) "For the following, we would prefer (7 * X) and (Y + (8 * X)), respectively:" ((simp '(3 * x + 4 * x)) => ((3 * X) + (4 * X))) ((simp '(3 * x + y + x + 4 * x)) => ((3 * X) + (Y + (X + (4 * X)))) ) "In chapter 15, we develop a new version of the program that handles this problem." (:section "8.6 Integration") ((set-simp-fn 'Int #'(lambda (exp) (integrate (exp-lhs exp) (exp-rhs exp)))) @ 258) ((simp '(Int x * sin(x ^ 2) d x)) => (1/2 * (- (COS (X ^ 2)))) ) ((simp '(Int ((3 * x ^ 3) - 1 / (3 * x ^ 3)) d x)) => ((3 * ((X ^ 4) / 4)) - (1/3 * ((X ^ -2) / -2))) ) ((simp '(Int (3 * x + 2) ^ -2/3 d x)) => (((3 * X) + 2) ^ 1/3) ) ((simp '(Int sin(x) ^ 2 * cos(x) d x)) => (((SIN X) ^ 3) / 3) ) ((simp '(Int sin(x) / (1 + cos(x)) d x)) => (-1 * (LOG ((COS X) + 1))) ) ((simp '(Int (2 * x + 1) / (x ^ 2 + x - 1) d x)) => (LOG ((X ^ 2) + (X - 1))) ) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (8 * ((1/3 * (((X ^ 3) + 2) ^ -2)) / -2)) ) ((set-simp-fn 'Int #'(lambda (exp) (unfactorize (factorize (integrate (exp-lhs exp) (exp-rhs exp)))))) @ 259) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (-4/3 * (((X ^ 3) + 2) ^ -2)) ) ) (defexamples 9 "Efficiency Issues" "One of the reasons Lisp has enjoyed a long history is because it is an" "ideal language for what is called rapid-prototyping or rapid development." "Most real AI programs deal with large amounts of data. Thus, efficiency" "is important. This chapter shows some ways to make programs efficient." (:section "9.1 Caching Results of Previous Computations: Memoization") ((defun fib (n) (if (<= n 1) 1 (+ (fib (- n 1)) (fib (- n 2))))) @ 269) ((setf memo-fib (memo #'fib)) @ 270) ((trace fib)) ((funcall memo-fib 3) => 3 @ 270) ((funcall memo-fib 3) => 3) ((untrace fib)) ((memoize 'fib) @ 272) ((trace fib)) ((fib 5) => 8) ((fib 5) => 8) ((fib 6) => 13) ((untrace fib)) ) (defexamples 10 "Low-Level Efficiency Issues" "The efficiency techniques of the previous chapter all involved fairly" "significant changes to an algorithm. But what happens when you are already" "using the best imaginable algorithms, and performance is still a problem?" (:section "10.1 Use Declarations") "Compare these functions with and without declarations:" ((defun f (x y) (declare (fixnum x y) (optimize (safety 0) (speed 3))) (the fixnum (+ x y))) @ 318) ((defun g (x y) (+ x y))) "Here is the disassembled code for f and g:" ((disassemble 'f)) ((disassemble 'g) @ 319) ) (defexamples 11 "Logic Programming" "The idea behind logic programming is that the programmer should state the" "relationships that describe a problem and its solution." "In this chapter we develop an interpreter for the Prolog language." (:section "11.1 Idea 1: A Uniform Data Base") ((requires "prolog1")) "First let's make sure we're dealing with a brand new database." ((clear-db)) "Facts are entered into the data base with the <- macro" ((<- (likes <NAME>)) @ 350) ((<- (likes <NAME>))) ((<- (likes <NAME> <NAME>))) ((<- (likes <NAME> cats))) "We can also enter rules, which state contingent facts." ((<- (likes <NAME> ?x) (likes ?x cats)) @ 351) ((<- (likes <NAME> ?x) (likes ?x <NAME>) (likes ?x <NAME>))) (:section "11.2 Idea 2: Unification of Logic Variables") ((requires "unify")) ((pat-match '(?x + ?y) '(2 + 1)) => ((?y . 1) (?x . 2)) @ 352) ((unify '(?x + 1) '(2 + ?y)) => ((?y . 1) (?x . 2))) ((unify '(f ?x) '(f ?y)) => ((?x . ?y))) ((unify '(?a + ?a = 0) '(?x + ?y = ?y)) => ((?y . 0) (?x . ?y) (?a . ?x))) ((unifier '(?a + ?a = 0) '(?x + ?y = ?y)) => (0 + 0 = 0)) "Let's try UNIFY on some (more) examples:" ((unify '(?x ?y a) '(?y ?x ?x)) => ((?y . a) (?x . ?y)) @ 357) ((unify '?x '(f ?x)) => nil) ((unify 'a 'a) => ((t . t))) "Here are some examples of UNIFIER:" ((unifier '(?x ?y a) '(?y ?x ?x)) => (a a a)) ((unifier '((?a * ?x ^ 2) + (?b * ?x) + ?c) '(?z + (4 * 5) + 3)) => ((?a * 5 ^ 2) + (4 * 5) + 3)) "Programming with Prolog" "First we define the MEMBER relation in Prolog:" ((<- (member ?item (?item . ?rest))) @ 358) ((<- (member ?item (?x . ?rest)) (member ?item ?rest))) "Now we can make some queries:" ((?- (member 2 (1 2 3)))) ((?- (member 2 (1 2 3 2 1)))) ((?- (member ?x (1 2 3)))) "Let's add one more rule to the Sandy and the cats facts:" ((<- (likes ?x ?x)) @ 363) "Now we can ask some queries:" ((?- (likes <NAME> ?who)) @ 365) ((?- (likes ?who <NAME>))) ((?- (likes <NAME>))) ((?- (likes ?x ?y) (likes ?y ?x)) @ 366) (:section "11.3 Idea 3: Automatic Backtracking") "Now we load the version that does automatic backtracking one step at a time" "as opposed to the previous version, which collects all answers at once." "Since we don't want to involve you, the user, in typing input to move on" "to the next step, we supply the input (a ; or a .) as in the book." "Unfortunately, it is not specified in Common Lisp whether read-char echoes" "the character it reads, so you may or may not see the ; and . characters." ((requires "prolog")) "Let's add the definition of the relation LENGTH:" ((<- (length () 0)) @ 370) ((<- (length (?x . ?y) (1+ ?n)) (length ?y ?n))) "Here are some queries:" ((?- (length (a b c d) ?n)) :input ";") ((?- (length ?list (1+ (1+ 0)))) :input ";") ((?- (length ?list ?n)) :input ";;.") ((?- (length ?l (1+ (1+ 0))) (member a ?l)) :input ";;") "(We won't try the example that leads to an infinite loop.)" (:section "11.4 The Zebra Puzzle") "First we define the NEXTO and IRIGHT (to the immediate right) relations:" ((<- (nextto ?x ?y ?list) (iright ?x ?y ?list)) @ 374) ((<- (nextto ?x ?y ?list) (iright ?y ?x ?list))) ((<- (iright ?left ?right (?left ?right . ?rest)))) ((<- (iright ?left ?right (?x . ?rest)) (iright ?left ?right ?rest))) ((<- (= ?x ?x))) "Now we define the zebra puzzle:" ((<- (zebra ?h ?w ?z) ;; Each house is of the form: ;; (house nationality pet cigarette drink house-color) (= ?h ((house norwegian ? ? ? ?) ;1,10 ? (house ? ? ? milk ?) ? ?)) ; 9 (member (house englishman ? ? ? red) ?h) ; 2 (member (house spaniard dog ? ? ?) ?h) ; 3 (member (house ? ? ? coffee green) ?h) ; 4 (member (house ukrainian ? ? tea ?) ?h) ; 5 (iright (house ? ? ? ? ivory) ; 6 (house ? ? ? ? green) ?h) (member (house ? snails winston ? ?) ?h) ; 7 (member (house ? ? kools ? yellow) ?h) ; 8 (nextto (house ? ? chesterfield ? ?) ;11 (house ? fox ? ? ?) ?h) (nextto (house ? ? kools ? ?) ;12 (house ? horse ? ? ?) ?h) (member (house ? ? luckystrike oj ?) ?h) ;13 (member (house japanese ? parliaments ? ?) ?h) ;14 (nextto (house norwegian ? ? ? ?) ;15 (house ? ? ? ? blue) ?h) (member (house ?w ? ? water ?) ?h) ;Q1 (member (house ?z zebra ? ? ?) ?h))) ;Q2 "If you want to test this out, run the following query:" " ((?- (zebra ?houses ?water-drinker ?zebra-owner)))" "It is not included as an example because it takes a minute or so to run." ) (defexamples 12 "Compiling Logic Programs" "This chapter presents a compiler that translates from Prolog to Lisp." "Unfortunatley, there's not much to see in terms of examples." "But we load the files for you, in case you want to play with them." ((requires "prologc1" "prologc2" "prologcp")) ((prolog-compile 'likes) @ 389) ((prolog-compile 'member)) ) (defexamples 13 "Object Oriented Programming" "It is only natural that a wide range of programming styles have been" "introduced to attack the wide range of problems in this book." "One style not yet covered is 'object-oriented programming'." "<NAME> (1987) proposes the following formula as a definition:" "Object-orientation = Objects + Classes + Inheritance" (:section "13.2 Objects") "Now we're ready to get started." ((requires "clos")) ((setf acct (new-account "<NAME>" 1000.00)) @ 438) ((send acct 'withdraw 500.00) => 500.0) ((send acct 'deposit 123.45) => 623.45) ((send acct 'name) => "<NAME>") ((send acct 'balance) => 623.45) (:section "13.4 Classes") "Now we define the class ACCOUNT with the define-class macro." ((define-class account (name &optional (balance 0.00)) ((interest-rate .06)) (withdraw (amt) (if (<= amt balance) (decf balance amt) 'insufficient-funds)) (deposit (amt) (incf balance amt)) (balance () balance) (name () name) (interest () (incf balance (* interest-rate balance)))) @ 440) "Here are the generic functions defined by this macro:" ((setf acct2 (account "<NAME>. User" 2000.00))) ((deposit acct2 42.00) => 2042.0) ((interest acct2) => 2164.52) ((balance acct2) => 2164.52 @ 441) ((balance acct) => 623.45) (:section "13.5 Delegation") ((define-class password-account (password acct) () (change-password (pass new-pass) (if (equal pass password) (setf password new-pass) 'wrong-password)) (otherwise (pass &rest args) (if (equal pass password) (apply message acct args) 'wrong-password)))) "Now we see how the class PASSWORD-ACCOUNT can be used to provide protection" "for an existing account:" ((setf acct3 (password-account "secret" acct2)) @ 441) ((balance acct3 "secret") => 2164.52) ((withdraw acct3 "guess" 2000.00) => WRONG-PASSWORD) ((withdraw acct3 "secret" 2000.00) => 164.52) (:section "13.7 CLOS: The Common Lisp Object System") "Because some Lisp implementations can't convert a structure class into" "a CLOS class, nor convert a regular function into a generic function," "we use the names account*, name*, balance*, interest-rate*. If you were" "doing a real application, not just some examples, you would choose one" "implementation and get to use the regular names." ; ?????? some problems here ((defclass account* () ((name :initarg :name :reader name*) (balance :initarg :balance :initform 0.00 :accessor balance*) (interest-rate :allocation :class :initform .06 :reader interest-rate*))) @ 445) ((setf a1 (make-instance 'account* :balance 5000.00 :name "<NAME>")) @ 446) ((name* a1) => "<NAME>") ((balance* a1) => 5000.0) ((interest-rate* a1) => 0.06) ((defmethod withdraw* ((acct account*) amt) (if (< amt (balance* acct)) (decf (balance* acct) amt) 'insufficient-funds)) @ 446) ((defclass limited-account (account*) ((limit :initarg :limit :reader limit)))) ((defmethod withdraw* ((acct limited-account) amt) (if (> amt (limit acct)) 'over-limit (call-next-method)))) ((setf a2 (make-instance 'limited-account :name "<NAME>" :balance 500.00 :limit 100.00)) @ 447) ((name* a2) => "<NAME>") ((withdraw* a2 200.00) => OVER-LIMIT) ((withdraw* a2 20.00) => 480.0) (:section "13.8 A CLOS Example: Searching Tools") ((defclass problem () ((states :initarg :states :accessor problem-states))) @ 449) ((defmethod searcher ((prob problem)) "Find a state that solves the search problem." (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) (searcher prob))))) ((defmethod current-state ((prob problem)) "The current state is the first of the possible states." (first (problem-states prob)))) ((defmethod pop-state ((prob problem)) "Remove and return the current state." (pop (problem-states prob)))) ((defmethod no-states-p ((prob problem)) "Are there any more unexplored states?" (null (problem-states prob)))) ((defmethod searcher :before ((prob problem)) (dbg 'search "~&;; Search: ~a" (problem-states prob))) @ 450) ((defclass eql-problem (problem) ((goal :initarg :goal :reader problem-goal)))) ((defmethod goal-p ((prob eql-problem)) (eql (current-state prob) (problem-goal prob)))) ((defclass dfs-problem (problem) () (:documentation "Depth-first search problem."))) ((defclass bfs-problem (problem) () (:documentation "Breadth-first search problem."))) ((defmethod problem-combiner ((prob dfs-problem) new old) "Depth-first search looks at new states first." (append new old))) ((defmethod problem-combiner ((prob bfs-problem) new old) "Depth-first search looks at old states first." (append old new))) ((defclass binary-tree-problem (problem) ()) @ 451) ((defmethod problem-successors ((prob binary-tree-problem) state) (let ((n (* 2 state))) (list n (+ n 1))))) ((defclass binary-tree-eql-bfs-problem (binary-tree-problem eql-problem bfs-problem) ())) ((setf p1 (make-instance 'binary-tree-eql-bfs-problem :states '(1) :goal 12))) ((searcher p1) => 12) ((defclass best-problem (problem) () (:documentation "A Best-first search problem.")) @ 452) ((defmethod problem-combiner ((prob best-problem) new old) "Best-first search sorts new and old according to cost-fn." (sort (append new old) #'< :key #'(lambda (state) (cost-fn prob state))))) ((defmethod cost-fn ((prob eql-problem) state) (abs (- state (problem-goal prob))))) ((defclass beam-problem (problem) ((beam-width :initarg :beam-width :initform nil :reader problem-beam-width)))) ((defmethod problem-combiner :around ((prob beam-problem) new old) (let ((combined (call-next-method))) (subseq combined 0 (min (problem-beam-width prob) (length combined)))))) ((defclass binary-tree-eql-best-beam-problem (binary-tree-problem eql-problem best-problem beam-problem) ())) ((setf p3 (make-instance 'binary-tree-eql-best-beam-problem :states '(1) :goal 12 :beam-width 3))) ((searcher p3) => 12) ((defclass trip-problem (binary-tree-eql-best-beam-problem) ((beam-width :initform 1))) @ 453) ((defmethod cost-fn ((prob trip-problem) city) (air-distance (problem-goal prob) city))) ((defmethod problem-successors ((prob trip-problem) city) (neighbors city))) ((setf p4 (make-instance 'trip-problem :states (list (city 'new-york)) :goal (city 'san-francisco)))) ((searcher p4) => (SAN-FRANCISCO 122.26 37.47)) (:section "13.9 Is CLOS Object-oriented?") ((defmethod conc ((x null) y) y) @ 454) ((defmethod conc (x (y null)) x)) ((defmethod conc ((x list) (y list)) (cons (first x) (conc (rest x) y)))) ((defmethod conc ((x vector) (y vector)) (let ((vect (make-array (+ (length x) (length y))))) (replace vect x) (replace vect y :start1 (length x))))) ((conc nil '(a b c)) => (A B C) @ 455) ((conc '(a b c) nil) => (A B C)) ((conc '(a b c) '(d e f)) => (A B C D E F)) ((conc '#(a b c) '#(d e f)) => #(A B C D E F)) ) (defexamples 14 "Knowledge Representation and Reasoning" "In this chapter we explore means of indexing facts so that they can be" "retrieved and reasoned with efficiently." "Section 14.1 to 14.7 discuss problems with logical reasoning systems" "such as Prolog." (:section "14.8 A Solution to the Indexing Problem") "Here we show how to index facts in a kind of table that makes it easy to" "add, delete, and retrieve entries. We will develop an extension of the" "trie or discrimination tree data structure built in section 10.5 (page 344)." ((requires "krep1")) "Now we define a function to test the indexing routine. Compare the output" "with figure 14.1 on page 474." ((test-index) @ 478) "Here is an example of fetching from the index" ((fetch '(p ? c)) @ 480 => (((P B C) (P A C)) ((P A ?X)))) "We can make a change to rename variables before indexing facts." ((defun index (key) "Store key in a dtree node. Key must be (predicate . args); it is stored in the predicate's dtree." (dtree-index key (rename-variables key) ; store unique vars (get-dtree (predicate key)))) @ 481) "We have to reindex:" ((test-index)) "We are now ready to test the retrieval mechanism:" ((fetch '(p ?x c)) @ 481) ((retrieve '(p ?x c)) @ 481) ((retrieve-matches '(p ?x c)) => ((P A C) (P A C) (P B C))) ((retrieve-matches '(p ?x (?fn c))) => ((P A (?FN C)) (P A (F C)) (P B (F C)))) ((query-bind (?x ?fn) '(p ?x (?fn c)) (format t "~&P holds between ~a and ~a of c." ?x ?fn)) @ 482) (:section "14.10 Solutions to the Expressiveness Problems") "In this section we introduce a frame-like language, using the primitives" "sub, rel, ind, val, and and." ((requires "krep")) "We add some facts about dogs and bears, both as individuals and species:" ((add-fact '(sub dog animal)) @ 488) ((add-fact '(sub bear animal))) ((add-fact '(ind Fido dog))) ((add-fact '(ind Yogi bear))) ((add-fact '(val color Yogi brown))) ((add-fact '(val color Fido golden))) ((add-fact '(val latin-name bear ursidae))) ((add-fact '(val latin-name dog canis-familiaris))) "Now retrieve-fact is used to answer three questions: What kinds of animals" "are there?" ((retrieve-fact '(sub ?kind animal)) => (((?KIND . DOG)) ((?KIND . BEAR)))) "What are the Latin names of each kind of animal?" ((retrieve-fact '(and (sub ?kind animal) (val latin-name ?kind ?latin))) => (((?LATIN . CANIS-FAMILIARIS) (?KIND . DOG)) ((?LATIN . URSIDAE) (?KIND . BEAR)))) "What are the colors of each individual bear?" ((retrieve-fact '(and (ind ?x bear) (val color ?x ?c))) @ 489 => (((?C . BROWN) (?X . YOGI)))) ((test-bears) @ 492) ) (defexamples 15 "Symbolic Mathematics with Canonical Forms" "This chapter uses a canonical representation for polynomials" "to achieve a more efficient program than the rules-based one in Chapter 8." (:section "15.1 A Canonical Form for Polynomials") ((requires "cmacsyma")) "We represent polynomials as vectors, with the variable in element 0," "and the coefficients starting in element 1 and going up from there." "Here is the representation of 5x^3 + 10x^2 + 20x + 30" ('#(x 30 20 10 5) @ 511) "Here are some examples (without the interactive loop):" ((canon '(3 + x + 4 - x)) => 7 @ 521) ((canon '(x + y + y + x)) => ((2 * x) + (2 * y))) ((canon '(3 * x + 4 * x)) => (7 * x)) ((canon '(3 * x + y + x + 4 * x)) => ((8 * x) + y)) ((canon '((x + 1) ^ 10)) => ((x ^ 10) + (10 * (x ^ 9)) + (45 * (x ^ 8)) + (120 * (x ^ 7)) + (210 * (x ^ 6)) + (252 * (x ^ 5)) + (210 * (x ^ 4)) + (120 * (x ^ 3)) + (45 * (x ^ 2)) + (10 * x) + 1)) ((canon '((x + 1) ^ 10 - (x - 1) ^ 10)) => ((20 * (x ^ 8)) + (240 * (x ^ 7)) + (504 * (x ^ 5)) + (240 * (x ^ 3)) + (20 * x))) ((canon '(d (3 * x ^ 2 + 2 * x + 1) / d x)) @ 522 => ((6 * x) + 2)) ((canon '(d (z + 3 * x + 3 * z * x ^ 2 + z ^ 2 * x ^ 3) / d z)) => (((2 * z) * (x ^ 3)) + (3 * (x ^ 2)) + 1))) (defexamples 16 "Expert Systems" "In this chapter we develop an expert system shell, and give it a few rules" "about infectious disease, thus duplicating some of the Mycin system." ((requires "mycin-r")) "Because this is an interactive system, we can't show the interaction here." "You can try it yourself by evaluating (mycin)" ) (defexamples 17 "Line Diagram Labelling by Constraint Satisfaction" "In this chapter we look at the line-diagram labeling problem: Given a list" "of lines and the vertexes at which they intersect, how can we determine" "what the lines represent?" ((requires "waltz")) (:section "17.2 Combining Constraints and Searching") "First let's test that we can find the possible labelings for a vertex class:" ((possible-labelings 'Y) @ 574 => ((+ + +) (- - -) (L R -) (- L R) (R - L))) "Notice how matrix-transpose works:" ((matrix-transpose (possible-labelings 'Y)) => ((+ - L - R) (+ - R L -) (+ - - R L))) ((defdiagram cube (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f L d c) (g L b d)) @ 575) (:section "17.3 Labelling Diagrams") "We are now ready to try labelling diagrams. First the cube:" ((print-labelings (diagram 'cube)) @ 577) "The cube should have given four solutions." "We can get down to one solution by grounding line GD:" ((print-labelings (ground (diagram 'cube) 'g 'd)) @ 580) "For the more complex cube on a plate, we get similar results;" "Four interpretations, which turn to one after grounding line KM:" ((defdiagram cube-on-plate (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f Y d c i) (g Y b d h) (h W l g j) (i W f m j) (j Y h i k) (k W m l j) (l L h k) (m L k i)) @ 581) ((print-labelings (ground (diagram 'cube-on-plate) 'k 'm)) @ 582) "It is interesting to try the algorithm on an 'impossible' diagram." "It turns out the algorithm correctly finds no interpretation for this" "well-known illusion:" ((defdiagram poiuyt (a L b g) (b L j a) (c L d l) (d L h c) (e L f i) (f L k e) (g L a l) (h L l d) (i L e k) (j L k b) (k W j i f) (l W h g c)) @ 583) ((print-labelings (diagram 'poiuyt)) @ 583) "Now we try a more complex diagram:" ((defdiagram tower (a Y b c d) (n L q o) (b W g e a) (o W y j n) (c W e f a) (p L r i) (d W f g a) (q W n s w) (e L c b) (r W s p x) (f Y d c i) (s L r q) (g Y b d h) (t W w x z) (h W l g j) (u W x y z) (i W f m p) (v W y w z) (j Y h o k) (w Y t v q) (k W m l j) (x Y r u t) (l L h k) (y Y v u o) (m L k i) (z Y t u v)) @ 584) ((print-labelings (ground (diagram 'tower) 'l 'k)) @ 584)) (defexamples 18 "Search and the Game of Othello" "In this chapter we will develop a simplified Othello-playing program." "It will not be a champion, but is much better than beginning players." (:section "18.2 Representation Choices") ((requires "othello")) "First, we see that our choices for representing the board seem to work:" ((print-board (initial-board)) @ 604) "Now we can compare the weighted squares and count difference strategies" "by playing two games, alternating who goes first. The NIL as third argument" "means don't print the board after each move." ((othello (maximizer #'weighted-squares) (maximizer #'count-difference) nil) @ 610) ((othello (maximizer #'count-difference) (maximizer #'weighted-squares) nil)) (:section "18.4 Searching Ahead: Minimax") "We can test the minimax strategy, and see that searching ahead 3 ply is" "indeed better than looking at only 1 ply. We can follow the whole game" ((othello (minimax-searcher 3 #'count-difference) (maximizer #'count-difference)) @ 614 => 53) (:section "18.5 Smarter Searching: Alpha-Beta Search") "The following should produce the same result, only faster:" ((othello (alpha-beta-searcher 3 #'count-difference) (maximizer #'count-difference) nil) => 53) (:section "18.8 Playing a Series of Games") "A single game is not enough to establish that one strategy is better than" "another. The function RANDOM-OTHELLO-SERIES allows two strategies to" "compete in a series of games." ((requires "othello2")) ((random-othello-series (alpha-beta-searcher 2 #'weighted-squares) (alpha-beta-searcher 2 #'modified-weighted-squares) 5) @ 628) "Here is a comparison of five strategies that search only 1 ply." "To save time, we run 2 pairs of games each, not 5 pairs." ((round-robin (list (maximizer #'count-difference) (maximizer #'mobility) (maximizer #'weighted-squares) (maximizer #'modified-weighted-squares) #'random-strategy) 2 10 '(count-difference mobility weighted modified-weighted random)) @ 629) "Now we compare alpha-beta searchers at 3 ply for 1 pair of games each." "In the book it was 4 ply for 5 pairs each, but that takes too long." ((round-robin (list (alpha-beta-searcher 3 #'count-difference) (alpha-beta-searcher 3 #'weighted-squares) (alpha-beta-searcher 3 #'modified-weighted-squares) #'random-strategy) 1 10 '(count-difference weighted modified-weighted random))) ) (defexamples 19 "Introduction to Natural Language" "This chapter is a brief introduction to natural language processing." (:section "19.1 Parsing with a Phrase-Structure Grammar") "We start with the grammar defined on page 39 for the GENERATE program." "I include 'noun' and 'verb' as nouns in the grammar *grammar3*" ((requires "syntax1")) (*grammar3* @ 657) ((use *grammar3*)) ((parser '(the table)) => ((NP (ART THE) (NOUN TABLE)))) ((parser '(the ball hit the table)) => ((SENTENCE (NP (ART THE) (NOUN BALL)) (VP (VERB HIT) (NP (ART THE) (NOUN TABLE)))))) ((parser '(the noun took the verb)) => ((SENTENCE (NP (ART THE) (NOUN NOUN)) (VP (VERB TOOK) (NP (ART THE) (NOUN VERB)))))) "The range of sentences we can parse is quite limited." "The following grammar includes a wider variety." (*grammar4* @ 661) ((use *grammar4*)) ((parser '(The man hit the table with the ball)) => ((S (NP (D THE) (N MAN)) (VP (VP (V HIT) (NP (D THE) (N TABLE))) (PP (P WITH) (NP (D THE) (N BALL))))) (S (NP (D THE) (N MAN)) (VP (V HIT) (NP (NP (D THE) (N TABLE)) (PP (P WITH) (NP (D THE) (N BALL)))))))) "Here we see a phrase that is ambiguous between a sentence and a noun phrase:" ((parser '(the orange saw)) @ 662 => ((S (NP (D THE) (N ORANGE)) (VP (V SAW))) (NP (D THE) (A+ (A ORANGE)) (N SAW)))) (:section "19.4 The Unknown-Word Problem") "As it stands, the parser cannot deal with unknown words." "One way of treating unknown words is to allow them to be any of the" "'open-class' categories--nouns, verbs, adjectives, and names." ((parser '(<NAME> <NAME>)) @ 664 => ((S (NP (NAME <NAME>)) (VP (V LIKED) (NP (NAME <NAME>)))))) ((parser '(<NAME> <NAME>)) @ 665 => ((S (NP (NAME <NAME>)) (VP (V LIKED) (NP (NAME DALE)))))) "We see the parser works as well with words it knows (<NAME> and <NAME>)" "as with new words (<NAME> and <NAME>), which it can recognize as names" "because of their position in the sentence." ((parser '(the rab zaggled the woogly quax)) => ((S (NP (D THE) (N RAB)) (VP (V ZAGGLED) (NP (D THE) (A+ (A WOOGLY)) (N QUAX)))))) ((parser '(the slithy toves gymbled)) => ((S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NAME GYMBLED)))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (V GYMBLED))) (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)))) ((parser '(the slithy toves gymbled on the wabe)) => ((S (NP (D THE) (N SLITHY)) (VP (VP (V TOVES) (NP (NAME GYMBLED))) (PP (P ON) (NP (D THE) (N WABE))))) (S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NP (NAME GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (VP (V GYMBLED)) (PP (P ON) (NP (D THE) (N WABE))))) (NP (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (:section "19.5 Parsing into a Semantic Representation") ((requires "syntax2")) "Syntactic parse trees of a sentence may be interesting, but by themselves" "they're not very useful. We use sentences to communicate ideas, not to" "display grammatical structures." "" "Imagine a compact disc player for which you can punch buttons like" "'play 1 to 5 without 3'. We will define such a language." "The meaning of a sentence in the language is the list of tracks played." (*grammar5* @ 667) ((use *grammar5*)) ((meanings '(1 to 5 without 3)) @ 669 => ((1 2 4 5))) ((meanings '(1 to 4 and 7 to 9)) => ((1 2 3 4 7 8 9))) ((meanings '(1 to 6 without 3 and 4)) => ((1 2 4 5 6) (1 2 5 6))) "The example '1 to 6 without 3 and 4' is ambiguous." "The syntactic ambiguity leads to a semantic ambiguity." "We can define a new grammar that eliminates some ambiguities:" (*grammar6* @ 669) ((use *grammar6*)) "With this new grammar, we can get single interpretations out of most inputs" ((meanings '(1 to 6 without 3 and 4)) => ((1 2 5 6))) ((meanings '(1 and 3 to 7 and 9 without 5 and 6)) => ((1 3 4 7 9))) ((meanings '(1 and 3 to 7 and 9 without 5 and 2)) => ((1 3 4 6 7 9 2))) ((meanings '(1 9 8 to 2 0 1)) => ((198 199 200 201))) ((meanings '(1 2 3)) => (123 (123))) (:section "19.6 Parsing with Preferences") ((requires "syntax3")) "We need some compromise between the permissive grammar, which generated" "all possible parses, and the restrictive grammar, which eliminates too" "many parses. To get the 'best' interpretation we will need not only a" "new grammar, we will also need to modify the program to compare the" "relative worth of candidate interpretations." (*grammar7* @ 673) ((use *grammar7*)) "We will need a way to show off the prefernce rankings:" ((all-parses '(1 to 6 without 3 and 4)) @ 675) ((all-parses '(1 and 3 to 7 and 9 without 5 and 6))) ((all-parses '(1 and 3 to 7 and 9 without 5 and 2)) @ 676) "In each case, the preference rules are able to assign higher scores to" "more reasonable interpretations. What we really want is to pick the best." "Here we see some examples:" ((meaning '(1 to 5 without 3 and 4)) => (1 2 5)) ((meaning '(1 to 5 without 3 and 6)) => (1 2 4 5 6)) ((meaning '(1 to 5 without 3 and 6 shuffled))) ((meaning '([ 1 to 5 without [ 3 and 6 ] ] reversed)) => (5 4 2 1)) ((meaning '(1 to 5 to 9)) => NIL) ) (defexamples 20 "Unification Grammars" "Prolog was invented as a formalism to describe the grammar of French." "It is still useful to view a grammar as a set of logic programming clauses." "This chapter describes how that can be done." ((requires "unifgram")) (:section "20.3 A Simple Grammar in DCG Format") "Here is the trivial grammar from page 688 in DCG format:" ((clear-db)) ((rule (S (?pred ?subj)) --> (NP ?agr ?subj) (VP ?agr ?pred)) @ 692) ((rule (NP ?agr (?det ?n)) --> (Det ?agr ?det) (N ?agr ?n))) ((rule (NP 3sg (the male)) --> (:word he)) @ 693) ((rule (NP ~3sg (some objects)) --> (:word they))) ((rule (VP 3sg sleep) --> (:word sleeps))) ((rule (VP ~3sg sleep) --> (:word sleep))) ((rule (Det ?any the) --> (:word the))) ((rule (N 3sg (young male human)) --> (:word boy))) ((rule (N 3sg (young female human)) --> (:word girl))) "We can parse some of the sentences from page 689 (but in DCG format)." "Parsing:" ((?- (S ?sem (He sleeps) ())) :input ".") "Generating:" ((?- (S (sleep (the male)) ?words ())) :input ".") "Enumerating:" ((?- (S ?sem ?words ())) :input ";;;;") "If we want the interpretation of '<NAME>' to be" "(kiss <NAME> <NAME>) not ((lambda (x) (kiss x <NAME>)) <NAME>), then we need" "a way to unify semantic components together. Here's one way:" ((clear-db)) ((rule (S ?pred) --> (NP ?agr ?subj) (VP ?agr ?subj ?pred)) @ 694) ((rule (VP ?agr ?subj ?pred) --> (Verb/tr ?agr ?subj ?pred ?obj) (NP ?any-agr ?obj))) ((rule (VP ?agr ?subj ?pred) --> (Verb/intr ?agr ?subj ?pred))) ((rule (Verb/tr ~3sg ?x (kiss ?x ?y) ?y) --> (:word kiss))) ((rule (Verb/tr 3sg ?x (kiss ?x ?y) ?y) --> (:word kisses))) ((rule (Verb/tr ?any ?x (kiss ?x ?y) ?y) --> (:word kissed))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) "Here are the rules for noun phrases and nouns" ((rule (NP ?agr ?sem) --> (Name ?agr ?sem))) ((rule (NP ?agr (?det-sem ?noun-sem)) --> (Det ?agr ?det-sem) (Noun ?agr ?noun-sem))) ((rule (Name 3sg <NAME> <NAME>) --> (:word Terry))) ((rule (Name 3sg <NAME>) --> (:word <NAME>))) ((rule (Noun 3sg (young male human)) --> (:word boy)) @ 695) ((rule (Noun 3sg (young female human)) --> (:word girl))) ((rule (Noun ~3sg (group (young male human))) --> (:word boys))) ((rule (Noun ~3sg (group (young female human))) --> (:word girls))) ((rule (Det ?any the) --> (:word the))) ((rule (Det 3sg a) --> (:word a))) "This grammar and lexicon generates more sentences, although it is still" "rather limited. Here are some examples:" ((?- (S ?sem (The boys kiss a girl) ())) @ 695 :input ";.") ((?- (S ?sem (The girls kissed the girls) ())) :input ";.") ((?- (S ?sem (<NAME> kissed the girl) ())) :input ";.") ((?- (S ?sem (The girls kisses the boys) ())) :input ";.") ((?- (S ?sem (<NAME> kissed a girls) ())) :input ";.") ((?- (S ?sem (<NAME> sleeps Jean) ())) :input ";.") (:section "20.4 A DCG Grammar with Quantifiers") ((clear-db)) ((rule (Det ?any ?x ?p ?q (the ?x (and ?p ?q))) --> (:word the)) @ 697) ((rule (Det 3sg ?x ?p ?q (exists ?x (and ?p ?q))) --> (:word a))) ((rule (Det 3sg ?x ?p ?q (all ?x (-> ?p ?q))) --> (:word every))) ((rule (Noun 3sg ?x (picture ?x)) --> (:word picture)) @ 698) ((rule (Noun 3sg ?x (story ?x)) --> (:word story))) ((rule (Noun 3sg ?x (and (young ?x) (male ?x) (human ?x))) --> (:word boy))) ((rule (NP ?agr ?x ?pred ?pred) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?pred ?np) --> (Det ?agr ?x ?noun&rel ?pred ?np) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?noun ?noun&rel))) ((rule (rel-clause ?agr ?x ?np ?np) --> )) ((rule (rel-clause ?agr ?x ?np (and ?np ?rel)) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Verb/tr ~3sg ?x ?y (paint ?x ?y)) --> (:word paint)) @ 699) ((rule (Verb/tr 3sg ?x ?y (paint ?x ?y)) --> (:word paints))) ((rule (Verb/tr ?any ?x ?y (paint ?x ?y)) --> (:word painted))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) ((rule (Verb/intr 3sg ?x (sells ?x)) --> (:word sells))) ((rule (Verb/intr 3sg ?x (stinks ?x)) --> (:word stinks))) ((rule (VP ?agr ?x ?vp) --> (Verb/tr ?agr ?x ?obj ?verb) (NP ?any-agr ?obj ?verb ?vp))) ((rule (VP ?agr ?x ?vp) --> (Verb/intr ?agr ?x ?vp))) ((rule (S ?np) --> (NP ?agr ?x ?vp ?np) (VP ?agr ?x ?vp))) "Now we define a function to show the output from a query." "In the book, you just saw the output of such a function." ((defun do-s (words) (top-level-prove `((S ?sem ,words ()))))) ((do-s '(Every picture paints a story)) :input "." @ 699) ((do-s '(Every boy that paints a picture sleeps)) :input ".") ((do-s '(Every boy that sleeps paints a picture)) :input ".") ((do-s '(Every boy that paints a picture that sells paints a picture that stinks)) :input "." @ 700) (:section "20.5 Preserving Quantifier Scope Ambiguity") ((clear-db)) ((rule (S (and ?np ?vp)) --> (NP ?agr ?x ?np) (VP ?agr ?x ?vp)) @ 701) ((rule (VP ?agr ?x (and ?verb ?obj)) --> (Verb/tr ?agr ?x ?o ?verb) (NP ?any-agr ?o ?obj))) ((rule (VP ?agr ?x ?verb) --> (Verb/intr ?agr ?x ?verb))) ((rule (NP ?agr ?name t) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?det) --> (Det ?agr ?x (and ?noun ?rel) ?det) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?rel))) ((rule (rel-clause ?agr ?x t) --> )) ((rule (rel-clause ?agr ?x ?rel) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Name 3sg <NAME>) --> (:word T<NAME>))) ((rule (Name 3sg <NAME>) --> (:word Jean))) ((rule (Det 3sg ?x ?restr (all ?x ?restr)) --> (:word every))) ((rule (Noun 3sg ?x (man ?x)) --> (:word man))) ((rule (Verb/tr 3sg ?x ?y (love ?x ?y)) --> (:word loves))) ((rule (Verb/intr 3sg ?x (lives ?x)) --> (:word lives))) ((rule (Det 3sg ?x ?res (exists ?x ?res)) --> (:word a))) ((rule (Noun 3sg ?x (woman ?x)) --> (:word woman))) "Here is an example of the new representation:" ((do-s '(every man loves a woman)) :input "." @ 701) ) (defexamples 21 "A Grammar of English" ((if (boundp 'clear-db) (clear-db)) @ 715) ((requires "grammar" "lexicon")) ((prolog-compile-symbols)) (:section "21.10 Word Categories") ((?- (word sees verb ?infl ?senses)) :input ".") ((try S <NAME> promised <NAME> to persuade <NAME> to sleep) :input ";;;.") (:section "21.14 Examples") ((try S When did <NAME> promise <NAME> to persuade <NAME> to sleep) @ 746 :input ";;;.") ((try S Kim would not have been looking for Lee) @ 747 :input ";;;.") ((try s It should not surprise you that Kim does not like Lee) :input ";;;.") ) (defexamples 22 "Scheme: An Uncommon Lisp" "This chapter presents the Scheme dialect of Lisp and an interpreter for it." "Understanding the interpreter can give you a better appreciation of Lisp." (:section "22.1 A Scheme Interpreter") ((requires "interp1")) "We're ready to try out the interpreter. Note we provide an argument" "to avoid going into a read-eval-print loop with SCHEME. This is a new" "functionality, no in the book, added to make these examples easier." ((scheme '(+ 2 2)) @ 760 => 4 ) ((scheme '((if (= 1 2) * +) 3 4)) => 7) ((scheme '((if (= 1 1) * +) 3 4)) => 12 @ 761) ((scheme '(set! fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))))) ((scheme '(fact 5)) => 120) ((scheme '(set! table (lambda (f start end) (if (<= start end) (begin (write (list start (f start))) (newline) (table f (+ start 1) end))))))) ((scheme '(table fact 1 10)) => NIL ) ((scheme '(table (lambda (x) (* x x x)) 5 10)) => NIL) (:section "22.2 Syntactic Extension with Macros") "Scheme has a number of special forms that were not listed above." "These can be implemented by macros (although macros are not officially" "part of Scheme). We can test out the macro facility:" ((scheme-macro-expand '(and p q)) => (IF P (AND Q)) @ 765) ((scheme-macro-expand '(and q)) => Q) ((scheme-macro-expand '(let ((x 1) (y 2)) (+ x y))) => ((LAMBDA (X Y) (+ X Y)) 1 2)) ((scheme-macro-expand '(letrec ((even? (lambda (x) (or (= x 0) (odd? (- x 1))))) (odd? (lambda (x) (even? (- x 1))))) (even? z)))) "Now let's look at uses of the macros DEFINE and LET*" ((scheme '(define (reverse l) (if (null? l) nil (append (reverse (cdr l)) (list (car l)))))) => REVERSE) ((scheme '(reverse '(a b c d))) => (D C B A)) ((scheme '(let* ((x 5) (y (+ x x))) (if (or (= x 0) (and (< 0 y) (< y 20))) (list x y) (+ y x)))) => (5 10)) (:section "22.4 Throw, Catch, and Call/cc") ((requires "interp3")) "Non-local flow of control is provided in Scheme with a very general and" "powerful procedure, CALL-WITH-CURRENT-CONTINUATION, which is often" "abbreviated CALL/CC. Here are some examples:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 300))))) @ 770 => 321) "The above example ignores CC and computes (+ 1 (+ 20 300))" "The next example does make use of CC:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 (cc 300)))))) => 301) "The above passes 300 to CC, thus bypassing the addition of 20." "It effectively throws 300 out to the catch point established by call/cc." ) (defexamples 23 "Compiling Lisp" "Compilers are simple to write and useful to know about." "In this chapter we develop a simple compiler for Scheme." "" ((requires "compile1")) "Now we are ready to show the simple compiler at work:" ((comp-show '(if (= x y) (f (g x)) (h x y (h 1 2)))) @ 791) "Here are some places where a compiler could do better than an interpreter" "(although our compiler currently does not):" ((comp-show '(begin "doc" (write x) y)) @ 792) "We should not have to push 'doc' on the stack just to pop it off." "Here's another example:" ((comp-show '(begin (+ (* a x) (f x)) x))) "Here's an example using local variables:" ((comp-show '((lambda (x) ((lambda (y z) (f x y z)) 3 x)) 4)) @ 794) (:section "23.1 A Properly Tail-Recursive Compiler") "Notice the two new instructions, CALLJ and SAVE" ((requires "compile2")) "First we see how nested function calls work:" ((comp-show '(f (g x))) @ 796) "In the next example we see that unneeded constants and variables in BEGIN" "expressions are ignored:" ((comp-show '(begin "doc" x (f x) y)) @ 797) ((comp-show '(begin (+ (* a x) (f x)) x))) "Here are some examples of IF expressions:" ((comp-show '(if p (+ x y) (* x y))) @ 801) "If we put the same code inside a BEGIN we get something quite different:" ((comp-show '(begin (if p (+ x y) (* x y)) z)) @ 802) "Here are some more examples of the compiler at work:" ((comp-show '(if (null? (car l)) (f (+ (* a x) b)) (g (/ x 2)))) @ 806) ((comp-show '(define (last1 l) (if (null? (cdr l)) (car l) (last1 (cdr l))))) @ 807) ((comp-show '(define (length l) (if (null? l) 0 (+ 1 (length (cdr l)))))) @ 808) "Of course, it is possible to write LENGTH in tail-recursive fashion:" ((comp-show '(define (length l) (letrec ((len (lambda (l n) (if (null? l) n (len (rest l) (+ n 1)))))) (len l 0))))) (:section "23.4 A Peephole Optimizer") "In this section we investigate a simple technique that will generate" "slightly better code in cases where the compiler is less than perfect." ((requires "compile3" "compopt")) ((comp-show '(begin (if (if t 1 (f x)) (set! x 2)) x)) @ 818) )
true
;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*- ;;;; Code from Paradigms of AI Programming ;;;; Copyright (c) 1991, 1996 PI:NAME:<NAME>END_PI (requires "tutor") (defexamples 1 "Introduction to Lisp" "This chapter is for people with little or no experince in Lisp." "Intermediate or advanced readers can skim or skip this chapter." "" "Lisp expressions are in prefix notation: the operator first." ((+ 2 2) => 4 @ 4) ((+ 1 2 3 4 5 6 7 8 9 10) => 55 @ 5) "This is Lisp for (900 + 900 + 90 + 9) - (5000 + 500 + 50 + 5)" ((- (+ 9000 900 90 9) (+ 5000 500 50 5)) => 4444) (:section "1.1 Symbolic Computation") "This is an example of computation on lists:" ((append '(PI:NAME:<NAME>END_PI) '(PI:NAME:<NAME>END_PI)) => (PAT KIM ROBIN SANDY) @ 6) "The quote mark instructs Lisp to treat the list as data." ('(pat Kim) => (PAT KIM)) "Let's look at some more list processing functions" (:section "1.4 Lists") ((setf p '(PI:NAME:<NAME>END_PI Q Public)) @ 10) ((first p)) ((rest p)) ((second p)) ((third p)) ((fourth p)) ((length p)) "It is also possible to build up new lists" (p @ 11) ((cons 'Mr p)) ((cons (first p) (rest p))) ((setf town (list 'Anytown 'USA))) ((list p 'of town 'may 'have 'already 'won!)) ((append p '(of) town '(may have already won))) (p) (:section "1.5 Defining New Functions") "The special form DEFUN stands for 'define function.'" "It is used here to define a new function called last-name:" ((requires "intro")) ((last-name p) => PUBLIC @ 13) ((last-name '(PI:NAME:<NAME>END_PI)) => MD) ((last-name '(Spot)) => PI:NAME:<NAME>END_PI) ((last-name '(PI:NAME:<NAME>END_PI)) => PI:NAME:<NAME>END_PI) "We can also define the function first-name." "Even though the definition is trivial (it is the same as FIRST)," "it is good practice to define first-name explicitly." (p) ((first-name p) => PI:NAME:<NAME>END_PI) ((first-name '(PI:NAME:<NAME>END_PI)) => PI:NAME:<NAME>END_PI) ((setf names '((PI:NAME:<NAME>END_PI) (PI:NAME:<NAME>END_PI) (PI:NAME:<NAME>END_PI) (Spot) (PI:NAME:<NAME>END_PI) (PI:NAME:<NAME>END_PI) (Z Z Top) (PI:NAME:<NAME>END_PI) (PI:NAME:<NAME>END_PI))) @ 14) ((first-name (first names)) => PI:NAME:<NAME>END_PI) (:section "1.6 Using Functions") "Consider the following expression, which can be used to test LAST-NAME:" ((mapcar #'last-name names)) "The #' notation maps the name of a function to the function itself." ((mapcar #'- '(1 2 3 4)) @ 15) ((mapcar #'+ '(1 2 3 4) '(10 20 30 40))) "Now that we understand mapcar, let's use it to test FIRST-NAME:" ((mapcar #'first-name names)) "Suppose we wanted a version of FIRST-NAME that ignored titles like Miss:" ((defparameter *titles* '(Mr Mrs Miss Ms Sir Madam Dr Admiral Major General) "A list of titles that can appear at the start of a name.")) ((defun first-name (name) "Select the first name from a name represented as a list." (if (member (first name) *titles*) (first-name (rest name)) (first name))) @ 16) ((mapcar #'first-name names)) ((first-name '(PI:NAME:<NAME>END_PI Major General PI:NAME:<NAME>END_PI)) => PI:NAME:<NAME>END_PI) "We can see how this works by tracing the execution of first-name:" ((trace first-name)) ((first-name '(PI:NAME:<NAME>END_PI)) => JOHN @ 17) ((first-name '(PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI)) => PAULA) ((untrace first-name)) (:section "1.7 Higher-Order Functions") ((apply #'+ '(1 2 3 4)) => 10) ((apply #'append '((1 2 3) (a b c)))) "Now we define a new function, self-and-double, and apply it to arguments." ((defun self-and-double (x) (list x (+ x x)))) ((self-and-double 3) => (3 6)) ((apply #'self-and-double '(3)) => (3 6)) "Now let's return to the mapping functions:" ((mapcar #'self-and-double '(1 10 300))) ((mappend #'self-and-double '(1 10 300))) "FUNCALL is similar to APPLY; it too takes a function as its" "first argument and applies the function to a list of arguments," "but in the case of FUNCALL, the arguments are listed separately:" ((funcall #'+ 2 3) => 5 @ 20) ((apply #'+ '(2 3)) => 5) ) (defexamples 2 "A Simple Lisp Program" "This chapter shows how to combine the basic functions and" "special forms of Lisp into a complete program" "The program generates random English sentences." (:section "2.2 A Straightforward Solution") "We can test the program by generating a few random sentences." "(Note that since these are random, you won't get the same ones" "as in the book.)" ((requires "simple")) ((sentence) @ 36) ((sentence) @ 36) ((sentence) @ 36) ((noun-phrase)) ((verb-phrase)) ((trace sentence noun-phrase verb-phrase article noun verb) @ 37) ((sentence)) ((untrace)) (:section "2.3 A Rule-Based Solution") "An alternative implementation concentrates on making it easy" "to write grammar rules." ((generate 'sentence) @ 41) ((generate 'sentence) @ 41) ((generate 'noun-phrase) @ 41) ((generate 'verb-phrase) @ 41) "One advantage of this approach is its easier to change grammars." ((setf *grammar* *bigger-grammar*) @ 43) ((generate 'sentence)) ((generate 'sentence)) "Another advantage is that the same data (grammar) can be used" "for more than one purpose. Consider generate-tree:" ((generate-tree 'sentence) @ 45)) (defexamples 3 "Overview of Lisp" "This chapter briefly covers the most important special forms and" "functions in Lisp." (:section "3.2 Special Forms") "Start with functions and special forms for repetition:" "First, functions like MAPCAR can apply to any number of lists:" ((mapcar #'- '(1 2 3)) => (-1 -2 -3) @ 61) ((mapcar #'+ '(1 2) '(10 20) '(100 200)) => (111 222)) "Second, many of the functions accept keywords:" ((remove 1 '(1 2 3 2 1 0 -1)) => (2 3 2 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :key #'abs) => (2 3 2 0) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :test #'<) => (1 1 0 -1) @ 61) ((remove 1 '(1 2 3 2 1 0 -1) :start 4) => (1 2 3 2 0 -1) @ 61) "Third, some have corresponding -IF or -IF-NOT versions:" ((remove-if #'oddp '(1 2 3 2 1 0 -1)) => (2 2 0)) ((remove-if-not #'oddp '(1 2 3 2 1 0 -1)) => (1 3 1 -1)) "The forms TRACE and UNTRACE are used to control debugging info:" ((requires "overview")) ((trace length9) @ 65) ((length9 '(1 b c)) => 3) ((untrace length9)) ((length9 '(1 b c)) => 3) (:section "3.7 Functions on Trees") ((setf tree '((a b) ((c)) (d e))) @ 76) ((tree-equal tree (copy-tree tree)) => t) ((same-shape-tree tree '((1 2) ((3)) (4 5))) => t) ((same-shape-tree tree '((1 2) (3) (4 5))) => nil) "There are two functions for substituting a new expression into a tree:" ((subst 'new 'old '(old ((very old)))) => (NEW ((VERY NEW)))) ((sublis '((old . new)) '(old ((very old)))) => (NEW ((VERY NEW)))) ((subst 'new 'old 'old) => NEW) "Here is an example:" ((english->french '(hello my friend - how are you today?)) => (bonjour mon ami - comment va tu today?) @ 77) (:section "3.10 Destructive Functions") "Consider the following:" ((setq x '(a b c)) @ 80) ((setq y '(1 2 3))) ((nconc x y) => (a b c 1 2 3)) (x => (a b c 1 2 3)) (y => (1 2 3)) "NCONC computes the same result as APPEND, but it alters the first argument." "It is called a 'destructive' function." "There is quite a conceptual load on the programmer who uses NCONC." "The advantage of NCONC is that it doesn't use any storage." "" (:section "3.11 Overview of Data Types") "The function TYPE-OF returns the type of its argument." ((type-of 123) => fixnum @ 82) ((typep 123 'fixnum) => t) ((typep 123 'integer) => t) ((typep 123.0 'integer) => nil) ((subtypep 'fixnum 'integer) => t) (:section "3.12 Input/Output") "FORMAT is the main function for formatted output:" ((format t "hello, world") @ 84) ((format t "~&~a plus ~s is ~f" "two" "two" 4)) ((let ((numbers '( 1 2 3 4 5))) (format t "~&~{~r~^ plus ~} is ~@r" numbers (apply #'+ numbers)))) (:section "3.13 Debugging tools") ((documentation 'first 'function) @ 87) ((documentation 'pi 'variable)) (:section "3.14 Antibugging Tools") ((defun f (n) (dotimes (i n) nil)) @ 90) ((time (f 10000))) ((compile 'f)) ((time (f 10000))) (:section "3.15 Evaluation") "The following five forms are equivalent:" ((+ 1 2 3 4) => 10 @ 91) ((funcall #'+ 1 2 3 4) => 10 @ 91) ((apply #'+ '(1 2 3 4)) => 10 @ 91) ((apply #'+ 1 2 '(3 4)) => 10 @ 91) ((eval '(+ 1 2 3 4)) => 10 @ 91) (:section "3.16 Closures") "In the general case, a function consists of the body of the function" "coupled with any free lexical variables that the function references." "Consider the example:" ((mapcar (adder 3) '(1 3 10)) => (4 6 13) @ 92) ((mapcar (adder 10) '(1 3 10)) => (11 13 20) @ 92) "In the following, two calls to BANK-ACCOUNT create two different closures," "each with a separate value for the lexical variable BALANCE." ((setf my-account (bank-account 500.00)) @ 92) ((setf your-account (bank-account 250.00)) @ 93) ((funcall my-account 'withdraw 75.00) => 425.0) ((funcall your-account 'deposit 250.00) => 500.0) ((funcall your-account 'withdraw 100.00) => 400.0) ((funcall my-account 'withdraw 25.00) => 400.0) "This style of programming is covered in more detail in chapter 13." ) (defexamples 4 "GPS: The General Problem Solver" "The General problem Solver, developed in 1957 by PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI" "PI:NAME:<NAME>END_PI, embodied a grandiose vision: a single computer program that could" "solve ANY problem. GPS caused quite a stir ..." (:section "4.4 Stage 4: test") ((requires "gps1")) "Here are some examples of using GPS" "The first example works with a complex chain of steps." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school) *school-ops*) => SOLVED @ 118) "The next example fails because there is no way to make the car work," "because we can't contact the shop to get the battery fixed." ((gps '(son-at-home car-needs-battery have-money) '(son-at-school) *school-ops*) => NIL) "The third example is easy, because the car is currently working." ((gps '(son-at-home car-works) '(son-at-school) *school-ops*) => SOLVED) (:section "4.7 The Clobbered Sibling Goal Problem") "In the next example, GPS incorrectly reports success, when in fact it has" "spent the money on the battery, and thus should fail." ((gps '(son-at-home have-money car-works) '(have-money son-at-school) *school-ops*) => SOLVED @ 120) "The bug is that when (EVERY #'ACHIEVE GOALS) returns true, it means all the" "goals were achieved in turn, but they might not still be all true." (:section "4.8 The Leaping before You Look Problem") "What happens if we move the HAVE-MONEY goal to the end?" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school) *school-ops*) => SOLVED @ 121) "GPS returns nil, but only after executing all the actions." "I call this the 'leaping before you look' problem, because if you asked" "the program to solve for the two goals (JUMP-OFF-CLIFF LAND-SAFELY) it" "would happily jump first, only to discover that it had no operator to land" "safely. This is less than prudent behavior." (:section "4.9 The Recursive Subgoal Problem") "We won't show the problem (because it gets into an infinite loop)," "but we will add the new operator to the *school-ops*; we'll use it later." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*) @ 122) (:section "4.11 GPS Version 2: A More General problem Solver") "At this point we are ready to put together a new version of GPS with" "solutions for the 'running around the block,' 'prerequisite clobbers" "sibling goal,' 'leaping before you look,' and 'recursive subgoal' problems." "The most important change is that, instead of printing a message when each" "operator is applied, we will instead have GPS return the resulting state." ((requires "gps")) "We use the list of operators that includes the 'asking the shop their" "phone number' operator." ((push (make-op :action 'ask-phone-number :preconds '(in-communication-with-shop) :add-list '(know-phone-number)) *school-ops*)) ((use *school-ops*) => 7 @ 130) "First we make sure the new version works on some of the examples that" "version 1 worked on:" ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) "We can see what is going on here by turning on debugging temporarily:" ((debug :gps)) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school)) => ((START) (EXECUTING LOOK-UP-NUMBER) (EXECUTING TELEPHONE-SHOP) (EXECUTING TELL-SHOP-PROBLEM) (EXECUTING GIVE-SHOP-MONEY) (EXECUTING SHOP-INSTALLS-BATTERY) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 131) ((undebug)) "Here is another old example:" ((gps '(son-at-home car-works) '(son-at-school)) => ((START) (EXECUTING DRIVE-SON-TO-SCHOOL)) @ 132) "Now we see that version 2 can handle the three cases version 1 got wrong." "In each case the program avoids an infinite loop, and also avoids leaping" "before it looks." ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(have-money son-at-school)) => NIL) ((gps '(son-at-home car-needs-battery have-money have-phone-book) '(son-at-school have-money)) => NIL) ((gps '(son-at-home car-needs-battery have-money) '(son-at-school)) => NIL) "Finally, we see the new GPS also works on trivial problems:" ((gps '(son-at-home) '(son-at-home)) => ((START))) (:section "4.12 The New Domain Problem: Monkey and Bananas") "To show that GPS is at all general, we have to make it work in different" "domains. We start with a 'classic' AI problem: Monkey and Bananas" ((use *banana-ops*) => 6 @ 133) "We pose the problem of becoming not-hungry, given an initial state." "GPS can find a solution to this problem:" ((GPS '(at-door on-floor has-ball hungry chair-at-door) '(not-hungry)) => ((START) (EXECUTING PUSH-CHAIR-FROM-DOOR-TO-MIDDLE-ROOM) (EXECUTING CLIMB-ON-CHAIR) (EXECUTING DROP-BALL) (EXECUTING GRASP-BANANAS) (EXECUTING EAT-BANANAS)) @ 133) "Notice we did not need to make any changes at all to the GPS program." "We just used a different set of operators." (:section "4.13 The Maze Searching Domain") "Next we will consider another 'classic' problem, maze searching." "We will assume a particular maze, diagrammed on page 134." ((use *maze-ops*) => 48 @ 134) ((gps '((at 1)) '((at 25))) @ 135) "We can define FIND-PATH to use the results of a GPS search:" ((find-path 1 25) @ 136 => (1 2 3 4 9 8 7 12 11 16 17 22 23 24 19 20 25)) ((find-path 1 1) => (1)) ((equal (find-path 1 25) (reverse (find-path 25 1))) => T) (:section "4.14 The Blocks World Domain") "Another domain that has attracted more than its share of attention in AI" "circles is the blocks world domain." ((use (make-block-ops '(a b))) => 4 @ 137) "The simplest possible problem is stacking one block on another." ((gps '((a on table) (b on table) (space on a) (space on b) (space on table)) '((a on b) (b on table))) => ((START) (EXECUTING (MOVE A FROM TABLE TO B)))) "Here is a slightly more complex problem: inverting a stack of two blocks." "This time we show the debugging output:" ((debug :gps) @ 138) ((gps '((a on b) (b on table) (space on a) (space on table)) '((b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO A)))) ((undebug)) "Now we move on to the three block world." ((use (make-block-ops '(a b c))) => 18) "We try some problems:" ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table)) '((c on table) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 141) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((b on a) (c on b))) @ 141 => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) ((gps '((a on b) (b on c) (c on table) (space on a) (space on table)) '((c on b) (b on a))) => ((START) (EXECUTING (MOVE A FROM B TO TABLE)) (EXECUTING (MOVE B FROM C TO A)) (EXECUTING (MOVE C FROM TABLE TO B)))) "The Sussman Anomaly" ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 142) ((gps start '((a on b) (b on c))) => NIL) ((gps start '((b on c) (a on b))) => NIL) (:section "4.16 The Not Looking after You Don't Leap Problem") ((use (push (op 'taxi-son-to-school :preconds '(son-at-home have-money) :add-list '(son-at-school) :del-list '(son-at-home have-money)) *school-ops*)) @ 143) ((debug :gps)) ((gps '(son-at-home have-money car-works) '(son-at-school have-money)) => NIL) ((undebug)) ) (defexamples 5 "Eliza: Dialog with a Machine" "ELIZA was one of the first programs to feature English output as well as input." "The program was named after the heroine of Pygmalion, who was taught to" "speak proper English by a dedicated teacher." (:section "5.2 Pattern Matching") ((requires "eliza1")) "The hard part is the notion of pattern matching and transformation." "All symbols beginning with ? are variables for the pattern matcher." "First we see how to substitute variable/value pairs into expressions:" ((sublis '((?X . vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 156) "Now a version of pat-match that works with such pairs:" ((pat-match '(I need a ?x) '(I need a vacation)) @ 158) "Showing how to plug it in:" ((sublis (pat-match '(I need a ?x) '(I need a vacation)) '(what would it mean to you if you got a ?X ?)) => (what would it mean to you if you got a VACATION ?) @ 159) ((pat-match '(I need a ?x) '(I really need a vacation)) => nil) ((pat-match '(this is easy) '(this is easy)) => ((t . t))) ((pat-match '(?x is ?x) '((2 + 2) is 4)) => nil) ((pat-match '(?x is ?x) '((2 + 2) is (2 + 2))) => ((?x 2 + 2))) ((pat-match '(?P need . ?X) '(I need a long vacation)) => ((?X a long vacation) (?P . I))) (:section "5.3 Segment Pattern Matching") "We show how to have a variable that will match more than one element." "We call these segment variables, and denote them (?* name)." ((pat-match '((?* ?p) need (?* ?x)) '(PI:NAME:<NAME>END_PI and I need a vacation)) @ 160) (:section "5.4 The Eliza Program: A Rule-Based Translator") ((requires "eliza")) "We can't show you an interactive ELIZA session, because the replies are" "random, and thus change every time. You can experiment on your own by" "evaluating (ELIZA) and typing in your end of the conversation. Type (good bye) when you are done." ) (defexamples 6 "Building Software Tools" "In chapters 4 and 5 we were concerned with buildinng two particular" "programs, GPS and ELIZA. In this chapter, we will reexamine those" "two programs to discover some common patterns. Those patterns will be" "abstracted out to form reusable software tools." (:section "6.2 A Pattern-Matching tool") ((requires "patmatch")) ((pat-match '(x = (?is ?n numberp)) '(x = 34)) => ((?n . 34)) @ 179) ((pat-match '(x = (?is ?n numberp)) '(x = x)) => NIL) ((pat-match '(?x (?or < = >) ?y) '(3 < 4)) => ((?Y . 4) (?X . 3))) ((pat-match '(x = (?and (?is ?n numberp) (?is ?n oddp))) '(x = 3)) => ((?N . 3))) ((pat-match '(?x /= (?not ?x)) '(3 /= 4)) => ((?X . 3)) @ 180) ((pat-match '(?x > ?y (?if (> ?x ?y))) '(4 > 3)) => ((?Y . 3) (?X . 4))) ((pat-match '(a (?* ?x) d) '(a b c d)) => ((?X B C)) @ 185) ((pat-match '(a (?* ?x) (?* ?y) d) '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(a (?* ?x) (?* ?y) ?x ?y) '(a b c d (b c) (d))) => ((?Y D) (?X B C)) @ 186) ((pat-match '(?x ?op ?y is ?z (?if (eql (funcall ?op ?x ?y) ?z))) '(3 + 4 is 7)) => ((?Z . 7) (?Y . 4) (?OP . +) (?X . 3))) ((pat-match '(?x ?op ?y (?if (funcall ?op ?x ?y))) '(3 > 4)) => NIL) ((pat-match-abbrev '?x* '(?* ?x)) => (?* ?X) @ 187) ((pat-match-abbrev '?y* '(?* ?y)) => (?* ?Y)) ((setf axyd (expand-pat-match-abbrev '(a ?x* ?y* d))) => (A (?* ?X) (?* ?Y) D)) ((pat-match axyd '(a b c d)) => ((?Y B C) (?X))) ((pat-match '(((?* ?x) (?* ?y)) ?x ?y) '((a b c d) (a b) (c d))) => NIL) ((requires "eliza-pm")) (:section "6.4 A Set of Searching Tools") ((requires "search")) ((debug :search) @ 192) "We can search through the binary tree, looking for, say, 12 as the goal." "With breadth-first search this would yield an infinite loop, so we won't" "do it. Breadth-first search works better:" ((breadth-first-search 1 (is 12) 'binary-tree) => 12 @ 193) ((depth-first-search 1 (is 12) (finite-binary-tree 15)) => 12 @ 193) "Guiding the Search" "Best-first search takes an additional argument which estimates how close" "we are to the goal. We call this the cost function." ((best-first-search 1 (is 12) #'binary-tree (diff 12)) => 12 @ 195) ((best-first-search 1 (is 12) #'binary-tree (price-is-right 12)) => 12) "The function beam-search is just like best-first-search, except that after" "we sort the states, we then take only the first beam-width states." ((beam-search 1 (is 12) #'binary-tree (price-is-right 12) 2) => 12) "As a concrete example of a problem that can be solved by search," "consider planning a flight across North America in a plane whose range is" "limited to 1000 kilometers. Here we plan a trip from SF to Boston." ((path-state (trip (city 'san-francisco) (city 'boston))) => (BOSTON 71.05 42.21) @ 199) ((path-state (trip (city 'boston) (city 'san-francisco))) => (SAN-FRANCISCO 122.26 37.47)) ((undebug :search)) ((show-city-path (trip (city 'san-francisco) (city 'boston) 1)) @ 201) ((show-city-path (trip (city 'boston) (city 'san-francisco) 1))) ((show-city-path (trip (city 'boston) (city 'san-francisco) 3)) @ 202) ((iter-wide-search 1 (is 12) (finite-binary-tree 15) (diff 12)) => 12 @ 205) ((tree-search '(1) (is 6) #'next2 #'prepend) => 6 @ 208) ((graph-search '(1) (is 6) #'next2 #'prepend) => 6) ((path-states (a*-search (list (make-path :state 1)) (is 6) #'next2 #'(lambda (x y) 1) (diff 6))) => (6 5 3 1) @ 210) (:section "6.5 GPS as Search") ((requires "gps-srch")) ((setf start '((c on a) (a on table) (b on table) (space on c) (space on b) (space on table))) @ 213) ((use (make-block-ops '(a b c))) => 18) ((search-gps start '((a on b) (b on c))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B))) @ 213) ((search-gps start '((b on c) (a on b))) => ((START) (EXECUTING (MOVE C FROM A TO TABLE)) (EXECUTING (MOVE B FROM TABLE TO C)) (EXECUTING (MOVE A FROM TABLE TO B)))) ) (defexamples 7 "STUDENT: Solving Algebra Word Problems" "STUDENT was another early language understanding program, written by PI:NAME:<NAME>END_PI" "Bobrow in 1964. It was designed to read and solve the kind of word" "problems found in high school algebra books." (:section "7.1 Translating English into Equations") ((requires "student")) ((translate-to-expression '(if z is 3 |,| what is twice z)) => ((= z 3) (= what (* 2 z))) @ 222) (:section "7.2 Solving Algebra Equations") ((trace isolate solve) @ 229) ((solve-equations '((= (+ 3 4) (* (- 5 (+ 2 x)) 7)) (= (+ (* 3 x) y) 12))) => nil) ((untrace isolate solve)) (:section "7.3 Examples") ((student '(If the number of customers PI:NAME:<NAME>END_PI gets is twice the square of 20 % of the number of advertisements he runs |,| and the number of advertisements is 45 |,| then what is the number of customers PI:NAME:<NAME>END_PI gets ?)) => nil @ 231) ((student '(The daily cost of living for a group is the overhead cost plus the running cost for each person times the number of people in the group |.| This cost for one group equals $ 100 |,| and the number of people in the group is 40 |.| If the overhead cost is 10 times the running cost |,| find the overhead and running cost for each person |.|))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 4 feet tall |,| how old is Fran ?))) ((student '(Fran's age divided by Robin's height is one half Kelly's IQ |.| Kelly's IQ minus 80 is Robin's height |.| If Robin is 0 feet tall |,| how old is Fran ?))) ) (defexamples 8 "Symbolic Mathematics: A Simplification Program" "'Symbolic mathematics' is to numerical mathematics as algebra is to" "arithmetic: it deals with variables and expressions, not just numbers." "This chapter develops a program that simplifies algebraic expressions." "We then show that differentiation and even integration can be seen as" "special cases of 'simplification.' (Note that we replace calls to the" "interactive function SIMPLIFIER with calls to the function SIMP.)" (:section "8.2 Simplification Rules") ((requires "macsymar")) ((simp '(2 + 2)) => 4 @ 245) ((simp '(5 * 20 + 30 + 7)) => 137 ) ((simp '(5 * x - (4 + 1) * x)) => 0 ) ((simp '(y / z * (5 * x - (4 + 1) * x))) => 0 ) ((simp '((4 - 3) * x + (y / y - 1) * z)) => X ) ((simp '(1 * f(x) + 0)) => (F X) ) (:section "8.3 Associativity and Commutativity") ((simp '(3 * 2 * x)) => (6 * X) @ 247) ((simp '(2 * x * x * 3)) => (6 * (X ^ 2)) ) ((simp '(2 * x * 3 * y * 4 * z * 5 * 6)) => (720 * (X * (Y * Z))) ) ((simp '(3 + x + 4 + x)) => ((2 * X) + 7) ) ((simp '(2 * x * 3 * x * 4 * (1 / x) * 5 * 6)) => (720 * X)) (:section "8.4 Logs, Trig, and Differentiation") ((simp '(d (x + x) / d x)) => 2 @ 250) ((simp '(d (a * x ^ 2 + b * x + c) / d x)) => ((2 * (A * X)) + B) ) "For the next one, note we had an error in the first printing of the book;" "the sign was reversed on the (d (u / v) ...) rule." ((simp '(d ((a * x ^ 2 + b * x + c) / x) / d x)) => (((X * ((2 * (A * X)) + B)) - ((A * (X ^ 2)) + ((B * X) + C))) / (X ^ 2))) ((simp '(log ((d (x + x) / d x) / 2))) => 0 ) ((simp '(log(x + x) - log x)) => (LOG 2)) ((simp '(x ^ cos pi)) => (1 / X) ) "These next two examples were also affected by the (d (u / v) ...) rule." ((simp '(d (3 * x + (cos x) / x) / d x)) => ((((X * (- (SIN X))) - (COS X)) / (X ^ 2)) + 3)) ((simp '(d ((cos x) / x) / d x)) => (((X * (- (SIN X))) - (COS X)) / (X ^ 2))) ((simp '(d (3 * x ^ 2 + 2 * x + 1) / d x)) => ((6 * X) + 2)) ((simp '(sin(x + x) ^ 2 + cos(d x ^ 2 / d x) ^ 2)) => 1 ) ((simp '(sin(x + x) * sin(d x ^ 2 / d x) + cos(2 * x) * cos(x * d 2 * y / d y))) => 1 ) (:section "8.5 Limits of Rule-Based Approaches") "In this section we return to some examples that pose problems." "For the following, we would prefer (2 * (x + y))" ((simp '(x + y + y + x)) => (X + (Y + (Y + X)))) "For the following, we would prefer (7 * X) and (Y + (8 * X)), respectively:" ((simp '(3 * x + 4 * x)) => ((3 * X) + (4 * X))) ((simp '(3 * x + y + x + 4 * x)) => ((3 * X) + (Y + (X + (4 * X)))) ) "In chapter 15, we develop a new version of the program that handles this problem." (:section "8.6 Integration") ((set-simp-fn 'Int #'(lambda (exp) (integrate (exp-lhs exp) (exp-rhs exp)))) @ 258) ((simp '(Int x * sin(x ^ 2) d x)) => (1/2 * (- (COS (X ^ 2)))) ) ((simp '(Int ((3 * x ^ 3) - 1 / (3 * x ^ 3)) d x)) => ((3 * ((X ^ 4) / 4)) - (1/3 * ((X ^ -2) / -2))) ) ((simp '(Int (3 * x + 2) ^ -2/3 d x)) => (((3 * X) + 2) ^ 1/3) ) ((simp '(Int sin(x) ^ 2 * cos(x) d x)) => (((SIN X) ^ 3) / 3) ) ((simp '(Int sin(x) / (1 + cos(x)) d x)) => (-1 * (LOG ((COS X) + 1))) ) ((simp '(Int (2 * x + 1) / (x ^ 2 + x - 1) d x)) => (LOG ((X ^ 2) + (X - 1))) ) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (8 * ((1/3 * (((X ^ 3) + 2) ^ -2)) / -2)) ) ((set-simp-fn 'Int #'(lambda (exp) (unfactorize (factorize (integrate (exp-lhs exp) (exp-rhs exp)))))) @ 259) ((simp '(Int 8 * x ^ 2 / (x ^ 3 + 2) ^ 3 d x)) => (-4/3 * (((X ^ 3) + 2) ^ -2)) ) ) (defexamples 9 "Efficiency Issues" "One of the reasons Lisp has enjoyed a long history is because it is an" "ideal language for what is called rapid-prototyping or rapid development." "Most real AI programs deal with large amounts of data. Thus, efficiency" "is important. This chapter shows some ways to make programs efficient." (:section "9.1 Caching Results of Previous Computations: Memoization") ((defun fib (n) (if (<= n 1) 1 (+ (fib (- n 1)) (fib (- n 2))))) @ 269) ((setf memo-fib (memo #'fib)) @ 270) ((trace fib)) ((funcall memo-fib 3) => 3 @ 270) ((funcall memo-fib 3) => 3) ((untrace fib)) ((memoize 'fib) @ 272) ((trace fib)) ((fib 5) => 8) ((fib 5) => 8) ((fib 6) => 13) ((untrace fib)) ) (defexamples 10 "Low-Level Efficiency Issues" "The efficiency techniques of the previous chapter all involved fairly" "significant changes to an algorithm. But what happens when you are already" "using the best imaginable algorithms, and performance is still a problem?" (:section "10.1 Use Declarations") "Compare these functions with and without declarations:" ((defun f (x y) (declare (fixnum x y) (optimize (safety 0) (speed 3))) (the fixnum (+ x y))) @ 318) ((defun g (x y) (+ x y))) "Here is the disassembled code for f and g:" ((disassemble 'f)) ((disassemble 'g) @ 319) ) (defexamples 11 "Logic Programming" "The idea behind logic programming is that the programmer should state the" "relationships that describe a problem and its solution." "In this chapter we develop an interpreter for the Prolog language." (:section "11.1 Idea 1: A Uniform Data Base") ((requires "prolog1")) "First let's make sure we're dealing with a brand new database." ((clear-db)) "Facts are entered into the data base with the <- macro" ((<- (likes PI:NAME:<NAME>END_PI)) @ 350) ((<- (likes PI:NAME:<NAME>END_PI))) ((<- (likes PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI))) ((<- (likes PI:NAME:<NAME>END_PI cats))) "We can also enter rules, which state contingent facts." ((<- (likes PI:NAME:<NAME>END_PI ?x) (likes ?x cats)) @ 351) ((<- (likes PI:NAME:<NAME>END_PI ?x) (likes ?x PI:NAME:<NAME>END_PI) (likes ?x PI:NAME:<NAME>END_PI))) (:section "11.2 Idea 2: Unification of Logic Variables") ((requires "unify")) ((pat-match '(?x + ?y) '(2 + 1)) => ((?y . 1) (?x . 2)) @ 352) ((unify '(?x + 1) '(2 + ?y)) => ((?y . 1) (?x . 2))) ((unify '(f ?x) '(f ?y)) => ((?x . ?y))) ((unify '(?a + ?a = 0) '(?x + ?y = ?y)) => ((?y . 0) (?x . ?y) (?a . ?x))) ((unifier '(?a + ?a = 0) '(?x + ?y = ?y)) => (0 + 0 = 0)) "Let's try UNIFY on some (more) examples:" ((unify '(?x ?y a) '(?y ?x ?x)) => ((?y . a) (?x . ?y)) @ 357) ((unify '?x '(f ?x)) => nil) ((unify 'a 'a) => ((t . t))) "Here are some examples of UNIFIER:" ((unifier '(?x ?y a) '(?y ?x ?x)) => (a a a)) ((unifier '((?a * ?x ^ 2) + (?b * ?x) + ?c) '(?z + (4 * 5) + 3)) => ((?a * 5 ^ 2) + (4 * 5) + 3)) "Programming with Prolog" "First we define the MEMBER relation in Prolog:" ((<- (member ?item (?item . ?rest))) @ 358) ((<- (member ?item (?x . ?rest)) (member ?item ?rest))) "Now we can make some queries:" ((?- (member 2 (1 2 3)))) ((?- (member 2 (1 2 3 2 1)))) ((?- (member ?x (1 2 3)))) "Let's add one more rule to the Sandy and the cats facts:" ((<- (likes ?x ?x)) @ 363) "Now we can ask some queries:" ((?- (likes PI:NAME:<NAME>END_PI ?who)) @ 365) ((?- (likes ?who PI:NAME:<NAME>END_PI))) ((?- (likes PI:NAME:<NAME>END_PI))) ((?- (likes ?x ?y) (likes ?y ?x)) @ 366) (:section "11.3 Idea 3: Automatic Backtracking") "Now we load the version that does automatic backtracking one step at a time" "as opposed to the previous version, which collects all answers at once." "Since we don't want to involve you, the user, in typing input to move on" "to the next step, we supply the input (a ; or a .) as in the book." "Unfortunately, it is not specified in Common Lisp whether read-char echoes" "the character it reads, so you may or may not see the ; and . characters." ((requires "prolog")) "Let's add the definition of the relation LENGTH:" ((<- (length () 0)) @ 370) ((<- (length (?x . ?y) (1+ ?n)) (length ?y ?n))) "Here are some queries:" ((?- (length (a b c d) ?n)) :input ";") ((?- (length ?list (1+ (1+ 0)))) :input ";") ((?- (length ?list ?n)) :input ";;.") ((?- (length ?l (1+ (1+ 0))) (member a ?l)) :input ";;") "(We won't try the example that leads to an infinite loop.)" (:section "11.4 The Zebra Puzzle") "First we define the NEXTO and IRIGHT (to the immediate right) relations:" ((<- (nextto ?x ?y ?list) (iright ?x ?y ?list)) @ 374) ((<- (nextto ?x ?y ?list) (iright ?y ?x ?list))) ((<- (iright ?left ?right (?left ?right . ?rest)))) ((<- (iright ?left ?right (?x . ?rest)) (iright ?left ?right ?rest))) ((<- (= ?x ?x))) "Now we define the zebra puzzle:" ((<- (zebra ?h ?w ?z) ;; Each house is of the form: ;; (house nationality pet cigarette drink house-color) (= ?h ((house norwegian ? ? ? ?) ;1,10 ? (house ? ? ? milk ?) ? ?)) ; 9 (member (house englishman ? ? ? red) ?h) ; 2 (member (house spaniard dog ? ? ?) ?h) ; 3 (member (house ? ? ? coffee green) ?h) ; 4 (member (house ukrainian ? ? tea ?) ?h) ; 5 (iright (house ? ? ? ? ivory) ; 6 (house ? ? ? ? green) ?h) (member (house ? snails winston ? ?) ?h) ; 7 (member (house ? ? kools ? yellow) ?h) ; 8 (nextto (house ? ? chesterfield ? ?) ;11 (house ? fox ? ? ?) ?h) (nextto (house ? ? kools ? ?) ;12 (house ? horse ? ? ?) ?h) (member (house ? ? luckystrike oj ?) ?h) ;13 (member (house japanese ? parliaments ? ?) ?h) ;14 (nextto (house norwegian ? ? ? ?) ;15 (house ? ? ? ? blue) ?h) (member (house ?w ? ? water ?) ?h) ;Q1 (member (house ?z zebra ? ? ?) ?h))) ;Q2 "If you want to test this out, run the following query:" " ((?- (zebra ?houses ?water-drinker ?zebra-owner)))" "It is not included as an example because it takes a minute or so to run." ) (defexamples 12 "Compiling Logic Programs" "This chapter presents a compiler that translates from Prolog to Lisp." "Unfortunatley, there's not much to see in terms of examples." "But we load the files for you, in case you want to play with them." ((requires "prologc1" "prologc2" "prologcp")) ((prolog-compile 'likes) @ 389) ((prolog-compile 'member)) ) (defexamples 13 "Object Oriented Programming" "It is only natural that a wide range of programming styles have been" "introduced to attack the wide range of problems in this book." "One style not yet covered is 'object-oriented programming'." "PI:NAME:<NAME>END_PI (1987) proposes the following formula as a definition:" "Object-orientation = Objects + Classes + Inheritance" (:section "13.2 Objects") "Now we're ready to get started." ((requires "clos")) ((setf acct (new-account "PI:NAME:<NAME>END_PI" 1000.00)) @ 438) ((send acct 'withdraw 500.00) => 500.0) ((send acct 'deposit 123.45) => 623.45) ((send acct 'name) => "PI:NAME:<NAME>END_PI") ((send acct 'balance) => 623.45) (:section "13.4 Classes") "Now we define the class ACCOUNT with the define-class macro." ((define-class account (name &optional (balance 0.00)) ((interest-rate .06)) (withdraw (amt) (if (<= amt balance) (decf balance amt) 'insufficient-funds)) (deposit (amt) (incf balance amt)) (balance () balance) (name () name) (interest () (incf balance (* interest-rate balance)))) @ 440) "Here are the generic functions defined by this macro:" ((setf acct2 (account "PI:NAME:<NAME>END_PI. User" 2000.00))) ((deposit acct2 42.00) => 2042.0) ((interest acct2) => 2164.52) ((balance acct2) => 2164.52 @ 441) ((balance acct) => 623.45) (:section "13.5 Delegation") ((define-class password-account (password acct) () (change-password (pass new-pass) (if (equal pass password) (setf password new-pass) 'wrong-password)) (otherwise (pass &rest args) (if (equal pass password) (apply message acct args) 'wrong-password)))) "Now we see how the class PASSWORD-ACCOUNT can be used to provide protection" "for an existing account:" ((setf acct3 (password-account "secret" acct2)) @ 441) ((balance acct3 "secret") => 2164.52) ((withdraw acct3 "guess" 2000.00) => WRONG-PASSWORD) ((withdraw acct3 "secret" 2000.00) => 164.52) (:section "13.7 CLOS: The Common Lisp Object System") "Because some Lisp implementations can't convert a structure class into" "a CLOS class, nor convert a regular function into a generic function," "we use the names account*, name*, balance*, interest-rate*. If you were" "doing a real application, not just some examples, you would choose one" "implementation and get to use the regular names." ; ?????? some problems here ((defclass account* () ((name :initarg :name :reader name*) (balance :initarg :balance :initform 0.00 :accessor balance*) (interest-rate :allocation :class :initform .06 :reader interest-rate*))) @ 445) ((setf a1 (make-instance 'account* :balance 5000.00 :name "PI:NAME:<NAME>END_PI")) @ 446) ((name* a1) => "PI:NAME:<NAME>END_PI") ((balance* a1) => 5000.0) ((interest-rate* a1) => 0.06) ((defmethod withdraw* ((acct account*) amt) (if (< amt (balance* acct)) (decf (balance* acct) amt) 'insufficient-funds)) @ 446) ((defclass limited-account (account*) ((limit :initarg :limit :reader limit)))) ((defmethod withdraw* ((acct limited-account) amt) (if (> amt (limit acct)) 'over-limit (call-next-method)))) ((setf a2 (make-instance 'limited-account :name "PI:NAME:<NAME>END_PI" :balance 500.00 :limit 100.00)) @ 447) ((name* a2) => "PI:NAME:<NAME>END_PI") ((withdraw* a2 200.00) => OVER-LIMIT) ((withdraw* a2 20.00) => 480.0) (:section "13.8 A CLOS Example: Searching Tools") ((defclass problem () ((states :initarg :states :accessor problem-states))) @ 449) ((defmethod searcher ((prob problem)) "Find a state that solves the search problem." (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) (searcher prob))))) ((defmethod current-state ((prob problem)) "The current state is the first of the possible states." (first (problem-states prob)))) ((defmethod pop-state ((prob problem)) "Remove and return the current state." (pop (problem-states prob)))) ((defmethod no-states-p ((prob problem)) "Are there any more unexplored states?" (null (problem-states prob)))) ((defmethod searcher :before ((prob problem)) (dbg 'search "~&;; Search: ~a" (problem-states prob))) @ 450) ((defclass eql-problem (problem) ((goal :initarg :goal :reader problem-goal)))) ((defmethod goal-p ((prob eql-problem)) (eql (current-state prob) (problem-goal prob)))) ((defclass dfs-problem (problem) () (:documentation "Depth-first search problem."))) ((defclass bfs-problem (problem) () (:documentation "Breadth-first search problem."))) ((defmethod problem-combiner ((prob dfs-problem) new old) "Depth-first search looks at new states first." (append new old))) ((defmethod problem-combiner ((prob bfs-problem) new old) "Depth-first search looks at old states first." (append old new))) ((defclass binary-tree-problem (problem) ()) @ 451) ((defmethod problem-successors ((prob binary-tree-problem) state) (let ((n (* 2 state))) (list n (+ n 1))))) ((defclass binary-tree-eql-bfs-problem (binary-tree-problem eql-problem bfs-problem) ())) ((setf p1 (make-instance 'binary-tree-eql-bfs-problem :states '(1) :goal 12))) ((searcher p1) => 12) ((defclass best-problem (problem) () (:documentation "A Best-first search problem.")) @ 452) ((defmethod problem-combiner ((prob best-problem) new old) "Best-first search sorts new and old according to cost-fn." (sort (append new old) #'< :key #'(lambda (state) (cost-fn prob state))))) ((defmethod cost-fn ((prob eql-problem) state) (abs (- state (problem-goal prob))))) ((defclass beam-problem (problem) ((beam-width :initarg :beam-width :initform nil :reader problem-beam-width)))) ((defmethod problem-combiner :around ((prob beam-problem) new old) (let ((combined (call-next-method))) (subseq combined 0 (min (problem-beam-width prob) (length combined)))))) ((defclass binary-tree-eql-best-beam-problem (binary-tree-problem eql-problem best-problem beam-problem) ())) ((setf p3 (make-instance 'binary-tree-eql-best-beam-problem :states '(1) :goal 12 :beam-width 3))) ((searcher p3) => 12) ((defclass trip-problem (binary-tree-eql-best-beam-problem) ((beam-width :initform 1))) @ 453) ((defmethod cost-fn ((prob trip-problem) city) (air-distance (problem-goal prob) city))) ((defmethod problem-successors ((prob trip-problem) city) (neighbors city))) ((setf p4 (make-instance 'trip-problem :states (list (city 'new-york)) :goal (city 'san-francisco)))) ((searcher p4) => (SAN-FRANCISCO 122.26 37.47)) (:section "13.9 Is CLOS Object-oriented?") ((defmethod conc ((x null) y) y) @ 454) ((defmethod conc (x (y null)) x)) ((defmethod conc ((x list) (y list)) (cons (first x) (conc (rest x) y)))) ((defmethod conc ((x vector) (y vector)) (let ((vect (make-array (+ (length x) (length y))))) (replace vect x) (replace vect y :start1 (length x))))) ((conc nil '(a b c)) => (A B C) @ 455) ((conc '(a b c) nil) => (A B C)) ((conc '(a b c) '(d e f)) => (A B C D E F)) ((conc '#(a b c) '#(d e f)) => #(A B C D E F)) ) (defexamples 14 "Knowledge Representation and Reasoning" "In this chapter we explore means of indexing facts so that they can be" "retrieved and reasoned with efficiently." "Section 14.1 to 14.7 discuss problems with logical reasoning systems" "such as Prolog." (:section "14.8 A Solution to the Indexing Problem") "Here we show how to index facts in a kind of table that makes it easy to" "add, delete, and retrieve entries. We will develop an extension of the" "trie or discrimination tree data structure built in section 10.5 (page 344)." ((requires "krep1")) "Now we define a function to test the indexing routine. Compare the output" "with figure 14.1 on page 474." ((test-index) @ 478) "Here is an example of fetching from the index" ((fetch '(p ? c)) @ 480 => (((P B C) (P A C)) ((P A ?X)))) "We can make a change to rename variables before indexing facts." ((defun index (key) "Store key in a dtree node. Key must be (predicate . args); it is stored in the predicate's dtree." (dtree-index key (rename-variables key) ; store unique vars (get-dtree (predicate key)))) @ 481) "We have to reindex:" ((test-index)) "We are now ready to test the retrieval mechanism:" ((fetch '(p ?x c)) @ 481) ((retrieve '(p ?x c)) @ 481) ((retrieve-matches '(p ?x c)) => ((P A C) (P A C) (P B C))) ((retrieve-matches '(p ?x (?fn c))) => ((P A (?FN C)) (P A (F C)) (P B (F C)))) ((query-bind (?x ?fn) '(p ?x (?fn c)) (format t "~&P holds between ~a and ~a of c." ?x ?fn)) @ 482) (:section "14.10 Solutions to the Expressiveness Problems") "In this section we introduce a frame-like language, using the primitives" "sub, rel, ind, val, and and." ((requires "krep")) "We add some facts about dogs and bears, both as individuals and species:" ((add-fact '(sub dog animal)) @ 488) ((add-fact '(sub bear animal))) ((add-fact '(ind Fido dog))) ((add-fact '(ind Yogi bear))) ((add-fact '(val color Yogi brown))) ((add-fact '(val color Fido golden))) ((add-fact '(val latin-name bear ursidae))) ((add-fact '(val latin-name dog canis-familiaris))) "Now retrieve-fact is used to answer three questions: What kinds of animals" "are there?" ((retrieve-fact '(sub ?kind animal)) => (((?KIND . DOG)) ((?KIND . BEAR)))) "What are the Latin names of each kind of animal?" ((retrieve-fact '(and (sub ?kind animal) (val latin-name ?kind ?latin))) => (((?LATIN . CANIS-FAMILIARIS) (?KIND . DOG)) ((?LATIN . URSIDAE) (?KIND . BEAR)))) "What are the colors of each individual bear?" ((retrieve-fact '(and (ind ?x bear) (val color ?x ?c))) @ 489 => (((?C . BROWN) (?X . YOGI)))) ((test-bears) @ 492) ) (defexamples 15 "Symbolic Mathematics with Canonical Forms" "This chapter uses a canonical representation for polynomials" "to achieve a more efficient program than the rules-based one in Chapter 8." (:section "15.1 A Canonical Form for Polynomials") ((requires "cmacsyma")) "We represent polynomials as vectors, with the variable in element 0," "and the coefficients starting in element 1 and going up from there." "Here is the representation of 5x^3 + 10x^2 + 20x + 30" ('#(x 30 20 10 5) @ 511) "Here are some examples (without the interactive loop):" ((canon '(3 + x + 4 - x)) => 7 @ 521) ((canon '(x + y + y + x)) => ((2 * x) + (2 * y))) ((canon '(3 * x + 4 * x)) => (7 * x)) ((canon '(3 * x + y + x + 4 * x)) => ((8 * x) + y)) ((canon '((x + 1) ^ 10)) => ((x ^ 10) + (10 * (x ^ 9)) + (45 * (x ^ 8)) + (120 * (x ^ 7)) + (210 * (x ^ 6)) + (252 * (x ^ 5)) + (210 * (x ^ 4)) + (120 * (x ^ 3)) + (45 * (x ^ 2)) + (10 * x) + 1)) ((canon '((x + 1) ^ 10 - (x - 1) ^ 10)) => ((20 * (x ^ 8)) + (240 * (x ^ 7)) + (504 * (x ^ 5)) + (240 * (x ^ 3)) + (20 * x))) ((canon '(d (3 * x ^ 2 + 2 * x + 1) / d x)) @ 522 => ((6 * x) + 2)) ((canon '(d (z + 3 * x + 3 * z * x ^ 2 + z ^ 2 * x ^ 3) / d z)) => (((2 * z) * (x ^ 3)) + (3 * (x ^ 2)) + 1))) (defexamples 16 "Expert Systems" "In this chapter we develop an expert system shell, and give it a few rules" "about infectious disease, thus duplicating some of the Mycin system." ((requires "mycin-r")) "Because this is an interactive system, we can't show the interaction here." "You can try it yourself by evaluating (mycin)" ) (defexamples 17 "Line Diagram Labelling by Constraint Satisfaction" "In this chapter we look at the line-diagram labeling problem: Given a list" "of lines and the vertexes at which they intersect, how can we determine" "what the lines represent?" ((requires "waltz")) (:section "17.2 Combining Constraints and Searching") "First let's test that we can find the possible labelings for a vertex class:" ((possible-labelings 'Y) @ 574 => ((+ + +) (- - -) (L R -) (- L R) (R - L))) "Notice how matrix-transpose works:" ((matrix-transpose (possible-labelings 'Y)) => ((+ - L - R) (+ - R L -) (+ - - R L))) ((defdiagram cube (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f L d c) (g L b d)) @ 575) (:section "17.3 Labelling Diagrams") "We are now ready to try labelling diagrams. First the cube:" ((print-labelings (diagram 'cube)) @ 577) "The cube should have given four solutions." "We can get down to one solution by grounding line GD:" ((print-labelings (ground (diagram 'cube) 'g 'd)) @ 580) "For the more complex cube on a plate, we get similar results;" "Four interpretations, which turn to one after grounding line KM:" ((defdiagram cube-on-plate (a Y b c d) (b W g e a) (c W e f a) (d W f g a) (e L c b) (f Y d c i) (g Y b d h) (h W l g j) (i W f m j) (j Y h i k) (k W m l j) (l L h k) (m L k i)) @ 581) ((print-labelings (ground (diagram 'cube-on-plate) 'k 'm)) @ 582) "It is interesting to try the algorithm on an 'impossible' diagram." "It turns out the algorithm correctly finds no interpretation for this" "well-known illusion:" ((defdiagram poiuyt (a L b g) (b L j a) (c L d l) (d L h c) (e L f i) (f L k e) (g L a l) (h L l d) (i L e k) (j L k b) (k W j i f) (l W h g c)) @ 583) ((print-labelings (diagram 'poiuyt)) @ 583) "Now we try a more complex diagram:" ((defdiagram tower (a Y b c d) (n L q o) (b W g e a) (o W y j n) (c W e f a) (p L r i) (d W f g a) (q W n s w) (e L c b) (r W s p x) (f Y d c i) (s L r q) (g Y b d h) (t W w x z) (h W l g j) (u W x y z) (i W f m p) (v W y w z) (j Y h o k) (w Y t v q) (k W m l j) (x Y r u t) (l L h k) (y Y v u o) (m L k i) (z Y t u v)) @ 584) ((print-labelings (ground (diagram 'tower) 'l 'k)) @ 584)) (defexamples 18 "Search and the Game of Othello" "In this chapter we will develop a simplified Othello-playing program." "It will not be a champion, but is much better than beginning players." (:section "18.2 Representation Choices") ((requires "othello")) "First, we see that our choices for representing the board seem to work:" ((print-board (initial-board)) @ 604) "Now we can compare the weighted squares and count difference strategies" "by playing two games, alternating who goes first. The NIL as third argument" "means don't print the board after each move." ((othello (maximizer #'weighted-squares) (maximizer #'count-difference) nil) @ 610) ((othello (maximizer #'count-difference) (maximizer #'weighted-squares) nil)) (:section "18.4 Searching Ahead: Minimax") "We can test the minimax strategy, and see that searching ahead 3 ply is" "indeed better than looking at only 1 ply. We can follow the whole game" ((othello (minimax-searcher 3 #'count-difference) (maximizer #'count-difference)) @ 614 => 53) (:section "18.5 Smarter Searching: Alpha-Beta Search") "The following should produce the same result, only faster:" ((othello (alpha-beta-searcher 3 #'count-difference) (maximizer #'count-difference) nil) => 53) (:section "18.8 Playing a Series of Games") "A single game is not enough to establish that one strategy is better than" "another. The function RANDOM-OTHELLO-SERIES allows two strategies to" "compete in a series of games." ((requires "othello2")) ((random-othello-series (alpha-beta-searcher 2 #'weighted-squares) (alpha-beta-searcher 2 #'modified-weighted-squares) 5) @ 628) "Here is a comparison of five strategies that search only 1 ply." "To save time, we run 2 pairs of games each, not 5 pairs." ((round-robin (list (maximizer #'count-difference) (maximizer #'mobility) (maximizer #'weighted-squares) (maximizer #'modified-weighted-squares) #'random-strategy) 2 10 '(count-difference mobility weighted modified-weighted random)) @ 629) "Now we compare alpha-beta searchers at 3 ply for 1 pair of games each." "In the book it was 4 ply for 5 pairs each, but that takes too long." ((round-robin (list (alpha-beta-searcher 3 #'count-difference) (alpha-beta-searcher 3 #'weighted-squares) (alpha-beta-searcher 3 #'modified-weighted-squares) #'random-strategy) 1 10 '(count-difference weighted modified-weighted random))) ) (defexamples 19 "Introduction to Natural Language" "This chapter is a brief introduction to natural language processing." (:section "19.1 Parsing with a Phrase-Structure Grammar") "We start with the grammar defined on page 39 for the GENERATE program." "I include 'noun' and 'verb' as nouns in the grammar *grammar3*" ((requires "syntax1")) (*grammar3* @ 657) ((use *grammar3*)) ((parser '(the table)) => ((NP (ART THE) (NOUN TABLE)))) ((parser '(the ball hit the table)) => ((SENTENCE (NP (ART THE) (NOUN BALL)) (VP (VERB HIT) (NP (ART THE) (NOUN TABLE)))))) ((parser '(the noun took the verb)) => ((SENTENCE (NP (ART THE) (NOUN NOUN)) (VP (VERB TOOK) (NP (ART THE) (NOUN VERB)))))) "The range of sentences we can parse is quite limited." "The following grammar includes a wider variety." (*grammar4* @ 661) ((use *grammar4*)) ((parser '(The man hit the table with the ball)) => ((S (NP (D THE) (N MAN)) (VP (VP (V HIT) (NP (D THE) (N TABLE))) (PP (P WITH) (NP (D THE) (N BALL))))) (S (NP (D THE) (N MAN)) (VP (V HIT) (NP (NP (D THE) (N TABLE)) (PP (P WITH) (NP (D THE) (N BALL)))))))) "Here we see a phrase that is ambiguous between a sentence and a noun phrase:" ((parser '(the orange saw)) @ 662 => ((S (NP (D THE) (N ORANGE)) (VP (V SAW))) (NP (D THE) (A+ (A ORANGE)) (N SAW)))) (:section "19.4 The Unknown-Word Problem") "As it stands, the parser cannot deal with unknown words." "One way of treating unknown words is to allow them to be any of the" "'open-class' categories--nouns, verbs, adjectives, and names." ((parser '(PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI)) @ 664 => ((S (NP (NAME PI:NAME:<NAME>END_PI)) (VP (V LIKED) (NP (NAME PI:NAME:<NAME>END_PI)))))) ((parser '(PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI)) @ 665 => ((S (NP (NAME PI:NAME:<NAME>END_PI)) (VP (V LIKED) (NP (NAME DALE)))))) "We see the parser works as well with words it knows (PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI)" "as with new words (PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI), which it can recognize as names" "because of their position in the sentence." ((parser '(the rab zaggled the woogly quax)) => ((S (NP (D THE) (N RAB)) (VP (V ZAGGLED) (NP (D THE) (A+ (A WOOGLY)) (N QUAX)))))) ((parser '(the slithy toves gymbled)) => ((S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NAME GYMBLED)))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (V GYMBLED))) (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)))) ((parser '(the slithy toves gymbled on the wabe)) => ((S (NP (D THE) (N SLITHY)) (VP (VP (V TOVES) (NP (NAME GYMBLED))) (PP (P ON) (NP (D THE) (N WABE))))) (S (NP (D THE) (N SLITHY)) (VP (V TOVES) (NP (NP (NAME GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (S (NP (D THE) (A+ (A SLITHY)) (N TOVES)) (VP (VP (V GYMBLED)) (PP (P ON) (NP (D THE) (N WABE))))) (NP (NP (D THE) (A+ (A SLITHY) (A+ (A TOVES))) (N GYMBLED)) (PP (P ON) (NP (D THE) (N WABE)))))) (:section "19.5 Parsing into a Semantic Representation") ((requires "syntax2")) "Syntactic parse trees of a sentence may be interesting, but by themselves" "they're not very useful. We use sentences to communicate ideas, not to" "display grammatical structures." "" "Imagine a compact disc player for which you can punch buttons like" "'play 1 to 5 without 3'. We will define such a language." "The meaning of a sentence in the language is the list of tracks played." (*grammar5* @ 667) ((use *grammar5*)) ((meanings '(1 to 5 without 3)) @ 669 => ((1 2 4 5))) ((meanings '(1 to 4 and 7 to 9)) => ((1 2 3 4 7 8 9))) ((meanings '(1 to 6 without 3 and 4)) => ((1 2 4 5 6) (1 2 5 6))) "The example '1 to 6 without 3 and 4' is ambiguous." "The syntactic ambiguity leads to a semantic ambiguity." "We can define a new grammar that eliminates some ambiguities:" (*grammar6* @ 669) ((use *grammar6*)) "With this new grammar, we can get single interpretations out of most inputs" ((meanings '(1 to 6 without 3 and 4)) => ((1 2 5 6))) ((meanings '(1 and 3 to 7 and 9 without 5 and 6)) => ((1 3 4 7 9))) ((meanings '(1 and 3 to 7 and 9 without 5 and 2)) => ((1 3 4 6 7 9 2))) ((meanings '(1 9 8 to 2 0 1)) => ((198 199 200 201))) ((meanings '(1 2 3)) => (123 (123))) (:section "19.6 Parsing with Preferences") ((requires "syntax3")) "We need some compromise between the permissive grammar, which generated" "all possible parses, and the restrictive grammar, which eliminates too" "many parses. To get the 'best' interpretation we will need not only a" "new grammar, we will also need to modify the program to compare the" "relative worth of candidate interpretations." (*grammar7* @ 673) ((use *grammar7*)) "We will need a way to show off the prefernce rankings:" ((all-parses '(1 to 6 without 3 and 4)) @ 675) ((all-parses '(1 and 3 to 7 and 9 without 5 and 6))) ((all-parses '(1 and 3 to 7 and 9 without 5 and 2)) @ 676) "In each case, the preference rules are able to assign higher scores to" "more reasonable interpretations. What we really want is to pick the best." "Here we see some examples:" ((meaning '(1 to 5 without 3 and 4)) => (1 2 5)) ((meaning '(1 to 5 without 3 and 6)) => (1 2 4 5 6)) ((meaning '(1 to 5 without 3 and 6 shuffled))) ((meaning '([ 1 to 5 without [ 3 and 6 ] ] reversed)) => (5 4 2 1)) ((meaning '(1 to 5 to 9)) => NIL) ) (defexamples 20 "Unification Grammars" "Prolog was invented as a formalism to describe the grammar of French." "It is still useful to view a grammar as a set of logic programming clauses." "This chapter describes how that can be done." ((requires "unifgram")) (:section "20.3 A Simple Grammar in DCG Format") "Here is the trivial grammar from page 688 in DCG format:" ((clear-db)) ((rule (S (?pred ?subj)) --> (NP ?agr ?subj) (VP ?agr ?pred)) @ 692) ((rule (NP ?agr (?det ?n)) --> (Det ?agr ?det) (N ?agr ?n))) ((rule (NP 3sg (the male)) --> (:word he)) @ 693) ((rule (NP ~3sg (some objects)) --> (:word they))) ((rule (VP 3sg sleep) --> (:word sleeps))) ((rule (VP ~3sg sleep) --> (:word sleep))) ((rule (Det ?any the) --> (:word the))) ((rule (N 3sg (young male human)) --> (:word boy))) ((rule (N 3sg (young female human)) --> (:word girl))) "We can parse some of the sentences from page 689 (but in DCG format)." "Parsing:" ((?- (S ?sem (He sleeps) ())) :input ".") "Generating:" ((?- (S (sleep (the male)) ?words ())) :input ".") "Enumerating:" ((?- (S ?sem ?words ())) :input ";;;;") "If we want the interpretation of 'PI:NAME:<NAME>END_PI' to be" "(kiss PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI) not ((lambda (x) (kiss x PI:NAME:<NAME>END_PI)) PI:NAME:<NAME>END_PI), then we need" "a way to unify semantic components together. Here's one way:" ((clear-db)) ((rule (S ?pred) --> (NP ?agr ?subj) (VP ?agr ?subj ?pred)) @ 694) ((rule (VP ?agr ?subj ?pred) --> (Verb/tr ?agr ?subj ?pred ?obj) (NP ?any-agr ?obj))) ((rule (VP ?agr ?subj ?pred) --> (Verb/intr ?agr ?subj ?pred))) ((rule (Verb/tr ~3sg ?x (kiss ?x ?y) ?y) --> (:word kiss))) ((rule (Verb/tr 3sg ?x (kiss ?x ?y) ?y) --> (:word kisses))) ((rule (Verb/tr ?any ?x (kiss ?x ?y) ?y) --> (:word kissed))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) "Here are the rules for noun phrases and nouns" ((rule (NP ?agr ?sem) --> (Name ?agr ?sem))) ((rule (NP ?agr (?det-sem ?noun-sem)) --> (Det ?agr ?det-sem) (Noun ?agr ?noun-sem))) ((rule (Name 3sg PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI) --> (:word Terry))) ((rule (Name 3sg PI:NAME:<NAME>END_PI) --> (:word PI:NAME:<NAME>END_PI))) ((rule (Noun 3sg (young male human)) --> (:word boy)) @ 695) ((rule (Noun 3sg (young female human)) --> (:word girl))) ((rule (Noun ~3sg (group (young male human))) --> (:word boys))) ((rule (Noun ~3sg (group (young female human))) --> (:word girls))) ((rule (Det ?any the) --> (:word the))) ((rule (Det 3sg a) --> (:word a))) "This grammar and lexicon generates more sentences, although it is still" "rather limited. Here are some examples:" ((?- (S ?sem (The boys kiss a girl) ())) @ 695 :input ";.") ((?- (S ?sem (The girls kissed the girls) ())) :input ";.") ((?- (S ?sem (PI:NAME:<NAME>END_PI kissed the girl) ())) :input ";.") ((?- (S ?sem (The girls kisses the boys) ())) :input ";.") ((?- (S ?sem (PI:NAME:<NAME>END_PI kissed a girls) ())) :input ";.") ((?- (S ?sem (PI:NAME:<NAME>END_PI sleeps Jean) ())) :input ";.") (:section "20.4 A DCG Grammar with Quantifiers") ((clear-db)) ((rule (Det ?any ?x ?p ?q (the ?x (and ?p ?q))) --> (:word the)) @ 697) ((rule (Det 3sg ?x ?p ?q (exists ?x (and ?p ?q))) --> (:word a))) ((rule (Det 3sg ?x ?p ?q (all ?x (-> ?p ?q))) --> (:word every))) ((rule (Noun 3sg ?x (picture ?x)) --> (:word picture)) @ 698) ((rule (Noun 3sg ?x (story ?x)) --> (:word story))) ((rule (Noun 3sg ?x (and (young ?x) (male ?x) (human ?x))) --> (:word boy))) ((rule (NP ?agr ?x ?pred ?pred) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?pred ?np) --> (Det ?agr ?x ?noun&rel ?pred ?np) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?noun ?noun&rel))) ((rule (rel-clause ?agr ?x ?np ?np) --> )) ((rule (rel-clause ?agr ?x ?np (and ?np ?rel)) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Verb/tr ~3sg ?x ?y (paint ?x ?y)) --> (:word paint)) @ 699) ((rule (Verb/tr 3sg ?x ?y (paint ?x ?y)) --> (:word paints))) ((rule (Verb/tr ?any ?x ?y (paint ?x ?y)) --> (:word painted))) ((rule (Verb/intr ~3sg ?x (sleep ?x)) --> (:word sleep))) ((rule (Verb/intr 3sg ?x (sleep ?x)) --> (:word sleeps))) ((rule (Verb/intr ?any ?x (sleep ?x)) --> (:word slept))) ((rule (Verb/intr 3sg ?x (sells ?x)) --> (:word sells))) ((rule (Verb/intr 3sg ?x (stinks ?x)) --> (:word stinks))) ((rule (VP ?agr ?x ?vp) --> (Verb/tr ?agr ?x ?obj ?verb) (NP ?any-agr ?obj ?verb ?vp))) ((rule (VP ?agr ?x ?vp) --> (Verb/intr ?agr ?x ?vp))) ((rule (S ?np) --> (NP ?agr ?x ?vp ?np) (VP ?agr ?x ?vp))) "Now we define a function to show the output from a query." "In the book, you just saw the output of such a function." ((defun do-s (words) (top-level-prove `((S ?sem ,words ()))))) ((do-s '(Every picture paints a story)) :input "." @ 699) ((do-s '(Every boy that paints a picture sleeps)) :input ".") ((do-s '(Every boy that sleeps paints a picture)) :input ".") ((do-s '(Every boy that paints a picture that sells paints a picture that stinks)) :input "." @ 700) (:section "20.5 Preserving Quantifier Scope Ambiguity") ((clear-db)) ((rule (S (and ?np ?vp)) --> (NP ?agr ?x ?np) (VP ?agr ?x ?vp)) @ 701) ((rule (VP ?agr ?x (and ?verb ?obj)) --> (Verb/tr ?agr ?x ?o ?verb) (NP ?any-agr ?o ?obj))) ((rule (VP ?agr ?x ?verb) --> (Verb/intr ?agr ?x ?verb))) ((rule (NP ?agr ?name t) --> (Name ?agr ?name))) ((rule (NP ?agr ?x ?det) --> (Det ?agr ?x (and ?noun ?rel) ?det) (Noun ?agr ?x ?noun) (rel-clause ?agr ?x ?rel))) ((rule (rel-clause ?agr ?x t) --> )) ((rule (rel-clause ?agr ?x ?rel) --> (:word that) (VP ?agr ?x ?rel))) ((rule (Name 3sg PI:NAME:<NAME>END_PI) --> (:word TPI:NAME:<NAME>END_PI))) ((rule (Name 3sg PI:NAME:<NAME>END_PI) --> (:word Jean))) ((rule (Det 3sg ?x ?restr (all ?x ?restr)) --> (:word every))) ((rule (Noun 3sg ?x (man ?x)) --> (:word man))) ((rule (Verb/tr 3sg ?x ?y (love ?x ?y)) --> (:word loves))) ((rule (Verb/intr 3sg ?x (lives ?x)) --> (:word lives))) ((rule (Det 3sg ?x ?res (exists ?x ?res)) --> (:word a))) ((rule (Noun 3sg ?x (woman ?x)) --> (:word woman))) "Here is an example of the new representation:" ((do-s '(every man loves a woman)) :input "." @ 701) ) (defexamples 21 "A Grammar of English" ((if (boundp 'clear-db) (clear-db)) @ 715) ((requires "grammar" "lexicon")) ((prolog-compile-symbols)) (:section "21.10 Word Categories") ((?- (word sees verb ?infl ?senses)) :input ".") ((try S PI:NAME:<NAME>END_PI promised PI:NAME:<NAME>END_PI to persuade PI:NAME:<NAME>END_PI to sleep) :input ";;;.") (:section "21.14 Examples") ((try S When did PI:NAME:<NAME>END_PI promise PI:NAME:<NAME>END_PI to persuade PI:NAME:<NAME>END_PI to sleep) @ 746 :input ";;;.") ((try S Kim would not have been looking for Lee) @ 747 :input ";;;.") ((try s It should not surprise you that Kim does not like Lee) :input ";;;.") ) (defexamples 22 "Scheme: An Uncommon Lisp" "This chapter presents the Scheme dialect of Lisp and an interpreter for it." "Understanding the interpreter can give you a better appreciation of Lisp." (:section "22.1 A Scheme Interpreter") ((requires "interp1")) "We're ready to try out the interpreter. Note we provide an argument" "to avoid going into a read-eval-print loop with SCHEME. This is a new" "functionality, no in the book, added to make these examples easier." ((scheme '(+ 2 2)) @ 760 => 4 ) ((scheme '((if (= 1 2) * +) 3 4)) => 7) ((scheme '((if (= 1 1) * +) 3 4)) => 12 @ 761) ((scheme '(set! fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))))) ((scheme '(fact 5)) => 120) ((scheme '(set! table (lambda (f start end) (if (<= start end) (begin (write (list start (f start))) (newline) (table f (+ start 1) end))))))) ((scheme '(table fact 1 10)) => NIL ) ((scheme '(table (lambda (x) (* x x x)) 5 10)) => NIL) (:section "22.2 Syntactic Extension with Macros") "Scheme has a number of special forms that were not listed above." "These can be implemented by macros (although macros are not officially" "part of Scheme). We can test out the macro facility:" ((scheme-macro-expand '(and p q)) => (IF P (AND Q)) @ 765) ((scheme-macro-expand '(and q)) => Q) ((scheme-macro-expand '(let ((x 1) (y 2)) (+ x y))) => ((LAMBDA (X Y) (+ X Y)) 1 2)) ((scheme-macro-expand '(letrec ((even? (lambda (x) (or (= x 0) (odd? (- x 1))))) (odd? (lambda (x) (even? (- x 1))))) (even? z)))) "Now let's look at uses of the macros DEFINE and LET*" ((scheme '(define (reverse l) (if (null? l) nil (append (reverse (cdr l)) (list (car l)))))) => REVERSE) ((scheme '(reverse '(a b c d))) => (D C B A)) ((scheme '(let* ((x 5) (y (+ x x))) (if (or (= x 0) (and (< 0 y) (< y 20))) (list x y) (+ y x)))) => (5 10)) (:section "22.4 Throw, Catch, and Call/cc") ((requires "interp3")) "Non-local flow of control is provided in Scheme with a very general and" "powerful procedure, CALL-WITH-CURRENT-CONTINUATION, which is often" "abbreviated CALL/CC. Here are some examples:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 300))))) @ 770 => 321) "The above example ignores CC and computes (+ 1 (+ 20 300))" "The next example does make use of CC:" ((scheme '(+ 1 (call/cc (lambda (cc) (+ 20 (cc 300)))))) => 301) "The above passes 300 to CC, thus bypassing the addition of 20." "It effectively throws 300 out to the catch point established by call/cc." ) (defexamples 23 "Compiling Lisp" "Compilers are simple to write and useful to know about." "In this chapter we develop a simple compiler for Scheme." "" ((requires "compile1")) "Now we are ready to show the simple compiler at work:" ((comp-show '(if (= x y) (f (g x)) (h x y (h 1 2)))) @ 791) "Here are some places where a compiler could do better than an interpreter" "(although our compiler currently does not):" ((comp-show '(begin "doc" (write x) y)) @ 792) "We should not have to push 'doc' on the stack just to pop it off." "Here's another example:" ((comp-show '(begin (+ (* a x) (f x)) x))) "Here's an example using local variables:" ((comp-show '((lambda (x) ((lambda (y z) (f x y z)) 3 x)) 4)) @ 794) (:section "23.1 A Properly Tail-Recursive Compiler") "Notice the two new instructions, CALLJ and SAVE" ((requires "compile2")) "First we see how nested function calls work:" ((comp-show '(f (g x))) @ 796) "In the next example we see that unneeded constants and variables in BEGIN" "expressions are ignored:" ((comp-show '(begin "doc" x (f x) y)) @ 797) ((comp-show '(begin (+ (* a x) (f x)) x))) "Here are some examples of IF expressions:" ((comp-show '(if p (+ x y) (* x y))) @ 801) "If we put the same code inside a BEGIN we get something quite different:" ((comp-show '(begin (if p (+ x y) (* x y)) z)) @ 802) "Here are some more examples of the compiler at work:" ((comp-show '(if (null? (car l)) (f (+ (* a x) b)) (g (/ x 2)))) @ 806) ((comp-show '(define (last1 l) (if (null? (cdr l)) (car l) (last1 (cdr l))))) @ 807) ((comp-show '(define (length l) (if (null? l) 0 (+ 1 (length (cdr l)))))) @ 808) "Of course, it is possible to write LENGTH in tail-recursive fashion:" ((comp-show '(define (length l) (letrec ((len (lambda (l n) (if (null? l) n (len (rest l) (+ n 1)))))) (len l 0))))) (:section "23.4 A Peephole Optimizer") "In this section we investigate a simple technique that will generate" "slightly better code in cases where the compiler is less than perfect." ((requires "compile3" "compopt")) ((comp-show '(begin (if (if t 1 (f x)) (set! x 2)) x)) @ 818) )
[ { "context": "C) 2014, Creative Commons License.\n;;;\n;;; Author: Szabolcs Pasztor <[email protected]>\n;;; Created: ", "end": 179, "score": 0.9998911619186401, "start": 163, "tag": "NAME", "value": "Szabolcs Pasztor" }, { "context": "ommons License.\n;;;\n;;; Author: Szabolcs Pasztor <[email protected]>\n;;; Created: 28 August 2014\n;;; Version: 1.0\n;;;", "end": 214, "score": 0.999933123588562, "start": 181, "tag": "EMAIL", "value": "[email protected]" } ]
src/lsp/LayerFreeze.lsp
spasztor/Goldsmith-Plugin
1
;;; LayerFreeze.LSP -- Calls the "layfrz" command with the viewports setting set to "freeze". ;; ;;; Copyright (C) 2014, Creative Commons License. ;;; ;;; Author: Szabolcs Pasztor <[email protected]> ;;; Created: 28 August 2014 ;;; Version: 1.0 ;;; Keywords: layfrz, layer, freeze, ;;; ;;; Code: (defun c:FR nil (setvar "nomutt" 1) (command "layfrz" "settings" "viewports" "freeze" "") (setvar "nomutt" 0) (command "layfrz") ) ;;; LayerFreeze.LSP
66627
;;; LayerFreeze.LSP -- Calls the "layfrz" command with the viewports setting set to "freeze". ;; ;;; Copyright (C) 2014, Creative Commons License. ;;; ;;; Author: <NAME> <<EMAIL>> ;;; Created: 28 August 2014 ;;; Version: 1.0 ;;; Keywords: layfrz, layer, freeze, ;;; ;;; Code: (defun c:FR nil (setvar "nomutt" 1) (command "layfrz" "settings" "viewports" "freeze" "") (setvar "nomutt" 0) (command "layfrz") ) ;;; LayerFreeze.LSP
true
;;; LayerFreeze.LSP -- Calls the "layfrz" command with the viewports setting set to "freeze". ;; ;;; Copyright (C) 2014, Creative Commons License. ;;; ;;; Author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;; Created: 28 August 2014 ;;; Version: 1.0 ;;; Keywords: layfrz, layer, freeze, ;;; ;;; Code: (defun c:FR nil (setvar "nomutt" 1) (command "layfrz" "settings" "viewports" "freeze" "") (setvar "nomutt" 0) (command "layfrz") ) ;;; LayerFreeze.LSP
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(inc", "end": 1356, "score": 0.9995777010917664, "start": 1345, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(include-book \"simple-ter", "end": 1377, "score": 0.9999355673789978, "start": 1358, "tag": "EMAIL", "value": "[email protected]" } ]
books/projects/milawa/ACL2/bootstrap/level6/factor.lisp
mayankmanj/acl2
305
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "MILAWA") (include-book "simple-termp") (%interactive) (%autoadmit clause.flag-factor) (%disable default clause.flag-factor) (%autoadmit clause.factor) (%autoadmit clause.factor-list) (%autoprove definition-of-clause.factor (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove definition-of-clause.factor-list (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove clause.flag-factor-of-term-removal (%enable default clause.factor)) (%autoprove clause.flag-factor-of-list-removal (%enable default clause.factor-list)) (%autoprove clause.factor-list-when-not-consp (%restrict default definition-of-clause.factor-list (equal x 'x))) (%autoprove clause.factor-list-of-cons (%restrict default definition-of-clause.factor-list (equal x '(cons a x)))) (%defprojection :list (clause.factor-list x assignment) :element (clause.factor x assignment)) (%autoprove clause.factor-list-when-len-three) (%autoprove clause.factor-when-logic.constantp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.variablep (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-non-if-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-bad-args-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-if-expression (%forcingp nil) (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.lambdap (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-degenerate (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove lemma-for-forcing-logic.termp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.termp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-listp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-forcing-logic.term-atblp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.term-atblp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-list-atblp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-clause.factor-when-not-consp-of-assignment (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove clause.factor-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'term)))) (%autoprove clause.factor-list-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'list)))) (%defprojection :list (clause.multifactor term x) :element (clause.factor term x)) (%autoprove forcing-logic.term-listp-of-clause.multifactor (%cdr-induction assignments)) (%ensure-exactly-these-rules-are-missing "../../clauses/if-lifting/factor")
36837
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "MILAWA") (include-book "simple-termp") (%interactive) (%autoadmit clause.flag-factor) (%disable default clause.flag-factor) (%autoadmit clause.factor) (%autoadmit clause.factor-list) (%autoprove definition-of-clause.factor (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove definition-of-clause.factor-list (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove clause.flag-factor-of-term-removal (%enable default clause.factor)) (%autoprove clause.flag-factor-of-list-removal (%enable default clause.factor-list)) (%autoprove clause.factor-list-when-not-consp (%restrict default definition-of-clause.factor-list (equal x 'x))) (%autoprove clause.factor-list-of-cons (%restrict default definition-of-clause.factor-list (equal x '(cons a x)))) (%defprojection :list (clause.factor-list x assignment) :element (clause.factor x assignment)) (%autoprove clause.factor-list-when-len-three) (%autoprove clause.factor-when-logic.constantp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.variablep (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-non-if-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-bad-args-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-if-expression (%forcingp nil) (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.lambdap (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-degenerate (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove lemma-for-forcing-logic.termp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.termp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-listp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-forcing-logic.term-atblp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.term-atblp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-list-atblp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-clause.factor-when-not-consp-of-assignment (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove clause.factor-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'term)))) (%autoprove clause.factor-list-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'list)))) (%defprojection :list (clause.multifactor term x) :element (clause.factor term x)) (%autoprove forcing-logic.term-listp-of-clause.multifactor (%cdr-induction assignments)) (%ensure-exactly-these-rules-are-missing "../../clauses/if-lifting/factor")
true
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "MILAWA") (include-book "simple-termp") (%interactive) (%autoadmit clause.flag-factor) (%disable default clause.flag-factor) (%autoadmit clause.factor) (%autoadmit clause.factor-list) (%autoprove definition-of-clause.factor (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove definition-of-clause.factor-list (%enable default clause.factor clause.factor-list) (%restrict default clause.flag-factor (equal x 'x))) (%autoprove clause.flag-factor-of-term-removal (%enable default clause.factor)) (%autoprove clause.flag-factor-of-list-removal (%enable default clause.factor-list)) (%autoprove clause.factor-list-when-not-consp (%restrict default definition-of-clause.factor-list (equal x 'x))) (%autoprove clause.factor-list-of-cons (%restrict default definition-of-clause.factor-list (equal x '(cons a x)))) (%defprojection :list (clause.factor-list x assignment) :element (clause.factor x assignment)) (%autoprove clause.factor-list-when-len-three) (%autoprove clause.factor-when-logic.constantp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.variablep (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-non-if-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-bad-args-logic.functionp (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-if-expression (%forcingp nil) (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-logic.lambdap (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove clause.factor-when-degenerate (%restrict default definition-of-clause.factor (equal x 'x))) (%autoprove lemma-for-forcing-logic.termp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.termp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-listp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.termp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-forcing-logic.term-atblp-of-clause.factor (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove forcing-logic.term-atblp-of-clause.factor (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'term)))) (%autoprove forcing-logic.term-list-atblp-of-clause.factor-list (%use (%instance (%thm lemma-for-forcing-logic.term-atblp-of-clause.factor) (flag 'list)))) (%autoprove lemma-for-clause.factor-when-not-consp-of-assignment (%clause.simple-term-induction flag x) (%disable default forcing-logic.function-of-logic.function-name-and-logic.function-args-free forcing-logic.functionp-when-logic.base-evaluablep not-equal-when-less trichotomy-of-< logic.formulap-when-not-consp)) (%autoprove clause.factor-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'term)))) (%autoprove clause.factor-list-when-not-consp-of-assignment (%use (%instance (%thm lemma-for-clause.factor-when-not-consp-of-assignment) (flag 'list)))) (%defprojection :list (clause.multifactor term x) :element (clause.factor term x)) (%autoprove forcing-logic.term-listp-of-clause.multifactor (%cdr-induction assignments)) (%ensure-exactly-these-rules-are-missing "../../clauses/if-lifting/factor")
[ { "context": "ile is a part of avm project.\n Copyright (c) 2016 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(d", "end": 77, "score": 0.9998180866241455, "start": 62, "tag": "NAME", "value": "Masayuki Takagi" }, { "context": "vm project.\n Copyright (c) 2016 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(defpackage avm.lang.c", "end": 97, "score": 0.9999260902404785, "start": 79, "tag": "EMAIL", "value": "[email protected]" } ]
src/lang/compiler/lisp/compile.lisp
JMC-design/avm
45
#| This file is a part of avm project. Copyright (c) 2016 Masayuki Takagi ([email protected]) |# (in-package :cl-user) (defpackage avm.lang.compiler.lisp.compile (:use :cl :avm :avm.lang.data :avm.lang.type :avm.lang.syntax :avm.lang.built-in :avm.lang.typenv :avm.lang.appenv :avm.lang.funenv :avm.lang.compiler.lisp.compile-type :avm.lang.compiler.lisp.varenv) (:export :compile-function :*genname-counter*)) (in-package :avm.lang.compiler.lisp.compile) ;; ;; Genname (defvar *genname-counter* 0) (defun genname (name) (prog1 (intern (format nil "~A~A" name *genname-counter*)) (incf *genname-counter*))) ;; ;; Compile (defun compile-function (name ftype args body venv aenv fenv &key entry-p rec-p) (assert (not (and entry-p (not rec-p)))) (let* ((name1 (compile-name name entry-p)) (pairs (loop for arg in args for type in (function-arg-types ftype) collect (cons arg type))) (venv1 (flet ((aux (venv pair) (destructuring-bind (arg . type) pair (extend-varenv arg type venv)))) (reduce #'aux pairs :initial-value venv))) (fenv1 (if rec-p (extend-funenv-function name name1 ftype args fenv) fenv))) (let ((args1 (compile-arguments args venv1)) (type-decls (compile-type-declarations ftype args venv1)) (body1 (compile-form body venv1 aenv fenv1))) (values name1 args1 `(,@type-decls ,body1))))) (defun compile-name (name entry-p) (if entry-p (let ((symbol-name (symbol-name name)) (symbol-package (symbol-package name))) (intern (format nil "%LISP-~A" symbol-name) symbol-package)) (genname name))) (defun compile-arguments (args venv) (loop for arg in args append (query-varenv arg venv))) (defun compile-type-declarations (ftype args venv) `((declare (optimize (speed 3) (safety 0))) (declare (ignorable ,@(loop for arg in args append (query-varenv arg venv)))) ,@(loop for arg in args for vars = (query-varenv arg venv) for type in (function-arg-types ftype) collect (cond ;; Scalar type and array type. ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(declare (type ,type1 ,@vars)))) ;; Vector type. ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(declare (type ,type1 ,@vars)))) (t (error "Must not be reached.")))))) (defun compile-form (form venv aenv fenv) (cond ((literal-p form) (compile-literal form venv aenv fenv)) ((reference-p form) (compile-reference form venv aenv fenv)) ((accessor-p form) (compile-accessor form venv aenv fenv)) ((the-p form) (compile-the form venv aenv fenv)) ((if-p form) (compile-if form venv aenv fenv)) ((let-p form) (compile-let form venv aenv fenv)) ((flet-p form) (compile-flet form venv aenv fenv)) ((labels-p form) (compile-labels form venv aenv fenv)) ((setf-p form) (compile-setf form venv aenv fenv)) ((apply-p form) (compile-apply form venv aenv fenv)) (t (error "The value ~S is an invalid form." form)))) (defun compile-literal (form venv aenv fenv) (declare (ignore venv aenv fenv)) form) (defun compile-reference (form venv aenv fenv) (declare (ignore aenv fenv)) (multiple-value-bind (vars type) (query-varenv form venv) (cond ((or (scalar-type-p type) (array-type-p type)) (car vars)) ((vector-type-p type) (let ((vector-values* (vector-type-values* type))) `(,vector-values* ,@vars))) (t (error "Must not be reached."))))) (defun vector-type-values* (type) (cl-pattern:match type ((:vector 'int 2) 'int2-values*) ((:vector 'int 3) 'int3-values*) ((:vector 'int 4) 'int4-values*) ((:vector 'float 2) 'float2-values*) ((:vector 'float 3) 'float3-values*) ((:vector 'float 4) 'float4-values*) ((:vector 'double 2) 'double2-values*) ((:vector 'double 3) 'double3-values*) ((:vector 'double 4) 'double4-values*) (_ (error "Must not be reached.")))) (defun compile-accessor (form venv aenv fenv) (compile-apply form venv aenv fenv)) (defun compile-the (form venv aenv fenv) (let ((value (the-value form))) (compile-form value venv aenv fenv))) (defun compile-if (form venv aenv fenv) (let ((test-form (if-test-form form)) (then-form (if-then-form form)) (else-form (if-else-form form))) (let ((test-form1 (compile-form test-form venv aenv fenv)) (then-form1 (compile-form then-form venv aenv fenv)) (else-form1 (compile-form else-form venv aenv fenv))) `(if ,test-form1 ,then-form1 ,else-form1)))) (defun compile-let (form venv aenv fenv) (let ((bindings (let-bindings form)) (body (let-body form))) (%compile-let bindings body venv aenv fenv venv))) (defun %compile-let (bindings body venv aenv fenv venv1) (if bindings (destructuring-bind ((var form) . bindings1) bindings (let* ((form1 (compile-form form venv aenv fenv)) (type (query-appenv (car bindings) aenv)) (venv2 (extend-varenv var type venv1)) (vars (query-varenv var venv2))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,form1)) (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,form1 (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) (t (error "Must not be reached."))))) (compile-form body venv1 aenv fenv))) (defun compile-flet (form venv aenv fenv) (let ((bindings (flet-bindings form)) (body (flet-body form))) (%compile-flet 'flet bindings body nil venv aenv fenv nil fenv))) (defun %compile-flet (op bindings body rec-p venv aenv fenv bindings1 fenv1) (if bindings (destructuring-bind ((name args form) . rest) bindings (let ((ftype (query-appenv (car bindings) aenv))) (multiple-value-bind (name1 args1 form1) (compile-function name ftype args form venv aenv fenv :entry-p nil :rec-p rec-p) (let ((bindings2 (cons `(,name1 ,args1 ,@form1) bindings1)) (fenv2 (extend-funenv-function name name1 ftype args fenv1))) (%compile-flet op rest body rec-p venv aenv fenv bindings2 fenv2))))) `(,op ,bindings1 ,(compile-form body venv aenv fenv1)))) (defun compile-labels (form venv aenv fenv) (let ((bindings (labels-bindings form)) (body (labels-body form))) (%compile-flet 'labels bindings body t venv aenv fenv nil fenv))) (defun compile-setf (form venv aenv fenv) (let ((place (setf-place form)) (value (setf-value form))) (let ((place1 (compile-place place venv aenv fenv)) (value1 (compile-form value venv aenv fenv))) `(setf ,place1 ,value1)))) (defun compile-place (place venv aenv fenv) ;; Strip type specifier from compiled form to be well optimized. (if (reference-place-p place) (compile-form place venv aenv fenv) (third (compile-form place venv aenv fenv)))) (defun compile-apply (form venv aenv fenv) (let ((operator (apply-operator form))) (if (built-in-exists-p operator) (compile-built-in-apply form venv aenv fenv) (compile-user-apply form venv aenv fenv)))) (defun compile-built-in-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (built-in-argc operator))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let* ((type (query-appenv form aenv)) (return-type (function-return-type type))) (let ((operator1 (built-in-operator :lisp operator type)) (operands1 (loop for operand in operands collect (compile-form operand venv aenv fenv))) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@operands1)))))) (defun compile-user-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (funenv-function-argc operator fenv))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let ((args (funenv-function-arguments operator fenv)) (arg-types (funenv-function-arg-types operator fenv))) (%compile-user-apply operator operands args arg-types venv aenv fenv nil)))) (defun %compile-user-apply (operator operands args arg-types venv aenv fenv vars1) (if operands (destructuring-bind (operand . operands1) operands (destructuring-bind (arg . args1) args (destructuring-bind (type . arg-types1) arg-types (let* ((operand1 (compile-form operand venv aenv fenv)) (venv1 (extend-varenv arg type venv)) (vars (query-varenv arg venv1)) (vars2 (append vars vars1))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,operand1)) (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,operand1 (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) (t (error "Must not be reached."))))))) (let* ((operator1 (funenv-function-name1 operator fenv)) (return-type (funenv-function-return-type operator fenv)) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@(nreverse vars1))))))
51502
#| This file is a part of avm project. Copyright (c) 2016 <NAME> (<EMAIL>) |# (in-package :cl-user) (defpackage avm.lang.compiler.lisp.compile (:use :cl :avm :avm.lang.data :avm.lang.type :avm.lang.syntax :avm.lang.built-in :avm.lang.typenv :avm.lang.appenv :avm.lang.funenv :avm.lang.compiler.lisp.compile-type :avm.lang.compiler.lisp.varenv) (:export :compile-function :*genname-counter*)) (in-package :avm.lang.compiler.lisp.compile) ;; ;; Genname (defvar *genname-counter* 0) (defun genname (name) (prog1 (intern (format nil "~A~A" name *genname-counter*)) (incf *genname-counter*))) ;; ;; Compile (defun compile-function (name ftype args body venv aenv fenv &key entry-p rec-p) (assert (not (and entry-p (not rec-p)))) (let* ((name1 (compile-name name entry-p)) (pairs (loop for arg in args for type in (function-arg-types ftype) collect (cons arg type))) (venv1 (flet ((aux (venv pair) (destructuring-bind (arg . type) pair (extend-varenv arg type venv)))) (reduce #'aux pairs :initial-value venv))) (fenv1 (if rec-p (extend-funenv-function name name1 ftype args fenv) fenv))) (let ((args1 (compile-arguments args venv1)) (type-decls (compile-type-declarations ftype args venv1)) (body1 (compile-form body venv1 aenv fenv1))) (values name1 args1 `(,@type-decls ,body1))))) (defun compile-name (name entry-p) (if entry-p (let ((symbol-name (symbol-name name)) (symbol-package (symbol-package name))) (intern (format nil "%LISP-~A" symbol-name) symbol-package)) (genname name))) (defun compile-arguments (args venv) (loop for arg in args append (query-varenv arg venv))) (defun compile-type-declarations (ftype args venv) `((declare (optimize (speed 3) (safety 0))) (declare (ignorable ,@(loop for arg in args append (query-varenv arg venv)))) ,@(loop for arg in args for vars = (query-varenv arg venv) for type in (function-arg-types ftype) collect (cond ;; Scalar type and array type. ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(declare (type ,type1 ,@vars)))) ;; Vector type. ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(declare (type ,type1 ,@vars)))) (t (error "Must not be reached.")))))) (defun compile-form (form venv aenv fenv) (cond ((literal-p form) (compile-literal form venv aenv fenv)) ((reference-p form) (compile-reference form venv aenv fenv)) ((accessor-p form) (compile-accessor form venv aenv fenv)) ((the-p form) (compile-the form venv aenv fenv)) ((if-p form) (compile-if form venv aenv fenv)) ((let-p form) (compile-let form venv aenv fenv)) ((flet-p form) (compile-flet form venv aenv fenv)) ((labels-p form) (compile-labels form venv aenv fenv)) ((setf-p form) (compile-setf form venv aenv fenv)) ((apply-p form) (compile-apply form venv aenv fenv)) (t (error "The value ~S is an invalid form." form)))) (defun compile-literal (form venv aenv fenv) (declare (ignore venv aenv fenv)) form) (defun compile-reference (form venv aenv fenv) (declare (ignore aenv fenv)) (multiple-value-bind (vars type) (query-varenv form venv) (cond ((or (scalar-type-p type) (array-type-p type)) (car vars)) ((vector-type-p type) (let ((vector-values* (vector-type-values* type))) `(,vector-values* ,@vars))) (t (error "Must not be reached."))))) (defun vector-type-values* (type) (cl-pattern:match type ((:vector 'int 2) 'int2-values*) ((:vector 'int 3) 'int3-values*) ((:vector 'int 4) 'int4-values*) ((:vector 'float 2) 'float2-values*) ((:vector 'float 3) 'float3-values*) ((:vector 'float 4) 'float4-values*) ((:vector 'double 2) 'double2-values*) ((:vector 'double 3) 'double3-values*) ((:vector 'double 4) 'double4-values*) (_ (error "Must not be reached.")))) (defun compile-accessor (form venv aenv fenv) (compile-apply form venv aenv fenv)) (defun compile-the (form venv aenv fenv) (let ((value (the-value form))) (compile-form value venv aenv fenv))) (defun compile-if (form venv aenv fenv) (let ((test-form (if-test-form form)) (then-form (if-then-form form)) (else-form (if-else-form form))) (let ((test-form1 (compile-form test-form venv aenv fenv)) (then-form1 (compile-form then-form venv aenv fenv)) (else-form1 (compile-form else-form venv aenv fenv))) `(if ,test-form1 ,then-form1 ,else-form1)))) (defun compile-let (form venv aenv fenv) (let ((bindings (let-bindings form)) (body (let-body form))) (%compile-let bindings body venv aenv fenv venv))) (defun %compile-let (bindings body venv aenv fenv venv1) (if bindings (destructuring-bind ((var form) . bindings1) bindings (let* ((form1 (compile-form form venv aenv fenv)) (type (query-appenv (car bindings) aenv)) (venv2 (extend-varenv var type venv1)) (vars (query-varenv var venv2))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,form1)) (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,form1 (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) (t (error "Must not be reached."))))) (compile-form body venv1 aenv fenv))) (defun compile-flet (form venv aenv fenv) (let ((bindings (flet-bindings form)) (body (flet-body form))) (%compile-flet 'flet bindings body nil venv aenv fenv nil fenv))) (defun %compile-flet (op bindings body rec-p venv aenv fenv bindings1 fenv1) (if bindings (destructuring-bind ((name args form) . rest) bindings (let ((ftype (query-appenv (car bindings) aenv))) (multiple-value-bind (name1 args1 form1) (compile-function name ftype args form venv aenv fenv :entry-p nil :rec-p rec-p) (let ((bindings2 (cons `(,name1 ,args1 ,@form1) bindings1)) (fenv2 (extend-funenv-function name name1 ftype args fenv1))) (%compile-flet op rest body rec-p venv aenv fenv bindings2 fenv2))))) `(,op ,bindings1 ,(compile-form body venv aenv fenv1)))) (defun compile-labels (form venv aenv fenv) (let ((bindings (labels-bindings form)) (body (labels-body form))) (%compile-flet 'labels bindings body t venv aenv fenv nil fenv))) (defun compile-setf (form venv aenv fenv) (let ((place (setf-place form)) (value (setf-value form))) (let ((place1 (compile-place place venv aenv fenv)) (value1 (compile-form value venv aenv fenv))) `(setf ,place1 ,value1)))) (defun compile-place (place venv aenv fenv) ;; Strip type specifier from compiled form to be well optimized. (if (reference-place-p place) (compile-form place venv aenv fenv) (third (compile-form place venv aenv fenv)))) (defun compile-apply (form venv aenv fenv) (let ((operator (apply-operator form))) (if (built-in-exists-p operator) (compile-built-in-apply form venv aenv fenv) (compile-user-apply form venv aenv fenv)))) (defun compile-built-in-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (built-in-argc operator))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let* ((type (query-appenv form aenv)) (return-type (function-return-type type))) (let ((operator1 (built-in-operator :lisp operator type)) (operands1 (loop for operand in operands collect (compile-form operand venv aenv fenv))) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@operands1)))))) (defun compile-user-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (funenv-function-argc operator fenv))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let ((args (funenv-function-arguments operator fenv)) (arg-types (funenv-function-arg-types operator fenv))) (%compile-user-apply operator operands args arg-types venv aenv fenv nil)))) (defun %compile-user-apply (operator operands args arg-types venv aenv fenv vars1) (if operands (destructuring-bind (operand . operands1) operands (destructuring-bind (arg . args1) args (destructuring-bind (type . arg-types1) arg-types (let* ((operand1 (compile-form operand venv aenv fenv)) (venv1 (extend-varenv arg type venv)) (vars (query-varenv arg venv1)) (vars2 (append vars vars1))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,operand1)) (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,operand1 (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) (t (error "Must not be reached."))))))) (let* ((operator1 (funenv-function-name1 operator fenv)) (return-type (funenv-function-return-type operator fenv)) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@(nreverse vars1))))))
true
#| This file is a part of avm project. Copyright (c) 2016 PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) |# (in-package :cl-user) (defpackage avm.lang.compiler.lisp.compile (:use :cl :avm :avm.lang.data :avm.lang.type :avm.lang.syntax :avm.lang.built-in :avm.lang.typenv :avm.lang.appenv :avm.lang.funenv :avm.lang.compiler.lisp.compile-type :avm.lang.compiler.lisp.varenv) (:export :compile-function :*genname-counter*)) (in-package :avm.lang.compiler.lisp.compile) ;; ;; Genname (defvar *genname-counter* 0) (defun genname (name) (prog1 (intern (format nil "~A~A" name *genname-counter*)) (incf *genname-counter*))) ;; ;; Compile (defun compile-function (name ftype args body venv aenv fenv &key entry-p rec-p) (assert (not (and entry-p (not rec-p)))) (let* ((name1 (compile-name name entry-p)) (pairs (loop for arg in args for type in (function-arg-types ftype) collect (cons arg type))) (venv1 (flet ((aux (venv pair) (destructuring-bind (arg . type) pair (extend-varenv arg type venv)))) (reduce #'aux pairs :initial-value venv))) (fenv1 (if rec-p (extend-funenv-function name name1 ftype args fenv) fenv))) (let ((args1 (compile-arguments args venv1)) (type-decls (compile-type-declarations ftype args venv1)) (body1 (compile-form body venv1 aenv fenv1))) (values name1 args1 `(,@type-decls ,body1))))) (defun compile-name (name entry-p) (if entry-p (let ((symbol-name (symbol-name name)) (symbol-package (symbol-package name))) (intern (format nil "%LISP-~A" symbol-name) symbol-package)) (genname name))) (defun compile-arguments (args venv) (loop for arg in args append (query-varenv arg venv))) (defun compile-type-declarations (ftype args venv) `((declare (optimize (speed 3) (safety 0))) (declare (ignorable ,@(loop for arg in args append (query-varenv arg venv)))) ,@(loop for arg in args for vars = (query-varenv arg venv) for type in (function-arg-types ftype) collect (cond ;; Scalar type and array type. ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(declare (type ,type1 ,@vars)))) ;; Vector type. ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(declare (type ,type1 ,@vars)))) (t (error "Must not be reached.")))))) (defun compile-form (form venv aenv fenv) (cond ((literal-p form) (compile-literal form venv aenv fenv)) ((reference-p form) (compile-reference form venv aenv fenv)) ((accessor-p form) (compile-accessor form venv aenv fenv)) ((the-p form) (compile-the form venv aenv fenv)) ((if-p form) (compile-if form venv aenv fenv)) ((let-p form) (compile-let form venv aenv fenv)) ((flet-p form) (compile-flet form venv aenv fenv)) ((labels-p form) (compile-labels form venv aenv fenv)) ((setf-p form) (compile-setf form venv aenv fenv)) ((apply-p form) (compile-apply form venv aenv fenv)) (t (error "The value ~S is an invalid form." form)))) (defun compile-literal (form venv aenv fenv) (declare (ignore venv aenv fenv)) form) (defun compile-reference (form venv aenv fenv) (declare (ignore aenv fenv)) (multiple-value-bind (vars type) (query-varenv form venv) (cond ((or (scalar-type-p type) (array-type-p type)) (car vars)) ((vector-type-p type) (let ((vector-values* (vector-type-values* type))) `(,vector-values* ,@vars))) (t (error "Must not be reached."))))) (defun vector-type-values* (type) (cl-pattern:match type ((:vector 'int 2) 'int2-values*) ((:vector 'int 3) 'int3-values*) ((:vector 'int 4) 'int4-values*) ((:vector 'float 2) 'float2-values*) ((:vector 'float 3) 'float3-values*) ((:vector 'float 4) 'float4-values*) ((:vector 'double 2) 'double2-values*) ((:vector 'double 3) 'double3-values*) ((:vector 'double 4) 'double4-values*) (_ (error "Must not be reached.")))) (defun compile-accessor (form venv aenv fenv) (compile-apply form venv aenv fenv)) (defun compile-the (form venv aenv fenv) (let ((value (the-value form))) (compile-form value venv aenv fenv))) (defun compile-if (form venv aenv fenv) (let ((test-form (if-test-form form)) (then-form (if-then-form form)) (else-form (if-else-form form))) (let ((test-form1 (compile-form test-form venv aenv fenv)) (then-form1 (compile-form then-form venv aenv fenv)) (else-form1 (compile-form else-form venv aenv fenv))) `(if ,test-form1 ,then-form1 ,else-form1)))) (defun compile-let (form venv aenv fenv) (let ((bindings (let-bindings form)) (body (let-body form))) (%compile-let bindings body venv aenv fenv venv))) (defun %compile-let (bindings body venv aenv fenv venv1) (if bindings (destructuring-bind ((var form) . bindings1) bindings (let* ((form1 (compile-form form venv aenv fenv)) (type (query-appenv (car bindings) aenv)) (venv2 (extend-varenv var type venv1)) (vars (query-varenv var venv2))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,form1)) (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,form1 (declare (ignorable ,@vars)) (declare (type ,type1 ,@vars)) ,(%compile-let bindings1 body venv aenv fenv venv2)))) (t (error "Must not be reached."))))) (compile-form body venv1 aenv fenv))) (defun compile-flet (form venv aenv fenv) (let ((bindings (flet-bindings form)) (body (flet-body form))) (%compile-flet 'flet bindings body nil venv aenv fenv nil fenv))) (defun %compile-flet (op bindings body rec-p venv aenv fenv bindings1 fenv1) (if bindings (destructuring-bind ((name args form) . rest) bindings (let ((ftype (query-appenv (car bindings) aenv))) (multiple-value-bind (name1 args1 form1) (compile-function name ftype args form venv aenv fenv :entry-p nil :rec-p rec-p) (let ((bindings2 (cons `(,name1 ,args1 ,@form1) bindings1)) (fenv2 (extend-funenv-function name name1 ftype args fenv1))) (%compile-flet op rest body rec-p venv aenv fenv bindings2 fenv2))))) `(,op ,bindings1 ,(compile-form body venv aenv fenv1)))) (defun compile-labels (form venv aenv fenv) (let ((bindings (labels-bindings form)) (body (labels-body form))) (%compile-flet 'labels bindings body t venv aenv fenv nil fenv))) (defun compile-setf (form venv aenv fenv) (let ((place (setf-place form)) (value (setf-value form))) (let ((place1 (compile-place place venv aenv fenv)) (value1 (compile-form value venv aenv fenv))) `(setf ,place1 ,value1)))) (defun compile-place (place venv aenv fenv) ;; Strip type specifier from compiled form to be well optimized. (if (reference-place-p place) (compile-form place venv aenv fenv) (third (compile-form place venv aenv fenv)))) (defun compile-apply (form venv aenv fenv) (let ((operator (apply-operator form))) (if (built-in-exists-p operator) (compile-built-in-apply form venv aenv fenv) (compile-user-apply form venv aenv fenv)))) (defun compile-built-in-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (built-in-argc operator))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let* ((type (query-appenv form aenv)) (return-type (function-return-type type))) (let ((operator1 (built-in-operator :lisp operator type)) (operands1 (loop for operand in operands collect (compile-form operand venv aenv fenv))) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@operands1)))))) (defun compile-user-apply (form venv aenv fenv) (let ((operator (apply-operator form)) (operands (apply-operands form))) (let ((argc (funenv-function-argc operator fenv))) (unless (= argc (length operands)) (error "Invalid number of arguments: ~S" (length operands)))) (let ((args (funenv-function-arguments operator fenv)) (arg-types (funenv-function-arg-types operator fenv))) (%compile-user-apply operator operands args arg-types venv aenv fenv nil)))) (defun %compile-user-apply (operator operands args arg-types venv aenv fenv vars1) (if operands (destructuring-bind (operand . operands1) operands (destructuring-bind (arg . args1) args (destructuring-bind (type . arg-types1) arg-types (let* ((operand1 (compile-form operand venv aenv fenv)) (venv1 (extend-varenv arg type venv)) (vars (query-varenv arg venv1)) (vars2 (append vars vars1))) (cond ((or (scalar-type-p type) (array-type-p type)) (let ((type1 (compile-type type))) `(let ((,@vars ,operand1)) (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) ((vector-type-p type) (let ((type1 (compile-type (vector-type-base-type type)))) `(multiple-value-bind ,vars ,operand1 (declare (type ,type1 ,@vars)) ,(%compile-user-apply operator operands1 args1 arg-types1 venv1 aenv fenv vars2)))) (t (error "Must not be reached."))))))) (let* ((operator1 (funenv-function-name1 operator fenv)) (return-type (funenv-function-return-type operator fenv)) (return-type1 (compile-type return-type))) `(the ,return-type1 (,operator1 ,@(nreverse vars1))))))
[ { "context": "Agreement (BSD License)\n;; \n;; Copyright (c) 2008, Willow Garage, Inc.\n;; All rights reserved.\n;;\n;; Redistributio", "end": 145, "score": 0.999845027923584, "start": 132, "tag": "NAME", "value": "Willow Garage" }, { "context": "d with the distribution.\n;; * Neither the name of Willow Garage, Inc. nor the names \n;; of its contributors ma", "end": 750, "score": 0.999789834022522, "start": 737, "tag": "NAME", "value": "Willow Garage" }, { "context": "p) \n (master-uri (make-uri \"127.0.0.1\" 11311) master-supplied) \n ", "end": 1989, "score": 0.9996944069862366, "start": 1980, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
src/roslisp/src/node.lisp
jungleni/ros_code_reading
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Software License Agreement (BSD License) ;; ;; Copyright (c) 2008, Willow Garage, Inc. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with ;; or without modification, are permitted provided that the ;; following conditions are met: ;; ;; * Redistributions of source code must retain the above ;; copyright notice, this list of conditions and the ;; following disclaimer. ;; * Redistributions in binary form must reproduce the ;; above copyright notice, this list of conditions and ;; the following disclaimer in the documentation and/or ;; other materials provided with the distribution. ;; * Neither the name of Willow Garage, Inc. nor the names ;; of its contributors may be used to endorse or promote ;; products derived from this software without specific ;; prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED ;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ;; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :roslisp) (defun start-ros-node (name &key (xml-rpc-port 8001 xml-port-supp) (pub-server-port 7001 pub-port-supp) (master-uri (make-uri "127.0.0.1" 11311) master-supplied) (anonymous nil) (cmd-line-args (rest sb-ext:*posix-argv*)) &allow-other-keys) "Start up the ROS Node with the given name and master URI. Reset any stored state left over from previous invocations. MASTER-URI is either a string of the form http://foo:12345, or an object created using make-uri. If MASTER-URI is not provided, use *default-master-uri*, and if that's nil (which it will be unless client code sets it), use the value of environment variable ROS_MASTER_URI. ANONYMOUS, if non-nil, causes the current time to be appended to the node name (to make it unique). XML-RPC-PORT and PUB-SERVER-PORT are no longer used. CMD-LINE-ARGS is the list of command line arguments (defaults to argv minus its first element). It can also be a string of space-separated arguments." (declare (string name) (type (or string uri) master-uri)) (assert (not xml-port-supp) nil "start-ros-node no longer accepts the xml-rpc-port argument") (assert (not pub-port-supp) nil "start-ros-node no longer accepts the pub-server-port argument") (unless (eq *node-status* :shutdown) (warn "Before starting node, node-status equalled ~a instead of :shutdown. Shutting the previous node invocation down now." *node-status*) (shutdown-ros-node)) (when anonymous (mvbind (success s ms) (sb-unix:unix-gettimeofday) (declare (ignore success)) (setq name (format nil "~a_~a_~a" name ms s)))) ;; check for legal base name once all changes have been made to the name (unless (and (alpha-char-p (char name 0)) (every #'(lambda (c) (or (alphanumericp c) (equal c #\_))) name)) (warn "~a is not a legal ROS base name. This may cause problems with other ROS tools" name)) (let ((params (handle-command-line-arguments name cmd-line-args))) (setq *ros-log-location* (get-ros-log-location name)) (ensure-directories-exist *ros-log-location* :verbose nil) (setq *ros-log-stream* (open *ros-log-location* :direction :output :if-exists :overwrite :if-does-not-exist :create)) ;; Deal with the master uri (unless master-supplied (setq master-uri (or *default-master-uri* (sb-ext:posix-getenv "ROS_MASTER_URI"))) (unless (and (stringp master-uri) (> (length master-uri) 0)) (error "Master uri needs to be supplied either as an argument to start-ros-node, or through the environment variable ROS_MASTER_URI, or by setting the lisp variable *default-master-uri*"))) (when (stringp master-uri) (mvbind (address port) (parse-uri master-uri) (setq master-uri (make-uri address port)))) (symbol-macrolet ((address (uri-address master-uri))) (unless (parse-string-ip-address address) (setf address (ip-address-string (lookup-hostname-ip-address address))))) (setq *master-uri* master-uri) ;; Set params specified at command line (dolist (p params) (set-param (car p) (cdr p))) ;; Initialize debug levels (reset-debug-levels (make-instance 'Empty-Request)) ;; Now we can finally print some debug messages (ros-debug (roslisp top) "Log location is ~a" *ros-log-location*) (command-line-args-rosout cmd-line-args params) (unless master-supplied (ros-debug (roslisp top) "Master uri was not supplied, so using default")) (ros-info (roslisp top) "master URI is ~a:~a" (uri-address master-uri) (uri-port master-uri)) ;; Done setting up master connection ;; Spawn a thread that will start up the listeners, then run the event loop (with-recursive-lock (*ros-lock*) (setf *event-loop-thread* (sb-thread:make-thread #'(lambda () (when (eq *node-status* :running) (error "Can't start node as status already equals running. Call shutdown-ros-node first.")) ;; Start publication and xml-rpc servers. (mvbind (srv sock) (start-xml-rpc-server :port 0) (setq *xml-server* srv xml-rpc-port (nth-value 1 (sb-bsd-sockets:socket-name sock)))) (ros-debug (roslisp top) "Started XML-RPC server on port ~a" xml-rpc-port) (setq *tcp-server-hostname* (hostname) *tcp-server* (ros-node-tcp-server 0) pub-server-port (nth-value 1 (sb-bsd-sockets:socket-name *tcp-server*))) (ros-debug (roslisp top) "Started tcpros server on port ~a" pub-server-port) (setq *tcp-server-port* pub-server-port *broken-socket-streams* (make-hash-table :test #'eq) *service-uri* (format nil "rosrpc://~a:~a" *tcp-server-hostname* *tcp-server-port*) *xml-rpc-caller-api* (format nil "http://~a:~a" (hostname) xml-rpc-port) *publications* (make-hash-table :test #'equal) *subscriptions* (make-hash-table :test #'equal) *services* (make-hash-table :test #'equal) *node-status* :running *deserialization-threads* nil ) (pushnew #'maybe-shutdown-ros-node sb-ext:*exit-hooks*) ;; Finally, start the serve-event loop (event-loop)) :name "ROSLisp event loop")) ;; There's no race condition - if this test and the following advertise call all happen before the event-loop starts, ;; things will just queue up (spin-until (eq *node-status* :running) 1)) ;; Advertise on global rosout topic for debugging messages (advertise "/rosout" "rosgraph_msgs/Log") ;; Subscribe to time if necessary (setq *use-sim-time* (member (get-param "/use_sim_time" nil) '("true" 1 t) :test #'equal)) (when *use-sim-time* (setq *last-clock* nil) (subscribe "/clock" "rosgraph_msgs/Clock" #'(lambda (m) (setq *last-clock* m)) :max-queue-length 5)) ;; Advertise reset-debug-levels service (register-service-fn "~reset_debug_levels" #'reset-debug-levels 'Empty) (ros-info (roslisp top) "Node startup complete"))) (defmacro with-ros-node (args &rest body) "with-ros-node ARGS &rest BODY. Call start-ros-node with argument list ARGS, then execute the body. Takes care of shutting down the ROS node if the body terminates or is interrupted. In addition to the start-ros-node arguments, ARGS may also include the boolean argument :spin. If this is true, after body is executed, the node will just spin forever. Assuming spin is not true, this call will return the return value of the final statement of body." (dbind (name &rest a &key spin &allow-other-keys) args (declare (ignorable name a)) `(let (*namespace*) ;; Set up a binding so that start-ros-node can set it and this will be seen in the body, but not by our caller (unwind-protect (restart-case (progn (start-ros-node ,@args) ,@body ,@(when spin `((spin-until nil 100)))) (shutdown-ros-node (&optional a) (ros-info (roslisp top) "About to shutdown~:[~; due to condition ~:*~a~]" a))) (shutdown-ros-node))))) (defun shutdown-ros-node () "Shutdown-ros-node. Set the status to shutdown, close all open sockets and XML-RPC servers, and unregister all publications, subscriptions, and services with master node. Finally, if *running-from-command-line* is true, exit lisp." (ros-debug (roslisp top) "Acquiring lock") (with-recursive-lock (*ros-lock*) (unless (eq *node-status* :shutdown) (ros-debug (roslisp top) "Initiating shutdown") (setf *node-status* :shutdown) (handler-case (stop-server *xml-server*) (error (c) (cerror "Continue" "Error stopping xml-rpc server: ~a" c))) (close-socket *tcp-server*) ;; Unregister from publications and subscriptions and close the sockets and kill callback and deserialization threads (do-hash (topic pub *publications*) (protected-call-to-master ("unregisterPublisher" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master at ~a when unregistering as publisher of ~a during shutdown: ~a" *master-uri* topic c)) (dolist (sub (subscriber-connections pub)) (handler-case (close-socket (subscriber-socket sub)) (sb-int:simple-stream-error (c) (ros-debug (roslisp top) "Received stream error ~a when attempting to close socket ~a. Skipping." c (subscriber-socket sub)))))) (do-hash (topic sub *subscriptions*) (protected-call-to-master ("unregisterSubscriber" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master when unsubscribing from ~a during shutdown: ~a" topic c)) (handler-case (terminate-thread (topic-thread sub)) (interrupt-thread-error (e) (declare (ignore e))))) (dolist (thread *deserialization-threads*) (ros-debug (roslisp deserialization-thread) "Killing deserialization thread") (ignore-errors (terminate-thread thread))) ;; Unregister services (do-hash (name s *services*) (let ((i (protected-call-to-master ("unregisterService" name *service-uri*) c (ros-warn roslisp "During shutdown, unable to contact master to unregister service ~a: ~a" name c) 1))) (unless (eql i 1) (ros-warn (roslisp top) "When trying to close service ~a, ~a services were closed instead of 1" name i)))) ;; Unset variables that will be used upon next startup (setq *ros-log-location* nil) ;; wait nicely for end of event loop, which was notified by setting *node-status* to shutdown (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5))) (when (sb-thread:thread-alive-p *event-loop-thread*) ;; try killing event-loop thread (may take time) (sb-thread:terminate-thread *event-loop-thread*) (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5)))) (when (sb-thread:thread-alive-p *event-loop-thread*) (error "Event-loop thread cannot be terminated")) (setf *event-loop-thread* nil) (ros-info (roslisp top) "Shutdown complete") (close *ros-log-stream*) (when *running-from-command-line* (sb-ext:exit))))) (defun maybe-shutdown-ros-node () (unless (eq *node-status* :shutdown) (shutdown-ros-node)))
21641
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Software License Agreement (BSD License) ;; ;; Copyright (c) 2008, <NAME>, Inc. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with ;; or without modification, are permitted provided that the ;; following conditions are met: ;; ;; * Redistributions of source code must retain the above ;; copyright notice, this list of conditions and the ;; following disclaimer. ;; * Redistributions in binary form must reproduce the ;; above copyright notice, this list of conditions and ;; the following disclaimer in the documentation and/or ;; other materials provided with the distribution. ;; * Neither the name of <NAME>, Inc. nor the names ;; of its contributors may be used to endorse or promote ;; products derived from this software without specific ;; prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED ;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ;; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :roslisp) (defun start-ros-node (name &key (xml-rpc-port 8001 xml-port-supp) (pub-server-port 7001 pub-port-supp) (master-uri (make-uri "127.0.0.1" 11311) master-supplied) (anonymous nil) (cmd-line-args (rest sb-ext:*posix-argv*)) &allow-other-keys) "Start up the ROS Node with the given name and master URI. Reset any stored state left over from previous invocations. MASTER-URI is either a string of the form http://foo:12345, or an object created using make-uri. If MASTER-URI is not provided, use *default-master-uri*, and if that's nil (which it will be unless client code sets it), use the value of environment variable ROS_MASTER_URI. ANONYMOUS, if non-nil, causes the current time to be appended to the node name (to make it unique). XML-RPC-PORT and PUB-SERVER-PORT are no longer used. CMD-LINE-ARGS is the list of command line arguments (defaults to argv minus its first element). It can also be a string of space-separated arguments." (declare (string name) (type (or string uri) master-uri)) (assert (not xml-port-supp) nil "start-ros-node no longer accepts the xml-rpc-port argument") (assert (not pub-port-supp) nil "start-ros-node no longer accepts the pub-server-port argument") (unless (eq *node-status* :shutdown) (warn "Before starting node, node-status equalled ~a instead of :shutdown. Shutting the previous node invocation down now." *node-status*) (shutdown-ros-node)) (when anonymous (mvbind (success s ms) (sb-unix:unix-gettimeofday) (declare (ignore success)) (setq name (format nil "~a_~a_~a" name ms s)))) ;; check for legal base name once all changes have been made to the name (unless (and (alpha-char-p (char name 0)) (every #'(lambda (c) (or (alphanumericp c) (equal c #\_))) name)) (warn "~a is not a legal ROS base name. This may cause problems with other ROS tools" name)) (let ((params (handle-command-line-arguments name cmd-line-args))) (setq *ros-log-location* (get-ros-log-location name)) (ensure-directories-exist *ros-log-location* :verbose nil) (setq *ros-log-stream* (open *ros-log-location* :direction :output :if-exists :overwrite :if-does-not-exist :create)) ;; Deal with the master uri (unless master-supplied (setq master-uri (or *default-master-uri* (sb-ext:posix-getenv "ROS_MASTER_URI"))) (unless (and (stringp master-uri) (> (length master-uri) 0)) (error "Master uri needs to be supplied either as an argument to start-ros-node, or through the environment variable ROS_MASTER_URI, or by setting the lisp variable *default-master-uri*"))) (when (stringp master-uri) (mvbind (address port) (parse-uri master-uri) (setq master-uri (make-uri address port)))) (symbol-macrolet ((address (uri-address master-uri))) (unless (parse-string-ip-address address) (setf address (ip-address-string (lookup-hostname-ip-address address))))) (setq *master-uri* master-uri) ;; Set params specified at command line (dolist (p params) (set-param (car p) (cdr p))) ;; Initialize debug levels (reset-debug-levels (make-instance 'Empty-Request)) ;; Now we can finally print some debug messages (ros-debug (roslisp top) "Log location is ~a" *ros-log-location*) (command-line-args-rosout cmd-line-args params) (unless master-supplied (ros-debug (roslisp top) "Master uri was not supplied, so using default")) (ros-info (roslisp top) "master URI is ~a:~a" (uri-address master-uri) (uri-port master-uri)) ;; Done setting up master connection ;; Spawn a thread that will start up the listeners, then run the event loop (with-recursive-lock (*ros-lock*) (setf *event-loop-thread* (sb-thread:make-thread #'(lambda () (when (eq *node-status* :running) (error "Can't start node as status already equals running. Call shutdown-ros-node first.")) ;; Start publication and xml-rpc servers. (mvbind (srv sock) (start-xml-rpc-server :port 0) (setq *xml-server* srv xml-rpc-port (nth-value 1 (sb-bsd-sockets:socket-name sock)))) (ros-debug (roslisp top) "Started XML-RPC server on port ~a" xml-rpc-port) (setq *tcp-server-hostname* (hostname) *tcp-server* (ros-node-tcp-server 0) pub-server-port (nth-value 1 (sb-bsd-sockets:socket-name *tcp-server*))) (ros-debug (roslisp top) "Started tcpros server on port ~a" pub-server-port) (setq *tcp-server-port* pub-server-port *broken-socket-streams* (make-hash-table :test #'eq) *service-uri* (format nil "rosrpc://~a:~a" *tcp-server-hostname* *tcp-server-port*) *xml-rpc-caller-api* (format nil "http://~a:~a" (hostname) xml-rpc-port) *publications* (make-hash-table :test #'equal) *subscriptions* (make-hash-table :test #'equal) *services* (make-hash-table :test #'equal) *node-status* :running *deserialization-threads* nil ) (pushnew #'maybe-shutdown-ros-node sb-ext:*exit-hooks*) ;; Finally, start the serve-event loop (event-loop)) :name "ROSLisp event loop")) ;; There's no race condition - if this test and the following advertise call all happen before the event-loop starts, ;; things will just queue up (spin-until (eq *node-status* :running) 1)) ;; Advertise on global rosout topic for debugging messages (advertise "/rosout" "rosgraph_msgs/Log") ;; Subscribe to time if necessary (setq *use-sim-time* (member (get-param "/use_sim_time" nil) '("true" 1 t) :test #'equal)) (when *use-sim-time* (setq *last-clock* nil) (subscribe "/clock" "rosgraph_msgs/Clock" #'(lambda (m) (setq *last-clock* m)) :max-queue-length 5)) ;; Advertise reset-debug-levels service (register-service-fn "~reset_debug_levels" #'reset-debug-levels 'Empty) (ros-info (roslisp top) "Node startup complete"))) (defmacro with-ros-node (args &rest body) "with-ros-node ARGS &rest BODY. Call start-ros-node with argument list ARGS, then execute the body. Takes care of shutting down the ROS node if the body terminates or is interrupted. In addition to the start-ros-node arguments, ARGS may also include the boolean argument :spin. If this is true, after body is executed, the node will just spin forever. Assuming spin is not true, this call will return the return value of the final statement of body." (dbind (name &rest a &key spin &allow-other-keys) args (declare (ignorable name a)) `(let (*namespace*) ;; Set up a binding so that start-ros-node can set it and this will be seen in the body, but not by our caller (unwind-protect (restart-case (progn (start-ros-node ,@args) ,@body ,@(when spin `((spin-until nil 100)))) (shutdown-ros-node (&optional a) (ros-info (roslisp top) "About to shutdown~:[~; due to condition ~:*~a~]" a))) (shutdown-ros-node))))) (defun shutdown-ros-node () "Shutdown-ros-node. Set the status to shutdown, close all open sockets and XML-RPC servers, and unregister all publications, subscriptions, and services with master node. Finally, if *running-from-command-line* is true, exit lisp." (ros-debug (roslisp top) "Acquiring lock") (with-recursive-lock (*ros-lock*) (unless (eq *node-status* :shutdown) (ros-debug (roslisp top) "Initiating shutdown") (setf *node-status* :shutdown) (handler-case (stop-server *xml-server*) (error (c) (cerror "Continue" "Error stopping xml-rpc server: ~a" c))) (close-socket *tcp-server*) ;; Unregister from publications and subscriptions and close the sockets and kill callback and deserialization threads (do-hash (topic pub *publications*) (protected-call-to-master ("unregisterPublisher" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master at ~a when unregistering as publisher of ~a during shutdown: ~a" *master-uri* topic c)) (dolist (sub (subscriber-connections pub)) (handler-case (close-socket (subscriber-socket sub)) (sb-int:simple-stream-error (c) (ros-debug (roslisp top) "Received stream error ~a when attempting to close socket ~a. Skipping." c (subscriber-socket sub)))))) (do-hash (topic sub *subscriptions*) (protected-call-to-master ("unregisterSubscriber" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master when unsubscribing from ~a during shutdown: ~a" topic c)) (handler-case (terminate-thread (topic-thread sub)) (interrupt-thread-error (e) (declare (ignore e))))) (dolist (thread *deserialization-threads*) (ros-debug (roslisp deserialization-thread) "Killing deserialization thread") (ignore-errors (terminate-thread thread))) ;; Unregister services (do-hash (name s *services*) (let ((i (protected-call-to-master ("unregisterService" name *service-uri*) c (ros-warn roslisp "During shutdown, unable to contact master to unregister service ~a: ~a" name c) 1))) (unless (eql i 1) (ros-warn (roslisp top) "When trying to close service ~a, ~a services were closed instead of 1" name i)))) ;; Unset variables that will be used upon next startup (setq *ros-log-location* nil) ;; wait nicely for end of event loop, which was notified by setting *node-status* to shutdown (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5))) (when (sb-thread:thread-alive-p *event-loop-thread*) ;; try killing event-loop thread (may take time) (sb-thread:terminate-thread *event-loop-thread*) (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5)))) (when (sb-thread:thread-alive-p *event-loop-thread*) (error "Event-loop thread cannot be terminated")) (setf *event-loop-thread* nil) (ros-info (roslisp top) "Shutdown complete") (close *ros-log-stream*) (when *running-from-command-line* (sb-ext:exit))))) (defun maybe-shutdown-ros-node () (unless (eq *node-status* :shutdown) (shutdown-ros-node)))
true
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Software License Agreement (BSD License) ;; ;; Copyright (c) 2008, PI:NAME:<NAME>END_PI, Inc. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with ;; or without modification, are permitted provided that the ;; following conditions are met: ;; ;; * Redistributions of source code must retain the above ;; copyright notice, this list of conditions and the ;; following disclaimer. ;; * Redistributions in binary form must reproduce the ;; above copyright notice, this list of conditions and ;; the following disclaimer in the documentation and/or ;; other materials provided with the distribution. ;; * Neither the name of PI:NAME:<NAME>END_PI, Inc. nor the names ;; of its contributors may be used to endorse or promote ;; products derived from this software without specific ;; prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND ;; CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED ;; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ;; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;; DAMAGE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :roslisp) (defun start-ros-node (name &key (xml-rpc-port 8001 xml-port-supp) (pub-server-port 7001 pub-port-supp) (master-uri (make-uri "127.0.0.1" 11311) master-supplied) (anonymous nil) (cmd-line-args (rest sb-ext:*posix-argv*)) &allow-other-keys) "Start up the ROS Node with the given name and master URI. Reset any stored state left over from previous invocations. MASTER-URI is either a string of the form http://foo:12345, or an object created using make-uri. If MASTER-URI is not provided, use *default-master-uri*, and if that's nil (which it will be unless client code sets it), use the value of environment variable ROS_MASTER_URI. ANONYMOUS, if non-nil, causes the current time to be appended to the node name (to make it unique). XML-RPC-PORT and PUB-SERVER-PORT are no longer used. CMD-LINE-ARGS is the list of command line arguments (defaults to argv minus its first element). It can also be a string of space-separated arguments." (declare (string name) (type (or string uri) master-uri)) (assert (not xml-port-supp) nil "start-ros-node no longer accepts the xml-rpc-port argument") (assert (not pub-port-supp) nil "start-ros-node no longer accepts the pub-server-port argument") (unless (eq *node-status* :shutdown) (warn "Before starting node, node-status equalled ~a instead of :shutdown. Shutting the previous node invocation down now." *node-status*) (shutdown-ros-node)) (when anonymous (mvbind (success s ms) (sb-unix:unix-gettimeofday) (declare (ignore success)) (setq name (format nil "~a_~a_~a" name ms s)))) ;; check for legal base name once all changes have been made to the name (unless (and (alpha-char-p (char name 0)) (every #'(lambda (c) (or (alphanumericp c) (equal c #\_))) name)) (warn "~a is not a legal ROS base name. This may cause problems with other ROS tools" name)) (let ((params (handle-command-line-arguments name cmd-line-args))) (setq *ros-log-location* (get-ros-log-location name)) (ensure-directories-exist *ros-log-location* :verbose nil) (setq *ros-log-stream* (open *ros-log-location* :direction :output :if-exists :overwrite :if-does-not-exist :create)) ;; Deal with the master uri (unless master-supplied (setq master-uri (or *default-master-uri* (sb-ext:posix-getenv "ROS_MASTER_URI"))) (unless (and (stringp master-uri) (> (length master-uri) 0)) (error "Master uri needs to be supplied either as an argument to start-ros-node, or through the environment variable ROS_MASTER_URI, or by setting the lisp variable *default-master-uri*"))) (when (stringp master-uri) (mvbind (address port) (parse-uri master-uri) (setq master-uri (make-uri address port)))) (symbol-macrolet ((address (uri-address master-uri))) (unless (parse-string-ip-address address) (setf address (ip-address-string (lookup-hostname-ip-address address))))) (setq *master-uri* master-uri) ;; Set params specified at command line (dolist (p params) (set-param (car p) (cdr p))) ;; Initialize debug levels (reset-debug-levels (make-instance 'Empty-Request)) ;; Now we can finally print some debug messages (ros-debug (roslisp top) "Log location is ~a" *ros-log-location*) (command-line-args-rosout cmd-line-args params) (unless master-supplied (ros-debug (roslisp top) "Master uri was not supplied, so using default")) (ros-info (roslisp top) "master URI is ~a:~a" (uri-address master-uri) (uri-port master-uri)) ;; Done setting up master connection ;; Spawn a thread that will start up the listeners, then run the event loop (with-recursive-lock (*ros-lock*) (setf *event-loop-thread* (sb-thread:make-thread #'(lambda () (when (eq *node-status* :running) (error "Can't start node as status already equals running. Call shutdown-ros-node first.")) ;; Start publication and xml-rpc servers. (mvbind (srv sock) (start-xml-rpc-server :port 0) (setq *xml-server* srv xml-rpc-port (nth-value 1 (sb-bsd-sockets:socket-name sock)))) (ros-debug (roslisp top) "Started XML-RPC server on port ~a" xml-rpc-port) (setq *tcp-server-hostname* (hostname) *tcp-server* (ros-node-tcp-server 0) pub-server-port (nth-value 1 (sb-bsd-sockets:socket-name *tcp-server*))) (ros-debug (roslisp top) "Started tcpros server on port ~a" pub-server-port) (setq *tcp-server-port* pub-server-port *broken-socket-streams* (make-hash-table :test #'eq) *service-uri* (format nil "rosrpc://~a:~a" *tcp-server-hostname* *tcp-server-port*) *xml-rpc-caller-api* (format nil "http://~a:~a" (hostname) xml-rpc-port) *publications* (make-hash-table :test #'equal) *subscriptions* (make-hash-table :test #'equal) *services* (make-hash-table :test #'equal) *node-status* :running *deserialization-threads* nil ) (pushnew #'maybe-shutdown-ros-node sb-ext:*exit-hooks*) ;; Finally, start the serve-event loop (event-loop)) :name "ROSLisp event loop")) ;; There's no race condition - if this test and the following advertise call all happen before the event-loop starts, ;; things will just queue up (spin-until (eq *node-status* :running) 1)) ;; Advertise on global rosout topic for debugging messages (advertise "/rosout" "rosgraph_msgs/Log") ;; Subscribe to time if necessary (setq *use-sim-time* (member (get-param "/use_sim_time" nil) '("true" 1 t) :test #'equal)) (when *use-sim-time* (setq *last-clock* nil) (subscribe "/clock" "rosgraph_msgs/Clock" #'(lambda (m) (setq *last-clock* m)) :max-queue-length 5)) ;; Advertise reset-debug-levels service (register-service-fn "~reset_debug_levels" #'reset-debug-levels 'Empty) (ros-info (roslisp top) "Node startup complete"))) (defmacro with-ros-node (args &rest body) "with-ros-node ARGS &rest BODY. Call start-ros-node with argument list ARGS, then execute the body. Takes care of shutting down the ROS node if the body terminates or is interrupted. In addition to the start-ros-node arguments, ARGS may also include the boolean argument :spin. If this is true, after body is executed, the node will just spin forever. Assuming spin is not true, this call will return the return value of the final statement of body." (dbind (name &rest a &key spin &allow-other-keys) args (declare (ignorable name a)) `(let (*namespace*) ;; Set up a binding so that start-ros-node can set it and this will be seen in the body, but not by our caller (unwind-protect (restart-case (progn (start-ros-node ,@args) ,@body ,@(when spin `((spin-until nil 100)))) (shutdown-ros-node (&optional a) (ros-info (roslisp top) "About to shutdown~:[~; due to condition ~:*~a~]" a))) (shutdown-ros-node))))) (defun shutdown-ros-node () "Shutdown-ros-node. Set the status to shutdown, close all open sockets and XML-RPC servers, and unregister all publications, subscriptions, and services with master node. Finally, if *running-from-command-line* is true, exit lisp." (ros-debug (roslisp top) "Acquiring lock") (with-recursive-lock (*ros-lock*) (unless (eq *node-status* :shutdown) (ros-debug (roslisp top) "Initiating shutdown") (setf *node-status* :shutdown) (handler-case (stop-server *xml-server*) (error (c) (cerror "Continue" "Error stopping xml-rpc server: ~a" c))) (close-socket *tcp-server*) ;; Unregister from publications and subscriptions and close the sockets and kill callback and deserialization threads (do-hash (topic pub *publications*) (protected-call-to-master ("unregisterPublisher" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master at ~a when unregistering as publisher of ~a during shutdown: ~a" *master-uri* topic c)) (dolist (sub (subscriber-connections pub)) (handler-case (close-socket (subscriber-socket sub)) (sb-int:simple-stream-error (c) (ros-debug (roslisp top) "Received stream error ~a when attempting to close socket ~a. Skipping." c (subscriber-socket sub)))))) (do-hash (topic sub *subscriptions*) (protected-call-to-master ("unregisterSubscriber" topic *xml-rpc-caller-api*) c (ros-warn (roslisp) "Could not contact master when unsubscribing from ~a during shutdown: ~a" topic c)) (handler-case (terminate-thread (topic-thread sub)) (interrupt-thread-error (e) (declare (ignore e))))) (dolist (thread *deserialization-threads*) (ros-debug (roslisp deserialization-thread) "Killing deserialization thread") (ignore-errors (terminate-thread thread))) ;; Unregister services (do-hash (name s *services*) (let ((i (protected-call-to-master ("unregisterService" name *service-uri*) c (ros-warn roslisp "During shutdown, unable to contact master to unregister service ~a: ~a" name c) 1))) (unless (eql i 1) (ros-warn (roslisp top) "When trying to close service ~a, ~a services were closed instead of 1" name i)))) ;; Unset variables that will be used upon next startup (setq *ros-log-location* nil) ;; wait nicely for end of event loop, which was notified by setting *node-status* to shutdown (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5))) (when (sb-thread:thread-alive-p *event-loop-thread*) ;; try killing event-loop thread (may take time) (sb-thread:terminate-thread *event-loop-thread*) (dotimes (wait-it 6) (when (sb-thread:thread-alive-p *event-loop-thread*) (sleep 0.5)))) (when (sb-thread:thread-alive-p *event-loop-thread*) (error "Event-loop thread cannot be terminated")) (setf *event-loop-thread* nil) (ros-info (roslisp top) "Shutdown complete") (close *ros-log-stream*) (when *running-from-command-line* (sb-ext:exit))))) (defun maybe-shutdown-ros-node () (unless (eq *node-status* :shutdown) (shutdown-ros-node)))
[ { "context": "ng 5/23/80 by BSG\n;;;\tGratuitous marks 11/06/81 by Barmar\n;;;\tJSL's regular expressions and other stuff,", "end": 633, "score": 0.5048455595970154, "start": 630, "tag": "NAME", "value": "Bar" }, { "context": "08/31/78\n;;;\tCleaned up and bugs fixed 1 July 1981 Barry Margolin\n;;;\tMerged and installed 1 July 1981 RMSoley\n;;;\n", "end": 7093, "score": 0.9916760325431824, "start": 7079, "tag": "NAME", "value": "Barry Margolin" }, { "context": "\n;;;\n;;; Regular Expression searches in Lisp.\n;;; J. Spencer Love, 7 May 1982\n;;;\n\n(defcom-synonym regexp-search-co", "end": 22989, "score": 0.9985535144805908, "start": 22974, "tag": "NAME", "value": "J. Spencer Love" } ]
library_dir_dir/system_library_unbundled/source/bound_emacs_packages_.s.archive/emacs-extended-searches.lisp
dancrossnyc/multics
65
;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; Various Hairy Search Commands ;;; GMP ;;; CR/NL handling 5/23/80 by BSG ;;; Gratuitous marks 11/06/81 by Barmar ;;; JSL's regular expressions and other stuff, 30 August 1982 Barmar ;;; Added ^_ (self-documentation) response to searches, ;;; and moved query-replace out to e_macops_. 31 August 1982 Barmar ;;; (%include backquote) ;;; read macro 12/3/78 by BSG (eval-when (compile eval) (setsyntax '/# 'macro '(lambda () (cond ((= (tyipeek) 57) (tyi) (tyi)) ((= (tyipeek) 136) (tyi) (- (boole 1 137 (tyi)) 100))))) );;;end of eval-when (defun chars-left-in-line macro (x) `(- curlinel curpointpos 1)) (defun save-excursion-on-search-failure macro (x) (let ((dummy (gensym)) (forms (cdr x)) (mark (gensym))) `(let ((,dummy nil) (,mark nil)) (unwind-protect (progn (setq ,mark (set-mark)) (setq ,dummy (progn . ,forms))) (if ,mark (if (null ,dummy) (go-to-mark ,mark)) (release-mark ,mark)))))) (%include e-macros) (declare (special search-forward last-search-string search-string search-ring search-from-end tty-no-upmotionp must-announce-search last-char-was-^S isearch-stack macro-execution-in-progress ITS-string-search-set-mark home-mark isearch-exit-char MCS-editing-characters rubout-character) (*expr minibuffer-rubout search:maybe-push-default set-permanent-key mark-at-current-point-p exch-point-mark forward-search-bounded go-to-line-point reverse-search-bounded search:announce-partial-failure search:last-string search:numeric-prompt search:prompt search:rotate-ring) (*lexpr gratuitous-mark-setter)) ;;; Command intended for use in start_up.emacs. It sets permanent definitions ;;; of ^S and ^R to specified type of search. Note that when an unrecognized ;;; type is supplied it merely prints an error without using command-quit. (defcom set-search-mode &args ((search-type &symbol &prompt "Search mode: " &completions '(string character ITS-string its-string incremental regexp regular-expression default))) (cond ((memq search-type '(default string)) (set-permanent-key '^S 'string-search) (set-permanent-key '^R 'reverse-string-search)) ((memq search-type '(character)) (set-permanent-key '^S 'character-search) (set-permanent-key '^R 'reverse-character-search)) ((memq search-type '(ITS-string its-string)) (set-permanent-key '^S 'ITS-string-search) (set-permanent-key '^R 'reverse-ITS-string-search)) ((memq search-type '(regular-expression regexp)) (set-permanent-key '^S 'regexp-search) (set-permanent-key '^R 'reverse-regexp-search)) ((eq search-type 'incremental) (set-permanent-key '^S 'incremental-search) (set-permanent-key '^R 'reverse-incremental-search)) (t (display-error-noabort "Unknown search mode: " search-type) (ring-tty-bell)))) ;;; ;;; ;;; Character search commands (from ITS) ;;; GMP, 08/31/78 ;;; ;;; Character search command (defcom character-search (let ((search-forward t)) (character-search-))) ;;; Reverse character search command (defcom reverse-character-search (let ((search-forward nil)) (character-search-))) ;;; Subr that actually does character search (defun character-search- () (with-mark home-mark (let ((quoted nil)) (do-forever (let ((ch (get-char))) (cond ((and (= ch #^A) (not quoted)) ; string search (ITS-string-search-) (stop-doing)) ((and (= ch #^G) (not quoted)) ; punt (command-quit)) ((or (= ch #^J) ; find line break (and (= ch #^M) (not quoted))) ; ^M (unquoted), same as ^J (search:maybe-push-default NL 'string) (if search-forward (if (lastlinep) (display-error "Search fails.")) (next-line) else (if (firstlinep) (display-error "Search fails.")) (prev-line) (go-to-end-of-line)) (gratuitous-mark-setter home-mark) (stop-doing)) ((and (= ch #^Q) (not quoted)) ; quote char (setq quoted t)) ((and (= ch #^R) (not quoted)) ; reverse direction (if search-forward (setq search-forward (not search-forward)) else (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing))) ((and (= ch #^S) (not quoted)) ; look for default (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing)) ((and (= ch #^_) (not quoted)) (character-search-documentation)) (t ; look for this (let ((result nil)) (if search-forward (setq result (forward-search (ascii ch))) else (setq result (reverse-search (ascii ch)))) (search:maybe-push-default (ascii ch) 'string) (if result (gratuitous-mark-setter home-mark) (stop-doing) else (display-error "Search fails.")))))))))) ;;; Search for current default string (defun search-for-default-string () (if (nullstringp last-search-string) (display-error "No default search string.") else (let ((result nil)) (if (> (stringlength last-search-string) 1) (minibuffer-clear) (minibuffer-print (cond (search-forward "") (t "Reverse ")) "Search: " last-search-string)) (if search-forward (setq result (forward-search last-search-string)) else (setq result (reverse-search last-search-string))) (or result (display-error "Search fails."))))) (defun character-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl '("Character search options:" "" "^S Search for default search string" "^R If searching forward, reverse direction, otherwise" " Search back for default string" "^A ITS string search" "CR, LF Search for next newline" "^G Abort search" "^Q Reads a character and searches for it" "^_ Print this description" "anything else" " searches for the character" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; ITS String search commands ;;; GMP, 08/31/78 ;;; Cleaned up and bugs fixed 1 July 1981 Barry Margolin ;;; Merged and installed 1 July 1981 RMSoley ;;; ;;; ITS string search command (defcom ITS-string-search (let ((search-forward t)) (ITS-string-search-))) ;;; Reverse ITS string search command (defcom reverse-ITS-string-search (let ((search-forward nil)) (ITS-string-search-))) ;;; Subr to perform ITS string search (defun ITS-string-search- () (with-mark home-mark (setq last-char-was-^S nil search-string "" search-from-end nil) (ITS-string-search-announce) (let ((ITS-string-search-set-mark nil) (rubout-character (cadr MCS-editing-characters))) (do-forever (if (eq (ITS-string-search-process-char (get-char)) 'done) (stop-doing)))) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")))) ;;; Announce direction, type, and search string (defun ITS-string-search-announce () (if (not macro-execution-in-progress) (minibuffer-clear) (if search-forward (if search-from-end (minibuffer-print "BJ ITS String Search: ") else (minibuffer-print "ITS String Search: ")) else (if search-from-end (minibuffer-print "ZJ Reverse ITS String Search: ") else (minibuffer-print "Reverse ITS String Search: "))) (minibuffer-print-noclear search-string)) (setq must-announce-search nil)) ;;; Handle single character of ITS string search (defun ITS-string-search-process-char (ch) (prog1 (cond ((or (= ch 177) (= ch rubout-character)) (if (nullstringp search-string) (ITS-string-search-quit) else (isearch-chop-string-and-minibuffer) ; need better for printing 'continue)) ((= ch #^J) 'continue) ;LF ((= ch #^G) (ITS-string-search-quit)) ; punt ((= ch #^B) ; complement search from beginning (if search-forward (setq search-from-end (not search-from-end)) (ITS-string-search-announce) else (ITS-string-search-error "Can not search from beginning in reverse search." nil)) 'continue) ((= ch #^E) ; complement search from end (if search-forward (ITS-string-search-error "Can not search from end in forward search." nil) else (setq search-from-end (not search-from-end)) (ITS-string-search-announce)) 'continue) ((= ch #^L) (if (not macro-execution-in-progress) (minibuffer-clear) (redisplay)) ; redisplay (ITS-string-search-announce) 'continue) ((= ch #^Y) ; append default string (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (catenate search-string last-search-string)) (ITS-string-search-out last-search-string)) 'continue) ((= ch #^D) ; yank default and rotate (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (search:rotate-ring)) (setq last-search-string (search:last-string)) ; copy of top (ITS-string-search-announce)) 'continue) ((= ch #^Q) ; quote next chararacter (let ((ch1 (ascii (get-char)))) (setq search-string (catenate search-string ch1)) (ITS-string-search-out ch1)) 'continue) ((= ch #^R) ; reverse direction of search (setq search-forward (not search-forward)) (ITS-string-search-announce) 'continue) ((or (= ch #^S) (= ch #^[)) ; ^S or ESC, search and maybe quit (if (and (= ch #^[) last-char-was-^S) ; ESC after ^S, just exit 'done else (if (nullstringp search-string) (setq search-string last-search-string) (ITS-string-search-out search-string)) (if (nullstringp search-string) (ITS-string-search-error "No search string." (= ch #^[)) else (with-mark start-pos (let ((result nil)) (if search-from-end (if search-forward (go-to-beginning-of-buffer) else (go-to-end-of-buffer))) (if search-forward (setq result (forward-search search-string)) else (setq result (reverse-search search-string))) (if result (if (not ITS-string-search-set-mark) (setq ITS-string-search-set-mark t) ;remember that we did it. (gratuitous-mark-setter home-mark)) (or macro-execution-in-progress (redisplay)) (if tty-no-upmotionp (setq must-announce-search t)) else (ITS-string-search-error "Search fails." (= ch #^[)) (go-to-mark start-pos))))) (search:maybe-push-default search-string 'string) (if (= ch #^S) 'continue ; keep looking else 'done))) ; ESC, search terminates ((= ch #^_) (ITS-string-search-documentation) 'continue) ((and (or (< ch 40) (> ch 177)) ; unknown control (not (or (= ch #^M) (= ch #^I)))) (ring-tty-bell) 'continue) (t ; normal character (if (= ch #^M) (setq ch #^J)) ;cr => nl 5/23/80 (setq search-string (catenate search-string (ascii ch))) (ITS-string-search-out (ascii ch)))) (setq last-char-was-^S (= ch #^S)))) ;;; Add string to minibuffer unless must redisplay minibuffer (defun ITS-string-search-out (string) (if must-announce-search (ITS-string-search-announce) else (or macro-execution-in-progress (minibuffer-print-noclear string)))) ;;; Print error for ITS string search (defun ITS-string-search-error (message use-minibuffer) (if (or tty-no-upmotionp use-minibuffer) (minibuffer-print message) ; not display-error since not fatal (setq must-announce-search t) else ; for display, print it (init-local-displays) (local-display-generator-nnl message) (minibuffer-print-noclear "")) ; reposition cursor (if macro-execution-in-progress (command-quit) else (ring-tty-bell))) ;;; Exit ITS string search (defun ITS-string-search-quit () (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")) ; If displaying, output message. (command-quit)) (defun ITS-string-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("ITS string search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Remove last character from search string") "ESC Exit search, possibly searching first if previous" " character was not ^S" "^S Search for next occurrence of search string or default" "^R Reverse search direction" "^B Toggle ""search from beginning of buffer""" "^E Toggle ""search from end of buffer""" "^Y Add default search string to search string" "^D Rotate default search string ring, and makes it the" " search string" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character and adds it to search string" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; Incremental Search ;;; ;;; Incremental search command (defcom incremental-search (let ((search-forward t)) (incremental-search-))) ;;; Reverse Incremental search command (defcom reverse-incremental-search (let ((search-forward nil)) (incremental-search-))) ;;;Subr to do all the work (defun incremental-search- () (setq isearch-stack (list (cons nil (set-mark)))) (setq search-string "") (incremental-search-announce) (let ((isearch-exit-char nil) (rubout-character (cadr MCS-editing-characters))) (with-mark home-mark (do-forever (or macro-execution-in-progress (redisplay)) (if (eq (isearch-process-char (get-char)) 'done) (stop-doing))) (if (not (nullstringp search-string)) ;if didn't abort search (gratuitous-mark-setter home-mark)) (search:maybe-push-default search-string 'string)) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.") (redisplay)) (and isearch-exit-char (process-char isearch-exit-char)))) ;;; Process a single character (defun isearch-process-char (ch) (cond ((or (= ch 177) (= ch rubout-character)) ;rubout last char (isearch-rubout)) ((= ch #^G) ; abort search (ring-tty-bell) (setq search-string "") (go-to-mark (cdar (last isearch-stack))) 'done) ((= ch #^L) ; redisplay (or macro-execution-in-progress (redisplay)) (incremental-search-announce) 'continue) ((= ch #^Q) ; quote next char (isearch-search-single (ascii (get-char)))) ((or (= ch #^S)(= ch #^R)) ; search again or use default (let ((new-dir (= ch #^S))) (if (not (eq new-dir search-forward)) (setq search-forward new-dir) (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-announce))) (if (not (nullstringp search-string)) (search:maybe-push-default search-string 'string) (setq search-string "") else (or macro-execution-in-progress (minibuffer-print-noclear last-search-string))) (setq isearch-stack (cons (cons nil (set-mark)) ;non-inserting isearch-stack)) (let ((nss (catenate search-string last-search-string))) (if search-forward ;Movin' right... (if (looking-at last-search-string) ;already in front of it, OK (forward-search last-search-string) (setq search-string nss) 'continue else (if (forward-search nss) (setq search-string nss) 'continue else ;not found again (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))) else ;Movin' left... (if (reverse-search nss) (setq search-string nss) 'continue else (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))))) ((= ch #^[) ; all done 'done) ((= ch #^J) 'continue) ((= ch #^M) (isearch-search-single NL)) ((= ch #^_) (incremental-search-documentation)) ((and (or (< ch 40) (> ch 177)) ;random control char, exits (not (= ch #^I))) ;search, then gets executed (setq isearch-exit-char ch) 'done) (t ;normal char, search for it (isearch-search-single (ascii ch))))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) (declare (special display-ctlchar-with-^)) (defun isearch-chop-string-and-minibuffer () (let ((sl (stringlength search-string))) (let ((lastch (CtoI (substr search-string sl 1)))) (setq search-string (substr search-string 1 (1- sl))) (if (and (not tty-no-upmotionp) (not macro-execution-in-progress)) (minibuffer-rubout (cond ((and (> lastch 37) (< lastch 177)) ;printing char 1) (display-ctlchar-with-^ 2) (t 4))))))) ;pretty kludgey, eh? ;;; Search for a single character incrementally (defun isearch-search-single (ch) (if (and (not tty-no-upmotionp) ;put in buffer if needed (not macro-execution-in-progress)) (minibuffer-print-noclear ch)) (setq search-string (catenate search-string ch)) (setq isearch-stack (cons (cons 'insert (set-mark)) isearch-stack)) (if search-forward (if-at ch ;char is here, continue along (forward-char) 'continue else ;not here, search again (if (forward-search search-string) 'continue ;found it else ;not found, flush char typed (incremental-search-failure) (isearch-rubout))) else ;Reverse Isearch (if (looking-at search-string) 'continue else (do-times (1- (stringlength search-string)) (forward-char)) (if (reverse-search search-string) 'continue else (do-times (1- (stringlength search-string)) (backward-char)) (incremental-search-failure) (isearch-rubout))))) (defun incremental-search-announce () (if (not macro-execution-in-progress) (if search-forward (minibuffer-print "Incremental Search: ") else (minibuffer-print "Reverse Incremental Search: ")) (minibuffer-print-noclear search-string)) 'continue) (defun incremental-search-failure () (if macro-execution-in-progress (go-to-mark (cdar (last isearch-stack))) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (setq search-string "") (search-failure-annunciator) else (ring-tty-bell))) (defun incremental-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("Incremental search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Undo last character") "ESC Exit search" "^S Search for next occurrence of search string or default" "^R Reverse search for next occurrence" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character, adds it to search string, and searches" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "other control characters" " Ends search, executes as an Emacs command" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; Global Regular Expression Print ;;; (defcom global-regexp-print &arguments ((string &string &default &eval (regexp:prompt "Global regexp print"))) (setq string (regexp:compile-and-save string)) (let ((foundflag) (tempmark)) (save-excursion (go-to-beginning-of-buffer) (do-forever (setq tempmark (regexp:search string)) (if (not tempmark) (stop-doing)) (if (not foundflag) (setq foundflag t) (init-local-displays)) (if (not (mark-on-current-line-p tempmark)) (exch-point-mark tempmark) (do-forever (local-display-current-line) (next-line) (if (mark-on-current-line-p tempmark) (stop-doing)))) (release-mark tempmark) (local-display-current-line) (if (lastlinep) (stop-doing)) (next-line))) (if foundflag (end-local-displays) else (search-failure-annunciator)))) ;;; These commands autoload from emacs-extended-searches ;;; ;;; Regular Expression searches in Lisp. ;;; J. Spencer Love, 7 May 1982 ;;; (defcom-synonym regexp-search-command regexp-search) (defcom regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse reverse-regexp-search &negative-function reverse-regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Regexp search"))) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:search regexp))) (defun regexp-search-in-line (regexp) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:match regexp (chars-left-in-line) nil))) (defcom reverse-regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse regexp-search &negative-function regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Reverse regexp search"))) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-search regexp))) (defun reverse-regexp-search-in-line (regexp) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-match regexp curpointpos nil))) (defun regexp:command-prologue () (list (or numarg 1) 0 (set-mark))) (defun regexp:command-cleanup (prologue-info) (if prologue-info (if (cdddr prologue-info) (release-mark (cdddr prologue-info))) (if (caddr prologue-info) (go-to-mark (caddr prologue-info)) (release-mark (caddr prologue-info))))) (defun regexp:command-epilogue (prologue-info result last-time) (cond (result (rplaca (cdr prologue-info) (1+ (cadr prologue-info))) (and (cdddr prologue-info) (release-mark (cdddr prologue-info))) (or last-time (rplacd (cddr prologue-info) result))) ((null (cdddr prologue-info)) (search-failure-annunciator)) (t (setq result (cdddr prologue-info) last-time t) (save-excursion (go-to-mark (caddr prologue-info)) (set-the-mark)))) (if last-time (exch-point-mark result) (set-the-mark) (exch-point-mark result) (release-mark result) (release-mark (caddr prologue-info)) (rplaca (cddr prologue-info) nil) ; For cleanup (if (< (cadr prologue-info) (car prologue-info)) (search:announce-partial-failure (cadr prologue-info))))) (defun regexp:prompt (prompt) (setq prompt (search:prompt (search:numeric-prompt prompt))) (regexp:compile-and-save prompt) (search:maybe-push-default prompt 'regexp)) ;;; ;;; Translating regular expressions to list form. ;;; ;;; The format of a compiled regular expression is: ;;; ;;; ((original-string . reversed-token-list) . token-list) ;;; ;;; The original-string is the argument given to compile-regexp. ;;; The reversed-token-list is initially nil, and is filled in ;;; by reverse-regexp, which returns the car of the compiled regexp. ;;; ;;; Each token in the token list is of the form: ;;; ;;; (tag . value) ;;; ;;; CONSTRUCT TAG VALUE ;;; ^ begins-string nil ;;; $ ends-string nil ;;; string constant string from (maknam) ;;; .* star nil ;;; * star preceding char from (ascii) ;;; . dots count of contiguous dots ;;; (defvar regexp:saved-compiled-string nil) (defun regexp:compile-and-save (regexp) (cond ((nullstringp regexp) (if regexp:saved-compiled-string regexp:saved-compiled-string else (display-error "No saved regular expression."))) ((samepnamep regexp (caar regexp:saved-compiled-string)) regexp:saved-compiled-string) (t (setq regexp:saved-compiled-string (regexp:compile regexp))))) (defun regexp:reverse (regexp) (cond ((cdar regexp) (car regexp)) ((null (cdr regexp)) (car regexp)) ((< (length (cdr regexp)) 2) (rplacd (car regexp) (cdr regexp))) (t (rplacd (car regexp) (reverse (cdr regexp)))))) ;;; Here follow macros for lexically inserting code into compile-regexp, ;;; which follows them. In some cases the macros are used in multiple ;;; places, but others are split out to make the code clearer and keep ;;; the indentation reasonable for 80 column screens. (defun regexp-emit macro (x) ; A conventional PUSH macro (let ((tag (cadr x)) (value (caddr x))) `(rplacd compiled-regexp (cons (cons ,tag ,value) (cdr compiled-regexp))))) (defun regexp-emit-constant macro (x) ; Construct a constant string (let ((delimiter (cadr x))) ; to be PUSHed, if present. `(cond ((null constant-begins)) ((eq constant-begins ,delimiter) (setq constant-begins nil)) (t (do ((cursor constant-begins (cdr cursor))) ((eq (cdr cursor) ,delimiter) (rplacd cursor nil))) (regexp-emit 'constant (maknam constant-begins)) (setq constant-begins nil))))) (defun regexp-emit-dots macro (x) ; Count the contiguous dots (let ((delimiter (cadr x))) ; and PUSH a token for them. `(cond ((null dots-begin)) ((eq dots-begin ,delimiter) (setq dots-begin nil)) (t (do ((count 1 (1+ count)) (cursor dots-begin (cdr cursor))) ((eq (cdr cursor) ,delimiter) (regexp-emit 'dots count))) (setq dots-begin nil))))) (defun regexp-mark-constant macro (x) ; Note the beginning of a `(progn ; constant string. (regexp-emit-dots this-one) (if (null constant-begins) (setq constant-begins this-one)))) (defun regexp:compile (regexp-string) (let ((regexp-list (exploden regexp-string)) (compiled-regexp (list (list regexp-string)))) (if (= (car regexp-list) #/^) (regexp-emit 'begins-line nil) (setq regexp-list (cdr regexp-list))) (do ((backslash-at 'backslash-at) (ch (car regexp-list) (cadr this-one)) (constant-begins) (dots-begin) (escape) (escape-patch) (last-one nil this-one) (star-at) (this-one regexp-list (cdr this-one))) ((null this-one) (if escape (display-error "Invalid use of ""\c"" at end of regular expression.")) (regexp-emit-constant nil) (regexp-emit-dots nil) (rplacd compiled-regexp (nreverse (cdr compiled-regexp)))) (cond (escape (setq escape nil) (regexp-mark-constant)) ((= ch #/\) (setq backslash-at this-one escape-patch last-one) (regexp-mark-constant)) ((and (= ch #/c) (eq backslash-at last-one)) (setq escape t) (if (eq constant-begins backslash-at) (setq constant-begins nil) else (rplacd escape-patch (cdr this-one)))) ((= ch #/.) (regexp-emit-constant this-one) (if (null dots-begin) (setq dots-begin this-one)) (rplaca this-one nil)) ((= ch #/*) (if (eq last-one star-at) (display-error "Invalid use of ""*"" in regular expression.")) (regexp-emit-constant last-one) (regexp-emit-dots last-one) (regexp-emit 'star (and (car last-one) (ascii (car last-one)))) (setq star-at this-one)) ((and (= ch #/$) (null (cdr this-one))) (regexp-emit-constant this-one) (regexp-emit-dots this-one) (regexp-emit 'ends-line nil)) (t (regexp-mark-constant)))))) ;;; ;;; Regular Expression match routines. ;;; ;;; Here follow a number of pairs of action routines. These routines are ;;; in the form of macros for lexical insertion of code into the routines ;;; regexp: search and match, forward and reverse, which are the recursive ;;; search routines which actually perform regular expression ;;; matching. The macro pairs are for forward and reverse matching ;;; respectively, and are grouped together for ease of maintenance. ;;; (declare (special curline curstuff)) (defun regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (mark) (string (cdar regexp))) ((not (forward-search string)) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (mark) (string (cdar reverse-regexp))) ((not (reverse-search string)) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (do-times backup (forward-char)))) (defun regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar regexp))) ((not (setq count (forward-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar reverse-regexp))) ((not (setq count (reverse-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (forward-char)))) (defun regexp-dots-floating macro (x) `(do ((count (cdar regexp)) (result)) ((or (if (not (> count (chars-left-in-line))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp (chars-left-in-line) nil))) (lastlinep)) result) (next-line))) (defun reverse-regexp-dots-floating macro (x) `(do ((count (cdar reverse-regexp)) (result)) ((or (if (not (> count curpointpos)) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp curpointpos nil))) (firstlinep)) result) (prev-line))) (defun regexp-dots-anchored macro (x) `(let ((count (cdar regexp))) (if (not (> count (chars-left-in-line))) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun reverse-regexp-dots-anchored macro (x) `(let ((count (cdar reverse-regexp))) (if (not (> count curpointpos)) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun regexp-star-floating macro (x) `(let ((char (cadr regexp)) (cl curline) (cpp curpointpos) (result (regexp:search regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (curchar)) (return nil)) (forward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-beginning-of-line))) (exch-point-mark result) result)))) (defun reverse-regexp-star-floating macro (x) `(let ((char (cadr reverse-regexp)) (cl curline) (cpp curpointpos) (result (regexp:reverse-search reverse-regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (lefthand-char)) (return nil)) (backward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-end-of-line))) (exch-point-mark result) result)))) (defun regexp-star-anchored macro (x) `(let ((char (cdar regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (curchar)))) (forward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance (chars-left-in-line))) (go-to-end-of-line))) (exch-point-mark my-mark) (setq result (regexp:match regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) (defun reverse-regexp-star-anchored macro (x) `(let ((char (cdar reverse-regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (lefthand-char)))) (backward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance curpointpos)) (go-to-beginning-of-line))) (exch-point-mark my-mark) (setq result (regexp:reverse-match reverse-regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) ;;; ;;; The actual top-level recursive forward search routines. ;;; (defun regexp:search (regexp) (setq regexp (cdr regexp)) (cond ((null regexp) (set-mark)) ((eq (caar regexp) 'constant) (regexp-constant-floating)) ((eq (caar regexp) 'dots) (regexp-dots-floating)) ((eq (caar regexp) 'star) (regexp-star-floating)) ((eq (caar regexp) 'ends-line) (go-to-end-of-line) (set-mark)) ;; ;; if we get this far, (caar regexp) = 'begins-line. ;; ((and (lastlinep) (not (bolp))) nil) (t (if (not (bolp)) (next-line)) (do ((result)) ((or (setq result (regexp:match regexp 0 nil)) (lastlinep)) result) (next-line))))) (defun regexp:match (regexp balance star-mark) (setq regexp (cdr regexp)) (cond ((null regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar regexp) 'constant) (regexp-constant-within-balance)) ((eq (caar regexp) 'dots) (regexp-dots-anchored)) ((eq (caar regexp) 'star) (regexp-star-anchored)) ((eq (caar regexp) 'ends-line) (cond ((< balance (chars-left-in-line)) nil) (t (prog1 (set-mark) (go-to-end-of-line))))) ((bolp) ; (caar regexp) = begins-line (regexp:match regexp 0 nil)))) ;;; ;;; The actual top-level recursive reverse search routines. ;;; Note that they closely parallel the forward regexp search, but the ;;; roles of begins-line (^) and ends-line ($) have been interchanged. ;;; (defun regexp:reverse-search (reverse-regexp) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (set-mark)) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-floating)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-floating)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-floating)) ((eq (caar reverse-regexp) 'begins-line) (go-to-beginning-of-line) (set-mark)) ;; ;; if we get this far, (caar reverse-regexp) = 'ends-line. ;; ((and (firstlinep) (not (eolp))) nil) (t (if (not (eolp)) (prev-line) (go-to-end-of-line)) (do ((result)) ((or (setq result (regexp:reverse-match reverse-regexp 0 nil)) (firstlinep)) result) (prev-line) (go-to-end-of-line))))) (defun regexp:reverse-match (reverse-regexp balance star-mark) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-within-balance)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-anchored)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-anchored)) ((eq (caar reverse-regexp) 'begins-line) (cond ((> balance curpointpos) nil) (t (prog1 (set-mark) (go-to-beginning-of-line))))) ((eolp) ; (caar reverse-regexp = ends-line (regexp:reverse-match reverse-regexp 0 nil))))
67540
;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; Various Hairy Search Commands ;;; GMP ;;; CR/NL handling 5/23/80 by BSG ;;; Gratuitous marks 11/06/81 by <NAME>mar ;;; JSL's regular expressions and other stuff, 30 August 1982 Barmar ;;; Added ^_ (self-documentation) response to searches, ;;; and moved query-replace out to e_macops_. 31 August 1982 Barmar ;;; (%include backquote) ;;; read macro 12/3/78 by BSG (eval-when (compile eval) (setsyntax '/# 'macro '(lambda () (cond ((= (tyipeek) 57) (tyi) (tyi)) ((= (tyipeek) 136) (tyi) (- (boole 1 137 (tyi)) 100))))) );;;end of eval-when (defun chars-left-in-line macro (x) `(- curlinel curpointpos 1)) (defun save-excursion-on-search-failure macro (x) (let ((dummy (gensym)) (forms (cdr x)) (mark (gensym))) `(let ((,dummy nil) (,mark nil)) (unwind-protect (progn (setq ,mark (set-mark)) (setq ,dummy (progn . ,forms))) (if ,mark (if (null ,dummy) (go-to-mark ,mark)) (release-mark ,mark)))))) (%include e-macros) (declare (special search-forward last-search-string search-string search-ring search-from-end tty-no-upmotionp must-announce-search last-char-was-^S isearch-stack macro-execution-in-progress ITS-string-search-set-mark home-mark isearch-exit-char MCS-editing-characters rubout-character) (*expr minibuffer-rubout search:maybe-push-default set-permanent-key mark-at-current-point-p exch-point-mark forward-search-bounded go-to-line-point reverse-search-bounded search:announce-partial-failure search:last-string search:numeric-prompt search:prompt search:rotate-ring) (*lexpr gratuitous-mark-setter)) ;;; Command intended for use in start_up.emacs. It sets permanent definitions ;;; of ^S and ^R to specified type of search. Note that when an unrecognized ;;; type is supplied it merely prints an error without using command-quit. (defcom set-search-mode &args ((search-type &symbol &prompt "Search mode: " &completions '(string character ITS-string its-string incremental regexp regular-expression default))) (cond ((memq search-type '(default string)) (set-permanent-key '^S 'string-search) (set-permanent-key '^R 'reverse-string-search)) ((memq search-type '(character)) (set-permanent-key '^S 'character-search) (set-permanent-key '^R 'reverse-character-search)) ((memq search-type '(ITS-string its-string)) (set-permanent-key '^S 'ITS-string-search) (set-permanent-key '^R 'reverse-ITS-string-search)) ((memq search-type '(regular-expression regexp)) (set-permanent-key '^S 'regexp-search) (set-permanent-key '^R 'reverse-regexp-search)) ((eq search-type 'incremental) (set-permanent-key '^S 'incremental-search) (set-permanent-key '^R 'reverse-incremental-search)) (t (display-error-noabort "Unknown search mode: " search-type) (ring-tty-bell)))) ;;; ;;; ;;; Character search commands (from ITS) ;;; GMP, 08/31/78 ;;; ;;; Character search command (defcom character-search (let ((search-forward t)) (character-search-))) ;;; Reverse character search command (defcom reverse-character-search (let ((search-forward nil)) (character-search-))) ;;; Subr that actually does character search (defun character-search- () (with-mark home-mark (let ((quoted nil)) (do-forever (let ((ch (get-char))) (cond ((and (= ch #^A) (not quoted)) ; string search (ITS-string-search-) (stop-doing)) ((and (= ch #^G) (not quoted)) ; punt (command-quit)) ((or (= ch #^J) ; find line break (and (= ch #^M) (not quoted))) ; ^M (unquoted), same as ^J (search:maybe-push-default NL 'string) (if search-forward (if (lastlinep) (display-error "Search fails.")) (next-line) else (if (firstlinep) (display-error "Search fails.")) (prev-line) (go-to-end-of-line)) (gratuitous-mark-setter home-mark) (stop-doing)) ((and (= ch #^Q) (not quoted)) ; quote char (setq quoted t)) ((and (= ch #^R) (not quoted)) ; reverse direction (if search-forward (setq search-forward (not search-forward)) else (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing))) ((and (= ch #^S) (not quoted)) ; look for default (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing)) ((and (= ch #^_) (not quoted)) (character-search-documentation)) (t ; look for this (let ((result nil)) (if search-forward (setq result (forward-search (ascii ch))) else (setq result (reverse-search (ascii ch)))) (search:maybe-push-default (ascii ch) 'string) (if result (gratuitous-mark-setter home-mark) (stop-doing) else (display-error "Search fails.")))))))))) ;;; Search for current default string (defun search-for-default-string () (if (nullstringp last-search-string) (display-error "No default search string.") else (let ((result nil)) (if (> (stringlength last-search-string) 1) (minibuffer-clear) (minibuffer-print (cond (search-forward "") (t "Reverse ")) "Search: " last-search-string)) (if search-forward (setq result (forward-search last-search-string)) else (setq result (reverse-search last-search-string))) (or result (display-error "Search fails."))))) (defun character-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl '("Character search options:" "" "^S Search for default search string" "^R If searching forward, reverse direction, otherwise" " Search back for default string" "^A ITS string search" "CR, LF Search for next newline" "^G Abort search" "^Q Reads a character and searches for it" "^_ Print this description" "anything else" " searches for the character" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; ITS String search commands ;;; GMP, 08/31/78 ;;; Cleaned up and bugs fixed 1 July 1981 <NAME> ;;; Merged and installed 1 July 1981 RMSoley ;;; ;;; ITS string search command (defcom ITS-string-search (let ((search-forward t)) (ITS-string-search-))) ;;; Reverse ITS string search command (defcom reverse-ITS-string-search (let ((search-forward nil)) (ITS-string-search-))) ;;; Subr to perform ITS string search (defun ITS-string-search- () (with-mark home-mark (setq last-char-was-^S nil search-string "" search-from-end nil) (ITS-string-search-announce) (let ((ITS-string-search-set-mark nil) (rubout-character (cadr MCS-editing-characters))) (do-forever (if (eq (ITS-string-search-process-char (get-char)) 'done) (stop-doing)))) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")))) ;;; Announce direction, type, and search string (defun ITS-string-search-announce () (if (not macro-execution-in-progress) (minibuffer-clear) (if search-forward (if search-from-end (minibuffer-print "BJ ITS String Search: ") else (minibuffer-print "ITS String Search: ")) else (if search-from-end (minibuffer-print "ZJ Reverse ITS String Search: ") else (minibuffer-print "Reverse ITS String Search: "))) (minibuffer-print-noclear search-string)) (setq must-announce-search nil)) ;;; Handle single character of ITS string search (defun ITS-string-search-process-char (ch) (prog1 (cond ((or (= ch 177) (= ch rubout-character)) (if (nullstringp search-string) (ITS-string-search-quit) else (isearch-chop-string-and-minibuffer) ; need better for printing 'continue)) ((= ch #^J) 'continue) ;LF ((= ch #^G) (ITS-string-search-quit)) ; punt ((= ch #^B) ; complement search from beginning (if search-forward (setq search-from-end (not search-from-end)) (ITS-string-search-announce) else (ITS-string-search-error "Can not search from beginning in reverse search." nil)) 'continue) ((= ch #^E) ; complement search from end (if search-forward (ITS-string-search-error "Can not search from end in forward search." nil) else (setq search-from-end (not search-from-end)) (ITS-string-search-announce)) 'continue) ((= ch #^L) (if (not macro-execution-in-progress) (minibuffer-clear) (redisplay)) ; redisplay (ITS-string-search-announce) 'continue) ((= ch #^Y) ; append default string (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (catenate search-string last-search-string)) (ITS-string-search-out last-search-string)) 'continue) ((= ch #^D) ; yank default and rotate (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (search:rotate-ring)) (setq last-search-string (search:last-string)) ; copy of top (ITS-string-search-announce)) 'continue) ((= ch #^Q) ; quote next chararacter (let ((ch1 (ascii (get-char)))) (setq search-string (catenate search-string ch1)) (ITS-string-search-out ch1)) 'continue) ((= ch #^R) ; reverse direction of search (setq search-forward (not search-forward)) (ITS-string-search-announce) 'continue) ((or (= ch #^S) (= ch #^[)) ; ^S or ESC, search and maybe quit (if (and (= ch #^[) last-char-was-^S) ; ESC after ^S, just exit 'done else (if (nullstringp search-string) (setq search-string last-search-string) (ITS-string-search-out search-string)) (if (nullstringp search-string) (ITS-string-search-error "No search string." (= ch #^[)) else (with-mark start-pos (let ((result nil)) (if search-from-end (if search-forward (go-to-beginning-of-buffer) else (go-to-end-of-buffer))) (if search-forward (setq result (forward-search search-string)) else (setq result (reverse-search search-string))) (if result (if (not ITS-string-search-set-mark) (setq ITS-string-search-set-mark t) ;remember that we did it. (gratuitous-mark-setter home-mark)) (or macro-execution-in-progress (redisplay)) (if tty-no-upmotionp (setq must-announce-search t)) else (ITS-string-search-error "Search fails." (= ch #^[)) (go-to-mark start-pos))))) (search:maybe-push-default search-string 'string) (if (= ch #^S) 'continue ; keep looking else 'done))) ; ESC, search terminates ((= ch #^_) (ITS-string-search-documentation) 'continue) ((and (or (< ch 40) (> ch 177)) ; unknown control (not (or (= ch #^M) (= ch #^I)))) (ring-tty-bell) 'continue) (t ; normal character (if (= ch #^M) (setq ch #^J)) ;cr => nl 5/23/80 (setq search-string (catenate search-string (ascii ch))) (ITS-string-search-out (ascii ch)))) (setq last-char-was-^S (= ch #^S)))) ;;; Add string to minibuffer unless must redisplay minibuffer (defun ITS-string-search-out (string) (if must-announce-search (ITS-string-search-announce) else (or macro-execution-in-progress (minibuffer-print-noclear string)))) ;;; Print error for ITS string search (defun ITS-string-search-error (message use-minibuffer) (if (or tty-no-upmotionp use-minibuffer) (minibuffer-print message) ; not display-error since not fatal (setq must-announce-search t) else ; for display, print it (init-local-displays) (local-display-generator-nnl message) (minibuffer-print-noclear "")) ; reposition cursor (if macro-execution-in-progress (command-quit) else (ring-tty-bell))) ;;; Exit ITS string search (defun ITS-string-search-quit () (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")) ; If displaying, output message. (command-quit)) (defun ITS-string-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("ITS string search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Remove last character from search string") "ESC Exit search, possibly searching first if previous" " character was not ^S" "^S Search for next occurrence of search string or default" "^R Reverse search direction" "^B Toggle ""search from beginning of buffer""" "^E Toggle ""search from end of buffer""" "^Y Add default search string to search string" "^D Rotate default search string ring, and makes it the" " search string" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character and adds it to search string" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; Incremental Search ;;; ;;; Incremental search command (defcom incremental-search (let ((search-forward t)) (incremental-search-))) ;;; Reverse Incremental search command (defcom reverse-incremental-search (let ((search-forward nil)) (incremental-search-))) ;;;Subr to do all the work (defun incremental-search- () (setq isearch-stack (list (cons nil (set-mark)))) (setq search-string "") (incremental-search-announce) (let ((isearch-exit-char nil) (rubout-character (cadr MCS-editing-characters))) (with-mark home-mark (do-forever (or macro-execution-in-progress (redisplay)) (if (eq (isearch-process-char (get-char)) 'done) (stop-doing))) (if (not (nullstringp search-string)) ;if didn't abort search (gratuitous-mark-setter home-mark)) (search:maybe-push-default search-string 'string)) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.") (redisplay)) (and isearch-exit-char (process-char isearch-exit-char)))) ;;; Process a single character (defun isearch-process-char (ch) (cond ((or (= ch 177) (= ch rubout-character)) ;rubout last char (isearch-rubout)) ((= ch #^G) ; abort search (ring-tty-bell) (setq search-string "") (go-to-mark (cdar (last isearch-stack))) 'done) ((= ch #^L) ; redisplay (or macro-execution-in-progress (redisplay)) (incremental-search-announce) 'continue) ((= ch #^Q) ; quote next char (isearch-search-single (ascii (get-char)))) ((or (= ch #^S)(= ch #^R)) ; search again or use default (let ((new-dir (= ch #^S))) (if (not (eq new-dir search-forward)) (setq search-forward new-dir) (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-announce))) (if (not (nullstringp search-string)) (search:maybe-push-default search-string 'string) (setq search-string "") else (or macro-execution-in-progress (minibuffer-print-noclear last-search-string))) (setq isearch-stack (cons (cons nil (set-mark)) ;non-inserting isearch-stack)) (let ((nss (catenate search-string last-search-string))) (if search-forward ;Movin' right... (if (looking-at last-search-string) ;already in front of it, OK (forward-search last-search-string) (setq search-string nss) 'continue else (if (forward-search nss) (setq search-string nss) 'continue else ;not found again (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))) else ;Movin' left... (if (reverse-search nss) (setq search-string nss) 'continue else (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))))) ((= ch #^[) ; all done 'done) ((= ch #^J) 'continue) ((= ch #^M) (isearch-search-single NL)) ((= ch #^_) (incremental-search-documentation)) ((and (or (< ch 40) (> ch 177)) ;random control char, exits (not (= ch #^I))) ;search, then gets executed (setq isearch-exit-char ch) 'done) (t ;normal char, search for it (isearch-search-single (ascii ch))))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) (declare (special display-ctlchar-with-^)) (defun isearch-chop-string-and-minibuffer () (let ((sl (stringlength search-string))) (let ((lastch (CtoI (substr search-string sl 1)))) (setq search-string (substr search-string 1 (1- sl))) (if (and (not tty-no-upmotionp) (not macro-execution-in-progress)) (minibuffer-rubout (cond ((and (> lastch 37) (< lastch 177)) ;printing char 1) (display-ctlchar-with-^ 2) (t 4))))))) ;pretty kludgey, eh? ;;; Search for a single character incrementally (defun isearch-search-single (ch) (if (and (not tty-no-upmotionp) ;put in buffer if needed (not macro-execution-in-progress)) (minibuffer-print-noclear ch)) (setq search-string (catenate search-string ch)) (setq isearch-stack (cons (cons 'insert (set-mark)) isearch-stack)) (if search-forward (if-at ch ;char is here, continue along (forward-char) 'continue else ;not here, search again (if (forward-search search-string) 'continue ;found it else ;not found, flush char typed (incremental-search-failure) (isearch-rubout))) else ;Reverse Isearch (if (looking-at search-string) 'continue else (do-times (1- (stringlength search-string)) (forward-char)) (if (reverse-search search-string) 'continue else (do-times (1- (stringlength search-string)) (backward-char)) (incremental-search-failure) (isearch-rubout))))) (defun incremental-search-announce () (if (not macro-execution-in-progress) (if search-forward (minibuffer-print "Incremental Search: ") else (minibuffer-print "Reverse Incremental Search: ")) (minibuffer-print-noclear search-string)) 'continue) (defun incremental-search-failure () (if macro-execution-in-progress (go-to-mark (cdar (last isearch-stack))) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (setq search-string "") (search-failure-annunciator) else (ring-tty-bell))) (defun incremental-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("Incremental search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Undo last character") "ESC Exit search" "^S Search for next occurrence of search string or default" "^R Reverse search for next occurrence" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character, adds it to search string, and searches" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "other control characters" " Ends search, executes as an Emacs command" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; Global Regular Expression Print ;;; (defcom global-regexp-print &arguments ((string &string &default &eval (regexp:prompt "Global regexp print"))) (setq string (regexp:compile-and-save string)) (let ((foundflag) (tempmark)) (save-excursion (go-to-beginning-of-buffer) (do-forever (setq tempmark (regexp:search string)) (if (not tempmark) (stop-doing)) (if (not foundflag) (setq foundflag t) (init-local-displays)) (if (not (mark-on-current-line-p tempmark)) (exch-point-mark tempmark) (do-forever (local-display-current-line) (next-line) (if (mark-on-current-line-p tempmark) (stop-doing)))) (release-mark tempmark) (local-display-current-line) (if (lastlinep) (stop-doing)) (next-line))) (if foundflag (end-local-displays) else (search-failure-annunciator)))) ;;; These commands autoload from emacs-extended-searches ;;; ;;; Regular Expression searches in Lisp. ;;; <NAME>, 7 May 1982 ;;; (defcom-synonym regexp-search-command regexp-search) (defcom regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse reverse-regexp-search &negative-function reverse-regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Regexp search"))) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:search regexp))) (defun regexp-search-in-line (regexp) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:match regexp (chars-left-in-line) nil))) (defcom reverse-regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse regexp-search &negative-function regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Reverse regexp search"))) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-search regexp))) (defun reverse-regexp-search-in-line (regexp) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-match regexp curpointpos nil))) (defun regexp:command-prologue () (list (or numarg 1) 0 (set-mark))) (defun regexp:command-cleanup (prologue-info) (if prologue-info (if (cdddr prologue-info) (release-mark (cdddr prologue-info))) (if (caddr prologue-info) (go-to-mark (caddr prologue-info)) (release-mark (caddr prologue-info))))) (defun regexp:command-epilogue (prologue-info result last-time) (cond (result (rplaca (cdr prologue-info) (1+ (cadr prologue-info))) (and (cdddr prologue-info) (release-mark (cdddr prologue-info))) (or last-time (rplacd (cddr prologue-info) result))) ((null (cdddr prologue-info)) (search-failure-annunciator)) (t (setq result (cdddr prologue-info) last-time t) (save-excursion (go-to-mark (caddr prologue-info)) (set-the-mark)))) (if last-time (exch-point-mark result) (set-the-mark) (exch-point-mark result) (release-mark result) (release-mark (caddr prologue-info)) (rplaca (cddr prologue-info) nil) ; For cleanup (if (< (cadr prologue-info) (car prologue-info)) (search:announce-partial-failure (cadr prologue-info))))) (defun regexp:prompt (prompt) (setq prompt (search:prompt (search:numeric-prompt prompt))) (regexp:compile-and-save prompt) (search:maybe-push-default prompt 'regexp)) ;;; ;;; Translating regular expressions to list form. ;;; ;;; The format of a compiled regular expression is: ;;; ;;; ((original-string . reversed-token-list) . token-list) ;;; ;;; The original-string is the argument given to compile-regexp. ;;; The reversed-token-list is initially nil, and is filled in ;;; by reverse-regexp, which returns the car of the compiled regexp. ;;; ;;; Each token in the token list is of the form: ;;; ;;; (tag . value) ;;; ;;; CONSTRUCT TAG VALUE ;;; ^ begins-string nil ;;; $ ends-string nil ;;; string constant string from (maknam) ;;; .* star nil ;;; * star preceding char from (ascii) ;;; . dots count of contiguous dots ;;; (defvar regexp:saved-compiled-string nil) (defun regexp:compile-and-save (regexp) (cond ((nullstringp regexp) (if regexp:saved-compiled-string regexp:saved-compiled-string else (display-error "No saved regular expression."))) ((samepnamep regexp (caar regexp:saved-compiled-string)) regexp:saved-compiled-string) (t (setq regexp:saved-compiled-string (regexp:compile regexp))))) (defun regexp:reverse (regexp) (cond ((cdar regexp) (car regexp)) ((null (cdr regexp)) (car regexp)) ((< (length (cdr regexp)) 2) (rplacd (car regexp) (cdr regexp))) (t (rplacd (car regexp) (reverse (cdr regexp)))))) ;;; Here follow macros for lexically inserting code into compile-regexp, ;;; which follows them. In some cases the macros are used in multiple ;;; places, but others are split out to make the code clearer and keep ;;; the indentation reasonable for 80 column screens. (defun regexp-emit macro (x) ; A conventional PUSH macro (let ((tag (cadr x)) (value (caddr x))) `(rplacd compiled-regexp (cons (cons ,tag ,value) (cdr compiled-regexp))))) (defun regexp-emit-constant macro (x) ; Construct a constant string (let ((delimiter (cadr x))) ; to be PUSHed, if present. `(cond ((null constant-begins)) ((eq constant-begins ,delimiter) (setq constant-begins nil)) (t (do ((cursor constant-begins (cdr cursor))) ((eq (cdr cursor) ,delimiter) (rplacd cursor nil))) (regexp-emit 'constant (maknam constant-begins)) (setq constant-begins nil))))) (defun regexp-emit-dots macro (x) ; Count the contiguous dots (let ((delimiter (cadr x))) ; and PUSH a token for them. `(cond ((null dots-begin)) ((eq dots-begin ,delimiter) (setq dots-begin nil)) (t (do ((count 1 (1+ count)) (cursor dots-begin (cdr cursor))) ((eq (cdr cursor) ,delimiter) (regexp-emit 'dots count))) (setq dots-begin nil))))) (defun regexp-mark-constant macro (x) ; Note the beginning of a `(progn ; constant string. (regexp-emit-dots this-one) (if (null constant-begins) (setq constant-begins this-one)))) (defun regexp:compile (regexp-string) (let ((regexp-list (exploden regexp-string)) (compiled-regexp (list (list regexp-string)))) (if (= (car regexp-list) #/^) (regexp-emit 'begins-line nil) (setq regexp-list (cdr regexp-list))) (do ((backslash-at 'backslash-at) (ch (car regexp-list) (cadr this-one)) (constant-begins) (dots-begin) (escape) (escape-patch) (last-one nil this-one) (star-at) (this-one regexp-list (cdr this-one))) ((null this-one) (if escape (display-error "Invalid use of ""\c"" at end of regular expression.")) (regexp-emit-constant nil) (regexp-emit-dots nil) (rplacd compiled-regexp (nreverse (cdr compiled-regexp)))) (cond (escape (setq escape nil) (regexp-mark-constant)) ((= ch #/\) (setq backslash-at this-one escape-patch last-one) (regexp-mark-constant)) ((and (= ch #/c) (eq backslash-at last-one)) (setq escape t) (if (eq constant-begins backslash-at) (setq constant-begins nil) else (rplacd escape-patch (cdr this-one)))) ((= ch #/.) (regexp-emit-constant this-one) (if (null dots-begin) (setq dots-begin this-one)) (rplaca this-one nil)) ((= ch #/*) (if (eq last-one star-at) (display-error "Invalid use of ""*"" in regular expression.")) (regexp-emit-constant last-one) (regexp-emit-dots last-one) (regexp-emit 'star (and (car last-one) (ascii (car last-one)))) (setq star-at this-one)) ((and (= ch #/$) (null (cdr this-one))) (regexp-emit-constant this-one) (regexp-emit-dots this-one) (regexp-emit 'ends-line nil)) (t (regexp-mark-constant)))))) ;;; ;;; Regular Expression match routines. ;;; ;;; Here follow a number of pairs of action routines. These routines are ;;; in the form of macros for lexical insertion of code into the routines ;;; regexp: search and match, forward and reverse, which are the recursive ;;; search routines which actually perform regular expression ;;; matching. The macro pairs are for forward and reverse matching ;;; respectively, and are grouped together for ease of maintenance. ;;; (declare (special curline curstuff)) (defun regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (mark) (string (cdar regexp))) ((not (forward-search string)) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (mark) (string (cdar reverse-regexp))) ((not (reverse-search string)) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (do-times backup (forward-char)))) (defun regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar regexp))) ((not (setq count (forward-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar reverse-regexp))) ((not (setq count (reverse-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (forward-char)))) (defun regexp-dots-floating macro (x) `(do ((count (cdar regexp)) (result)) ((or (if (not (> count (chars-left-in-line))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp (chars-left-in-line) nil))) (lastlinep)) result) (next-line))) (defun reverse-regexp-dots-floating macro (x) `(do ((count (cdar reverse-regexp)) (result)) ((or (if (not (> count curpointpos)) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp curpointpos nil))) (firstlinep)) result) (prev-line))) (defun regexp-dots-anchored macro (x) `(let ((count (cdar regexp))) (if (not (> count (chars-left-in-line))) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun reverse-regexp-dots-anchored macro (x) `(let ((count (cdar reverse-regexp))) (if (not (> count curpointpos)) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun regexp-star-floating macro (x) `(let ((char (cadr regexp)) (cl curline) (cpp curpointpos) (result (regexp:search regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (curchar)) (return nil)) (forward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-beginning-of-line))) (exch-point-mark result) result)))) (defun reverse-regexp-star-floating macro (x) `(let ((char (cadr reverse-regexp)) (cl curline) (cpp curpointpos) (result (regexp:reverse-search reverse-regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (lefthand-char)) (return nil)) (backward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-end-of-line))) (exch-point-mark result) result)))) (defun regexp-star-anchored macro (x) `(let ((char (cdar regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (curchar)))) (forward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance (chars-left-in-line))) (go-to-end-of-line))) (exch-point-mark my-mark) (setq result (regexp:match regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) (defun reverse-regexp-star-anchored macro (x) `(let ((char (cdar reverse-regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (lefthand-char)))) (backward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance curpointpos)) (go-to-beginning-of-line))) (exch-point-mark my-mark) (setq result (regexp:reverse-match reverse-regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) ;;; ;;; The actual top-level recursive forward search routines. ;;; (defun regexp:search (regexp) (setq regexp (cdr regexp)) (cond ((null regexp) (set-mark)) ((eq (caar regexp) 'constant) (regexp-constant-floating)) ((eq (caar regexp) 'dots) (regexp-dots-floating)) ((eq (caar regexp) 'star) (regexp-star-floating)) ((eq (caar regexp) 'ends-line) (go-to-end-of-line) (set-mark)) ;; ;; if we get this far, (caar regexp) = 'begins-line. ;; ((and (lastlinep) (not (bolp))) nil) (t (if (not (bolp)) (next-line)) (do ((result)) ((or (setq result (regexp:match regexp 0 nil)) (lastlinep)) result) (next-line))))) (defun regexp:match (regexp balance star-mark) (setq regexp (cdr regexp)) (cond ((null regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar regexp) 'constant) (regexp-constant-within-balance)) ((eq (caar regexp) 'dots) (regexp-dots-anchored)) ((eq (caar regexp) 'star) (regexp-star-anchored)) ((eq (caar regexp) 'ends-line) (cond ((< balance (chars-left-in-line)) nil) (t (prog1 (set-mark) (go-to-end-of-line))))) ((bolp) ; (caar regexp) = begins-line (regexp:match regexp 0 nil)))) ;;; ;;; The actual top-level recursive reverse search routines. ;;; Note that they closely parallel the forward regexp search, but the ;;; roles of begins-line (^) and ends-line ($) have been interchanged. ;;; (defun regexp:reverse-search (reverse-regexp) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (set-mark)) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-floating)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-floating)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-floating)) ((eq (caar reverse-regexp) 'begins-line) (go-to-beginning-of-line) (set-mark)) ;; ;; if we get this far, (caar reverse-regexp) = 'ends-line. ;; ((and (firstlinep) (not (eolp))) nil) (t (if (not (eolp)) (prev-line) (go-to-end-of-line)) (do ((result)) ((or (setq result (regexp:reverse-match reverse-regexp 0 nil)) (firstlinep)) result) (prev-line) (go-to-end-of-line))))) (defun regexp:reverse-match (reverse-regexp balance star-mark) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-within-balance)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-anchored)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-anchored)) ((eq (caar reverse-regexp) 'begins-line) (cond ((> balance curpointpos) nil) (t (prog1 (set-mark) (go-to-beginning-of-line))))) ((eolp) ; (caar reverse-regexp = ends-line (regexp:reverse-match reverse-regexp 0 nil))))
true
;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; Various Hairy Search Commands ;;; GMP ;;; CR/NL handling 5/23/80 by BSG ;;; Gratuitous marks 11/06/81 by PI:NAME:<NAME>END_PImar ;;; JSL's regular expressions and other stuff, 30 August 1982 Barmar ;;; Added ^_ (self-documentation) response to searches, ;;; and moved query-replace out to e_macops_. 31 August 1982 Barmar ;;; (%include backquote) ;;; read macro 12/3/78 by BSG (eval-when (compile eval) (setsyntax '/# 'macro '(lambda () (cond ((= (tyipeek) 57) (tyi) (tyi)) ((= (tyipeek) 136) (tyi) (- (boole 1 137 (tyi)) 100))))) );;;end of eval-when (defun chars-left-in-line macro (x) `(- curlinel curpointpos 1)) (defun save-excursion-on-search-failure macro (x) (let ((dummy (gensym)) (forms (cdr x)) (mark (gensym))) `(let ((,dummy nil) (,mark nil)) (unwind-protect (progn (setq ,mark (set-mark)) (setq ,dummy (progn . ,forms))) (if ,mark (if (null ,dummy) (go-to-mark ,mark)) (release-mark ,mark)))))) (%include e-macros) (declare (special search-forward last-search-string search-string search-ring search-from-end tty-no-upmotionp must-announce-search last-char-was-^S isearch-stack macro-execution-in-progress ITS-string-search-set-mark home-mark isearch-exit-char MCS-editing-characters rubout-character) (*expr minibuffer-rubout search:maybe-push-default set-permanent-key mark-at-current-point-p exch-point-mark forward-search-bounded go-to-line-point reverse-search-bounded search:announce-partial-failure search:last-string search:numeric-prompt search:prompt search:rotate-ring) (*lexpr gratuitous-mark-setter)) ;;; Command intended for use in start_up.emacs. It sets permanent definitions ;;; of ^S and ^R to specified type of search. Note that when an unrecognized ;;; type is supplied it merely prints an error without using command-quit. (defcom set-search-mode &args ((search-type &symbol &prompt "Search mode: " &completions '(string character ITS-string its-string incremental regexp regular-expression default))) (cond ((memq search-type '(default string)) (set-permanent-key '^S 'string-search) (set-permanent-key '^R 'reverse-string-search)) ((memq search-type '(character)) (set-permanent-key '^S 'character-search) (set-permanent-key '^R 'reverse-character-search)) ((memq search-type '(ITS-string its-string)) (set-permanent-key '^S 'ITS-string-search) (set-permanent-key '^R 'reverse-ITS-string-search)) ((memq search-type '(regular-expression regexp)) (set-permanent-key '^S 'regexp-search) (set-permanent-key '^R 'reverse-regexp-search)) ((eq search-type 'incremental) (set-permanent-key '^S 'incremental-search) (set-permanent-key '^R 'reverse-incremental-search)) (t (display-error-noabort "Unknown search mode: " search-type) (ring-tty-bell)))) ;;; ;;; ;;; Character search commands (from ITS) ;;; GMP, 08/31/78 ;;; ;;; Character search command (defcom character-search (let ((search-forward t)) (character-search-))) ;;; Reverse character search command (defcom reverse-character-search (let ((search-forward nil)) (character-search-))) ;;; Subr that actually does character search (defun character-search- () (with-mark home-mark (let ((quoted nil)) (do-forever (let ((ch (get-char))) (cond ((and (= ch #^A) (not quoted)) ; string search (ITS-string-search-) (stop-doing)) ((and (= ch #^G) (not quoted)) ; punt (command-quit)) ((or (= ch #^J) ; find line break (and (= ch #^M) (not quoted))) ; ^M (unquoted), same as ^J (search:maybe-push-default NL 'string) (if search-forward (if (lastlinep) (display-error "Search fails.")) (next-line) else (if (firstlinep) (display-error "Search fails.")) (prev-line) (go-to-end-of-line)) (gratuitous-mark-setter home-mark) (stop-doing)) ((and (= ch #^Q) (not quoted)) ; quote char (setq quoted t)) ((and (= ch #^R) (not quoted)) ; reverse direction (if search-forward (setq search-forward (not search-forward)) else (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing))) ((and (= ch #^S) (not quoted)) ; look for default (and (search-for-default-string) (gratuitous-mark-setter home-mark)) (stop-doing)) ((and (= ch #^_) (not quoted)) (character-search-documentation)) (t ; look for this (let ((result nil)) (if search-forward (setq result (forward-search (ascii ch))) else (setq result (reverse-search (ascii ch)))) (search:maybe-push-default (ascii ch) 'string) (if result (gratuitous-mark-setter home-mark) (stop-doing) else (display-error "Search fails.")))))))))) ;;; Search for current default string (defun search-for-default-string () (if (nullstringp last-search-string) (display-error "No default search string.") else (let ((result nil)) (if (> (stringlength last-search-string) 1) (minibuffer-clear) (minibuffer-print (cond (search-forward "") (t "Reverse ")) "Search: " last-search-string)) (if search-forward (setq result (forward-search last-search-string)) else (setq result (reverse-search last-search-string))) (or result (display-error "Search fails."))))) (defun character-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl '("Character search options:" "" "^S Search for default search string" "^R If searching forward, reverse direction, otherwise" " Search back for default string" "^A ITS string search" "CR, LF Search for next newline" "^G Abort search" "^Q Reads a character and searches for it" "^_ Print this description" "anything else" " searches for the character" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; ITS String search commands ;;; GMP, 08/31/78 ;;; Cleaned up and bugs fixed 1 July 1981 PI:NAME:<NAME>END_PI ;;; Merged and installed 1 July 1981 RMSoley ;;; ;;; ITS string search command (defcom ITS-string-search (let ((search-forward t)) (ITS-string-search-))) ;;; Reverse ITS string search command (defcom reverse-ITS-string-search (let ((search-forward nil)) (ITS-string-search-))) ;;; Subr to perform ITS string search (defun ITS-string-search- () (with-mark home-mark (setq last-char-was-^S nil search-string "" search-from-end nil) (ITS-string-search-announce) (let ((ITS-string-search-set-mark nil) (rubout-character (cadr MCS-editing-characters))) (do-forever (if (eq (ITS-string-search-process-char (get-char)) 'done) (stop-doing)))) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")))) ;;; Announce direction, type, and search string (defun ITS-string-search-announce () (if (not macro-execution-in-progress) (minibuffer-clear) (if search-forward (if search-from-end (minibuffer-print "BJ ITS String Search: ") else (minibuffer-print "ITS String Search: ")) else (if search-from-end (minibuffer-print "ZJ Reverse ITS String Search: ") else (minibuffer-print "Reverse ITS String Search: "))) (minibuffer-print-noclear search-string)) (setq must-announce-search nil)) ;;; Handle single character of ITS string search (defun ITS-string-search-process-char (ch) (prog1 (cond ((or (= ch 177) (= ch rubout-character)) (if (nullstringp search-string) (ITS-string-search-quit) else (isearch-chop-string-and-minibuffer) ; need better for printing 'continue)) ((= ch #^J) 'continue) ;LF ((= ch #^G) (ITS-string-search-quit)) ; punt ((= ch #^B) ; complement search from beginning (if search-forward (setq search-from-end (not search-from-end)) (ITS-string-search-announce) else (ITS-string-search-error "Can not search from beginning in reverse search." nil)) 'continue) ((= ch #^E) ; complement search from end (if search-forward (ITS-string-search-error "Can not search from end in forward search." nil) else (setq search-from-end (not search-from-end)) (ITS-string-search-announce)) 'continue) ((= ch #^L) (if (not macro-execution-in-progress) (minibuffer-clear) (redisplay)) ; redisplay (ITS-string-search-announce) 'continue) ((= ch #^Y) ; append default string (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (catenate search-string last-search-string)) (ITS-string-search-out last-search-string)) 'continue) ((= ch #^D) ; yank default and rotate (if (nullstringp last-search-string) (ITS-string-search-error "No default search string." nil) else (setq search-string (search:rotate-ring)) (setq last-search-string (search:last-string)) ; copy of top (ITS-string-search-announce)) 'continue) ((= ch #^Q) ; quote next chararacter (let ((ch1 (ascii (get-char)))) (setq search-string (catenate search-string ch1)) (ITS-string-search-out ch1)) 'continue) ((= ch #^R) ; reverse direction of search (setq search-forward (not search-forward)) (ITS-string-search-announce) 'continue) ((or (= ch #^S) (= ch #^[)) ; ^S or ESC, search and maybe quit (if (and (= ch #^[) last-char-was-^S) ; ESC after ^S, just exit 'done else (if (nullstringp search-string) (setq search-string last-search-string) (ITS-string-search-out search-string)) (if (nullstringp search-string) (ITS-string-search-error "No search string." (= ch #^[)) else (with-mark start-pos (let ((result nil)) (if search-from-end (if search-forward (go-to-beginning-of-buffer) else (go-to-end-of-buffer))) (if search-forward (setq result (forward-search search-string)) else (setq result (reverse-search search-string))) (if result (if (not ITS-string-search-set-mark) (setq ITS-string-search-set-mark t) ;remember that we did it. (gratuitous-mark-setter home-mark)) (or macro-execution-in-progress (redisplay)) (if tty-no-upmotionp (setq must-announce-search t)) else (ITS-string-search-error "Search fails." (= ch #^[)) (go-to-mark start-pos))))) (search:maybe-push-default search-string 'string) (if (= ch #^S) 'continue ; keep looking else 'done))) ; ESC, search terminates ((= ch #^_) (ITS-string-search-documentation) 'continue) ((and (or (< ch 40) (> ch 177)) ; unknown control (not (or (= ch #^M) (= ch #^I)))) (ring-tty-bell) 'continue) (t ; normal character (if (= ch #^M) (setq ch #^J)) ;cr => nl 5/23/80 (setq search-string (catenate search-string (ascii ch))) (ITS-string-search-out (ascii ch)))) (setq last-char-was-^S (= ch #^S)))) ;;; Add string to minibuffer unless must redisplay minibuffer (defun ITS-string-search-out (string) (if must-announce-search (ITS-string-search-announce) else (or macro-execution-in-progress (minibuffer-print-noclear string)))) ;;; Print error for ITS string search (defun ITS-string-search-error (message use-minibuffer) (if (or tty-no-upmotionp use-minibuffer) (minibuffer-print message) ; not display-error since not fatal (setq must-announce-search t) else ; for display, print it (init-local-displays) (local-display-generator-nnl message) (minibuffer-print-noclear "")) ; reposition cursor (if macro-execution-in-progress (command-quit) else (ring-tty-bell))) ;;; Exit ITS string search (defun ITS-string-search-quit () (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.")) ; If displaying, output message. (command-quit)) (defun ITS-string-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("ITS string search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Remove last character from search string") "ESC Exit search, possibly searching first if previous" " character was not ^S" "^S Search for next occurrence of search string or default" "^R Reverse search direction" "^B Toggle ""search from beginning of buffer""" "^E Toggle ""search from end of buffer""" "^Y Add default search string to search string" "^D Rotate default search string ring, and makes it the" " search string" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character and adds it to search string" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; ;;; Incremental Search ;;; ;;; Incremental search command (defcom incremental-search (let ((search-forward t)) (incremental-search-))) ;;; Reverse Incremental search command (defcom reverse-incremental-search (let ((search-forward nil)) (incremental-search-))) ;;;Subr to do all the work (defun incremental-search- () (setq isearch-stack (list (cons nil (set-mark)))) (setq search-string "") (incremental-search-announce) (let ((isearch-exit-char nil) (rubout-character (cadr MCS-editing-characters))) (with-mark home-mark (do-forever (or macro-execution-in-progress (redisplay)) (if (eq (isearch-process-char (get-char)) 'done) (stop-doing))) (if (not (nullstringp search-string)) ;if didn't abort search (gratuitous-mark-setter home-mark)) (search:maybe-push-default search-string 'string)) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (if (not macro-execution-in-progress) (minibuffer-print-noclear " Done.") (redisplay)) (and isearch-exit-char (process-char isearch-exit-char)))) ;;; Process a single character (defun isearch-process-char (ch) (cond ((or (= ch 177) (= ch rubout-character)) ;rubout last char (isearch-rubout)) ((= ch #^G) ; abort search (ring-tty-bell) (setq search-string "") (go-to-mark (cdar (last isearch-stack))) 'done) ((= ch #^L) ; redisplay (or macro-execution-in-progress (redisplay)) (incremental-search-announce) 'continue) ((= ch #^Q) ; quote next char (isearch-search-single (ascii (get-char)))) ((or (= ch #^S)(= ch #^R)) ; search again or use default (let ((new-dir (= ch #^S))) (if (not (eq new-dir search-forward)) (setq search-forward new-dir) (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-announce))) (if (not (nullstringp search-string)) (search:maybe-push-default search-string 'string) (setq search-string "") else (or macro-execution-in-progress (minibuffer-print-noclear last-search-string))) (setq isearch-stack (cons (cons nil (set-mark)) ;non-inserting isearch-stack)) (let ((nss (catenate search-string last-search-string))) (if search-forward ;Movin' right... (if (looking-at last-search-string) ;already in front of it, OK (forward-search last-search-string) (setq search-string nss) 'continue else (if (forward-search nss) (setq search-string nss) 'continue else ;not found again (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))) else ;Movin' left... (if (reverse-search nss) (setq search-string nss) 'continue else (or macro-execution-in-progress (minibuffer-clear)) (incremental-search-failure) (incremental-search-announce))))) ((= ch #^[) ; all done 'done) ((= ch #^J) 'continue) ((= ch #^M) (isearch-search-single NL)) ((= ch #^_) (incremental-search-documentation)) ((and (or (< ch 40) (> ch 177)) ;random control char, exits (not (= ch #^I))) ;search, then gets executed (setq isearch-exit-char ch) 'done) (t ;normal char, search for it (isearch-search-single (ascii ch))))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) ;;; Delete a character from search string (defun isearch-rubout () (cond ((null (cdr isearch-stack)) ;nothing to rubout, abort (ring-tty-bell) 'done) (t (go-to-mark (cdar isearch-stack)) (release-mark (cdar isearch-stack)) (cond ((caar isearch-stack) ;rubbing out self-insert (isearch-chop-string-and-minibuffer))) (setq isearch-stack (cdr isearch-stack)) 'continue))) (declare (special display-ctlchar-with-^)) (defun isearch-chop-string-and-minibuffer () (let ((sl (stringlength search-string))) (let ((lastch (CtoI (substr search-string sl 1)))) (setq search-string (substr search-string 1 (1- sl))) (if (and (not tty-no-upmotionp) (not macro-execution-in-progress)) (minibuffer-rubout (cond ((and (> lastch 37) (< lastch 177)) ;printing char 1) (display-ctlchar-with-^ 2) (t 4))))))) ;pretty kludgey, eh? ;;; Search for a single character incrementally (defun isearch-search-single (ch) (if (and (not tty-no-upmotionp) ;put in buffer if needed (not macro-execution-in-progress)) (minibuffer-print-noclear ch)) (setq search-string (catenate search-string ch)) (setq isearch-stack (cons (cons 'insert (set-mark)) isearch-stack)) (if search-forward (if-at ch ;char is here, continue along (forward-char) 'continue else ;not here, search again (if (forward-search search-string) 'continue ;found it else ;not found, flush char typed (incremental-search-failure) (isearch-rubout))) else ;Reverse Isearch (if (looking-at search-string) 'continue else (do-times (1- (stringlength search-string)) (forward-char)) (if (reverse-search search-string) 'continue else (do-times (1- (stringlength search-string)) (backward-char)) (incremental-search-failure) (isearch-rubout))))) (defun incremental-search-announce () (if (not macro-execution-in-progress) (if search-forward (minibuffer-print "Incremental Search: ") else (minibuffer-print "Reverse Incremental Search: ")) (minibuffer-print-noclear search-string)) 'continue) (defun incremental-search-failure () (if macro-execution-in-progress (go-to-mark (cdar (last isearch-stack))) (mapc '(lambda (x) (release-mark (cdr x))) isearch-stack) (setq search-string "") (search-failure-annunciator) else (ring-tty-bell))) (defun incremental-search-documentation () (init-local-displays) (mapc 'local-display-generator-nnl `("Incremental search options:" "" ,(catenate "DEL, " (ItoC rubout-character) " Undo last character") "ESC Exit search" "^S Search for next occurrence of search string or default" "^R Reverse search for next occurrence" "CR Add newline to search string" "^G Abort search and return to starting point" "^Q Reads a character, adds it to search string, and searches" "LF Nothing" "^L Redisplay" "^_ Print this description" "printing characters, TAB, ^I" " Adds to the search string, and searches" "other control characters" " Ends search, executes as an Emacs command" "" "Type any character to remove this display.")) (end-local-displays) (redisplay) (get-char)) ;;; ;;; Global Regular Expression Print ;;; (defcom global-regexp-print &arguments ((string &string &default &eval (regexp:prompt "Global regexp print"))) (setq string (regexp:compile-and-save string)) (let ((foundflag) (tempmark)) (save-excursion (go-to-beginning-of-buffer) (do-forever (setq tempmark (regexp:search string)) (if (not tempmark) (stop-doing)) (if (not foundflag) (setq foundflag t) (init-local-displays)) (if (not (mark-on-current-line-p tempmark)) (exch-point-mark tempmark) (do-forever (local-display-current-line) (next-line) (if (mark-on-current-line-p tempmark) (stop-doing)))) (release-mark tempmark) (local-display-current-line) (if (lastlinep) (stop-doing)) (next-line))) (if foundflag (end-local-displays) else (search-failure-annunciator)))) ;;; These commands autoload from emacs-extended-searches ;;; ;;; Regular Expression searches in Lisp. ;;; PI:NAME:<NAME>END_PI, 7 May 1982 ;;; (defcom-synonym regexp-search-command regexp-search) (defcom regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse reverse-regexp-search &negative-function reverse-regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Regexp search"))) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:search regexp))) (defun regexp-search-in-line (regexp) (setq regexp (regexp:compile-and-save regexp)) (save-excursion-on-search-failure (regexp:match regexp (chars-left-in-line) nil))) (defcom reverse-regexp-search &cleanup regexp:command-cleanup &prologue regexp:command-prologue &epilogue regexp:command-epilogue &inverse regexp-search &negative-function regexp-search &numeric-argument &repeat &args ((regexp &default &eval (regexp:prompt "Reverse regexp search"))) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-search regexp))) (defun reverse-regexp-search-in-line (regexp) (setq regexp (regexp:reverse (regexp:compile-and-save regexp))) (save-excursion-on-search-failure (regexp:reverse-match regexp curpointpos nil))) (defun regexp:command-prologue () (list (or numarg 1) 0 (set-mark))) (defun regexp:command-cleanup (prologue-info) (if prologue-info (if (cdddr prologue-info) (release-mark (cdddr prologue-info))) (if (caddr prologue-info) (go-to-mark (caddr prologue-info)) (release-mark (caddr prologue-info))))) (defun regexp:command-epilogue (prologue-info result last-time) (cond (result (rplaca (cdr prologue-info) (1+ (cadr prologue-info))) (and (cdddr prologue-info) (release-mark (cdddr prologue-info))) (or last-time (rplacd (cddr prologue-info) result))) ((null (cdddr prologue-info)) (search-failure-annunciator)) (t (setq result (cdddr prologue-info) last-time t) (save-excursion (go-to-mark (caddr prologue-info)) (set-the-mark)))) (if last-time (exch-point-mark result) (set-the-mark) (exch-point-mark result) (release-mark result) (release-mark (caddr prologue-info)) (rplaca (cddr prologue-info) nil) ; For cleanup (if (< (cadr prologue-info) (car prologue-info)) (search:announce-partial-failure (cadr prologue-info))))) (defun regexp:prompt (prompt) (setq prompt (search:prompt (search:numeric-prompt prompt))) (regexp:compile-and-save prompt) (search:maybe-push-default prompt 'regexp)) ;;; ;;; Translating regular expressions to list form. ;;; ;;; The format of a compiled regular expression is: ;;; ;;; ((original-string . reversed-token-list) . token-list) ;;; ;;; The original-string is the argument given to compile-regexp. ;;; The reversed-token-list is initially nil, and is filled in ;;; by reverse-regexp, which returns the car of the compiled regexp. ;;; ;;; Each token in the token list is of the form: ;;; ;;; (tag . value) ;;; ;;; CONSTRUCT TAG VALUE ;;; ^ begins-string nil ;;; $ ends-string nil ;;; string constant string from (maknam) ;;; .* star nil ;;; * star preceding char from (ascii) ;;; . dots count of contiguous dots ;;; (defvar regexp:saved-compiled-string nil) (defun regexp:compile-and-save (regexp) (cond ((nullstringp regexp) (if regexp:saved-compiled-string regexp:saved-compiled-string else (display-error "No saved regular expression."))) ((samepnamep regexp (caar regexp:saved-compiled-string)) regexp:saved-compiled-string) (t (setq regexp:saved-compiled-string (regexp:compile regexp))))) (defun regexp:reverse (regexp) (cond ((cdar regexp) (car regexp)) ((null (cdr regexp)) (car regexp)) ((< (length (cdr regexp)) 2) (rplacd (car regexp) (cdr regexp))) (t (rplacd (car regexp) (reverse (cdr regexp)))))) ;;; Here follow macros for lexically inserting code into compile-regexp, ;;; which follows them. In some cases the macros are used in multiple ;;; places, but others are split out to make the code clearer and keep ;;; the indentation reasonable for 80 column screens. (defun regexp-emit macro (x) ; A conventional PUSH macro (let ((tag (cadr x)) (value (caddr x))) `(rplacd compiled-regexp (cons (cons ,tag ,value) (cdr compiled-regexp))))) (defun regexp-emit-constant macro (x) ; Construct a constant string (let ((delimiter (cadr x))) ; to be PUSHed, if present. `(cond ((null constant-begins)) ((eq constant-begins ,delimiter) (setq constant-begins nil)) (t (do ((cursor constant-begins (cdr cursor))) ((eq (cdr cursor) ,delimiter) (rplacd cursor nil))) (regexp-emit 'constant (maknam constant-begins)) (setq constant-begins nil))))) (defun regexp-emit-dots macro (x) ; Count the contiguous dots (let ((delimiter (cadr x))) ; and PUSH a token for them. `(cond ((null dots-begin)) ((eq dots-begin ,delimiter) (setq dots-begin nil)) (t (do ((count 1 (1+ count)) (cursor dots-begin (cdr cursor))) ((eq (cdr cursor) ,delimiter) (regexp-emit 'dots count))) (setq dots-begin nil))))) (defun regexp-mark-constant macro (x) ; Note the beginning of a `(progn ; constant string. (regexp-emit-dots this-one) (if (null constant-begins) (setq constant-begins this-one)))) (defun regexp:compile (regexp-string) (let ((regexp-list (exploden regexp-string)) (compiled-regexp (list (list regexp-string)))) (if (= (car regexp-list) #/^) (regexp-emit 'begins-line nil) (setq regexp-list (cdr regexp-list))) (do ((backslash-at 'backslash-at) (ch (car regexp-list) (cadr this-one)) (constant-begins) (dots-begin) (escape) (escape-patch) (last-one nil this-one) (star-at) (this-one regexp-list (cdr this-one))) ((null this-one) (if escape (display-error "Invalid use of ""\c"" at end of regular expression.")) (regexp-emit-constant nil) (regexp-emit-dots nil) (rplacd compiled-regexp (nreverse (cdr compiled-regexp)))) (cond (escape (setq escape nil) (regexp-mark-constant)) ((= ch #/\) (setq backslash-at this-one escape-patch last-one) (regexp-mark-constant)) ((and (= ch #/c) (eq backslash-at last-one)) (setq escape t) (if (eq constant-begins backslash-at) (setq constant-begins nil) else (rplacd escape-patch (cdr this-one)))) ((= ch #/.) (regexp-emit-constant this-one) (if (null dots-begin) (setq dots-begin this-one)) (rplaca this-one nil)) ((= ch #/*) (if (eq last-one star-at) (display-error "Invalid use of ""*"" in regular expression.")) (regexp-emit-constant last-one) (regexp-emit-dots last-one) (regexp-emit 'star (and (car last-one) (ascii (car last-one)))) (setq star-at this-one)) ((and (= ch #/$) (null (cdr this-one))) (regexp-emit-constant this-one) (regexp-emit-dots this-one) (regexp-emit 'ends-line nil)) (t (regexp-mark-constant)))))) ;;; ;;; Regular Expression match routines. ;;; ;;; Here follow a number of pairs of action routines. These routines are ;;; in the form of macros for lexical insertion of code into the routines ;;; regexp: search and match, forward and reverse, which are the recursive ;;; search routines which actually perform regular expression ;;; matching. The macro pairs are for forward and reverse matching ;;; respectively, and are grouped together for ease of maintenance. ;;; (declare (special curline curstuff)) (defun regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (mark) (string (cdar regexp))) ((not (forward-search string)) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-floating macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (mark) (string (cdar reverse-regexp))) ((not (reverse-search string)) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (do-times backup (forward-char)))) (defun regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar regexp))) ((not (setq count (forward-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:match regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (backward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (backward-char)))) (defun reverse-regexp-constant-within-balance macro (x) `(do ((backup (1- (stringlength (cdar reverse-regexp)))) (cl curline) (count) (cpp curpointpos) (mark) (string (cdar reverse-regexp))) ((not (setq count (reverse-search-bounded string balance))) (go-to-line-point cl cpp) nil) (setq mark (regexp:reverse-match reverse-regexp 0 nil)) (if mark (exch-point-mark mark) (do-times (1+ backup) (forward-char)) (exch-point-mark mark) (return mark)) (setq balance (- balance count 1)) (do-times backup (forward-char)))) (defun regexp-dots-floating macro (x) `(do ((count (cdar regexp)) (result)) ((or (if (not (> count (chars-left-in-line))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp (chars-left-in-line) nil))) (lastlinep)) result) (next-line))) (defun reverse-regexp-dots-floating macro (x) `(do ((count (cdar reverse-regexp)) (result)) ((or (if (not (> count curpointpos)) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp curpointpos nil))) (firstlinep)) result) (prev-line))) (defun regexp-dots-anchored macro (x) `(let ((count (cdar regexp))) (if (not (> count (chars-left-in-line))) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (+ curpointpos count)) (setq result (regexp:match regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun reverse-regexp-dots-anchored macro (x) `(let ((count (cdar reverse-regexp))) (if (not (> count curpointpos)) (let ((cl curline) (cpp curpointpos) (result)) (if (> count balance) (setq balance 0 star-mark nil) else (setq balance (- balance count))) (setq curpointpos (- curpointpos count)) (setq result (regexp:reverse-match reverse-regexp balance star-mark)) (cond (result (exch-point-mark result) (setq curpointpos cpp) (exch-point-mark result)) (t (go-to-line-point cl cpp))) result)))) (defun regexp-star-floating macro (x) `(let ((char (cadr regexp)) (cl curline) (cpp curpointpos) (result (regexp:search regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (curchar)) (return nil)) (forward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-beginning-of-line))) (exch-point-mark result) result)))) (defun reverse-regexp-star-floating macro (x) `(let ((char (cadr reverse-regexp)) (cl curline) (cpp curpointpos) (result (regexp:reverse-search reverse-regexp))) (if result (exch-point-mark result) (cond (char (do () ((and (eq cl curline) (= cpp curpointpos))) (or (eq char (lefthand-char)) (return nil)) (backward-char))) ((eq cl curline) (go-to-line-point cl cpp)) (t (go-to-end-of-line))) (exch-point-mark result) result)))) (defun regexp-star-anchored macro (x) `(let ((char (cdar regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (curchar)))) (forward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance (chars-left-in-line))) (go-to-end-of-line))) (exch-point-mark my-mark) (setq result (regexp:match regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) (defun reverse-regexp-star-anchored macro (x) `(let ((char (cdar reverse-regexp)) (cl curline) (cpp curpointpos) (my-mark) (result)) (cond (star-mark (setq my-mark star-mark) (exch-point-mark my-mark)) (t (setq my-mark (set-mark)))) (cond (char (do () ((not (eq char (lefthand-char)))) (backward-char) (setq balance (1+ balance)))) (t (setq balance (+ balance curpointpos)) (go-to-beginning-of-line))) (exch-point-mark my-mark) (setq result (regexp:reverse-match reverse-regexp balance my-mark)) (or star-mark (release-mark my-mark)) (cond (result (exch-point-mark result) (go-to-line-point cl cpp) (exch-point-mark result))) result)) ;;; ;;; The actual top-level recursive forward search routines. ;;; (defun regexp:search (regexp) (setq regexp (cdr regexp)) (cond ((null regexp) (set-mark)) ((eq (caar regexp) 'constant) (regexp-constant-floating)) ((eq (caar regexp) 'dots) (regexp-dots-floating)) ((eq (caar regexp) 'star) (regexp-star-floating)) ((eq (caar regexp) 'ends-line) (go-to-end-of-line) (set-mark)) ;; ;; if we get this far, (caar regexp) = 'begins-line. ;; ((and (lastlinep) (not (bolp))) nil) (t (if (not (bolp)) (next-line)) (do ((result)) ((or (setq result (regexp:match regexp 0 nil)) (lastlinep)) result) (next-line))))) (defun regexp:match (regexp balance star-mark) (setq regexp (cdr regexp)) (cond ((null regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar regexp) 'constant) (regexp-constant-within-balance)) ((eq (caar regexp) 'dots) (regexp-dots-anchored)) ((eq (caar regexp) 'star) (regexp-star-anchored)) ((eq (caar regexp) 'ends-line) (cond ((< balance (chars-left-in-line)) nil) (t (prog1 (set-mark) (go-to-end-of-line))))) ((bolp) ; (caar regexp) = begins-line (regexp:match regexp 0 nil)))) ;;; ;;; The actual top-level recursive reverse search routines. ;;; Note that they closely parallel the forward regexp search, but the ;;; roles of begins-line (^) and ends-line ($) have been interchanged. ;;; (defun regexp:reverse-search (reverse-regexp) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (set-mark)) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-floating)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-floating)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-floating)) ((eq (caar reverse-regexp) 'begins-line) (go-to-beginning-of-line) (set-mark)) ;; ;; if we get this far, (caar reverse-regexp) = 'ends-line. ;; ((and (firstlinep) (not (eolp))) nil) (t (if (not (eolp)) (prev-line) (go-to-end-of-line)) (do ((result)) ((or (setq result (regexp:reverse-match reverse-regexp 0 nil)) (firstlinep)) result) (prev-line) (go-to-end-of-line))))) (defun regexp:reverse-match (reverse-regexp balance star-mark) (setq reverse-regexp (cdr reverse-regexp)) (cond ((null reverse-regexp) (prog1 (set-mark) (if star-mark (go-to-mark star-mark)))) ((eq (caar reverse-regexp) 'constant) (reverse-regexp-constant-within-balance)) ((eq (caar reverse-regexp) 'dots) (reverse-regexp-dots-anchored)) ((eq (caar reverse-regexp) 'star) (reverse-regexp-star-anchored)) ((eq (caar reverse-regexp) 'begins-line) (cond ((> balance curpointpos) nil) (t (prog1 (set-mark) (go-to-beginning-of-line))))) ((eolp) ; (caar reverse-regexp = ends-line (regexp:reverse-match reverse-regexp 0 nil))))
[ { "context": ";-*- Mode: Lisp -*-\n;;;; Author: Paul Dietz\n;;;; Created: Thu Oct 10 23:25:50 2002\n;;;; Cont", "end": 49, "score": 0.999863862991333, "start": 39, "tag": "NAME", "value": "Paul Dietz" } ]
data-and-control-flow/destructuring-bind.lsp
pfdietz/ansi-test
8
;-*- Mode: Lisp -*- ;;;; Author: Paul Dietz ;;;; Created: Thu Oct 10 23:25:50 2002 ;;;; Contains: Tests for DESTRUCTURING-BIND ;;; See the page for this in section 5.3 ;;; Also, see destructuring lambda lists in section 3.4.5 (deftest destructuring-bind.1 (destructuring-bind (x y z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.2 (destructuring-bind (x y &rest z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.3 (destructuring-bind (x y &optional z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.4 (destructuring-bind (x y &optional z) '(a b) (values x y z)) a b nil) (deftest destructuring-bind.5 (destructuring-bind (x y &optional (z 'w)) '(a b) (values x y z)) a b w) (deftest destructuring-bind.6 (destructuring-bind (x y &optional (z 'w z-p)) '(a b) (values x y z z-p)) a b w nil) (deftest destructuring-bind.7 (destructuring-bind (x y &optional (z 'w z-p)) '(a b c) (values x y z (notnot z-p))) a b c t) (deftest destructuring-bind.7a (destructuring-bind (x y &optional (z x z-p)) '(a b) (values x y z z-p)) a b a nil) (deftest destructuring-bind.8 (destructuring-bind (x y &optional z w) '(a b c) (values x y z w)) a b c nil) (deftest destructuring-bind.9 (destructuring-bind ((x y)) '((a b)) (values x y)) a b) (deftest destructuring-bind.10 (destructuring-bind (&whole w (x y)) '((a b)) (values x y w)) a b ((a b))) (deftest destructuring-bind.11 (destructuring-bind ((x . y) . w) '((a b) c) (values x y w)) a (b) (c)) (deftest destructuring-bind.12 (destructuring-bind (x y &body z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.12a (destructuring-bind ((x y &body z)) '((a b c d)) (values x y z)) a b (c d)) (deftest destructuring-bind.13 (destructuring-bind (&whole x y z) '(a b) (values x y z)) (a b) a b) (deftest destructuring-bind.14 (destructuring-bind (w (&whole x y z)) '(1 (a b)) (values w x y z)) 1 (a b) a b) (deftest destructuring-bind.15 (destructuring-bind (&key a b c) '(:a 1) (values a b c)) 1 nil nil) (deftest destructuring-bind.16 (destructuring-bind (&key a b c) '(:b 1) (values a b c)) nil 1 nil) (deftest destructuring-bind.17 (destructuring-bind (&key a b c) '(:c 1) (values a b c)) nil nil 1) (deftest destructuring-bind.17a (destructuring-bind (&key (a 'foo) (b 'bar) c) '(:c 1) (values a b c)) foo bar 1) (deftest destructuring-bind.17c (destructuring-bind (&key (a 'foo a-p) (b a b-p) (c 'zzz c-p)) '(:c 1) (values a b c a-p b-p (notnot c-p))) foo foo 1 nil nil t) (deftest destructuring-bind.18 (destructuring-bind ((&key a b c)) '((:c 1 :b 2)) (values a b c)) nil 2 1) ;;; Test that destructuring-bind does not have a tagbody (deftest destructuring-bind.19 (block nil (tagbody (destructuring-bind (a . b) '(1 2) (go 10) 10 (return 'bad)) 10 (return 'good))) good) (deftest destructuring-bind.20 (destructuring-bind (&whole (a . b) c . d) '(1 . 2) (list a b c d)) (1 2 1 2)) (deftest destructuring-bind.21 (destructuring-bind (x &rest (y z)) '(1 2 3) (values x y z)) 1 2 3) (deftest destructuring-bind.22 (destructuring-bind (x y &key) '(1 2) (values x y)) 1 2) (deftest destructuring-bind.23 (destructuring-bind (&rest x &key) '(:allow-other-keys 1) x) (:allow-other-keys 1)) (deftest destructuring-bind.24 (destructuring-bind (&rest x &key) nil x) nil) (deftest destructuring-bind.25 (let ((x :bad)) (declare (special x)) (let ((x :good)) (destructuring-bind (y) (list x) (declare (special x)) y))) :good) (deftest destructuring-bind.26 (destructuring-bind (x) (list 1)) nil) (deftest destructuring-bind.27 (destructuring-bind (x) (list 1) (declare (optimize))) nil) (deftest destructuring-bind.28 (destructuring-bind (x) (list 1) (declare (optimize)) (declare)) nil) (deftest destructuring-bind.29 (destructuring-bind (x &aux y) '(:foo) (values x y)) :foo nil) (deftest destructuring-bind.30 (destructuring-bind (x &aux (y (list x))) '(:foo) (values x y)) :foo (:foo)) ;;; Test that explicit calls to macroexpand in subforms ;;; are done in the correct environment (deftest destructuring-bind.31 (macrolet ((%m (z) z)) (destructuring-bind (a b c) (expand-in-current-env (%m '(1 2 3))) (values a b c))) 1 2 3) ;;; Error cases #| (deftest destructuring-bind.error.1 (signals-error (destructuring-bind (a b c) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.2 (signals-error (destructuring-bind ((a b c)) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.3 (signals-error (destructuring-bind (a b) 'x (list a b)) program-error) t) (deftest destructuring-bind.error.4 (signals-error (destructuring-bind (a . b) 'x (list a b)) program-error) t) |# ;;; (deftest destructuring-bind.error.5 ;;; (signals-error (destructuring-bind) program-error) ;;; t) ;;; ;;; (deftest destructuring-bind.error.6 ;;; (signals-error (destructuring-bind x) program-error) ;;; t) (deftest destructuring-bind.error.7 (signals-error (funcall (macro-function 'destructuring-bind)) program-error) t) (deftest destructuring-bind.error.8 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil)) program-error) t) (deftest destructuring-bind.error.9 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil) nil nil) program-error) t) (deftest destructuring-bind.error.10 (signals-error (destructuring-bind (foo nil bar) (list 1 2 3) nil) program-error) t)
53680
;-*- Mode: Lisp -*- ;;;; Author: <NAME> ;;;; Created: Thu Oct 10 23:25:50 2002 ;;;; Contains: Tests for DESTRUCTURING-BIND ;;; See the page for this in section 5.3 ;;; Also, see destructuring lambda lists in section 3.4.5 (deftest destructuring-bind.1 (destructuring-bind (x y z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.2 (destructuring-bind (x y &rest z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.3 (destructuring-bind (x y &optional z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.4 (destructuring-bind (x y &optional z) '(a b) (values x y z)) a b nil) (deftest destructuring-bind.5 (destructuring-bind (x y &optional (z 'w)) '(a b) (values x y z)) a b w) (deftest destructuring-bind.6 (destructuring-bind (x y &optional (z 'w z-p)) '(a b) (values x y z z-p)) a b w nil) (deftest destructuring-bind.7 (destructuring-bind (x y &optional (z 'w z-p)) '(a b c) (values x y z (notnot z-p))) a b c t) (deftest destructuring-bind.7a (destructuring-bind (x y &optional (z x z-p)) '(a b) (values x y z z-p)) a b a nil) (deftest destructuring-bind.8 (destructuring-bind (x y &optional z w) '(a b c) (values x y z w)) a b c nil) (deftest destructuring-bind.9 (destructuring-bind ((x y)) '((a b)) (values x y)) a b) (deftest destructuring-bind.10 (destructuring-bind (&whole w (x y)) '((a b)) (values x y w)) a b ((a b))) (deftest destructuring-bind.11 (destructuring-bind ((x . y) . w) '((a b) c) (values x y w)) a (b) (c)) (deftest destructuring-bind.12 (destructuring-bind (x y &body z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.12a (destructuring-bind ((x y &body z)) '((a b c d)) (values x y z)) a b (c d)) (deftest destructuring-bind.13 (destructuring-bind (&whole x y z) '(a b) (values x y z)) (a b) a b) (deftest destructuring-bind.14 (destructuring-bind (w (&whole x y z)) '(1 (a b)) (values w x y z)) 1 (a b) a b) (deftest destructuring-bind.15 (destructuring-bind (&key a b c) '(:a 1) (values a b c)) 1 nil nil) (deftest destructuring-bind.16 (destructuring-bind (&key a b c) '(:b 1) (values a b c)) nil 1 nil) (deftest destructuring-bind.17 (destructuring-bind (&key a b c) '(:c 1) (values a b c)) nil nil 1) (deftest destructuring-bind.17a (destructuring-bind (&key (a 'foo) (b 'bar) c) '(:c 1) (values a b c)) foo bar 1) (deftest destructuring-bind.17c (destructuring-bind (&key (a 'foo a-p) (b a b-p) (c 'zzz c-p)) '(:c 1) (values a b c a-p b-p (notnot c-p))) foo foo 1 nil nil t) (deftest destructuring-bind.18 (destructuring-bind ((&key a b c)) '((:c 1 :b 2)) (values a b c)) nil 2 1) ;;; Test that destructuring-bind does not have a tagbody (deftest destructuring-bind.19 (block nil (tagbody (destructuring-bind (a . b) '(1 2) (go 10) 10 (return 'bad)) 10 (return 'good))) good) (deftest destructuring-bind.20 (destructuring-bind (&whole (a . b) c . d) '(1 . 2) (list a b c d)) (1 2 1 2)) (deftest destructuring-bind.21 (destructuring-bind (x &rest (y z)) '(1 2 3) (values x y z)) 1 2 3) (deftest destructuring-bind.22 (destructuring-bind (x y &key) '(1 2) (values x y)) 1 2) (deftest destructuring-bind.23 (destructuring-bind (&rest x &key) '(:allow-other-keys 1) x) (:allow-other-keys 1)) (deftest destructuring-bind.24 (destructuring-bind (&rest x &key) nil x) nil) (deftest destructuring-bind.25 (let ((x :bad)) (declare (special x)) (let ((x :good)) (destructuring-bind (y) (list x) (declare (special x)) y))) :good) (deftest destructuring-bind.26 (destructuring-bind (x) (list 1)) nil) (deftest destructuring-bind.27 (destructuring-bind (x) (list 1) (declare (optimize))) nil) (deftest destructuring-bind.28 (destructuring-bind (x) (list 1) (declare (optimize)) (declare)) nil) (deftest destructuring-bind.29 (destructuring-bind (x &aux y) '(:foo) (values x y)) :foo nil) (deftest destructuring-bind.30 (destructuring-bind (x &aux (y (list x))) '(:foo) (values x y)) :foo (:foo)) ;;; Test that explicit calls to macroexpand in subforms ;;; are done in the correct environment (deftest destructuring-bind.31 (macrolet ((%m (z) z)) (destructuring-bind (a b c) (expand-in-current-env (%m '(1 2 3))) (values a b c))) 1 2 3) ;;; Error cases #| (deftest destructuring-bind.error.1 (signals-error (destructuring-bind (a b c) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.2 (signals-error (destructuring-bind ((a b c)) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.3 (signals-error (destructuring-bind (a b) 'x (list a b)) program-error) t) (deftest destructuring-bind.error.4 (signals-error (destructuring-bind (a . b) 'x (list a b)) program-error) t) |# ;;; (deftest destructuring-bind.error.5 ;;; (signals-error (destructuring-bind) program-error) ;;; t) ;;; ;;; (deftest destructuring-bind.error.6 ;;; (signals-error (destructuring-bind x) program-error) ;;; t) (deftest destructuring-bind.error.7 (signals-error (funcall (macro-function 'destructuring-bind)) program-error) t) (deftest destructuring-bind.error.8 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil)) program-error) t) (deftest destructuring-bind.error.9 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil) nil nil) program-error) t) (deftest destructuring-bind.error.10 (signals-error (destructuring-bind (foo nil bar) (list 1 2 3) nil) program-error) t)
true
;-*- Mode: Lisp -*- ;;;; Author: PI:NAME:<NAME>END_PI ;;;; Created: Thu Oct 10 23:25:50 2002 ;;;; Contains: Tests for DESTRUCTURING-BIND ;;; See the page for this in section 5.3 ;;; Also, see destructuring lambda lists in section 3.4.5 (deftest destructuring-bind.1 (destructuring-bind (x y z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.2 (destructuring-bind (x y &rest z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.3 (destructuring-bind (x y &optional z) '(a b c) (values x y z)) a b c) (deftest destructuring-bind.4 (destructuring-bind (x y &optional z) '(a b) (values x y z)) a b nil) (deftest destructuring-bind.5 (destructuring-bind (x y &optional (z 'w)) '(a b) (values x y z)) a b w) (deftest destructuring-bind.6 (destructuring-bind (x y &optional (z 'w z-p)) '(a b) (values x y z z-p)) a b w nil) (deftest destructuring-bind.7 (destructuring-bind (x y &optional (z 'w z-p)) '(a b c) (values x y z (notnot z-p))) a b c t) (deftest destructuring-bind.7a (destructuring-bind (x y &optional (z x z-p)) '(a b) (values x y z z-p)) a b a nil) (deftest destructuring-bind.8 (destructuring-bind (x y &optional z w) '(a b c) (values x y z w)) a b c nil) (deftest destructuring-bind.9 (destructuring-bind ((x y)) '((a b)) (values x y)) a b) (deftest destructuring-bind.10 (destructuring-bind (&whole w (x y)) '((a b)) (values x y w)) a b ((a b))) (deftest destructuring-bind.11 (destructuring-bind ((x . y) . w) '((a b) c) (values x y w)) a (b) (c)) (deftest destructuring-bind.12 (destructuring-bind (x y &body z) '(a b c d) (values x y z)) a b (c d)) (deftest destructuring-bind.12a (destructuring-bind ((x y &body z)) '((a b c d)) (values x y z)) a b (c d)) (deftest destructuring-bind.13 (destructuring-bind (&whole x y z) '(a b) (values x y z)) (a b) a b) (deftest destructuring-bind.14 (destructuring-bind (w (&whole x y z)) '(1 (a b)) (values w x y z)) 1 (a b) a b) (deftest destructuring-bind.15 (destructuring-bind (&key a b c) '(:a 1) (values a b c)) 1 nil nil) (deftest destructuring-bind.16 (destructuring-bind (&key a b c) '(:b 1) (values a b c)) nil 1 nil) (deftest destructuring-bind.17 (destructuring-bind (&key a b c) '(:c 1) (values a b c)) nil nil 1) (deftest destructuring-bind.17a (destructuring-bind (&key (a 'foo) (b 'bar) c) '(:c 1) (values a b c)) foo bar 1) (deftest destructuring-bind.17c (destructuring-bind (&key (a 'foo a-p) (b a b-p) (c 'zzz c-p)) '(:c 1) (values a b c a-p b-p (notnot c-p))) foo foo 1 nil nil t) (deftest destructuring-bind.18 (destructuring-bind ((&key a b c)) '((:c 1 :b 2)) (values a b c)) nil 2 1) ;;; Test that destructuring-bind does not have a tagbody (deftest destructuring-bind.19 (block nil (tagbody (destructuring-bind (a . b) '(1 2) (go 10) 10 (return 'bad)) 10 (return 'good))) good) (deftest destructuring-bind.20 (destructuring-bind (&whole (a . b) c . d) '(1 . 2) (list a b c d)) (1 2 1 2)) (deftest destructuring-bind.21 (destructuring-bind (x &rest (y z)) '(1 2 3) (values x y z)) 1 2 3) (deftest destructuring-bind.22 (destructuring-bind (x y &key) '(1 2) (values x y)) 1 2) (deftest destructuring-bind.23 (destructuring-bind (&rest x &key) '(:allow-other-keys 1) x) (:allow-other-keys 1)) (deftest destructuring-bind.24 (destructuring-bind (&rest x &key) nil x) nil) (deftest destructuring-bind.25 (let ((x :bad)) (declare (special x)) (let ((x :good)) (destructuring-bind (y) (list x) (declare (special x)) y))) :good) (deftest destructuring-bind.26 (destructuring-bind (x) (list 1)) nil) (deftest destructuring-bind.27 (destructuring-bind (x) (list 1) (declare (optimize))) nil) (deftest destructuring-bind.28 (destructuring-bind (x) (list 1) (declare (optimize)) (declare)) nil) (deftest destructuring-bind.29 (destructuring-bind (x &aux y) '(:foo) (values x y)) :foo nil) (deftest destructuring-bind.30 (destructuring-bind (x &aux (y (list x))) '(:foo) (values x y)) :foo (:foo)) ;;; Test that explicit calls to macroexpand in subforms ;;; are done in the correct environment (deftest destructuring-bind.31 (macrolet ((%m (z) z)) (destructuring-bind (a b c) (expand-in-current-env (%m '(1 2 3))) (values a b c))) 1 2 3) ;;; Error cases #| (deftest destructuring-bind.error.1 (signals-error (destructuring-bind (a b c) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.2 (signals-error (destructuring-bind ((a b c)) nil (list a b c)) program-error) t) (deftest destructuring-bind.error.3 (signals-error (destructuring-bind (a b) 'x (list a b)) program-error) t) (deftest destructuring-bind.error.4 (signals-error (destructuring-bind (a . b) 'x (list a b)) program-error) t) |# ;;; (deftest destructuring-bind.error.5 ;;; (signals-error (destructuring-bind) program-error) ;;; t) ;;; ;;; (deftest destructuring-bind.error.6 ;;; (signals-error (destructuring-bind x) program-error) ;;; t) (deftest destructuring-bind.error.7 (signals-error (funcall (macro-function 'destructuring-bind)) program-error) t) (deftest destructuring-bind.error.8 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil)) program-error) t) (deftest destructuring-bind.error.9 (signals-error (funcall (macro-function 'destructuring-bind) '(destructuring-bind (a . b) '(1 2) nil) nil nil) program-error) t) (deftest destructuring-bind.error.10 (signals-error (destructuring-bind (foo nil bar) (list 1 2 3) nil) program-error) t)
[ { "context": ";;;; package.lisp\n;;;;\n;;;; Copyright 2018 Alexander Gutev\n;;;;\n;;;; Permission is hereby granted, free of c", "end": 58, "score": 0.9998647570610046, "start": 43, "tag": "NAME", "value": "Alexander Gutev" } ]
src/iterator/package.lisp
tani/generic-cl
99
;;;; package.lisp ;;;; ;;;; Copyright 2018 Alexander Gutev ;;;; ;;;; Permission is hereby granted, free of charge, to any person ;;;; obtaining a copy of this software and associated documentation ;;;; files (the "Software"), to deal in the Software without ;;;; restriction, including without limitation the rights to use, ;;;; copy, modify, merge, publish, distribute, sublicense, and/or sell ;;;; copies of the Software, and to permit persons to whom the ;;;; Software is furnished to do so, subject to the following ;;;; conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be ;;;; included in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ;;;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ;;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ;;;; OTHER DEALINGS IN THE SOFTWARE. (uiop:define-package :generic-cl.iterator (:mix :generic-cl.object :generic-cl.container :static-dispatch-cl) (:use :anaphora :arrows :trivia :tcr.parse-declarations-1.0 :cl-form-types :generic-cl.internal) (:import-from :agutil :let-if :nlet) (:import-from :alexandria :with-gensyms :make-gensym-list :mappend :ensure-car :ensure-list :if-let :parse-body) (:shadow :endp) (:export :iterator :make-iterator :make-reverse-iterator :at :start :advance :advance-n :endp :doseq :doseq! :do-sequences :do-sequences! :doiter :doiters :with-iterators :with-iter-value :with-iter-values :with-iter-place :do-iter-values) (:intern :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Generic iterator interface")) (defpackage :generic-cl.iterator.optimization (:use) (:import-from :generic-cl.iterator :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:export :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Optimization interface of iterator interface."))
35179
;;;; package.lisp ;;;; ;;;; Copyright 2018 <NAME> ;;;; ;;;; Permission is hereby granted, free of charge, to any person ;;;; obtaining a copy of this software and associated documentation ;;;; files (the "Software"), to deal in the Software without ;;;; restriction, including without limitation the rights to use, ;;;; copy, modify, merge, publish, distribute, sublicense, and/or sell ;;;; copies of the Software, and to permit persons to whom the ;;;; Software is furnished to do so, subject to the following ;;;; conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be ;;;; included in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ;;;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ;;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ;;;; OTHER DEALINGS IN THE SOFTWARE. (uiop:define-package :generic-cl.iterator (:mix :generic-cl.object :generic-cl.container :static-dispatch-cl) (:use :anaphora :arrows :trivia :tcr.parse-declarations-1.0 :cl-form-types :generic-cl.internal) (:import-from :agutil :let-if :nlet) (:import-from :alexandria :with-gensyms :make-gensym-list :mappend :ensure-car :ensure-list :if-let :parse-body) (:shadow :endp) (:export :iterator :make-iterator :make-reverse-iterator :at :start :advance :advance-n :endp :doseq :doseq! :do-sequences :do-sequences! :doiter :doiters :with-iterators :with-iter-value :with-iter-values :with-iter-place :do-iter-values) (:intern :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Generic iterator interface")) (defpackage :generic-cl.iterator.optimization (:use) (:import-from :generic-cl.iterator :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:export :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Optimization interface of iterator interface."))
true
;;;; package.lisp ;;;; ;;;; Copyright 2018 PI:NAME:<NAME>END_PI ;;;; ;;;; Permission is hereby granted, free of charge, to any person ;;;; obtaining a copy of this software and associated documentation ;;;; files (the "Software"), to deal in the Software without ;;;; restriction, including without limitation the rights to use, ;;;; copy, modify, merge, publish, distribute, sublicense, and/or sell ;;;; copies of the Software, and to permit persons to whom the ;;;; Software is furnished to do so, subject to the following ;;;; conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be ;;;; included in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ;;;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ;;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ;;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ;;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ;;;; OTHER DEALINGS IN THE SOFTWARE. (uiop:define-package :generic-cl.iterator (:mix :generic-cl.object :generic-cl.container :static-dispatch-cl) (:use :anaphora :arrows :trivia :tcr.parse-declarations-1.0 :cl-form-types :generic-cl.internal) (:import-from :agutil :let-if :nlet) (:import-from :alexandria :with-gensyms :make-gensym-list :mappend :ensure-car :ensure-list :if-let :parse-body) (:shadow :endp) (:export :iterator :make-iterator :make-reverse-iterator :at :start :advance :advance-n :endp :doseq :doseq! :do-sequences :do-sequences! :doiter :doiters :with-iterators :with-iter-value :with-iter-values :with-iter-place :do-iter-values) (:intern :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Generic iterator interface")) (defpackage :generic-cl.iterator.optimization (:use) (:import-from :generic-cl.iterator :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:export :make-doseq :subtype :with-destructure-pattern :split-declarations-forms :with-variable-declarations :iter-macro) (:documentation "Optimization interface of iterator interface."))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"VL2014\")\n(prog", "end": 1415, "score": 0.9996745586395264, "start": 1404, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"VL2014\")\n(progn\n\n (defun vl-printe", "end": 1435, "score": 0.9999291300773621, "start": 1417, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/vl2014/util/printedlist-fast.lsp
mayankmanj/acl2
305
; VL 2014 -- VL Verilog Toolkit, 2014 Edition ; Copyright (C) 2008-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "VL2014") (progn (defun vl-printedlist->string (x) ;; Optimized PS->STRING routine. We're going to build the return string in ;; two passes. In the first pass we'll determine how big of an array we ;; need. In the second, we'll fill in its characters with the reverse of ;; the elems. (let* ((size (vl-printedlist-length x 0))) (unless (typep size 'fixnum) (er hard? 'vl-ps->string-fn "Printed list will will be longer than a fixnum (~x0). You don't ~ actually want to turn it into a string, I think." size)) ;; Since the elems are in reverse order, we'll work backwards from the end ;; of the array. (let* ((ret (make-array size :element-type 'character)) (i (the fixnum (- (the fixnum size) 1)))) (declare (type fixnum i)) (loop while (consp x) do (let ((elem (car x))) (if (characterp elem) (progn (setf (schar ret i) elem) (decf i)) ;; For strings, things are trickier because the characters of ;; the string *are* in the right order. It's very helpful to ;; think of a concrete example. Suppose we do: ;; ;; print #\A ;; print #\B ;; print #\C ;; print "abc" ;; print #\D ;; print #\E ;; ;; Then the rchars we'll have are (#\E #\D "abc" #\C #\B #\A). ;; The ret array is 8 entries long and we've already set ;; ret[7] = #\E ;; ret[6] = #\D ;; So we now want to set ;; ret[5] = #\c ;; ret[4] = #\b ;; ret[3] = #\a ;; ;; I think it's easiest to just go down from the end of the ;; string so we can (decf i) like before. (loop for j fixnum from (- (length (the string elem)) 1) downto 0 do (setf (schar ret i) (schar elem j)) (decf i)))) (setq x (cdr x))) ret))))
18406
; VL 2014 -- VL Verilog Toolkit, 2014 Edition ; Copyright (C) 2008-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "VL2014") (progn (defun vl-printedlist->string (x) ;; Optimized PS->STRING routine. We're going to build the return string in ;; two passes. In the first pass we'll determine how big of an array we ;; need. In the second, we'll fill in its characters with the reverse of ;; the elems. (let* ((size (vl-printedlist-length x 0))) (unless (typep size 'fixnum) (er hard? 'vl-ps->string-fn "Printed list will will be longer than a fixnum (~x0). You don't ~ actually want to turn it into a string, I think." size)) ;; Since the elems are in reverse order, we'll work backwards from the end ;; of the array. (let* ((ret (make-array size :element-type 'character)) (i (the fixnum (- (the fixnum size) 1)))) (declare (type fixnum i)) (loop while (consp x) do (let ((elem (car x))) (if (characterp elem) (progn (setf (schar ret i) elem) (decf i)) ;; For strings, things are trickier because the characters of ;; the string *are* in the right order. It's very helpful to ;; think of a concrete example. Suppose we do: ;; ;; print #\A ;; print #\B ;; print #\C ;; print "abc" ;; print #\D ;; print #\E ;; ;; Then the rchars we'll have are (#\E #\D "abc" #\C #\B #\A). ;; The ret array is 8 entries long and we've already set ;; ret[7] = #\E ;; ret[6] = #\D ;; So we now want to set ;; ret[5] = #\c ;; ret[4] = #\b ;; ret[3] = #\a ;; ;; I think it's easiest to just go down from the end of the ;; string so we can (decf i) like before. (loop for j fixnum from (- (length (the string elem)) 1) downto 0 do (setf (schar ret i) (schar elem j)) (decf i)))) (setq x (cdr x))) ret))))
true
; VL 2014 -- VL Verilog Toolkit, 2014 Edition ; Copyright (C) 2008-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "VL2014") (progn (defun vl-printedlist->string (x) ;; Optimized PS->STRING routine. We're going to build the return string in ;; two passes. In the first pass we'll determine how big of an array we ;; need. In the second, we'll fill in its characters with the reverse of ;; the elems. (let* ((size (vl-printedlist-length x 0))) (unless (typep size 'fixnum) (er hard? 'vl-ps->string-fn "Printed list will will be longer than a fixnum (~x0). You don't ~ actually want to turn it into a string, I think." size)) ;; Since the elems are in reverse order, we'll work backwards from the end ;; of the array. (let* ((ret (make-array size :element-type 'character)) (i (the fixnum (- (the fixnum size) 1)))) (declare (type fixnum i)) (loop while (consp x) do (let ((elem (car x))) (if (characterp elem) (progn (setf (schar ret i) elem) (decf i)) ;; For strings, things are trickier because the characters of ;; the string *are* in the right order. It's very helpful to ;; think of a concrete example. Suppose we do: ;; ;; print #\A ;; print #\B ;; print #\C ;; print "abc" ;; print #\D ;; print #\E ;; ;; Then the rchars we'll have are (#\E #\D "abc" #\C #\B #\A). ;; The ret array is 8 entries long and we've already set ;; ret[7] = #\E ;; ret[6] = #\D ;; So we now want to set ;; ret[5] = #\c ;; ret[4] = #\b ;; ret[3] = #\a ;; ;; I think it's easiest to just go down from the end of the ;; string so we can (decf i) like before. (loop for j fixnum from (- (length (the string elem)) 1) downto 0 do (setf (schar ret i) (schar elem j)) (decf i)))) (setq x (cdr x))) ret))))
[ { "context": "-instance 'connection :username username :password password :url url :api api))\n\n(defclass status ()\n ((curr", "end": 1295, "score": 0.9728365540504456, "start": 1287, "tag": "PASSWORD", "value": "password" } ]
src/classes.lisp
K1D77A/egora-admin
0
(in-package #:egora-admin) (defclass connection () ((logged-in-p :initform nil :accessor logged-in-p) (url :accessor url :initarg :url :type string) (api :accessor api :initarg :api :type string) (username :accessor username :type string :initarg :username) (password :accessor password :type string :initarg :password) (auth :accessor auth :type auth :initarg :auth) (device-id :accessor device-id :type string) (status :accessor status :initform (make-instance 'status) :type status))) (defmethod print-object ((connection connection) stream) (print-unreadable-object (connection stream :type t :identity t) (format stream "~&URL: ~S~%Username: ~S~%Logged in: ~S~%Auth: ~S~%Device-id: ~S~%Status object: ~A~%" (str:concat (url connection) (api connection)) (username connection) (logged-in-p connection) (if (slot-boundp connection 'auth) (auth connection) "Not authorized yet") (if (slot-boundp connection 'device-id) (device-id connection) "No device ID yet") (status connection)))) (defun make-connection (username password url api) (make-instance 'connection :username username :password password :url url :api api)) (defclass status () ((current-rooms :accessor current-rooms :initform nil :type list) (known-users :accessor known-users :type list) (room-aliases :accessor room-aliases :type list :initform nil) (banned :accessor banned :type list) (kicked :accessor kicked :type list) (sync-history :accessor sync-history :initform (make-array 50 :element-type 'list :initial-element nil)) (latest-sync :accessor latest-sync :type list))) (defclass auth () ((token :accessor token :initarg :token :type string))) (define-condition api-error () ((api-error-error :accessor api-error-error :initarg :api-error-error :type string) (api-error-code :accessor api-error-code :initarg :api-error-code :type string) (api-error-description :accessor api-error-description))) (defmethod print-object ((api-error api-error) stream) (print-unreadable-object (api-error stream :type t :identity t) (format stream "~&Error code: ~S~%Error value: ~S~%Description: ~S~%" (api-error-code api-error) (api-error-error api-error) (api-error-description api-error)))) (define-condition m-forbidden (api-error) ((api-error-description :initform "Forbidden access, e.g. joining a room without permission, failed login."))) (define-condition m-unknown-token (api-error) ((api-error-description :initform "The access token specified was not recognised. An additional response parameter, soft_logout, might be present on the response for 401 HTTP status codes. See the soft logout section for more information."))) (define-condition m-missing-token (api-error) ((api-error-description :initform "No access token was specified for the request."))) (define-condition m-bad-json (api-error) ((api-error-description :initform "Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys."))) (define-condition m-not-json (api-error) ((api-error-description :initform "Request did not contain valid JSON."))) (define-condition m-not-found (api-error) ((api-error-description :initform "No resource was found for this request."))) (define-condition m-limit-exceeded (api-error) ((api-error-description :initform "Too many requests have been sent in a short period of time. Wait a while then try again."))) (define-condition m-unknown (api-error) ((api-error-description :initform "An unknown error has occurred."))) (define-condition m-unrecognized (api-error) ((api-error-description :initform "The server did not understand the request."))) (define-condition m-unauthorized (api-error) ((api-error-description :initform "The request was not correctly authorized. Usually due to login failures."))) (defparameter *string->condition* (make-hash-table :test #'equal)) (defun add-string->condition (string condition-sym) (setf (gethash string *string->condition*) condition-sym)) (defun get-string->condition (string) (let ((condition (gethash string *string->condition*))) (unless condition (error (format nil "Condition for ~S not defined" string))) condition)) (defmacro pkv (plist key) `(plist-key-val ,plist ,key)) (add-string->condition "M_FORBIDDEN" 'm-forbidden) (add-string->condition "M_UNKNOWN_TOKEN" 'm-unknown-token) (add-string->condition "M_MISSING_TOKEN" 'm-missing-token) (add-string->condition "M_BAD_JSON" 'm-bad-json) (add-string->condition "M_NOT_JSON" 'm-not-json) (add-string->condition "M_NOT_FOUND" 'm-not-found) (add-string->condition "M_LIMIT_EXCEEDED" 'm-limit-exceeded) (add-string->condition "M_UNKNOWN" 'm-unknown) (add-string->condition "M_UNRECOGNIZED" 'm-unrecognized) (add-string->condition "M_UNAUTHORIZED" 'm-unauthorized) (defun signal-condition-from-response (response) (let* ((code (pkv response :|errcode|)) (error-val (pkv response :|error|)) (condition (get-string->condition code))) (error condition :api-error-code code :api-error-error error-val)))
34924
(in-package #:egora-admin) (defclass connection () ((logged-in-p :initform nil :accessor logged-in-p) (url :accessor url :initarg :url :type string) (api :accessor api :initarg :api :type string) (username :accessor username :type string :initarg :username) (password :accessor password :type string :initarg :password) (auth :accessor auth :type auth :initarg :auth) (device-id :accessor device-id :type string) (status :accessor status :initform (make-instance 'status) :type status))) (defmethod print-object ((connection connection) stream) (print-unreadable-object (connection stream :type t :identity t) (format stream "~&URL: ~S~%Username: ~S~%Logged in: ~S~%Auth: ~S~%Device-id: ~S~%Status object: ~A~%" (str:concat (url connection) (api connection)) (username connection) (logged-in-p connection) (if (slot-boundp connection 'auth) (auth connection) "Not authorized yet") (if (slot-boundp connection 'device-id) (device-id connection) "No device ID yet") (status connection)))) (defun make-connection (username password url api) (make-instance 'connection :username username :password <PASSWORD> :url url :api api)) (defclass status () ((current-rooms :accessor current-rooms :initform nil :type list) (known-users :accessor known-users :type list) (room-aliases :accessor room-aliases :type list :initform nil) (banned :accessor banned :type list) (kicked :accessor kicked :type list) (sync-history :accessor sync-history :initform (make-array 50 :element-type 'list :initial-element nil)) (latest-sync :accessor latest-sync :type list))) (defclass auth () ((token :accessor token :initarg :token :type string))) (define-condition api-error () ((api-error-error :accessor api-error-error :initarg :api-error-error :type string) (api-error-code :accessor api-error-code :initarg :api-error-code :type string) (api-error-description :accessor api-error-description))) (defmethod print-object ((api-error api-error) stream) (print-unreadable-object (api-error stream :type t :identity t) (format stream "~&Error code: ~S~%Error value: ~S~%Description: ~S~%" (api-error-code api-error) (api-error-error api-error) (api-error-description api-error)))) (define-condition m-forbidden (api-error) ((api-error-description :initform "Forbidden access, e.g. joining a room without permission, failed login."))) (define-condition m-unknown-token (api-error) ((api-error-description :initform "The access token specified was not recognised. An additional response parameter, soft_logout, might be present on the response for 401 HTTP status codes. See the soft logout section for more information."))) (define-condition m-missing-token (api-error) ((api-error-description :initform "No access token was specified for the request."))) (define-condition m-bad-json (api-error) ((api-error-description :initform "Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys."))) (define-condition m-not-json (api-error) ((api-error-description :initform "Request did not contain valid JSON."))) (define-condition m-not-found (api-error) ((api-error-description :initform "No resource was found for this request."))) (define-condition m-limit-exceeded (api-error) ((api-error-description :initform "Too many requests have been sent in a short period of time. Wait a while then try again."))) (define-condition m-unknown (api-error) ((api-error-description :initform "An unknown error has occurred."))) (define-condition m-unrecognized (api-error) ((api-error-description :initform "The server did not understand the request."))) (define-condition m-unauthorized (api-error) ((api-error-description :initform "The request was not correctly authorized. Usually due to login failures."))) (defparameter *string->condition* (make-hash-table :test #'equal)) (defun add-string->condition (string condition-sym) (setf (gethash string *string->condition*) condition-sym)) (defun get-string->condition (string) (let ((condition (gethash string *string->condition*))) (unless condition (error (format nil "Condition for ~S not defined" string))) condition)) (defmacro pkv (plist key) `(plist-key-val ,plist ,key)) (add-string->condition "M_FORBIDDEN" 'm-forbidden) (add-string->condition "M_UNKNOWN_TOKEN" 'm-unknown-token) (add-string->condition "M_MISSING_TOKEN" 'm-missing-token) (add-string->condition "M_BAD_JSON" 'm-bad-json) (add-string->condition "M_NOT_JSON" 'm-not-json) (add-string->condition "M_NOT_FOUND" 'm-not-found) (add-string->condition "M_LIMIT_EXCEEDED" 'm-limit-exceeded) (add-string->condition "M_UNKNOWN" 'm-unknown) (add-string->condition "M_UNRECOGNIZED" 'm-unrecognized) (add-string->condition "M_UNAUTHORIZED" 'm-unauthorized) (defun signal-condition-from-response (response) (let* ((code (pkv response :|errcode|)) (error-val (pkv response :|error|)) (condition (get-string->condition code))) (error condition :api-error-code code :api-error-error error-val)))
true
(in-package #:egora-admin) (defclass connection () ((logged-in-p :initform nil :accessor logged-in-p) (url :accessor url :initarg :url :type string) (api :accessor api :initarg :api :type string) (username :accessor username :type string :initarg :username) (password :accessor password :type string :initarg :password) (auth :accessor auth :type auth :initarg :auth) (device-id :accessor device-id :type string) (status :accessor status :initform (make-instance 'status) :type status))) (defmethod print-object ((connection connection) stream) (print-unreadable-object (connection stream :type t :identity t) (format stream "~&URL: ~S~%Username: ~S~%Logged in: ~S~%Auth: ~S~%Device-id: ~S~%Status object: ~A~%" (str:concat (url connection) (api connection)) (username connection) (logged-in-p connection) (if (slot-boundp connection 'auth) (auth connection) "Not authorized yet") (if (slot-boundp connection 'device-id) (device-id connection) "No device ID yet") (status connection)))) (defun make-connection (username password url api) (make-instance 'connection :username username :password PI:PASSWORD:<PASSWORD>END_PI :url url :api api)) (defclass status () ((current-rooms :accessor current-rooms :initform nil :type list) (known-users :accessor known-users :type list) (room-aliases :accessor room-aliases :type list :initform nil) (banned :accessor banned :type list) (kicked :accessor kicked :type list) (sync-history :accessor sync-history :initform (make-array 50 :element-type 'list :initial-element nil)) (latest-sync :accessor latest-sync :type list))) (defclass auth () ((token :accessor token :initarg :token :type string))) (define-condition api-error () ((api-error-error :accessor api-error-error :initarg :api-error-error :type string) (api-error-code :accessor api-error-code :initarg :api-error-code :type string) (api-error-description :accessor api-error-description))) (defmethod print-object ((api-error api-error) stream) (print-unreadable-object (api-error stream :type t :identity t) (format stream "~&Error code: ~S~%Error value: ~S~%Description: ~S~%" (api-error-code api-error) (api-error-error api-error) (api-error-description api-error)))) (define-condition m-forbidden (api-error) ((api-error-description :initform "Forbidden access, e.g. joining a room without permission, failed login."))) (define-condition m-unknown-token (api-error) ((api-error-description :initform "The access token specified was not recognised. An additional response parameter, soft_logout, might be present on the response for 401 HTTP status codes. See the soft logout section for more information."))) (define-condition m-missing-token (api-error) ((api-error-description :initform "No access token was specified for the request."))) (define-condition m-bad-json (api-error) ((api-error-description :initform "Request contained valid JSON, but it was malformed in some way, e.g. missing required keys, invalid values for keys."))) (define-condition m-not-json (api-error) ((api-error-description :initform "Request did not contain valid JSON."))) (define-condition m-not-found (api-error) ((api-error-description :initform "No resource was found for this request."))) (define-condition m-limit-exceeded (api-error) ((api-error-description :initform "Too many requests have been sent in a short period of time. Wait a while then try again."))) (define-condition m-unknown (api-error) ((api-error-description :initform "An unknown error has occurred."))) (define-condition m-unrecognized (api-error) ((api-error-description :initform "The server did not understand the request."))) (define-condition m-unauthorized (api-error) ((api-error-description :initform "The request was not correctly authorized. Usually due to login failures."))) (defparameter *string->condition* (make-hash-table :test #'equal)) (defun add-string->condition (string condition-sym) (setf (gethash string *string->condition*) condition-sym)) (defun get-string->condition (string) (let ((condition (gethash string *string->condition*))) (unless condition (error (format nil "Condition for ~S not defined" string))) condition)) (defmacro pkv (plist key) `(plist-key-val ,plist ,key)) (add-string->condition "M_FORBIDDEN" 'm-forbidden) (add-string->condition "M_UNKNOWN_TOKEN" 'm-unknown-token) (add-string->condition "M_MISSING_TOKEN" 'm-missing-token) (add-string->condition "M_BAD_JSON" 'm-bad-json) (add-string->condition "M_NOT_JSON" 'm-not-json) (add-string->condition "M_NOT_FOUND" 'm-not-found) (add-string->condition "M_LIMIT_EXCEEDED" 'm-limit-exceeded) (add-string->condition "M_UNKNOWN" 'm-unknown) (add-string->condition "M_UNRECOGNIZED" 'm-unrecognized) (add-string->condition "M_UNAUTHORIZED" 'm-unauthorized) (defun signal-condition-from-response (response) (let* ((code (pkv response :|errcode|)) (error-val (pkv response :|error|)) (condition (get-string->condition code))) (error condition :api-error-code code :api-error-error error-val)))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"VL\")\n(include-", "end": 1390, "score": 0.9995076060295105, "start": 1379, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"VL\")\n(include-book \"../parsetree\")", "end": 1410, "score": 0.9999341368675232, "start": 1392, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/vl/transforms/eliminitial.lisp
mayankmanj/acl2
305
; VL Verilog Toolkit ; Copyright (C) 2008-2014 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "VL") (include-book "../parsetree") (include-book "../mlib/blocks") (local (include-book "../util/arithmetic")) (local (std::add-default-post-define-hook :fix)) (defxdoc eliminitial :parents (transforms) :short "Throw away any @('initial') statements and add non-fatal @(see warnings) to the affected modules." :long "<p>Initial statements can be important for simulation, but are meaningless if we want to consider the post synthesis/build behavior of the actual part. Throwing them away, then, is basically reasonable for any back-end tool that wants to analyze the behavior of the synthesized modules.</p> <p>This transform can be run at any time. Back in VL2014 it was important to run it somewhere before the old @(see vl2014::always-top) transform, since some always-block code was reluctant to process modules with @('initial') statements. That probably doesn't matter anymore.</p>") (local (xdoc::set-default-parents eliminitial)) (def-genblob-transform vl-genblob-eliminitial ((modname stringp) (warnings vl-warninglist-p)) :returns ((warnings vl-warninglist-p)) ;; :verify-guards nil (b* (((vl-genblob x) x) (warnings (if x.initials (warn :type :vl-warn-initial :msg "Dropped ~x0 initial statement~s1 from module ~m2. (This is ~ generally fine: initial statements are just test bench code ~ that can be ignored when analyzing the module's behavior.)" :args (list (len x.initials) (if (vl-plural-p x.initials) "s" "") (string-fix modname))) (ok))) ((mv warnings generates) (vl-generates-eliminitial x.generates modname warnings))) (mv warnings (change-vl-genblob x :initials nil :generates generates))) :apply-to-generates vl-generates-eliminitial) (define vl-module-eliminitial ((x vl-module-p)) :returns (new-x vl-module-p) (b* ((x (vl-module-fix x)) ((when (vl-module->hands-offp x)) x) (genblob (vl-module->genblob x)) ((mv warnings new-genblob) (vl-genblob-eliminitial genblob (vl-module->name x) (vl-module->warnings x))) (x-warn (change-vl-module x :warnings warnings))) (vl-genblob->module new-genblob x-warn))) (defprojection vl-modulelist-eliminitial ((x vl-modulelist-p)) :returns (new-x vl-modulelist-p) (vl-module-eliminitial x)) (define vl-design-eliminitial :short "Top-level @(see eliminitial) transform." ((x vl-design-p)) :returns (new-x vl-design-p) (b* (((vl-design x) x)) (change-vl-design x :mods (vl-modulelist-eliminitial x.mods))))
64771
; VL Verilog Toolkit ; Copyright (C) 2008-2014 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "VL") (include-book "../parsetree") (include-book "../mlib/blocks") (local (include-book "../util/arithmetic")) (local (std::add-default-post-define-hook :fix)) (defxdoc eliminitial :parents (transforms) :short "Throw away any @('initial') statements and add non-fatal @(see warnings) to the affected modules." :long "<p>Initial statements can be important for simulation, but are meaningless if we want to consider the post synthesis/build behavior of the actual part. Throwing them away, then, is basically reasonable for any back-end tool that wants to analyze the behavior of the synthesized modules.</p> <p>This transform can be run at any time. Back in VL2014 it was important to run it somewhere before the old @(see vl2014::always-top) transform, since some always-block code was reluctant to process modules with @('initial') statements. That probably doesn't matter anymore.</p>") (local (xdoc::set-default-parents eliminitial)) (def-genblob-transform vl-genblob-eliminitial ((modname stringp) (warnings vl-warninglist-p)) :returns ((warnings vl-warninglist-p)) ;; :verify-guards nil (b* (((vl-genblob x) x) (warnings (if x.initials (warn :type :vl-warn-initial :msg "Dropped ~x0 initial statement~s1 from module ~m2. (This is ~ generally fine: initial statements are just test bench code ~ that can be ignored when analyzing the module's behavior.)" :args (list (len x.initials) (if (vl-plural-p x.initials) "s" "") (string-fix modname))) (ok))) ((mv warnings generates) (vl-generates-eliminitial x.generates modname warnings))) (mv warnings (change-vl-genblob x :initials nil :generates generates))) :apply-to-generates vl-generates-eliminitial) (define vl-module-eliminitial ((x vl-module-p)) :returns (new-x vl-module-p) (b* ((x (vl-module-fix x)) ((when (vl-module->hands-offp x)) x) (genblob (vl-module->genblob x)) ((mv warnings new-genblob) (vl-genblob-eliminitial genblob (vl-module->name x) (vl-module->warnings x))) (x-warn (change-vl-module x :warnings warnings))) (vl-genblob->module new-genblob x-warn))) (defprojection vl-modulelist-eliminitial ((x vl-modulelist-p)) :returns (new-x vl-modulelist-p) (vl-module-eliminitial x)) (define vl-design-eliminitial :short "Top-level @(see eliminitial) transform." ((x vl-design-p)) :returns (new-x vl-design-p) (b* (((vl-design x) x)) (change-vl-design x :mods (vl-modulelist-eliminitial x.mods))))
true
; VL Verilog Toolkit ; Copyright (C) 2008-2014 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "VL") (include-book "../parsetree") (include-book "../mlib/blocks") (local (include-book "../util/arithmetic")) (local (std::add-default-post-define-hook :fix)) (defxdoc eliminitial :parents (transforms) :short "Throw away any @('initial') statements and add non-fatal @(see warnings) to the affected modules." :long "<p>Initial statements can be important for simulation, but are meaningless if we want to consider the post synthesis/build behavior of the actual part. Throwing them away, then, is basically reasonable for any back-end tool that wants to analyze the behavior of the synthesized modules.</p> <p>This transform can be run at any time. Back in VL2014 it was important to run it somewhere before the old @(see vl2014::always-top) transform, since some always-block code was reluctant to process modules with @('initial') statements. That probably doesn't matter anymore.</p>") (local (xdoc::set-default-parents eliminitial)) (def-genblob-transform vl-genblob-eliminitial ((modname stringp) (warnings vl-warninglist-p)) :returns ((warnings vl-warninglist-p)) ;; :verify-guards nil (b* (((vl-genblob x) x) (warnings (if x.initials (warn :type :vl-warn-initial :msg "Dropped ~x0 initial statement~s1 from module ~m2. (This is ~ generally fine: initial statements are just test bench code ~ that can be ignored when analyzing the module's behavior.)" :args (list (len x.initials) (if (vl-plural-p x.initials) "s" "") (string-fix modname))) (ok))) ((mv warnings generates) (vl-generates-eliminitial x.generates modname warnings))) (mv warnings (change-vl-genblob x :initials nil :generates generates))) :apply-to-generates vl-generates-eliminitial) (define vl-module-eliminitial ((x vl-module-p)) :returns (new-x vl-module-p) (b* ((x (vl-module-fix x)) ((when (vl-module->hands-offp x)) x) (genblob (vl-module->genblob x)) ((mv warnings new-genblob) (vl-genblob-eliminitial genblob (vl-module->name x) (vl-module->warnings x))) (x-warn (change-vl-module x :warnings warnings))) (vl-genblob->module new-genblob x-warn))) (defprojection vl-modulelist-eliminitial ((x vl-modulelist-p)) :returns (new-x vl-modulelist-p) (vl-module-eliminitial x)) (define vl-design-eliminitial :short "Top-level @(see eliminitial) transform." ((x vl-design-p)) :returns (new-x vl-design-p) (b* (((vl-design x) x)) (change-vl-design x :mods (vl-modulelist-eliminitial x.mods))))
[ { "context": ";;; Copyright (C) 2002 Gerd Moellmann <[email protected]>\n;;; All rights reser", "end": 37, "score": 0.9998278617858887, "start": 23, "tag": "NAME", "value": "Gerd Moellmann" }, { "context": ";;; Copyright (C) 2002 Gerd Moellmann <[email protected]>\n;;; All rights reserved.\n;;;\n;;; Redistribution ", "end": 65, "score": 0.999936044216156, "start": 39, "tag": "EMAIL", "value": "[email protected]" } ]
rt/reinitialize-instance.lisp
binghe/portable-clos
57
;;; Copyright (C) 2002 Gerd Moellmann <[email protected]> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; 2. Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; 3. The name of the author may not be used to endorse or promote ;;; products derived from this software without specific prior written ;;; permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT ;;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ;;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;;; DAMAGE. (ext:file-comment "$Header: src/pcl/rt/reinitialize-instance.lisp $") (in-package "PCL-TEST") (deftest reinitialize-instance.0 (multiple-value-bind (r c) (ignore-errors (defclass ri0 () ((a :initarg :a))) (reinitialize-instance (make-instance 'ri0) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.1 (multiple-value-bind (r c) (ignore-errors (defclass ri1 () ()) (reinitialize-instance (make-instance 'ri1) :a 1)) (values (null r) (typep c 'error))) t t) (deftest reinitialize-instance.2 (multiple-value-bind (r c) (ignore-errors (defclass ri2 () ()) (defmethod shared-initialize ((x ri2) slots &rest initargs &key a) (declare (ignore slots initargs a))) (reinitialize-instance (make-instance 'ri2) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.3 (multiple-value-bind (r c) (ignore-errors (defclass ri3 () ()) (defmethod reinitialize-instance :after ((x ri3) &rest initargs &key a) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri3) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.4 (multiple-value-bind (r c) (ignore-errors (defclass ri4 () ()) (defmethod reinitialize-instance :after ((x ri4) &rest initargs &key a &allow-other-keys) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.5 (multiple-value-bind (r c) (ignore-errors (defclass ri5 () ()) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2 :allow-other-keys t)) (values (null r) (typep c 'error))) nil nil)
14206
;;; Copyright (C) 2002 <NAME> <<EMAIL>> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; 2. Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; 3. The name of the author may not be used to endorse or promote ;;; products derived from this software without specific prior written ;;; permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT ;;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ;;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;;; DAMAGE. (ext:file-comment "$Header: src/pcl/rt/reinitialize-instance.lisp $") (in-package "PCL-TEST") (deftest reinitialize-instance.0 (multiple-value-bind (r c) (ignore-errors (defclass ri0 () ((a :initarg :a))) (reinitialize-instance (make-instance 'ri0) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.1 (multiple-value-bind (r c) (ignore-errors (defclass ri1 () ()) (reinitialize-instance (make-instance 'ri1) :a 1)) (values (null r) (typep c 'error))) t t) (deftest reinitialize-instance.2 (multiple-value-bind (r c) (ignore-errors (defclass ri2 () ()) (defmethod shared-initialize ((x ri2) slots &rest initargs &key a) (declare (ignore slots initargs a))) (reinitialize-instance (make-instance 'ri2) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.3 (multiple-value-bind (r c) (ignore-errors (defclass ri3 () ()) (defmethod reinitialize-instance :after ((x ri3) &rest initargs &key a) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri3) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.4 (multiple-value-bind (r c) (ignore-errors (defclass ri4 () ()) (defmethod reinitialize-instance :after ((x ri4) &rest initargs &key a &allow-other-keys) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.5 (multiple-value-bind (r c) (ignore-errors (defclass ri5 () ()) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2 :allow-other-keys t)) (values (null r) (typep c 'error))) nil nil)
true
;;; Copyright (C) 2002 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;; All rights reserved. ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; 2. Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; 3. The name of the author may not be used to endorse or promote ;;; products derived from this software without specific prior written ;;; permission. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE ;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT ;;; OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ;;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE ;;; USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ;;; DAMAGE. (ext:file-comment "$Header: src/pcl/rt/reinitialize-instance.lisp $") (in-package "PCL-TEST") (deftest reinitialize-instance.0 (multiple-value-bind (r c) (ignore-errors (defclass ri0 () ((a :initarg :a))) (reinitialize-instance (make-instance 'ri0) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.1 (multiple-value-bind (r c) (ignore-errors (defclass ri1 () ()) (reinitialize-instance (make-instance 'ri1) :a 1)) (values (null r) (typep c 'error))) t t) (deftest reinitialize-instance.2 (multiple-value-bind (r c) (ignore-errors (defclass ri2 () ()) (defmethod shared-initialize ((x ri2) slots &rest initargs &key a) (declare (ignore slots initargs a))) (reinitialize-instance (make-instance 'ri2) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.3 (multiple-value-bind (r c) (ignore-errors (defclass ri3 () ()) (defmethod reinitialize-instance :after ((x ri3) &rest initargs &key a) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri3) :a 1)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.4 (multiple-value-bind (r c) (ignore-errors (defclass ri4 () ()) (defmethod reinitialize-instance :after ((x ri4) &rest initargs &key a &allow-other-keys) (declare (ignore initargs a))) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2)) (values (null r) (typep c 'error))) nil nil) (deftest reinitialize-instance.5 (multiple-value-bind (r c) (ignore-errors (defclass ri5 () ()) (reinitialize-instance (make-instance 'ri4) :a 1 :b 2 :allow-other-keys t)) (values (null r) (typep c 'error))) nil nil)
[ { "context": "; JVM instructions\n;\n; Copyright (C) 2008-2011 Eric Smith and Stanford University\n; Copyright (C) 2013-2021", "end": 57, "score": 0.999511182308197, "start": 47, "tag": "NAME", "value": "Eric Smith" }, { "context": "ense. See the file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;", "end": 218, "score": 0.9995918869972229, "start": 208, "tag": "NAME", "value": "Eric Smith" }, { "context": " file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 242, "score": 0.9999322295188904, "start": 220, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/jvm/instructions.lisp
mayankmanj/acl2
305
; JVM instructions ; ; Copyright (C) 2008-2011 Eric Smith and Stanford University ; Copyright (C) 2013-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "JVM") (include-book "floats") (include-book "fields") ;for field-idp (include-book "method-descriptors") (local (in-theory (disable member-equal jvm::typep))) ;for speed ;; The name of a method is just a string (defun method-namep (obj) (declare (xargs :guard t)) (stringp obj)) ;; Disabled by default ;; Needed if we call string functions on method-names (defthmd stringp-when-method-namep (implies (stringp name) (method-namep name))) ;takes the decimal number version of the opcode and gives back the symbolic name ;fixme could use an array for this, for speed. ;fixme generalize this to map from the number to the format of the opcode? (defconst acl2::*opcode-to-name-table* '((0 . :nop) (1 . :aconst_null) (2 . :iconst_m1) (3 . :iconst_0) (4 . :iconst_1) (5 . :iconst_2) (6 . :iconst_3) (7 . :iconst_4) (8 . :iconst_5) (9 . :lconst_0) (10 . :lconst_1) (11 . :fconst_0) (12 . :fconst_1) (13 . :fconst_2) (14 . :dconst_0) (15 . :dconst_1) (16 . :bipush) (17 . :sipush) (18 . :ldc) (19 . :ldc_w) (20 . :ldc2_w) (21 . :iload) (22 . :lload) (23 . :fload) (24 . :dload) (25 . :aload) (26 . :iload_0) (27 . :iload_1) (28 . :iload_2) (29 . :iload_3) (30 . :lload_0) (31 . :lload_1) (32 . :lload_2) (33 . :lload_3) (34 . :fload_0) (35 . :fload_1) (36 . :fload_2) (37 . :fload_3) (38 . :dload_0) (39 . :dload_1) (40 . :dload_2) (41 . :dload_3) (42 . :aload_0) (43 . :aload_1) (44 . :aload_2) (45 . :aload_3) (46 . :iaload) (47 . :laload) (48 . :faload) (49 . :daload) (50 . :aaload) (51 . :baload) (52 . :caload) (53 . :saload) (54 . :istore) (55 . :lstore) (56 . :fstore) (57 . :dstore) (58 . :astore) (59 . :istore_0) (60 . :istore_1) (61 . :istore_2) (62 . :istore_3) (63 . :lstore_0) (64 . :lstore_1) (65 . :lstore_2) (66 . :lstore_3) (67 . :fstore_0) (68 . :fstore_1) (69 . :fstore_2) (70 . :fstore_3) (71 . :dstore_0) (72 . :dstore_1) (73 . :dstore_2) (74 . :dstore_3) (75 . :astore_0) (76 . :astore_1) (77 . :astore_2) (78 . :astore_3) (79 . :iastore) (80 . :lastore) (81 . :fastore) (82 . :dastore) (83 . :aastore) (84 . :bastore) (85 . :castore) (86 . :sastore) (87 . :pop) (88 . :pop2) (89 . :dup) (90 . :dup_x1) (91 . :dup_x2) (92 . :dup2) (93 . :dup2_x1) (94 . :dup2_x2) (95 . :swap) (96 . :iadd) (97 . :ladd) (98 . :fadd) (99 . :dadd) (100 . :isub) (101 . :lsub) (102 . :fsub) (103 . :dsub) (104 . :imul) (105 . :lmul) (106 . :fmul) (107 . :dmul) (108 . :idiv) (109 . :ldiv) (110 . :fdiv) (111 . :ddiv) (112 . :irem) (113 . :lrem) (114 . :frem) (115 . :drem) (116 . :ineg) (117 . :lneg) (118 . :fneg) (119 . :dneg) (120 . :ishl) (121 . :lshl) (122 . :ishr) (123 . :lshr) (124 . :iushr) (125 . :lushr) (126 . :iand) (127 . :land) (128 . :ior) (129 . :lor) (130 . :ixor) (131 . :lxor) (132 . :iinc) (133 . :i2l) (134 . :i2f) (135 . :i2d) (136 . :l2i) (137 . :l2f) (138 . :l2d) (139 . :f2i) (140 . :f2l) (141 . :f2d) (142 . :d2i) (143 . :d2l) (144 . :d2f) (145 . :i2b) (146 . :i2c) (147 . :i2s) (148 . :lcmp) (149 . :fcmpl) (150 . :fcmpg) (151 . :dcmpl) (152 . :dcmpg) (153 . :ifeq) (154 . :ifne) (155 . :iflt) (156 . :ifge) (157 . :ifgt) (158 . :ifle) (159 . :if_icmpeq) (160 . :if_icmpne) (161 . :if_icmplt) (162 . :if_icmpge) (163 . :if_icmpgt) (164 . :if_icmple) (165 . :if_acmpeq) (166 . :if_acmpne) (167 . :goto) (168 . :jsr) (169 . :ret) (170 . :tableswitch) (171 . :lookupswitch) (172 . :ireturn) (173 . :lreturn) (174 . :freturn) (175 . :dreturn) (176 . :areturn) (177 . :return) (178 . :getstatic) (179 . :putstatic) (180 . :getfield) (181 . :putfield) (182 . :invokevirtual) (183 . :invokespecial) (184 . :invokestatic) (185 . :invokeinterface) (186 . :invokedynamic) (187 . :new) (188 . :newarray) (189 . :anewarray) (190 . :arraylength) (191 . :athrow) (192 . :checkcast) (193 . :instanceof) (194 . :monitorenter) (195 . :monitorexit) (196 . :wide) ;special handling for this (197 . :multianewarray) (198 . :ifnull) (199 . :ifnonnull) (200 . :goto_w) (201 . :jsr_w))) ;todo package (defconst acl2::*opcodes* (strip-cdrs acl2::*opcode-to-name-table*)) ;fixme add into the below. or deprecate? (defun invokevirtual-instructionp (x) (declare (xargs :guard t)) (and (consp x) (eq :invokevirtual (first x)) (let ((args (acl2::fargs x))) (and (= 4 (len args)) (reference-typep (first args)) (method-namep (second args)) (method-descriptorp (third args)) (all-typep (fourth args)))))) ;fixme guard should restrict this to an instruction (defun instruction-args (x) (declare (xargs :guard (true-listp x))) (acl2::fargs x)) (defun inst-lengthp (len) (declare (xargs :guard t)) (natp len)) (defund jvm-instructionp (inst) (declare (xargs :guard t)) (and (consp inst) (member-eq (car inst) acl2::*opcodes*) (true-listp (cdr inst)))) (defthm jvm-instructionp-forward-to-consp (implies (jvm-instructionp inst) (consp inst)) :rule-classes :forward-chaining :hints (("Goal" :in-theory (enable jvm-instructionp)))) ;todo: invokedynamic (defund len-of-invoke-instruction (opcode) (declare (xargs :guard t)) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok )))) (defthm len-of-invoke-instruction-constant-opener (implies (syntaxp (quotep opcode)) (equal (len-of-invoke-instruction opcode) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok ))))) :hints (("Goal" :in-theory (enable LEN-OF-INVOKE-INSTRUCTION)))) ;These are the ops that have only one byte (the opcode itself) in the ;instruction stream. The order here shouldn't matter (could sort by ;frequency). (defconst *one-byte-ops* '(:NOP :ACONST_NULL :ICONST_M1 :ICONST_0 :ICONST_1 :ICONST_2 :ICONST_3 :ICONST_4 :ICONST_5 :LCONST_0 :LCONST_1 :FCONST_0 :FCONST_1 :FCONST_2 :DCONST_0 :DCONST_1 :ILOAD_0 :ILOAD_1 :ILOAD_2 :ILOAD_3 :LLOAD_0 :LLOAD_1 :LLOAD_2 :LLOAD_3 :FLOAD_0 :FLOAD_1 :FLOAD_2 :FLOAD_3 :DLOAD_0 :DLOAD_1 :DLOAD_2 :DLOAD_3 :ALOAD_0 :ALOAD_1 :ALOAD_2 :ALOAD_3 :ISTORE_0 :ISTORE_1 :ISTORE_2 :ISTORE_3 :LSTORE_0 :LSTORE_1 :LSTORE_2 :LSTORE_3 :FSTORE_0 :FSTORE_1 :FSTORE_2 :FSTORE_3 :DSTORE_0 :DSTORE_1 :DSTORE_2 :DSTORE_3 :ASTORE_0 :ASTORE_1 :ASTORE_2 :ASTORE_3 :POP :POP2 :DUP :DUP_X1 :DUP_X2 :DUP2 :DUP2_X1 :DUP2_X2 :SWAP :IADD :LADD :FADD :DADD :ISUB :LSUB :FSUB :DSUB :IMUL :LMUL :FMUL :DMUL :IDIV :LDIV :FDIV :DDIV :IREM :LREM :FREM :DREM :INEG :LNEG :FNEG :DNEG :ISHL :LSHL :ISHR :LSHR :IUSHR :LUSHR :IAND :LAND :IOR :LOR :IXOR :LXOR :I2L :I2F :I2D :L2I :L2F :L2D :F2I :F2L :F2D :D2I :D2L :D2F :I2B :I2C :I2S :LCMP :FCMPL :FCMPG :DCMPL :DCMPG :IRETURN :LRETURN :FRETURN :DRETURN :ARETURN :RETURN :ARRAYLENGTH :ATHROW :MONITORENTER :MONITOREXIT :IALOAD :LALOAD :FALOAD :DALOAD :AALOAD :BALOAD :CALOAD :SALOAD :IASTORE :LASTORE :FASTORE :DASTORE :AASTORE :BASTORE :CASTORE :SASTORE)) ;; Recognize a program counter. (defund pcp (val) (declare (xargs :guard t)) (natp val)) ;; Recognize a list of program counters. (defund acl2::all-pcp (pcs) (declare (xargs :guard t)) (if (atom pcs) t (and (jvm::pcp (first pcs)) (acl2::all-pcp (rest pcs))))) (defthm all-pcp-of-revappend (implies (and (acl2::all-pcp x) (acl2::all-pcp y)) (acl2::all-pcp (revappend x y))) :hints (("Goal" :induct t :in-theory (enable acl2::all-pcp revappend)))) (defthm pcp-of-car (implies (acl2::all-pcp pcs) (equal (pcp (car pcs)) (consp pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defthm all-pcp-of-cdr (implies (acl2::all-pcp pcs) (acl2::all-pcp (cdr pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defund valid-pcp (pc valid-pcs) (declare (xargs :guard (and; (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (enable pcp))))) (and (pcp pc) ;drop? (member pc valid-pcs))) ;recognize an offset to a program counter (defund pc-offsetp (val) (declare (xargs :guard t)) (integerp val)) ;fixme constrain to not make the whole pc negative... (defthm pcp-of-len-of-invoke-instruction (pcp (len-of-invoke-instruction opcode)) :hints (("Goal" :in-theory (enable len-of-invoke-instruction)))) ;fixme move or copy some of these checks (the ones not involving PC) into jvm-instructionp ;fixme improve to check the args of the instructions (e.g., that the inst-len stored is an integer for those instructions that can be preceded by WIDE) ;we need the pc here to make sure that relative jumps are okay (defund jvm-instruction-okayp (inst pc valid-pcs) (declare (xargs :guard (and (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (e/d (jvm-instructionp len-of-invoke-instruction) ( ;memberp-of-cons )))))) (and (jvm-instructionp inst) ;fixme eventually drop this (or at least the member-eq) ;; (not (cw "Checking ~x0~%" inst)) (or (member-eq (car inst) *one-byte-ops*) (case (car inst) ;;fixme add the rest of the cases! (:new (and (= 1 (len (instruction-args inst))) (class-namep (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) ;todo: either drop these or change to a more efficient check )) (:putfield (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (valid-pcp (+ 3 pc) valid-pcs))) ((:invokevirtual :invokeinterface) (and (= 4 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:invokestatic :invokespecial) (and (= 5 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (booleanp (farg5 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:if_acmpeq :if_acmpne :if_icmpeq :if_icmpne :if_icmplt :if_icmpge :if_icmpgt :if_icmple :ifeq :ifne :iflt :ifge :ifgt :ifle :ifnull :ifnonnull) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) (valid-pcp (+ (farg1 inst) pc) valid-pcs))) ((:goto :jsr) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ (farg1 inst) pc) valid-pcs) ;no need to check the instr following this unconditional jump )) ((:getfield :putfield :getstatic :putstatic) (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (booleanp (farg3 inst)))) ((:iload :lload :fload :dload :aload :istore :lstore :fstore :dstore :astore :ret) (and (= 2 (len (instruction-args inst))) (unsigned-byte-p 16 (farg2 inst)) (inst-lengthp (farg2 inst)) ;total length of the instruction (stored because of wide) )) (:iinc (and (= 3 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)) (signed-byte-p 16 (farg2 inst)) (or (eql 3 (farg3 inst)) (eql 6 (farg3 inst))))) ((:checkcast :anewarray :instanceof) (and (= 1 (len (instruction-args inst))) (typep (farg1 inst)))) (:newarray (and (= 1 (len (instruction-args inst))) (member-eq (farg1 inst) *primitive-types*))) (:bipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 8 (farg1 inst)))) (:sipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 16 (farg1 inst)))) ((:ldc :ldc_w) (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 32 (farg1 inst)) (java-floatp (farg1 inst)) (stringp (farg1 inst)) (and (true-listp (farg1 inst)) (= 2 (len (farg1 inst))) (eq :class (first (farg1 inst))) (class-namep (second (farg1 inst))))))) (:ldc2_w (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 64 (farg1 inst)) (java-doublep (farg1 inst))))) ((:goto_w :jsr_w) (and (= 1 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)))) (:invokedynamic ;may change (and (= 1 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)))) (:multianewarray (and (= 2 (len (instruction-args inst))) (typep (farg1 inst)) (unsigned-byte-p 8 (farg2 inst)))) (:tableswitch (and (= 4 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)) (signed-byte-p 32 (farg2 inst)) (signed-byte-p 32 (farg3 inst)) (and (true-listp (farg4 inst)) ;(all-signed-byte-p 32 (farg4 inst)) ))) (:lookupswitch (and (= 2 (len (instruction-args inst))) (and (alistp (farg1 inst)) ;(all-signed-byte-p 32 (strip-cars (farg1 inst))) ;(all-signed-byte-p 32 (strip-cdrs (farg1 inst))) ) (signed-byte-p 32 (farg2 inst)))) ;; :wide is handled specially (otherwise (er hard? 'jvm-instruction-okayp "Unknown opcode: ~x0" (car inst))))))) (defthm jvm-instructionp-when-jvm-instruction-okayp (implies (jvm-instruction-okayp inst pc valid-pcs) (jvm-instructionp inst)) :hints (("Goal" :in-theory (enable jvm-instruction-okayp)))) ;extract the op-code from an instruction ;make a macro? (why?) (defund op-code (inst) (declare (xargs :guard (jvm-instructionp inst) :guard-hints (("Goal" :in-theory (enable jvm-instructionp))))) (car inst))
68670
; JVM instructions ; ; Copyright (C) 2008-2011 <NAME> and Stanford University ; Copyright (C) 2013-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "JVM") (include-book "floats") (include-book "fields") ;for field-idp (include-book "method-descriptors") (local (in-theory (disable member-equal jvm::typep))) ;for speed ;; The name of a method is just a string (defun method-namep (obj) (declare (xargs :guard t)) (stringp obj)) ;; Disabled by default ;; Needed if we call string functions on method-names (defthmd stringp-when-method-namep (implies (stringp name) (method-namep name))) ;takes the decimal number version of the opcode and gives back the symbolic name ;fixme could use an array for this, for speed. ;fixme generalize this to map from the number to the format of the opcode? (defconst acl2::*opcode-to-name-table* '((0 . :nop) (1 . :aconst_null) (2 . :iconst_m1) (3 . :iconst_0) (4 . :iconst_1) (5 . :iconst_2) (6 . :iconst_3) (7 . :iconst_4) (8 . :iconst_5) (9 . :lconst_0) (10 . :lconst_1) (11 . :fconst_0) (12 . :fconst_1) (13 . :fconst_2) (14 . :dconst_0) (15 . :dconst_1) (16 . :bipush) (17 . :sipush) (18 . :ldc) (19 . :ldc_w) (20 . :ldc2_w) (21 . :iload) (22 . :lload) (23 . :fload) (24 . :dload) (25 . :aload) (26 . :iload_0) (27 . :iload_1) (28 . :iload_2) (29 . :iload_3) (30 . :lload_0) (31 . :lload_1) (32 . :lload_2) (33 . :lload_3) (34 . :fload_0) (35 . :fload_1) (36 . :fload_2) (37 . :fload_3) (38 . :dload_0) (39 . :dload_1) (40 . :dload_2) (41 . :dload_3) (42 . :aload_0) (43 . :aload_1) (44 . :aload_2) (45 . :aload_3) (46 . :iaload) (47 . :laload) (48 . :faload) (49 . :daload) (50 . :aaload) (51 . :baload) (52 . :caload) (53 . :saload) (54 . :istore) (55 . :lstore) (56 . :fstore) (57 . :dstore) (58 . :astore) (59 . :istore_0) (60 . :istore_1) (61 . :istore_2) (62 . :istore_3) (63 . :lstore_0) (64 . :lstore_1) (65 . :lstore_2) (66 . :lstore_3) (67 . :fstore_0) (68 . :fstore_1) (69 . :fstore_2) (70 . :fstore_3) (71 . :dstore_0) (72 . :dstore_1) (73 . :dstore_2) (74 . :dstore_3) (75 . :astore_0) (76 . :astore_1) (77 . :astore_2) (78 . :astore_3) (79 . :iastore) (80 . :lastore) (81 . :fastore) (82 . :dastore) (83 . :aastore) (84 . :bastore) (85 . :castore) (86 . :sastore) (87 . :pop) (88 . :pop2) (89 . :dup) (90 . :dup_x1) (91 . :dup_x2) (92 . :dup2) (93 . :dup2_x1) (94 . :dup2_x2) (95 . :swap) (96 . :iadd) (97 . :ladd) (98 . :fadd) (99 . :dadd) (100 . :isub) (101 . :lsub) (102 . :fsub) (103 . :dsub) (104 . :imul) (105 . :lmul) (106 . :fmul) (107 . :dmul) (108 . :idiv) (109 . :ldiv) (110 . :fdiv) (111 . :ddiv) (112 . :irem) (113 . :lrem) (114 . :frem) (115 . :drem) (116 . :ineg) (117 . :lneg) (118 . :fneg) (119 . :dneg) (120 . :ishl) (121 . :lshl) (122 . :ishr) (123 . :lshr) (124 . :iushr) (125 . :lushr) (126 . :iand) (127 . :land) (128 . :ior) (129 . :lor) (130 . :ixor) (131 . :lxor) (132 . :iinc) (133 . :i2l) (134 . :i2f) (135 . :i2d) (136 . :l2i) (137 . :l2f) (138 . :l2d) (139 . :f2i) (140 . :f2l) (141 . :f2d) (142 . :d2i) (143 . :d2l) (144 . :d2f) (145 . :i2b) (146 . :i2c) (147 . :i2s) (148 . :lcmp) (149 . :fcmpl) (150 . :fcmpg) (151 . :dcmpl) (152 . :dcmpg) (153 . :ifeq) (154 . :ifne) (155 . :iflt) (156 . :ifge) (157 . :ifgt) (158 . :ifle) (159 . :if_icmpeq) (160 . :if_icmpne) (161 . :if_icmplt) (162 . :if_icmpge) (163 . :if_icmpgt) (164 . :if_icmple) (165 . :if_acmpeq) (166 . :if_acmpne) (167 . :goto) (168 . :jsr) (169 . :ret) (170 . :tableswitch) (171 . :lookupswitch) (172 . :ireturn) (173 . :lreturn) (174 . :freturn) (175 . :dreturn) (176 . :areturn) (177 . :return) (178 . :getstatic) (179 . :putstatic) (180 . :getfield) (181 . :putfield) (182 . :invokevirtual) (183 . :invokespecial) (184 . :invokestatic) (185 . :invokeinterface) (186 . :invokedynamic) (187 . :new) (188 . :newarray) (189 . :anewarray) (190 . :arraylength) (191 . :athrow) (192 . :checkcast) (193 . :instanceof) (194 . :monitorenter) (195 . :monitorexit) (196 . :wide) ;special handling for this (197 . :multianewarray) (198 . :ifnull) (199 . :ifnonnull) (200 . :goto_w) (201 . :jsr_w))) ;todo package (defconst acl2::*opcodes* (strip-cdrs acl2::*opcode-to-name-table*)) ;fixme add into the below. or deprecate? (defun invokevirtual-instructionp (x) (declare (xargs :guard t)) (and (consp x) (eq :invokevirtual (first x)) (let ((args (acl2::fargs x))) (and (= 4 (len args)) (reference-typep (first args)) (method-namep (second args)) (method-descriptorp (third args)) (all-typep (fourth args)))))) ;fixme guard should restrict this to an instruction (defun instruction-args (x) (declare (xargs :guard (true-listp x))) (acl2::fargs x)) (defun inst-lengthp (len) (declare (xargs :guard t)) (natp len)) (defund jvm-instructionp (inst) (declare (xargs :guard t)) (and (consp inst) (member-eq (car inst) acl2::*opcodes*) (true-listp (cdr inst)))) (defthm jvm-instructionp-forward-to-consp (implies (jvm-instructionp inst) (consp inst)) :rule-classes :forward-chaining :hints (("Goal" :in-theory (enable jvm-instructionp)))) ;todo: invokedynamic (defund len-of-invoke-instruction (opcode) (declare (xargs :guard t)) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok )))) (defthm len-of-invoke-instruction-constant-opener (implies (syntaxp (quotep opcode)) (equal (len-of-invoke-instruction opcode) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok ))))) :hints (("Goal" :in-theory (enable LEN-OF-INVOKE-INSTRUCTION)))) ;These are the ops that have only one byte (the opcode itself) in the ;instruction stream. The order here shouldn't matter (could sort by ;frequency). (defconst *one-byte-ops* '(:NOP :ACONST_NULL :ICONST_M1 :ICONST_0 :ICONST_1 :ICONST_2 :ICONST_3 :ICONST_4 :ICONST_5 :LCONST_0 :LCONST_1 :FCONST_0 :FCONST_1 :FCONST_2 :DCONST_0 :DCONST_1 :ILOAD_0 :ILOAD_1 :ILOAD_2 :ILOAD_3 :LLOAD_0 :LLOAD_1 :LLOAD_2 :LLOAD_3 :FLOAD_0 :FLOAD_1 :FLOAD_2 :FLOAD_3 :DLOAD_0 :DLOAD_1 :DLOAD_2 :DLOAD_3 :ALOAD_0 :ALOAD_1 :ALOAD_2 :ALOAD_3 :ISTORE_0 :ISTORE_1 :ISTORE_2 :ISTORE_3 :LSTORE_0 :LSTORE_1 :LSTORE_2 :LSTORE_3 :FSTORE_0 :FSTORE_1 :FSTORE_2 :FSTORE_3 :DSTORE_0 :DSTORE_1 :DSTORE_2 :DSTORE_3 :ASTORE_0 :ASTORE_1 :ASTORE_2 :ASTORE_3 :POP :POP2 :DUP :DUP_X1 :DUP_X2 :DUP2 :DUP2_X1 :DUP2_X2 :SWAP :IADD :LADD :FADD :DADD :ISUB :LSUB :FSUB :DSUB :IMUL :LMUL :FMUL :DMUL :IDIV :LDIV :FDIV :DDIV :IREM :LREM :FREM :DREM :INEG :LNEG :FNEG :DNEG :ISHL :LSHL :ISHR :LSHR :IUSHR :LUSHR :IAND :LAND :IOR :LOR :IXOR :LXOR :I2L :I2F :I2D :L2I :L2F :L2D :F2I :F2L :F2D :D2I :D2L :D2F :I2B :I2C :I2S :LCMP :FCMPL :FCMPG :DCMPL :DCMPG :IRETURN :LRETURN :FRETURN :DRETURN :ARETURN :RETURN :ARRAYLENGTH :ATHROW :MONITORENTER :MONITOREXIT :IALOAD :LALOAD :FALOAD :DALOAD :AALOAD :BALOAD :CALOAD :SALOAD :IASTORE :LASTORE :FASTORE :DASTORE :AASTORE :BASTORE :CASTORE :SASTORE)) ;; Recognize a program counter. (defund pcp (val) (declare (xargs :guard t)) (natp val)) ;; Recognize a list of program counters. (defund acl2::all-pcp (pcs) (declare (xargs :guard t)) (if (atom pcs) t (and (jvm::pcp (first pcs)) (acl2::all-pcp (rest pcs))))) (defthm all-pcp-of-revappend (implies (and (acl2::all-pcp x) (acl2::all-pcp y)) (acl2::all-pcp (revappend x y))) :hints (("Goal" :induct t :in-theory (enable acl2::all-pcp revappend)))) (defthm pcp-of-car (implies (acl2::all-pcp pcs) (equal (pcp (car pcs)) (consp pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defthm all-pcp-of-cdr (implies (acl2::all-pcp pcs) (acl2::all-pcp (cdr pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defund valid-pcp (pc valid-pcs) (declare (xargs :guard (and; (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (enable pcp))))) (and (pcp pc) ;drop? (member pc valid-pcs))) ;recognize an offset to a program counter (defund pc-offsetp (val) (declare (xargs :guard t)) (integerp val)) ;fixme constrain to not make the whole pc negative... (defthm pcp-of-len-of-invoke-instruction (pcp (len-of-invoke-instruction opcode)) :hints (("Goal" :in-theory (enable len-of-invoke-instruction)))) ;fixme move or copy some of these checks (the ones not involving PC) into jvm-instructionp ;fixme improve to check the args of the instructions (e.g., that the inst-len stored is an integer for those instructions that can be preceded by WIDE) ;we need the pc here to make sure that relative jumps are okay (defund jvm-instruction-okayp (inst pc valid-pcs) (declare (xargs :guard (and (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (e/d (jvm-instructionp len-of-invoke-instruction) ( ;memberp-of-cons )))))) (and (jvm-instructionp inst) ;fixme eventually drop this (or at least the member-eq) ;; (not (cw "Checking ~x0~%" inst)) (or (member-eq (car inst) *one-byte-ops*) (case (car inst) ;;fixme add the rest of the cases! (:new (and (= 1 (len (instruction-args inst))) (class-namep (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) ;todo: either drop these or change to a more efficient check )) (:putfield (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (valid-pcp (+ 3 pc) valid-pcs))) ((:invokevirtual :invokeinterface) (and (= 4 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:invokestatic :invokespecial) (and (= 5 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (booleanp (farg5 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:if_acmpeq :if_acmpne :if_icmpeq :if_icmpne :if_icmplt :if_icmpge :if_icmpgt :if_icmple :ifeq :ifne :iflt :ifge :ifgt :ifle :ifnull :ifnonnull) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) (valid-pcp (+ (farg1 inst) pc) valid-pcs))) ((:goto :jsr) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ (farg1 inst) pc) valid-pcs) ;no need to check the instr following this unconditional jump )) ((:getfield :putfield :getstatic :putstatic) (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (booleanp (farg3 inst)))) ((:iload :lload :fload :dload :aload :istore :lstore :fstore :dstore :astore :ret) (and (= 2 (len (instruction-args inst))) (unsigned-byte-p 16 (farg2 inst)) (inst-lengthp (farg2 inst)) ;total length of the instruction (stored because of wide) )) (:iinc (and (= 3 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)) (signed-byte-p 16 (farg2 inst)) (or (eql 3 (farg3 inst)) (eql 6 (farg3 inst))))) ((:checkcast :anewarray :instanceof) (and (= 1 (len (instruction-args inst))) (typep (farg1 inst)))) (:newarray (and (= 1 (len (instruction-args inst))) (member-eq (farg1 inst) *primitive-types*))) (:bipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 8 (farg1 inst)))) (:sipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 16 (farg1 inst)))) ((:ldc :ldc_w) (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 32 (farg1 inst)) (java-floatp (farg1 inst)) (stringp (farg1 inst)) (and (true-listp (farg1 inst)) (= 2 (len (farg1 inst))) (eq :class (first (farg1 inst))) (class-namep (second (farg1 inst))))))) (:ldc2_w (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 64 (farg1 inst)) (java-doublep (farg1 inst))))) ((:goto_w :jsr_w) (and (= 1 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)))) (:invokedynamic ;may change (and (= 1 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)))) (:multianewarray (and (= 2 (len (instruction-args inst))) (typep (farg1 inst)) (unsigned-byte-p 8 (farg2 inst)))) (:tableswitch (and (= 4 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)) (signed-byte-p 32 (farg2 inst)) (signed-byte-p 32 (farg3 inst)) (and (true-listp (farg4 inst)) ;(all-signed-byte-p 32 (farg4 inst)) ))) (:lookupswitch (and (= 2 (len (instruction-args inst))) (and (alistp (farg1 inst)) ;(all-signed-byte-p 32 (strip-cars (farg1 inst))) ;(all-signed-byte-p 32 (strip-cdrs (farg1 inst))) ) (signed-byte-p 32 (farg2 inst)))) ;; :wide is handled specially (otherwise (er hard? 'jvm-instruction-okayp "Unknown opcode: ~x0" (car inst))))))) (defthm jvm-instructionp-when-jvm-instruction-okayp (implies (jvm-instruction-okayp inst pc valid-pcs) (jvm-instructionp inst)) :hints (("Goal" :in-theory (enable jvm-instruction-okayp)))) ;extract the op-code from an instruction ;make a macro? (why?) (defund op-code (inst) (declare (xargs :guard (jvm-instructionp inst) :guard-hints (("Goal" :in-theory (enable jvm-instructionp))))) (car inst))
true
; JVM instructions ; ; Copyright (C) 2008-2011 PI:NAME:<NAME>END_PI and Stanford University ; Copyright (C) 2013-2021 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "JVM") (include-book "floats") (include-book "fields") ;for field-idp (include-book "method-descriptors") (local (in-theory (disable member-equal jvm::typep))) ;for speed ;; The name of a method is just a string (defun method-namep (obj) (declare (xargs :guard t)) (stringp obj)) ;; Disabled by default ;; Needed if we call string functions on method-names (defthmd stringp-when-method-namep (implies (stringp name) (method-namep name))) ;takes the decimal number version of the opcode and gives back the symbolic name ;fixme could use an array for this, for speed. ;fixme generalize this to map from the number to the format of the opcode? (defconst acl2::*opcode-to-name-table* '((0 . :nop) (1 . :aconst_null) (2 . :iconst_m1) (3 . :iconst_0) (4 . :iconst_1) (5 . :iconst_2) (6 . :iconst_3) (7 . :iconst_4) (8 . :iconst_5) (9 . :lconst_0) (10 . :lconst_1) (11 . :fconst_0) (12 . :fconst_1) (13 . :fconst_2) (14 . :dconst_0) (15 . :dconst_1) (16 . :bipush) (17 . :sipush) (18 . :ldc) (19 . :ldc_w) (20 . :ldc2_w) (21 . :iload) (22 . :lload) (23 . :fload) (24 . :dload) (25 . :aload) (26 . :iload_0) (27 . :iload_1) (28 . :iload_2) (29 . :iload_3) (30 . :lload_0) (31 . :lload_1) (32 . :lload_2) (33 . :lload_3) (34 . :fload_0) (35 . :fload_1) (36 . :fload_2) (37 . :fload_3) (38 . :dload_0) (39 . :dload_1) (40 . :dload_2) (41 . :dload_3) (42 . :aload_0) (43 . :aload_1) (44 . :aload_2) (45 . :aload_3) (46 . :iaload) (47 . :laload) (48 . :faload) (49 . :daload) (50 . :aaload) (51 . :baload) (52 . :caload) (53 . :saload) (54 . :istore) (55 . :lstore) (56 . :fstore) (57 . :dstore) (58 . :astore) (59 . :istore_0) (60 . :istore_1) (61 . :istore_2) (62 . :istore_3) (63 . :lstore_0) (64 . :lstore_1) (65 . :lstore_2) (66 . :lstore_3) (67 . :fstore_0) (68 . :fstore_1) (69 . :fstore_2) (70 . :fstore_3) (71 . :dstore_0) (72 . :dstore_1) (73 . :dstore_2) (74 . :dstore_3) (75 . :astore_0) (76 . :astore_1) (77 . :astore_2) (78 . :astore_3) (79 . :iastore) (80 . :lastore) (81 . :fastore) (82 . :dastore) (83 . :aastore) (84 . :bastore) (85 . :castore) (86 . :sastore) (87 . :pop) (88 . :pop2) (89 . :dup) (90 . :dup_x1) (91 . :dup_x2) (92 . :dup2) (93 . :dup2_x1) (94 . :dup2_x2) (95 . :swap) (96 . :iadd) (97 . :ladd) (98 . :fadd) (99 . :dadd) (100 . :isub) (101 . :lsub) (102 . :fsub) (103 . :dsub) (104 . :imul) (105 . :lmul) (106 . :fmul) (107 . :dmul) (108 . :idiv) (109 . :ldiv) (110 . :fdiv) (111 . :ddiv) (112 . :irem) (113 . :lrem) (114 . :frem) (115 . :drem) (116 . :ineg) (117 . :lneg) (118 . :fneg) (119 . :dneg) (120 . :ishl) (121 . :lshl) (122 . :ishr) (123 . :lshr) (124 . :iushr) (125 . :lushr) (126 . :iand) (127 . :land) (128 . :ior) (129 . :lor) (130 . :ixor) (131 . :lxor) (132 . :iinc) (133 . :i2l) (134 . :i2f) (135 . :i2d) (136 . :l2i) (137 . :l2f) (138 . :l2d) (139 . :f2i) (140 . :f2l) (141 . :f2d) (142 . :d2i) (143 . :d2l) (144 . :d2f) (145 . :i2b) (146 . :i2c) (147 . :i2s) (148 . :lcmp) (149 . :fcmpl) (150 . :fcmpg) (151 . :dcmpl) (152 . :dcmpg) (153 . :ifeq) (154 . :ifne) (155 . :iflt) (156 . :ifge) (157 . :ifgt) (158 . :ifle) (159 . :if_icmpeq) (160 . :if_icmpne) (161 . :if_icmplt) (162 . :if_icmpge) (163 . :if_icmpgt) (164 . :if_icmple) (165 . :if_acmpeq) (166 . :if_acmpne) (167 . :goto) (168 . :jsr) (169 . :ret) (170 . :tableswitch) (171 . :lookupswitch) (172 . :ireturn) (173 . :lreturn) (174 . :freturn) (175 . :dreturn) (176 . :areturn) (177 . :return) (178 . :getstatic) (179 . :putstatic) (180 . :getfield) (181 . :putfield) (182 . :invokevirtual) (183 . :invokespecial) (184 . :invokestatic) (185 . :invokeinterface) (186 . :invokedynamic) (187 . :new) (188 . :newarray) (189 . :anewarray) (190 . :arraylength) (191 . :athrow) (192 . :checkcast) (193 . :instanceof) (194 . :monitorenter) (195 . :monitorexit) (196 . :wide) ;special handling for this (197 . :multianewarray) (198 . :ifnull) (199 . :ifnonnull) (200 . :goto_w) (201 . :jsr_w))) ;todo package (defconst acl2::*opcodes* (strip-cdrs acl2::*opcode-to-name-table*)) ;fixme add into the below. or deprecate? (defun invokevirtual-instructionp (x) (declare (xargs :guard t)) (and (consp x) (eq :invokevirtual (first x)) (let ((args (acl2::fargs x))) (and (= 4 (len args)) (reference-typep (first args)) (method-namep (second args)) (method-descriptorp (third args)) (all-typep (fourth args)))))) ;fixme guard should restrict this to an instruction (defun instruction-args (x) (declare (xargs :guard (true-listp x))) (acl2::fargs x)) (defun inst-lengthp (len) (declare (xargs :guard t)) (natp len)) (defund jvm-instructionp (inst) (declare (xargs :guard t)) (and (consp inst) (member-eq (car inst) acl2::*opcodes*) (true-listp (cdr inst)))) (defthm jvm-instructionp-forward-to-consp (implies (jvm-instructionp inst) (consp inst)) :rule-classes :forward-chaining :hints (("Goal" :in-theory (enable jvm-instructionp)))) ;todo: invokedynamic (defund len-of-invoke-instruction (opcode) (declare (xargs :guard t)) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok )))) (defthm len-of-invoke-instruction-constant-opener (implies (syntaxp (quotep opcode)) (equal (len-of-invoke-instruction opcode) (case opcode (:INVOKEVIRTUAL 3) (:INVOKESTATIC 3) (:INVOKESPECIAL 3) (:invokeinterface 5) (:ldc 2) ; LDC now counts as an invoke instruction because it can run a dummy method to build a class object (:ldc_w 3) (otherwise (prog2$ (er hard? 'len-of-invoke-instruction "Unknown invoke instruction: ~x0" opcode) 3 ;needed to show that the new frame is ok ))))) :hints (("Goal" :in-theory (enable LEN-OF-INVOKE-INSTRUCTION)))) ;These are the ops that have only one byte (the opcode itself) in the ;instruction stream. The order here shouldn't matter (could sort by ;frequency). (defconst *one-byte-ops* '(:NOP :ACONST_NULL :ICONST_M1 :ICONST_0 :ICONST_1 :ICONST_2 :ICONST_3 :ICONST_4 :ICONST_5 :LCONST_0 :LCONST_1 :FCONST_0 :FCONST_1 :FCONST_2 :DCONST_0 :DCONST_1 :ILOAD_0 :ILOAD_1 :ILOAD_2 :ILOAD_3 :LLOAD_0 :LLOAD_1 :LLOAD_2 :LLOAD_3 :FLOAD_0 :FLOAD_1 :FLOAD_2 :FLOAD_3 :DLOAD_0 :DLOAD_1 :DLOAD_2 :DLOAD_3 :ALOAD_0 :ALOAD_1 :ALOAD_2 :ALOAD_3 :ISTORE_0 :ISTORE_1 :ISTORE_2 :ISTORE_3 :LSTORE_0 :LSTORE_1 :LSTORE_2 :LSTORE_3 :FSTORE_0 :FSTORE_1 :FSTORE_2 :FSTORE_3 :DSTORE_0 :DSTORE_1 :DSTORE_2 :DSTORE_3 :ASTORE_0 :ASTORE_1 :ASTORE_2 :ASTORE_3 :POP :POP2 :DUP :DUP_X1 :DUP_X2 :DUP2 :DUP2_X1 :DUP2_X2 :SWAP :IADD :LADD :FADD :DADD :ISUB :LSUB :FSUB :DSUB :IMUL :LMUL :FMUL :DMUL :IDIV :LDIV :FDIV :DDIV :IREM :LREM :FREM :DREM :INEG :LNEG :FNEG :DNEG :ISHL :LSHL :ISHR :LSHR :IUSHR :LUSHR :IAND :LAND :IOR :LOR :IXOR :LXOR :I2L :I2F :I2D :L2I :L2F :L2D :F2I :F2L :F2D :D2I :D2L :D2F :I2B :I2C :I2S :LCMP :FCMPL :FCMPG :DCMPL :DCMPG :IRETURN :LRETURN :FRETURN :DRETURN :ARETURN :RETURN :ARRAYLENGTH :ATHROW :MONITORENTER :MONITOREXIT :IALOAD :LALOAD :FALOAD :DALOAD :AALOAD :BALOAD :CALOAD :SALOAD :IASTORE :LASTORE :FASTORE :DASTORE :AASTORE :BASTORE :CASTORE :SASTORE)) ;; Recognize a program counter. (defund pcp (val) (declare (xargs :guard t)) (natp val)) ;; Recognize a list of program counters. (defund acl2::all-pcp (pcs) (declare (xargs :guard t)) (if (atom pcs) t (and (jvm::pcp (first pcs)) (acl2::all-pcp (rest pcs))))) (defthm all-pcp-of-revappend (implies (and (acl2::all-pcp x) (acl2::all-pcp y)) (acl2::all-pcp (revappend x y))) :hints (("Goal" :induct t :in-theory (enable acl2::all-pcp revappend)))) (defthm pcp-of-car (implies (acl2::all-pcp pcs) (equal (pcp (car pcs)) (consp pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defthm all-pcp-of-cdr (implies (acl2::all-pcp pcs) (acl2::all-pcp (cdr pcs))) :hints (("Goal" :in-theory (enable acl2::all-pcp)))) (defund valid-pcp (pc valid-pcs) (declare (xargs :guard (and; (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (enable pcp))))) (and (pcp pc) ;drop? (member pc valid-pcs))) ;recognize an offset to a program counter (defund pc-offsetp (val) (declare (xargs :guard t)) (integerp val)) ;fixme constrain to not make the whole pc negative... (defthm pcp-of-len-of-invoke-instruction (pcp (len-of-invoke-instruction opcode)) :hints (("Goal" :in-theory (enable len-of-invoke-instruction)))) ;fixme move or copy some of these checks (the ones not involving PC) into jvm-instructionp ;fixme improve to check the args of the instructions (e.g., that the inst-len stored is an integer for those instructions that can be preceded by WIDE) ;we need the pc here to make sure that relative jumps are okay (defund jvm-instruction-okayp (inst pc valid-pcs) (declare (xargs :guard (and (pcp pc) (true-listp valid-pcs) (acl2::all-pcp valid-pcs)) :guard-hints (("Goal" :in-theory (e/d (jvm-instructionp len-of-invoke-instruction) ( ;memberp-of-cons )))))) (and (jvm-instructionp inst) ;fixme eventually drop this (or at least the member-eq) ;; (not (cw "Checking ~x0~%" inst)) (or (member-eq (car inst) *one-byte-ops*) (case (car inst) ;;fixme add the rest of the cases! (:new (and (= 1 (len (instruction-args inst))) (class-namep (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) ;todo: either drop these or change to a more efficient check )) (:putfield (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (valid-pcp (+ 3 pc) valid-pcs))) ((:invokevirtual :invokeinterface) (and (= 4 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:invokestatic :invokespecial) (and (= 5 (len (instruction-args inst))) (reference-typep (farg1 inst)) ;todo: think about array types (method-namep (farg2 inst)) (method-descriptorp (farg3 inst)) (true-listp (farg4 inst)) (all-typep (farg4 inst)) (booleanp (farg5 inst)) (valid-pcp (+ (len-of-invoke-instruction (car inst)) pc) valid-pcs))) ((:if_acmpeq :if_acmpne :if_icmpeq :if_icmpne :if_icmplt :if_icmpge :if_icmpgt :if_icmple :ifeq :ifne :iflt :ifge :ifgt :ifle :ifnull :ifnonnull) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ 3 pc) valid-pcs) (valid-pcp (+ (farg1 inst) pc) valid-pcs))) ((:goto :jsr) (and (= 1 (len (instruction-args inst))) (pc-offsetp (farg1 inst)) (valid-pcp (+ (farg1 inst) pc) valid-pcs) ;no need to check the instr following this unconditional jump )) ((:getfield :putfield :getstatic :putstatic) (and (= 3 (len (instruction-args inst))) (class-namep (farg1 inst)) (field-idp (farg2 inst)) (booleanp (farg3 inst)))) ((:iload :lload :fload :dload :aload :istore :lstore :fstore :dstore :astore :ret) (and (= 2 (len (instruction-args inst))) (unsigned-byte-p 16 (farg2 inst)) (inst-lengthp (farg2 inst)) ;total length of the instruction (stored because of wide) )) (:iinc (and (= 3 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)) (signed-byte-p 16 (farg2 inst)) (or (eql 3 (farg3 inst)) (eql 6 (farg3 inst))))) ((:checkcast :anewarray :instanceof) (and (= 1 (len (instruction-args inst))) (typep (farg1 inst)))) (:newarray (and (= 1 (len (instruction-args inst))) (member-eq (farg1 inst) *primitive-types*))) (:bipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 8 (farg1 inst)))) (:sipush (and (= 1 (len (instruction-args inst))) (signed-byte-p 16 (farg1 inst)))) ((:ldc :ldc_w) (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 32 (farg1 inst)) (java-floatp (farg1 inst)) (stringp (farg1 inst)) (and (true-listp (farg1 inst)) (= 2 (len (farg1 inst))) (eq :class (first (farg1 inst))) (class-namep (second (farg1 inst))))))) (:ldc2_w (and (= 1 (len (instruction-args inst))) (or (unsigned-byte-p 64 (farg1 inst)) (java-doublep (farg1 inst))))) ((:goto_w :jsr_w) (and (= 1 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)))) (:invokedynamic ;may change (and (= 1 (len (instruction-args inst))) (unsigned-byte-p 16 (farg1 inst)))) (:multianewarray (and (= 2 (len (instruction-args inst))) (typep (farg1 inst)) (unsigned-byte-p 8 (farg2 inst)))) (:tableswitch (and (= 4 (len (instruction-args inst))) (signed-byte-p 32 (farg1 inst)) (signed-byte-p 32 (farg2 inst)) (signed-byte-p 32 (farg3 inst)) (and (true-listp (farg4 inst)) ;(all-signed-byte-p 32 (farg4 inst)) ))) (:lookupswitch (and (= 2 (len (instruction-args inst))) (and (alistp (farg1 inst)) ;(all-signed-byte-p 32 (strip-cars (farg1 inst))) ;(all-signed-byte-p 32 (strip-cdrs (farg1 inst))) ) (signed-byte-p 32 (farg2 inst)))) ;; :wide is handled specially (otherwise (er hard? 'jvm-instruction-okayp "Unknown opcode: ~x0" (car inst))))))) (defthm jvm-instructionp-when-jvm-instruction-okayp (implies (jvm-instruction-okayp inst pc valid-pcs) (jvm-instructionp inst)) :hints (("Goal" :in-theory (enable jvm-instruction-okayp)))) ;extract the op-code from an instruction ;make a macro? (why?) (defund op-code (inst) (declare (xargs :guard (jvm-instructionp inst) :guard-hints (("Goal" :in-theory (enable jvm-instructionp))))) (car inst))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(inc", "end": 1356, "score": 0.9995377063751221, "start": 1345, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(include-book \"lift\")\n(in", "end": 1377, "score": 0.9999350309371948, "start": 1358, "tag": "EMAIL", "value": "[email protected]" } ]
books/projects/milawa/ACL2/bootstrap/level7/lift-bldr.lisp
mayankmanj/acl2
305
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "MILAWA") (include-book "lift") (include-book "casesplit-bldr") (%interactive) (%autoadmit clause.lift-term1-bldr) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoadmit clause.lift-term-bldr) (defthmd clause.lift-term-when-clause.lifted-termp (implies (clause.lifted-termp x) (equal (clause.lift-term x) x)) :hints(("Goal" :in-theory (enable clause.lift-term)))) (%autoprove clause.lift-term-when-clause.lifted-termp (%restrict default clause.lift-term (equal x 'x))) (local (%enable default clause.lift-term-when-clause.lifted-termp)) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%defprojection :list (clause.lift-term-list-bldr x) :element (clause.lift-term-bldr x)) (%autoprove forcing-logic.appeal-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.proof-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoadmit clause.lift-clauses-bldr) (%autoprove forcing-logic.appeal-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.proof-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x)))
12125
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "MILAWA") (include-book "lift") (include-book "casesplit-bldr") (%interactive) (%autoadmit clause.lift-term1-bldr) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoadmit clause.lift-term-bldr) (defthmd clause.lift-term-when-clause.lifted-termp (implies (clause.lifted-termp x) (equal (clause.lift-term x) x)) :hints(("Goal" :in-theory (enable clause.lift-term)))) (%autoprove clause.lift-term-when-clause.lifted-termp (%restrict default clause.lift-term (equal x 'x))) (local (%enable default clause.lift-term-when-clause.lifted-termp)) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%defprojection :list (clause.lift-term-list-bldr x) :element (clause.lift-term-bldr x)) (%autoprove forcing-logic.appeal-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.proof-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoadmit clause.lift-clauses-bldr) (%autoprove forcing-logic.appeal-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.proof-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x)))
true
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "MILAWA") (include-book "lift") (include-book "casesplit-bldr") (%interactive) (%autoadmit clause.lift-term1-bldr) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term1-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term1-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term1-bldr (%clause.lift-term1-induction x) (%disable default expensive-arithmetic-rules type-set-like-rules logic.termp-when-logic.formulap) (%auto) (%restrict default clause.lift-term1-bldr (equal x 'x)) (%restrict default clause.lift-term1 (equal x 'x))) (%autoadmit clause.lift-term-bldr) (defthmd clause.lift-term-when-clause.lifted-termp (implies (clause.lifted-termp x) (equal (clause.lift-term x) x)) :hints(("Goal" :in-theory (enable clause.lift-term)))) (%autoprove clause.lift-term-when-clause.lifted-termp (%restrict default clause.lift-term (equal x 'x))) (local (%enable default clause.lift-term-when-clause.lifted-termp)) (%autoprove lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%autoprove forcing-logic.appealp-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.conclusion-of-clause.lift-term-bldr (%use (%instance (%thm lemma-for-forcing-logic.appealp-of-clause.lift-term-bldr)))) (%autoprove forcing-logic.proofp-of-clause.lift-term-bldr (%clause.lift-term-induction x) (%auto) (%restrict default clause.lift-term-bldr (equal x 'x)) (%restrict default clause.lift-term (equal x 'x))) (%defprojection :list (clause.lift-term-list-bldr x) :element (clause.lift-term-bldr x)) (%autoprove forcing-logic.appeal-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoprove forcing-logic.proof-listp-of-clause.lift-term-list-bldr (%cdr-induction x)) (%autoadmit clause.lift-clauses-bldr) (%autoprove forcing-logic.appeal-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.strip-conclusions-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x))) (%autoprove forcing-logic.proof-listp-of-clause.lift-clauses-bldr (%cdr-cdr-induction x proofs) (%restrict default clause.lift-clauses-bldr (equal x 'x)))
[ { "context": ";; state-machine.lisp\n;;;;\n;;;; Copyright (c) 2015 Robert Smith\n;;;;\n;;;; This file is an attempt to build a rela", "end": 65, "score": 0.9996527433395386, "start": 53, "tag": "NAME", "value": "Robert Smith" } ]
state-machine.lisp
stylewarning/lisp-random
56
;;;; state-machine.lisp ;;;; ;;;; Copyright (c) 2015 Robert Smith ;;;; ;;;; This file is an attempt to build a relatively efficient state ;;;; machine abstraction. ;;;; Bugs: SBCL complains about modifying constant data. I don't know if it is right or if I am right. ;;; (ql:quickload :alexandria) (defclass state-machine () ((states :initarg :states :reader state-machine-states :documentation "A list of the names of each state.") (transition-graph :initarg :transition-graph :reader state-machine-transition-graph :documentation "A hash table containing the state names as keys and a list of possible transitions as values.") (invocation-function :initarg :invocation-function :reader state-machine-invocation-function :documentation "The multivariate function to invoke to enter the state machine."))) (defgeneric invoke-state-machine (sm &rest args) (:method ((sm state-machine) &rest args) (apply (state-machine-invocation-function sm) args))) (eval-when (:compile-toplevel :load-toplevel :execute) (defun contains-duplicates-p (list &key (test 'eql)) (/= (list-length list) (list-length (remove-duplicates list :test test)))) ) (defmacro transition (state &rest args) (declare (ignore state args)) (error "Transition is an internal macro to DEFINE-STATE-MACHINE.")) (defmacro state-machine (args state-definitions &body body) "Create a state machine which takes the arguments ARGS the body BODY. Return a state machine object which can be invoked with the arguments ARGS. STATE-DEFINITIONS is a list of state definitions. It looks much like the definition of a LABELS function definition: (state-name arguments [documentation] [declarations] forms ...) Within the state definitions, however, there is a macro defined called TRANSITION which transitions to one of the other states immediately without return. (The use of TRANSITION ensures that a tail call will happen.) BODY can enter the state machine \(It is allowed, but discouraged, to bypass the use of TRANSITION by simply calling the state name as a function instead.)" (let ((states (mapcar #'first state-definitions)) (transition-graph (make-hash-table))) (labels ((construct-state (state-def) (destructuring-bind (name args . body) state-def (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) ;; This is a LABELS function definition. `(,name ,args ,@(and doc (list doc)) ,@decls (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the transition ~ occurring in the state ~S ~ is not a valid." state ',name)) (pushnew state (gethash ',name ,transition-graph)) `(return-from ,',name (,state ,@args)))) ,@forms)))))) (when (contains-duplicates-p states) (warn "There are duplicate state names in the state machine.")) (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) `(make-instance 'state-machine :states ',(remove-duplicates states) :transition-graph ',transition-graph :invocation-function (lambda ,args ,@(and doc (list doc)) ,@decls (labels ,(mapcar #'construct-state state-definitions) (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the initial transition ~ is not a valid." state)) (pushnew state (gethash nil ,transition-graph)) `(,state ,@args))) ,@forms)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Examples ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *beer-machine* (state-machine (count) ((decide (current-count) (if (= 1 current-count) (transition last-case) (transition general-case current-count))) (general-case (current-count) (format t "~D bottles of beer on the wall, ~D bottles of beer.~%~ Take one down, pass it around, ~D bottle~:P of beer on ~ the wall...~%" current-count current-count (1- current-count)) (transition decide (1- current-count))) (last-case () (format t "If that one bottle should happen to fall, what a waste ~ of alcohol!"))) (transition decide count))) (defparameter *tail-call-test* (state-machine (x) ((even (x) (if (zerop x) t (transition odd (1- x)))) (odd (x) (if (zerop x) nil (transition even (1- x))))) (even x)))
73327
;;;; state-machine.lisp ;;;; ;;;; Copyright (c) 2015 <NAME> ;;;; ;;;; This file is an attempt to build a relatively efficient state ;;;; machine abstraction. ;;;; Bugs: SBCL complains about modifying constant data. I don't know if it is right or if I am right. ;;; (ql:quickload :alexandria) (defclass state-machine () ((states :initarg :states :reader state-machine-states :documentation "A list of the names of each state.") (transition-graph :initarg :transition-graph :reader state-machine-transition-graph :documentation "A hash table containing the state names as keys and a list of possible transitions as values.") (invocation-function :initarg :invocation-function :reader state-machine-invocation-function :documentation "The multivariate function to invoke to enter the state machine."))) (defgeneric invoke-state-machine (sm &rest args) (:method ((sm state-machine) &rest args) (apply (state-machine-invocation-function sm) args))) (eval-when (:compile-toplevel :load-toplevel :execute) (defun contains-duplicates-p (list &key (test 'eql)) (/= (list-length list) (list-length (remove-duplicates list :test test)))) ) (defmacro transition (state &rest args) (declare (ignore state args)) (error "Transition is an internal macro to DEFINE-STATE-MACHINE.")) (defmacro state-machine (args state-definitions &body body) "Create a state machine which takes the arguments ARGS the body BODY. Return a state machine object which can be invoked with the arguments ARGS. STATE-DEFINITIONS is a list of state definitions. It looks much like the definition of a LABELS function definition: (state-name arguments [documentation] [declarations] forms ...) Within the state definitions, however, there is a macro defined called TRANSITION which transitions to one of the other states immediately without return. (The use of TRANSITION ensures that a tail call will happen.) BODY can enter the state machine \(It is allowed, but discouraged, to bypass the use of TRANSITION by simply calling the state name as a function instead.)" (let ((states (mapcar #'first state-definitions)) (transition-graph (make-hash-table))) (labels ((construct-state (state-def) (destructuring-bind (name args . body) state-def (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) ;; This is a LABELS function definition. `(,name ,args ,@(and doc (list doc)) ,@decls (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the transition ~ occurring in the state ~S ~ is not a valid." state ',name)) (pushnew state (gethash ',name ,transition-graph)) `(return-from ,',name (,state ,@args)))) ,@forms)))))) (when (contains-duplicates-p states) (warn "There are duplicate state names in the state machine.")) (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) `(make-instance 'state-machine :states ',(remove-duplicates states) :transition-graph ',transition-graph :invocation-function (lambda ,args ,@(and doc (list doc)) ,@decls (labels ,(mapcar #'construct-state state-definitions) (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the initial transition ~ is not a valid." state)) (pushnew state (gethash nil ,transition-graph)) `(,state ,@args))) ,@forms)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Examples ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *beer-machine* (state-machine (count) ((decide (current-count) (if (= 1 current-count) (transition last-case) (transition general-case current-count))) (general-case (current-count) (format t "~D bottles of beer on the wall, ~D bottles of beer.~%~ Take one down, pass it around, ~D bottle~:P of beer on ~ the wall...~%" current-count current-count (1- current-count)) (transition decide (1- current-count))) (last-case () (format t "If that one bottle should happen to fall, what a waste ~ of alcohol!"))) (transition decide count))) (defparameter *tail-call-test* (state-machine (x) ((even (x) (if (zerop x) t (transition odd (1- x)))) (odd (x) (if (zerop x) nil (transition even (1- x))))) (even x)))
true
;;;; state-machine.lisp ;;;; ;;;; Copyright (c) 2015 PI:NAME:<NAME>END_PI ;;;; ;;;; This file is an attempt to build a relatively efficient state ;;;; machine abstraction. ;;;; Bugs: SBCL complains about modifying constant data. I don't know if it is right or if I am right. ;;; (ql:quickload :alexandria) (defclass state-machine () ((states :initarg :states :reader state-machine-states :documentation "A list of the names of each state.") (transition-graph :initarg :transition-graph :reader state-machine-transition-graph :documentation "A hash table containing the state names as keys and a list of possible transitions as values.") (invocation-function :initarg :invocation-function :reader state-machine-invocation-function :documentation "The multivariate function to invoke to enter the state machine."))) (defgeneric invoke-state-machine (sm &rest args) (:method ((sm state-machine) &rest args) (apply (state-machine-invocation-function sm) args))) (eval-when (:compile-toplevel :load-toplevel :execute) (defun contains-duplicates-p (list &key (test 'eql)) (/= (list-length list) (list-length (remove-duplicates list :test test)))) ) (defmacro transition (state &rest args) (declare (ignore state args)) (error "Transition is an internal macro to DEFINE-STATE-MACHINE.")) (defmacro state-machine (args state-definitions &body body) "Create a state machine which takes the arguments ARGS the body BODY. Return a state machine object which can be invoked with the arguments ARGS. STATE-DEFINITIONS is a list of state definitions. It looks much like the definition of a LABELS function definition: (state-name arguments [documentation] [declarations] forms ...) Within the state definitions, however, there is a macro defined called TRANSITION which transitions to one of the other states immediately without return. (The use of TRANSITION ensures that a tail call will happen.) BODY can enter the state machine \(It is allowed, but discouraged, to bypass the use of TRANSITION by simply calling the state name as a function instead.)" (let ((states (mapcar #'first state-definitions)) (transition-graph (make-hash-table))) (labels ((construct-state (state-def) (destructuring-bind (name args . body) state-def (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) ;; This is a LABELS function definition. `(,name ,args ,@(and doc (list doc)) ,@decls (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the transition ~ occurring in the state ~S ~ is not a valid." state ',name)) (pushnew state (gethash ',name ,transition-graph)) `(return-from ,',name (,state ,@args)))) ,@forms)))))) (when (contains-duplicates-p states) (warn "There are duplicate state names in the state machine.")) (multiple-value-bind (forms decls doc) (alexandria:parse-body body :documentation t) `(make-instance 'state-machine :states ',(remove-duplicates states) :transition-graph ',transition-graph :invocation-function (lambda ,args ,@(and doc (list doc)) ,@decls (labels ,(mapcar #'construct-state state-definitions) (macrolet ((transition (state &rest args) (unless (member state ',states) (error "The state ~S in the initial transition ~ is not a valid." state)) (pushnew state (gethash nil ,transition-graph)) `(,state ,@args))) ,@forms)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Examples ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *beer-machine* (state-machine (count) ((decide (current-count) (if (= 1 current-count) (transition last-case) (transition general-case current-count))) (general-case (current-count) (format t "~D bottles of beer on the wall, ~D bottles of beer.~%~ Take one down, pass it around, ~D bottle~:P of beer on ~ the wall...~%" current-count current-count (1- current-count)) (transition decide (1- current-count))) (last-case () (format t "If that one bottle should happen to fall, what a waste ~ of alcohol!"))) (transition decide count))) (defparameter *tail-call-test* (state-machine (x) ((even (x) (if (zerop x) t (transition odd (1- x)))) (odd (x) (if (zerop x) nil (transition even (1- x))))) (even x)))
[ { "context": "is a part of cl-cuda project.\n Copyright (c) 2012 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-cuda-int", "end": 81, "score": 0.999815046787262, "start": 66, "tag": "NAME", "value": "Masayuki Takagi" }, { "context": "da project.\n Copyright (c) 2012 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-cuda-interop.driver-api)\n\n\n;", "end": 101, "score": 0.9999257922172546, "start": 83, "tag": "EMAIL", "value": "[email protected]" } ]
interop/src/driver-api/function.lisp
digikar99/cl-cuda
222
#| This file is a part of cl-cuda project. Copyright (c) 2012 Masayuki Takagi ([email protected]) |# (in-package :cl-cuda-interop.driver-api) ;;; ;;; Functions ;;; ;; cuGLCtxCreate (defcufun (cu-gl-ctx-create "cuGLCtxCreate_v2") cu-result (pctx (:pointer cu-context)) (flags :unsigned-int) (dev cu-device)) ;; cuGraphicsGLRegisterBuffer (defcufun (cu-graphics-gl-register-buffer "cuGraphicsGLRegisterBuffer") cu-result (p-cuda-resource (:pointer cu-graphics-resource)) (buffer %gl:uint) (flags :unsigned-int)) ;; cuGraphicsMapResources (defcufun (cu-graphics-map-resources "cuGraphicsMapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsResourceGetMappedPointer (defcufun (cu-graphics-resource-get-mapped-pointer "cuGraphicsResourceGetMappedPointer_v2") cu-result (pdevptr (:pointer cu-device-ptr)) (psize (:pointer size-t)) (resource cu-graphics-resource)) ;; cuGraphicsResourceSetMapFlags (defcufun (cu-graphics-resource-set-map-flags "cuGraphicsResourceSetMapFlags") cu-result (resource cu-graphics-resource) (flags :unsigned-int)) ;; cuGraphicsUnmapResources (defcufun (cu-graphics-unmap-resources "cuGraphicsUnmapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsUnregisterResource (defcufun (cu-graphics-unregister-resource "cuGraphicsUnregisterResource") cu-result (resource cu-graphics-resource))
51121
#| This file is a part of cl-cuda project. Copyright (c) 2012 <NAME> (<EMAIL>) |# (in-package :cl-cuda-interop.driver-api) ;;; ;;; Functions ;;; ;; cuGLCtxCreate (defcufun (cu-gl-ctx-create "cuGLCtxCreate_v2") cu-result (pctx (:pointer cu-context)) (flags :unsigned-int) (dev cu-device)) ;; cuGraphicsGLRegisterBuffer (defcufun (cu-graphics-gl-register-buffer "cuGraphicsGLRegisterBuffer") cu-result (p-cuda-resource (:pointer cu-graphics-resource)) (buffer %gl:uint) (flags :unsigned-int)) ;; cuGraphicsMapResources (defcufun (cu-graphics-map-resources "cuGraphicsMapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsResourceGetMappedPointer (defcufun (cu-graphics-resource-get-mapped-pointer "cuGraphicsResourceGetMappedPointer_v2") cu-result (pdevptr (:pointer cu-device-ptr)) (psize (:pointer size-t)) (resource cu-graphics-resource)) ;; cuGraphicsResourceSetMapFlags (defcufun (cu-graphics-resource-set-map-flags "cuGraphicsResourceSetMapFlags") cu-result (resource cu-graphics-resource) (flags :unsigned-int)) ;; cuGraphicsUnmapResources (defcufun (cu-graphics-unmap-resources "cuGraphicsUnmapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsUnregisterResource (defcufun (cu-graphics-unregister-resource "cuGraphicsUnregisterResource") cu-result (resource cu-graphics-resource))
true
#| This file is a part of cl-cuda project. Copyright (c) 2012 PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) |# (in-package :cl-cuda-interop.driver-api) ;;; ;;; Functions ;;; ;; cuGLCtxCreate (defcufun (cu-gl-ctx-create "cuGLCtxCreate_v2") cu-result (pctx (:pointer cu-context)) (flags :unsigned-int) (dev cu-device)) ;; cuGraphicsGLRegisterBuffer (defcufun (cu-graphics-gl-register-buffer "cuGraphicsGLRegisterBuffer") cu-result (p-cuda-resource (:pointer cu-graphics-resource)) (buffer %gl:uint) (flags :unsigned-int)) ;; cuGraphicsMapResources (defcufun (cu-graphics-map-resources "cuGraphicsMapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsResourceGetMappedPointer (defcufun (cu-graphics-resource-get-mapped-pointer "cuGraphicsResourceGetMappedPointer_v2") cu-result (pdevptr (:pointer cu-device-ptr)) (psize (:pointer size-t)) (resource cu-graphics-resource)) ;; cuGraphicsResourceSetMapFlags (defcufun (cu-graphics-resource-set-map-flags "cuGraphicsResourceSetMapFlags") cu-result (resource cu-graphics-resource) (flags :unsigned-int)) ;; cuGraphicsUnmapResources (defcufun (cu-graphics-unmap-resources "cuGraphicsUnmapResources") cu-result (count :unsigned-int) (resources (:pointer cu-graphics-resource)) (hstream cu-stream)) ;; cuGraphicsUnregisterResource (defcufun (cu-graphics-unregister-resource "cuGraphicsUnregisterResource") cu-result (resource cu-graphics-resource))
[ { "context": "subbagp x y) \n (list::memberp a x) \n; [Changed by Matt K. to handle changes to member, assoc, etc. after AC", "end": 81173, "score": 0.9989746809005737, "start": 81167, "tag": "NAME", "value": "Matt K" } ]
books/coi/paths/meta.lisp
ragerdl/acl2-defthm-rc2
1
#|-*-Lisp-*-=================================================================|# #| |# #| coi: Computational Object Inference |# #| |# #|===========================================================================|# (in-package "PATH") (include-book "../lists/basic") (include-book "../lists/map-cons") (include-book "../syntax/syntax") (include-book "../util/mv-nth") (local (include-book "../util/iff")) ;; jcd - changing this to path, speeds things up a lot (~100 seconds) and ;; separates paths from graphs. (include-book "path") ;; jcd - moved to :lists/map-cons ;; (defun map-cons (a list) ;; (declare (type t a list)) ;; (if (consp list) ;; (cons (cons a (car list)) ;; (map-cons a (cdr list))) ;; nil)) ;; jcd - moved to :lists/basic ;; (defun appendx (x y) ;; (declare (type t x y)) ;; (if (consp x) ;; (cons (car x) (appendx (cdr x) y)) ;; y)) ;; jcd - we use mbe now, no need for this rule ;; (defthm appendx-is-append ;; (equal (appendx x y) ;; (append x y))) ; 1.36 12.00 ; CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-MEMBERSHIP-DECONSTRUCTION ;jcd Trying this. -ews (local (in-theory (disable not-dominates-from-diverge-one not-dominates-from-diverge-two))) ;; Normalization: assume that (append (cons a b) list) = (cons a (append b list)) ;; (for quoted (cons a b) terms, too) (in-theory (disable LENS-<-WHEN-DOMINATES-BUT-NOT-CONG NOT-DOMINATES-FROM-<-OF-LEN-AND-LEN DOMINATES-WHEN-LENS-EQUAL ;; jcd - Cheapened this, going to try leaving it enabled ;; DOMINATES-WHEN-NOT-DIVERGE-AND-NOT-DOMINATES DOMINATES-ASYMMETRIC DOMINATES-TRANSITIVE-TWO dominates-means-not-diverge dominates-means-not-diverge-alt )) (in-theory (enable BAG::APPEND-COMMUTATIVE-INSIDE-PERM )) (local (in-theory (disable syn::open-len))) (defun syn::ts-consp (term fact) (declare (type (satisfies acl2::type-alist-entryp) fact) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alist-entryp))))) (let ((ts (cadr fact)) (tsterm (car fact))) (and (or (not (= (logand ts acl2::*ts-proper-cons*) acl2::*ts-empty*)) (not (= (logand ts acl2::*ts-improper-cons*) acl2::*ts-empty*))) (equal term tsterm)))) (defun sudo-len (term) (declare (type t term)) (if (syn::consp term) (1+ (sudo-len (syn::cdr term))) (if (syn::appendp term) (1+ (sudo-len (syn::arg 2 term))) (if (syn::quotep term) 1 0)))) (defthm integerp-sudo-len (integerp (sudo-len term)) :rule-classes (:rewrite :type-prescription)) (defthm sudo-len-linear (<= 0 (sudo-len ter)) :rule-classes (:linear)) (defun equal-len (path1 path2) (declare (type t path1 path2)) (cond ((and (syn::quotep path1) (syn::quotep path2)) (equal (len (syn::dequote path1)) (len (syn::dequote path2)))) ((and (syn::consp path1) (syn::consp path2)) (equal-len (syn::cdr path1) (syn::cdr path2))) ((and (syn::appendp path1) (syn::appendp path2)) (and (equal-len (syn::arg 1 path1) (syn::arg 1 path2)) (equal-len (syn::arg 2 path1) (syn::arg 2 path2)))) (t (equal path1 path2)))) (defthm equal-len-identity (equal-len x x)) (defun syntax-quote-diverge (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (or (and (syn::quotep v) (not (equal (car path1) (syn::dequote v))) (syn::true)) (syntax-quote-diverge (cdr path1) (syn::cdr path2))))) ((syn::quotep path2) (and (diverge path1 (syn::dequote path2)) (syn::true))) (t nil)) nil)) (defthm syntax-quote-diverge-implies-quote-true (implies (syntax-quote-diverge path1 path2) (equal (syntax-quote-diverge path1 path2) (syn::true)))) (defthm syntax-quote-diverge-implies-diverge (implies (syntax-quote-diverge x1 t2) (diverge x1 (syn::eval t2 a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (defun syntax-diverge (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (syntax-quote-diverge (syn::dequote path1) path2)) ((syn::quotep path2) (syntax-quote-diverge (syn::dequote path2) path1)) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (and (syn::quotep car1) (syn::quotep car2) (not (equal (syn::dequote car1) (syn::dequote car2)))) (syn::true) (syntax-diverge (syn::cdr path1) (syn::cdr path2))))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (and (equal arg11 arg12) (syntax-diverge (syn::arg 2 path1) (syn::arg 2 path2))))) (t nil))) (defthm syntax-diverge-implies-diverge (implies (syntax-diverge t1 t2) (diverge (syn::eval t1 a) (syn::eval t2 a))) :hints (("goal" :in-theory (enable syn::open-nth diverge-append-len-equal)))) (defun remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (and (consp path1) (consp path2)) (if (equal (car path1) (car path2)) (remove-common-prefix (cdr path1) (cdr path2)) (mv path1 path2)) (mv nil nil))) (defthm remove-common-prefix-identity (and (equal (v0 (remove-common-prefix x x)) nil) (equal (v1 (remove-common-prefix x x)) nil))) (defun syntax-quote-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (if (and (syn::quotep v) (equal (car path1) (syn::dequote v))) (syntax-quote-remove-common-prefix (cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((syn::quotep path2) (met ((path1 path2) (remove-common-prefix path1 (syn::dequote path2))) (mv path1 (syn::enquote path2)))) (t (mv path1 path2))) (mv path1 path2))) (defthm pseudo-termp-syntax-quote-remove-common-prefix (implies (and (pseudo-termp y)) (pseudo-termp (v1 (syntax-quote-remove-common-prefix x y)))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthm diverge-remove-common-prefix-noop (equal (diverge (v0 (remove-common-prefix t1 t2)) (v1 (remove-common-prefix t1 t2))) (diverge t1 t2))) (defthm syntax-quote-diverge-syntax-quote-remove-common-prefix-noop (equal (syntax-quote-diverge (v0 (syntax-quote-remove-common-prefix t1 t2)) (v1 (syntax-quote-remove-common-prefix t1 t2))) (syntax-quote-diverge t1 t2))) (defun syntax-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (met ((path1 path2) (syntax-quote-remove-common-prefix (syn::dequote path1) path2)) (mv (syn::enquote path1) path2))) ((syn::quotep path2) (met ((path2 path1) (syntax-quote-remove-common-prefix (syn::dequote path2) path1)) (mv path1 (syn::enquote path2)))) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (equal car1 car2) (syntax-remove-common-prefix (syn::cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (if (equal arg11 arg12) (syntax-remove-common-prefix (syn::arg 2 path1) (syn::arg 2 path2)) (mv path1 path2)))) ((equal path1 path2) (mv (syn::nil) (syn::nil))) (t (mv path1 path2)))) (defthm pseudo-termp-syntax-remove-common-prefix (implies (and (pseudo-termp x) (pseudo-termp y)) (and (pseudo-termp (v0 (syntax-remove-common-prefix x y))) (pseudo-termp (v1 (syntax-remove-common-prefix x y))))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthmd syntax-diverge-commute (equal (syntax-diverge x y) (syntax-diverge y x)) :rule-classes ((:rewrite :loop-stopper ((y x))))) (defthm syntax-diverge-syntax-remove-common-prefix-noop (equal (syntax-diverge (v0 (syntax-remove-common-prefix t1 t0)) (v1 (syntax-remove-common-prefix t1 t0))) (syntax-diverge t1 t0)) :hints (("goal" :in-theory (e/d (syntax-diverge-commute) (;for efficiency: SYN::OPEN-LEN SYNTAX-QUOTE-DIVERGE))))) (defun syntax-diverge-wrapper (term) (declare (type t term)) (if (syn::funcall 'diverge 2 term) (let ((arg1 (syn::arg 1 term)) (arg2 (syn::arg 2 term))) (met ((arg1 arg2) (syntax-remove-common-prefix arg1 arg2)) (let ((hit (syntax-diverge arg1 arg2))) (if hit hit term)))) term)) (defthm equal-len-implies-equal-len (implies (equal-len t1 t2) (iff (equal (len (syn::eval t1 a)) (len (syn::eval t2 a))) t)) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (syn::eval t1 a) (syn::eval t2 a)) (syn::eval (syntax-diverge t1 t2) a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (syn::extend-eval diverge-eval ( (diverge x y) )) (syn::defevthm diverge-eval syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (diverge-eval t1 a) (diverge-eval t2 a)) (diverge-eval (syntax-diverge t1 t2) a)))) (defthmd *meta*-syntax-diverge (iff (diverge-eval term a) (diverge-eval (syntax-diverge-wrapper term) a)) :hints (("goal" :in-theory (enable syn::open-nth))) :rule-classes ((:meta :trigger-fns (diverge)))) ;; Syntactic tail domination .. (defun true-p (x) (declare (type t x) (ignore x)) t) (defun remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (remove-prefix (cdr prefix) (cdr x)) (mv nil nil)) (mv t x))) (defun v0-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v0-remove-prefix (cdr prefix) (cdr x)) nil) t)) (defun v1-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v1-remove-prefix (cdr prefix) (cdr x)) nil) x)) (defthm v0-remove-prefix-reduction (equal (v0 (remove-prefix prefix x)) (v0-remove-prefix prefix x))) (defcong list::equiv equal (v0-remove-prefix prefix x) 2) (defthm v1-remove-prefix-reduction (equal (v1 (remove-prefix prefix x)) (v1-remove-prefix prefix x))) (defcong list::equiv list::equiv (v1-remove-prefix prefix x) 2) (defthm list-fix-v1-remove-prefix (equal (list::fix (v1-remove-prefix prefix x)) (v1-remove-prefix prefix (list::fix x)))) (defthm v0-remove-prefix-append (equal (v0-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v0-remove-prefix y (v1-remove-prefix x z))))) (defthm v1-remove-prefix-append (equal (v1-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v1-remove-prefix y (v1-remove-prefix x z))))) (defthm not-v0-implies-nil-v1-remove-prefix (implies (not (v0-remove-prefix x y)) (equal (v1-remove-prefix x y) nil))) #| (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) (mv nil nil)))) ((syn::quotep x) (remove-prefix prefix (syn::dequote x))) (t (mv nil nil))) (mv (syn::null x) nil))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v0-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v0-remove-prefix prefix (syn::dequote x))) (t nil)) (syn::null x))) (defirrelevant v0-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v1-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v1-remove-prefix prefix (syn::dequote x))) (t nil)) nil)) (defirrelevant v1-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defthm v0-to-v0-syntax-quote-remove-prefix (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-to-v1-syntax-quote-remove-prefix (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defcong list::equiv equal (v0-syntax-remove-prefix prefix x) 2) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix prefix x) 2) (defthm list-fix-v1-syntax-quote-remove-prefix (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x)))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix x y)) (equal (v1-syntax-quote-remove-prefix x y) nil))) #+joe (defignore syntax-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (if (and (syn::consp x) (equal (syn::car prefix) (syn::car x))) (syntax-remove-prefix (syn::cdr prefix) (syn::cdr x)) (mv nil nil))) ((syn::appendp prefix) (if (and (syn::appendp x) (equal (syn::arg 1 prefix) (syn::arg 1 x))) (syntax-remove-prefix (syn::arg 2 prefix) (syn::arg 2 x)) (mv nil nil))) ((syn::quotep prefix) (syntax-quote-remmove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) |# (defun tail-p (x y) (declare (type t x y)) (or (list::equiv x y) (and (consp y) (tail-p x (cdr y))))) (defthm v1-remove-prefix-is-tail-x (implies (v0-remove-prefix prefix x) (tail-p (v1-remove-prefix prefix x) x))) (defthm tail-p-implies (implies (tail-p x y) (<= (len x) (len y))) :rule-classes (:linear :rewrite)) #+joe (defignore syntax-alist-quote-remove-prefix bag::a (prefix x) (if (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (if (equal (car x) val) (syntax-alist-quote-remove-prefix prefix x) (mv nil nil))) (:append (met ((hit rest) (syntax- (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) x) nil)))) #| ;; DAG - I have removed this line of thinking. It just doesn't make any sense ;; .. if x is a quoted constant, then the prefix would have to be quoted as ;; well. (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) (mv nil nil)))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) (mv nil nil) (syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (remove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (prefix x) ) (defthmd list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1 (syntax-quote-remove-prefix prefix x))) (v1 (syntax-quote-remove-prefix prefix (list::fix x)))) (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0 (syntax-quote-remove-prefix prefix (list::fix x))) )))) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v0-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v0-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v0-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v0-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v1-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v1-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v1-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v1-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defthm v0-syntax-quote-remove-prefix-reduction (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-syntax-quote-remove-prefix-reduction (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defthmd vx-list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x))) (equal (v0-syntax-quote-remove-prefix prefix x) (v0-syntax-quote-remove-prefix prefix (list::fix x))))) :hints (("goal" :use (:instance list-fix-commutes-over-syntax-quote-remove-prefix)))) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defcong list::equiv equal (v0-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix prefix x)) (equal (v1-syntax-quote-remove-prefix prefix x) nil))) (defthm v0-syntax-quote-remove-prefix-implies-v2-cong (implies (v0-syntax-quote-remove-prefix prefix x) (and (list::equiv (v1-syntax-quote-remove-prefix prefix x) (v1-remove-prefix (syn::eval prefix bag::a) x)) (v0-remove-prefix (syn::eval prefix bag::a) x))) :hints (("goal" :induct (syntax-quote-remove-prefix prefix x)))) #+joe (defignore syntax-remove-term (term x) ..) #+joe (defignore syntax-remove-prefix (prefix x) ) |# (defignore syntax-quote-dominates-p bag::a (x y) (declare (type t x y) (xargs :measure (acl2-count y))) (if (consp x) (cond ((syn::consp y) (let ((v (syn::car y))) (and (syn::quotep v) (equal (car x) (syn::dequote v)) (syntax-quote-dominates-p (cdr x) (syn::cdr y))))) #+joe ((syn::appendp y) (met ((hit rest) (syntax-quote-remove-prefix x (syn::arg 1 y) x)) (and hit (syntax-quote-dominates-p rest (syn::arg 2 y))))) ((syn::quotep y) (dominates x (syn::dequote y))) (t nil)) t)) (defirrelevant syntax-quote-dominates-p 1 bag::a (x y) :hints (("goal" :in-theory (enable ;v0-syntax-quote-remove-prefix-irrelevant ;v1-syntax-quote-remove-prefix-irrelevant )))) (defthmd dominates-append-2 (equal (dominates x (append y z)) (or (dominates x y) (and (v0-remove-prefix y x) (dominates (v1-remove-prefix y x) z)))) :hints (("goal" :in-theory (enable dominates)))) (defthm syntax-quote-dominates-implies-dominates (implies (syntax-quote-dominates-p x y) (dominates x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable dominates dominates-append-2)))) (defignore show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (syn::ts-consp term entry) (show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defignore hyp-for-show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (and (syn::ts-consp term entry) `(consp ,term)) (hyp-for-show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant hyp-for-show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defthm pseudo-termp-hyp-for-show-syntax-consp-from-alist (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp-from-alist term type-alist)))) (defthm show-syntax-consp-from-alist-to-hyp-for (iff (show-syntax-consp-from-alist term type-alist) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defthm show-syntax-consp-from-alist-works (implies (and (hyp-for-show-syntax-consp-from-alist x type-alist) (syn::eval (hyp-for-show-syntax-consp-from-alist x type-alist) bag::a)) (consp (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG -- This could be improved by checking each append term for ;; consp. (defignored show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (or (syn::consp-rec term) (show-syntax-consp-from-alist term type-alist))) (defirrelevant show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defignored hyp-for-show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (if (syn::consp-rec term) (syn::true) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defirrelevant hyp-for-show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defthm show-syntax-consp-to-hyp-for (iff (show-syntax-consp term type-alist) (hyp-for-show-syntax-consp term type-alist)) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp )))) (defthm pseudo-termp-hyp-for-show-syntax-consp (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp term type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defthm show-syntax-consp-works (implies (and (hyp-for-show-syntax-consp term type-alist) (syn::eval (hyp-for-show-syntax-consp term type-alist) bag::a)) (consp (syn::eval term bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defignore show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (show-syntax-dominates-p (or flg (show-syntax-consp (syn::arg 1 x) type-alist)) (syn::arg 2 x) (syn::arg 2 y) type-alist))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or flg (show-syntax-consp x type-alist)))) (t (and (equal x y) (or flg (show-syntax-consp x type-alist)))))) (defcong iff iff (show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (hyp-for-show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (let ((hyp (if flg (syn::true) (hyp-for-show-syntax-consp (syn::arg 1 x) type-alist)))) (if hyp (syn::and hyp (hyp-for-show-syntax-dominates-p t (syn::arg 2 x) (syn::arg 2 y) type-alist)) (hyp-for-show-syntax-dominates-p nil (syn::arg 2 x) (syn::arg 2 y) type-alist))))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y) (syn::true)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))) (t (and (equal x y) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))))) (defcong iff iff (hyp-for-show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant hyp-for-show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defthm show-syntax-dominates-p-to-hyp-for (iff (show-syntax-dominates-p flg x y type-alist) (hyp-for-show-syntax-dominates-p flg x y type-alist)) :hints (("goal" :induct (hyp-for-show-syntax-dominates-p-fn bag::a flg x y type-alist)))) (defthm pseudo-termp-hyp-for-show-syntax-dominates-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-dominates-p flg x y type-alist))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defun contains (symbol term) (declare (type t symbol term)) (if (consp term) (if (consp (car term)) (or (contains symbol (car term)) (contains symbol (cdr term))) (or (equal symbol (car term)) (contains symbol (cdr term)))) (equal symbol term))) (defthmd syntax-domination-implies-domination (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syntaxp (contains 'syn::eval logical-x)) (equal (syn::eval x bag::a) logical-x)) (dominates logical-x (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-domination-implies-domination-helper (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-domination)))) (defthmd syntax-domination-implies-consp (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syn::eval (hyp-for-show-syntax-dominates-p flg x y type-alist) bag::a) (syntaxp (contains 'syn::eval logical-x)) (not flg) (equal logical-x (syn::eval x bag::a))) (consp logical-x)) :hints (("goal" :in-theory (enable SYN::CONJOIN syn::open-nth)))) (defun tail-dominates-p (x y) (declare (type t x y)) (cond ((consp x) (or (dominates x y) (tail-dominates-p (cdr x) y))) (t nil))) (defun tail-dominates (x y) (declare (type t x y)) (cond ((consp x) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))) (t (mv nil nil)))) (defthm booleanp-v0-tail-dominates (booleanp (v0 (tail-dominates x y)))) (defmacro wf-prefix (prefix) `(alistp ,prefix)) (defthm wf-prefix-v1-tail-dominates (wf-prefix (v1 (tail-dominates val v)))) (defthm v0-tail-dominates-to-tail-dominates-p (equal (v0 (tail-dominates x y)) (tail-dominates-p x y))) (defun prefixes (prefix) (declare (type (satisfies alistp) prefix)) (if (consp prefix) (let ((list (list::map-cons (cdar prefix) (prefixes (cdr prefix))))) (if (caar prefix) (cons nil list) list)) nil)) ;; jcd removing this for list::map-cons ;; (defthm non-consp-memberp-map-cons ;; (implies ;; (not (consp x)) ;; (not (list::memberp x (map-cons a z))))) (defthm consp-prefixes-v1-tail-dominates (implies (v0 (tail-dominates x y)) (consp (prefixes (v1 (tail-dominates x y)))))) (defun true-listp-list (list) (declare (type t list)) (if (consp list) (and (true-listp (car list)) (true-listp-list (cdr list))) (null list))) (defthm true-listp-car-true-listp-list (implies (true-listp-list list) (true-listp (car list)))) (defthm true-listp-list-prefixes (true-listp-list (prefixes list))) (defun prefixed-tail-dominator-p (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (dominates x y)))) (defthm not-consp-y-not-prefixed-tail-dominator-p (implies (not (consp y)) (not (prefixed-tail-dominator-p x prefix y)))) (defun list-prefixed-tail-dominator-p (x prefixes y) (declare (type t x prefixes y)) (if (consp prefixes) (or (prefixed-tail-dominator-p x (car prefixes) y) (list-prefixed-tail-dominator-p x (cdr prefixes) y)) nil)) (defthm not-consp-y-not-list-prefixed-tail-dominator-p (implies (not (consp y)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm not-consp-x-not-list-prefixed-tail-dominator-p (implies (not (consp x)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-p (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list-prefixed-tail-dominator-p x prefixes y))) #+joe (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-membership (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list::memberp prefix (list-prefixed-tail-dominator-p x prefixes y)))) (defthm prefixed-tail-dominator-p-implies-len (implies (prefixed-tail-dominator-p x prefix y) (< (len prefix) (len x))) :rule-classes (:forward-chaining)) (defthm consp-dominates-implies-tail-dominates-p (implies (and (consp x) (dominates x y)) (tail-dominates-p x y))) (defthm not-consp-not-tail-dominates-p (implies (not (consp y)) (not (tail-dominates-p x y)))) (defthm not-tail-dominates-p-implies-nil-prefix (implies (not (tail-dominates-p x y)) (equal (v1 (tail-dominates x y)) nil))) (defthm tail-dominates-append (implies (tail-dominates-p x z) (tail-dominates-p (append y x) z)) :hints (("goal" :in-theory (enable binary-append) :induct (append y x)))) (defun wf-syntax-prefix (prefix) (declare (type t prefix)) (if (consp prefix) (let ((entry (car prefix))) (and (consp entry) (case (car entry) (:cons (wf-syntax-prefix (cdr prefix))) (:append (wf-syntax-prefix (cdr prefix))) (:quote (and (null (cdr prefix)) (true-listp (cdr entry)))) (t nil)))) (null prefix))) (defthm wf-syntax-prefix-implies-true-listp (implies (wf-syntax-prefix prefix) (true-listp prefix)) :rule-classes (:rewrite :forward-chaining)) (defun s2l (prefix a) (declare (type (satisfies wf-syntax-prefix) prefix)) (if (consp prefix) (let ((entry (car prefix))) (case (car entry) (:cons (cons (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:append (list::appendx (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:quote (cdr entry)) (t nil))) nil)) (defthm true-listp-s2l (implies (wf-syntax-prefix pre) (true-listp (s2l pre a)))) (defignore syntax-quote-tail-dominates bag::a (x y) (declare (type t x y)) (if (consp x) (if (syntax-quote-dominates-p x y) (mv t nil) (met ((hit prefix) (syntax-quote-tail-dominates (cdr x) y)) (if hit (mv t (cons (cons :cons (syn::enquote (car x))) prefix)) (mv nil nil)))) (mv nil nil))) (defirrelevant syntax-quote-tail-dominates 1 bag::a (x y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant )))) (defthm wf-syntax-prefix-syntax-quote-tail-dominates (wf-syntax-prefix (v1 (syntax-quote-tail-dominates x y)))) (defthm syntax-quote-tail-dominates-implies-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (tail-dominates-p x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthmd not-consp-membership-implies-dominates (implies (and (not (consp pre)) (list::memberp pre (prefixes (v1 (tail-dominates x y))))) (dominates x y))) ;; jcd removing this for list::map-cons ;; (defthm memberp-x-map-cons ;; (equal (list::memberp x (map-cons a y)) ;; (and (consp x) ;; (equal (car x) a) ;; (list::memberp (cdr x) y)))) (defthmd memberp-not-consp-prefixes (implies (not (consp pre)) (equal (list::memberp pre (prefixes (val 1 (tail-dominates x y)))) (and (null pre) (consp x) (dominates x y)))) :hints (("goal" :in-theory (enable list::memberp not-consp-membership-implies-dominates) :expand (tail-dominates x y)))) (defthm s2l-membership-in-syntax-quote-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (list::memberp (s2l (v1 (syntax-quote-tail-dominates x y)) bag::a) (prefixes (v1 (tail-dominates x (syn::eval y bag::a)))))) :hints (("goal" :induct (syntax-quote-tail-dominates-fn bag::a x y)) (and acl2::stable-under-simplificationp `(:in-theory (enable memberp-not-consp-prefixes syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ))))) (defignore show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (if (show-syntax-dominates-p t x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::cdr x) y type-alist)) (if hit (mv t (cons (cons :cons (syn::car x)) prefix)) (mv nil nil))))) ((syn::appendp x) (if (show-syntax-dominates-p nil x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::arg 2 x) y type-alist)) (if hit (mv t (cons (cons :append (syn::arg 1 x)) prefix)) (mv nil nil))))) ((syn::quotep x) (if (syn::quotep y) (met ((hit prefix) (tail-dominates (syn::dequote x) (syn::dequote y))) (if hit (mv t (list (cons :quote (car (prefixes prefix))))) (mv nil nil))) (syntax-quote-tail-dominates (syn::dequote x) y))) (t (mv (show-syntax-dominates-p nil x y type-alist) nil)))) (defirrelevant show-syntax-tail-dominates 2 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (or (hyp-for-show-syntax-dominates-p t x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::cdr x) y type-alist))) ((syn::appendp x) (or (hyp-for-show-syntax-dominates-p nil x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::arg 2 x) y type-alist))) ((syn::quotep x) (if (syn::quotep y) (and (tail-dominates-p (syn::dequote x) (syn::dequote y)) (syn::true)) (met ((hit rest) (syntax-quote-tail-dominates (syn::dequote x) y)) (declare (ignore rest)) (and hit (syn::true))))) (t (hyp-for-show-syntax-dominates-p nil x y type-alist)))) (defirrelevant hyp-for-show-syntax-tail-dominates 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defthm show-syntax-tail-dominates-to-hyp-for (iff (v0 (show-syntax-tail-dominates x y type-alist)) (hyp-for-show-syntax-tail-dominates x y type-alist))) (defthm pseduo-termp-hyp-for-show-syntax-tail-dominates (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-tail-dominates x y type-alist)))) (defthm wf-syntax-prefix-show-syntax-tail-dominates (wf-syntax-prefix (v1 (show-syntax-tail-dominates x y type-alist)))) #+joe (defthm tail-dominates-p-from-dominates (implies (dominates x y) (tail-dominates-p x y))) (defthm show-syntax-tail-dominates-implies-tail-dominates (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (tail-dominates-p (syn::eval x bag::a) (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthm memberp-prefixes-implies-memberp-prefixes-append (implies (list::memberp list (prefixes (v1 (tail-dominates x y)))) (list::memberp (append z list) (prefixes (v1 (tail-dominates (append z x) y))))) :hints (("goal" :induct (len z) :in-theory (enable binary-append)))) (defthm s2l-membership-in-prefixes (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (list::memberp (s2l (v1 (show-syntax-tail-dominates x y type-alist)) bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory (e/d (syn::open-nth syn::conjoin syn::open-len syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ) ( ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION TRUE-LISTP) (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE list::CONSP-APPEND) (:REWRITE list::CDR-APPEND) (:REWRITE list::APPEND-OF-NON-CONSP-ONE) (:TYPE-PRESCRIPTION SYN::CONSP-REC) SYNTAX-QUOTE-DOMINATES-P-FN TAIL-DOMINATES-P SYNTAX-QUOTE-TAIL-DOMINATES-FN DOMINATES-SAME-LEN-CHEAP )) :induct (show-syntax-tail-dominates-fn bag::a x y type-alist)) )) (defignore syntax-quote-quote-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (syntax-quote-quote-prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (syntax-quote-dominates-p x y)))) #+joe (defignore syntax-quote-alist-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type (satisfies wf-syntax-prefix) prefix)) (and (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (equal (car x) val) (syntax-quote-alist-prefixed-tail-dominator-p (cdr x) (cdr prefix) y))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) (syntax-quote-dominates-p x y)))) (defirrelevant syntax-quote-quote-prefixed-tail-dominator-p 1 bag::a (x prefix y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant)))) (defthm syntax-quote-quote-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (syntax-quote-quote-prefixed-tail-dominator-p x prefix y) (prefixed-tail-dominator-p x prefix (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defignore show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)))) (t nil))) (show-syntax-dominates-p nil x y type-alist))) (defirrelevant show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)) (syn::true))) (t nil))) (hyp-for-show-syntax-dominates-p nil x y type-alist))) (defirrelevant hyp-for-show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm show-syntax-prefixed-tail-dominator-p-to-hyp-for (iff (show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist))) (defthm pseudo-termp-hyp-for-show-syntax-prefixed-tail-dominator-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist)))) (defthm prefixed-tail-dominator-p-append (implies (and (prefixed-tail-dominator-p x y z) (equal w k)) (prefixed-tail-dominator-p (append w x) (append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) #+joe (defthm list-prefixed-tail-dominator-p-append (implies (and (list-prefixed-tail-dominator-p x y z) (equal w k)) (list-prefixed-tail-dominator-p (append w x) (map-append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) (defun len-len-len-induction (x y z) (if (and (consp x) (consp y) (consp z)) (len-len-len-induction (cdr x) (cdr y) (cdr z)) (list x y z))) ;; I don't think this helps .. (defcong list::equiv equal (prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) #+joe (defcong list::equiv equal (list-prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) bag::a)) (prefixed-tail-dominator-p (syn::eval x bag::a) (s2l prefix bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-membership-implies-prefixed-tail-dominator (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (prefixed-tail-dominator-p x pre y)) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm prefixed-tail-dominator-membership-implies-tail-dominates-p (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (tail-dominates-p x y)) :hints (("goal" :in-theory (enable list::memberp))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm list-prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (list-prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-implies-membership-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (equal (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (true-listp pre))) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-memberp (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) bag::a) (wf-syntax-prefix pre)) (list::memberp (s2l pre bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory '(true-listp-s2l show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator prefixed-tail-dominator-implies-membership-tail-dominates )))) (defun contains-prefixed-tail-dominator-p (list pre x) (declare (type t x pre list)) (if (consp list) (or (prefixed-tail-dominator-p (car list) pre x) (contains-prefixed-tail-dominator-p (cdr list) pre x)) nil)) (defthm contains-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-prefixed-tail-dominator-p list pre y) (or (prefixed-tail-dominator-p v pre y) (contains-prefixed-tail-dominator-p (bag::remove-1 v list) pre y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) #+joe (defthm not-prefixed-tail-dominator-p-remove-1-reduction (implies (not (list-prefixed-tail-dominator-p x pre y)) (equal (contains-prefixed-tail-dominator-p (bag::remove-1 x list) pre y) (contains-prefixed-tail-dominator-p list pre y))) :hints (("goal" :in-theory (enable bag::remove-1)))) #+joe (defthm membership-reduction (implies (and (list::memberp x list) (prefixed-tail-dominator-p x pre y)) (contains-prefixed-tail-dominator-p list pre y)) :hints (("goal" :in-theory (enable list::memberp)))) (defcong bag::perm equal (contains-prefixed-tail-dominator-p list pre x) 1 :hints (("goal" :induct (bag::perm list bag::list-equiv) :in-theory (enable bag::perm)) (and acl2::stable-under-simplificationp `(:cases ((list-prefixed-tail-dominator-p (car list) pre x)))))) (defthm contains-prefixed-tail-dominator-p-append-2 (implies (contains-prefixed-tail-dominator-p list pre x) (contains-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-prefixed-tail-dominator-p-append-1 (implies (contains-prefixed-tail-dominator-p z pre x) (contains-prefixed-tail-dominator-p (append z a) pre x))) (defun contains-list-prefixed-tail-dominator-p (list prefixes x) (declare (type t x prefixes list)) (if (consp list) (or (list-prefixed-tail-dominator-p (car list) prefixes x) (contains-list-prefixed-tail-dominator-p (cdr list) prefixes x)) nil)) (local (in-theory (disable LIST-PREFIXED-TAIL-DOMINATOR-P))) (defthm contains-list-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-list-prefixed-tail-dominator-p list prefixes x) (or (list-prefixed-tail-dominator-p v prefixes x) (contains-list-prefixed-tail-dominator-p (bag::remove-1 v list) prefixes x)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) (defcong bag::perm equal (contains-list-prefixed-tail-dominator-p list prefixes x) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-list-prefixed-tail-dominator-p-append-2 (implies (contains-list-prefixed-tail-dominator-p list pre x) (contains-list-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-list-prefixed-tail-dominator-p-append-1 (implies (contains-list-prefixed-tail-dominator-p z pre x) (contains-list-prefixed-tail-dominator-p (append z a) pre x))) (defthmd member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (contains-prefixed-tail-dominator-p list pre x) (list::memberp pre prefixes)) (contains-list-prefixed-tail-dominator-p list prefixes x)) :hints (("goal" :in-theory (enable list::memberp)))) (in-theory (disable NOT-CONSP-MEMBERSHIP-IMPLIES-DOMINATES MEMBERP-NOT-CONSP-PREFIXES PREFIXED-TAIL-DOMINATOR-IMPLIES-MEMBERSHIP-TAIL-DOMINATES )) (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) (declare (type (integer 0 *) n) (type (satisfies wf-syntax-prefix) pre)) (if (consp list) (let ((z (car list))) (let ((m (len z))) (or (and (< n m) (syntax-quote-quote-prefixed-tail-dominator-p z pre x)) (syntax-quote-contains-prefixed-tail-dominator (cdr list) pre n x)))) nil)) (defirrelevant syntax-quote-contains-prefixed-tail-dominator 1 bag::a (list pre n x) :hints (("goal" :in-theory (enable syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-quote-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (syntax-quote-contains-prefixed-tail-dominator list pre n x) (contains-prefixed-tail-dominator-p list pre (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG - finish this function to fix problem identified below #+joe (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) ) (defignore syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))))) (t nil))) (defirrelevant syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable show-syntax-prefixed-tail-dominator-p-irrelevant hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (hyp-for-show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-contains-prefixed-tail-dominator-to-hyp-for (iff (syntax-contains-prefixed-tail-dominator list pre n x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist))) (defthm pseudo-termp-hyp-for-syntax-contains-prefixed-tail-dominator (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist)))) (defthm syntax-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a)) (contains-prefixed-tail-dominator-p (syn::eval list bag::a) (s2l pre bag::a) (syn::eval x bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin))) :rule-classes (:rewrite :forward-chaining)) (defthm member-syntax-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a) (list::memberp (s2l pre bag::a) prefixes)) (contains-list-prefixed-tail-dominator-p (syn::eval list bag::a) prefixes (syn::eval x bag::a))) :hints (("goal" :use (:instance member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (list (syn::eval list bag::a)) (pre (s2l pre bag::a)) (x (syn::eval x bag::a)) (prefixes prefixes))))) (defund tail-dominator-body (val rest x y) (declare (type t x y)) (met ((hit prex) (tail-dominates val x)) (or (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prex) y)) (met ((hit prey) (tail-dominates val y)) (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prey) x)))))) (defthm list-prefixed-tail-dominator-p-map-cons (equal (list-prefixed-tail-dominator-p w (list::map-cons a list) y) (and (consp w) (equal (car w) a) (list-prefixed-tail-dominator-p (cdr w) list y))) :hints (("goal" :in-theory (enable LIST-PREFIXED-TAIL-DOMINATOR-P) :induct (len list)))) (defun tail-dominator-body-body (v w x y) (met ((hitx prex) (tail-dominates v x)) (met ((hity prey) (tail-dominates v y)) (or (and hitx (list-prefixed-tail-dominator-p w (prefixes prex) y)) (and hity (list-prefixed-tail-dominator-p w (prefixes prey) x)))))) (defun tail-dominator-body-rec (val rest x y) (if (consp rest) (or (tail-dominator-body-body val (car rest) x y) (tail-dominator-body-rec val (cdr rest) x y)) nil)) (defthm tail-dominator-boody-to-tail-dominator-body-rec (equal (tail-dominator-body val rest x y) (tail-dominator-body-rec val rest x y)) :hints (("goal" :in-theory (enable tail-dominator-body) :induct (len rest)))) (in-theory (disable tail-dominator-body )) (defun tail-dominator-body-body-rec (w v x y) (if (and (consp w) (consp v)) (or (and (dominates w x) (dominates v y)) (and (dominates v x) (dominates w y)) (and (equal (car w) (car v)) (tail-dominator-body-body-rec (cdr w) (cdr v) x y))) nil)) (defthm open-tail-dominates (implies (consp x) (equal (tail-dominates x y) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))))) (defthm tail-dominator-body-body-is-tail-dominator-body-body-rec (equal (tail-dominator-body-body w v x y) (tail-dominator-body-body-rec w v x y)) :hints (("Goal" :in-theory (e/d (LIST-PREFIXED-TAIL-DOMINATOR-P) ( TAIL-DOMINATES ;efficiency CONSP-PREFIXES-V1-TAIL-DOMINATES STRICTLY-DOMINATES-IMPLIES-DOMINATES ;LIST::MV-NTH-TO-VAL ;LIST-PREFIXED-TAIL-DOMINATOR-P ;TAIL-DOMINATES-P )))) ) (defthm tail-dominator-body-body-commutes-first-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec w v x y))) (defthm tail-dominator-body-body-commutes-last-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec v w y x))) (defthm tail-dominator-body-commutes-last-2 (equal (tail-dominator-body-rec val rest x y) (tail-dominator-body-rec val rest y x))) (in-theory (disable tail-dominator-body-body )) (defthm tail-dominator-body-rec-membership-reduction (implies (list::memberp v rest) (equal (tail-dominator-body-rec val rest x y) (or (tail-dominator-body-body-rec val v x y) (tail-dominator-body-rec val (bag::remove-1 v rest) x y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len rest)))) (defcong bag::perm equal (tail-dominator-body-rec val rest x y) 2 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm rest bag::rest-equiv)))) (defun contains-unique-prefixed-tail-dominators (list x y) (declare (type t list x y)) (if (consp list) (let ((rest (cdr list)) (val (car list))) (or (tail-dominator-body val rest x y) (contains-unique-prefixed-tail-dominators rest x y))) nil)) (defthm contains-unique-prefixed-tail-dominators-membership-deconstruction (implies (list::memberp v list) (equal (contains-unique-prefixed-tail-dominators list x y) (or (tail-dominator-body v (bag::remove-1 v list) x y) (contains-unique-prefixed-tail-dominators (bag::remove-1 v list) x y)))) :hints (("goal" :in-theory (enable bag::remove-1)))) (defcong bag::perm equal (contains-unique-prefixed-tail-dominators list x y) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-unique-prefixed-tail-dominators-commutes (equal (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators list y x))) (defthm contains-unique-prefixed-tail-dominators-append-1 (implies (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators (append z list) x y)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append z list)))) (defthm contains-unique-prefixed-tail-dominators-append-2 (implies (contains-unique-prefixed-tail-dominators z x y) (contains-unique-prefixed-tail-dominators (append z a) x y))) (defignore syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist)) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist)) (syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)))) (t nil))) (defirrelevant syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant syntax-contains-prefixed-tail-dominator-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (;for efficiency: SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES PREFIXED-TAIL-DOMINATOR-P TAIL-DOMINATES-P ))))) (defignore hyp-for-syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist))) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) y type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist))) (hyp-for-syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN ))))) (defthm syntax-contains-unique-prefixed-tail-dominators-to-hyp-for (iff (syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist)) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm pseudo-termp-hyp-for-syntax-contains-unique-prefixed-tail-dominators (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist))) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm syntax-contains-unique-prefixed-tail-dominators-implies-contains-unique-prefixed-tail-dominators (implies (and (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (syn::eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (contains-unique-prefixed-tail-dominators (syn::eval list bag::a) (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth TAIL-DOMINATOR-BODY) (;TAIL-DOMINATOR-BODY SYNTAX-QUOTE-DOMINATES-P-FN ;these for efficiency TAIL-DOMINATES TAIL-DOMINATES-P CONTAINS-LIST-PREFIXED-TAIL-DOMINATOR-P LIST-PREFIXED-TAIL-DOMINATOR-P HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYNTAX-QUOTE-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN SHOW-SYNTAX-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN SHOW-SYNTAX-DOMINATES-P-FN TAIL-DOMINATOR-BOODY-TO-TAIL-DOMINATOR-BODY-REC (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) (:REWRITE BAG::SUBBAGP-CDR-LEMMA) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE BAG::SUBBAGP-WHEN-CDR-IS-NON-CONSP)) )))) (defthm diverge-tail-dominator-body-body-rec-implies-diverge (implies (and (tail-dominator-body-body-rec a b x y) (diverge a b)) (diverge x y)) :hints (("goal" :induct (tail-dominator-body-body-rec a b x y)))) (defthm all-diverge-from-all-tail-dominator-body-implies-diverge (implies (and (tail-dominator-body-rec val rest x y) (diverges-from-all val rest)) (diverge x y)) :hints (("goal" :in-theory (enable diverges-from-all)))) (defthm all-diverge-from-all-contains-unique-prefixed-tail-dominators-implies-diverge (implies (and (all-diverge list) (contains-unique-prefixed-tail-dominators list x y)) (diverge x y)) :hints (("goal" :in-theory (enable all-diverge)))) (defignored show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist)) (show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (show-prefix-diverge-from-type-alist syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant ) ( ;efficiency (bzo consider making some of these disables global?) HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (defignored hyp-for-show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syn::and (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist) fact)) (hyp-for-show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-show-prefix-diverge-from-type-alist ) (;efficiency: HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (local (in-theory (disable HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN))) (defthm to-hyp-for-show-prefix-diverge-from-type-alist (iff (show-prefix-diverge-from-type-alist a b alist wlist) (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-type-alist hyp-for-show-prefix-diverge-from-type-alist)))) (defthm psedu-termp-hyp-for-show-prefix-diverge-from-type-alist (implies (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-type-alist a b type-alist whole-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-type-alist)))) (syn::extend-eval pd-eval ( (diverge x y) (dominates x y) (diverges-from-all x list) (all-diverge-from-all x y) (all-diverge x) (list::equiv x y) ;; We do this to expediate functional instantiation. ;; This should not be necessary as bag:: should use ;; the syn:: evaluator as much as possible. (bag::hide x) (bag::hide-unique list) (bag::hide-subbagp x y) (bag::hide-disjoint x y) (bag::hide-memberp a x) (bag::perm x y) (bag::unique list) (bag::if a b c) (bag::consp x) (bag::true-listp x) (bag::binary-append x y) (bag::cons a b) (bag::meta-subbagp list1 list2) (bag::remove-bag x list) (bag::meta-remove-bag x list) (bag::remove-1 x list) (bag::unique-memberps x y list) (bag::unique-subbagps x y list) (bag::subbagp-pair x1 x2 list1 list2) (bag::meta-memberp x list) (bag::any-subbagp x list) ;remove this? (list::finalcdr x) (list::fix x) (bag::subbagp x y) (list::memberp a x) ; [Changed by Matt K. to handle changes to member, assoc, etc. after ACL2 4.2 ; (replaced member by member-equal).] (acl2::member-equal a x) (bag::disjoint x y) )) (DEFTHM PD-EVAL-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (IMPLIES (and (hyp-for-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS LIST X Y type-alist) (pd-eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (PD-EVAL LIST BAG::A) (PD-EVAL X BAG::A) (PD-EVAL Y BAG::A))) :rule-classes (:rewrite :forward-chaining) :HINTS (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (bag::A bag::A) (Y Y) (X X) (type-alist type-alist) (LIST LIST)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defthm pd-eval-show-not-equal-from-type-alist-works-right (implies (and (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) (pd-eval (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) bag::a) ) (not (equal (pd-eval x bag::a) (pd-eval y bag::a)))) :rule-classes (:forward-chaining :rewrite) :hints (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE bag::show-not-equal-from-type-alist-works-right (bag::A bag::A) (bag::Y Y) (bag::X X) (bag::N n) (bag::type-alist type-alist) (bag::whole-type-alist whole-type-alist) ) (BAG::syntax-EV PD-EVAL) (bag::syntax-ev-list PD-EVAL-LIST))))) (defthm show-prefix-diverge-from-type-alist-works (implies (and (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) (pd-eval (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) bag::a)) (diverge (pd-eval a bag::a) (pd-eval b bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth hyp-for-show-prefix-diverge-from-type-alist) ( (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN) (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN) (:DEFINITION HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN) (:REWRITE PREFIXED-TAIL-DOMINATOR-MEMBERSHIP-IMPLIES-PREFIXED-TAIL-DOMINATOR) (:DEFINITION TAIL-DOMINATES-P) (:DEFINITION TAIL-DOMINATES) ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:DEFINITION HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN) (:DEFINITION PREFIXED-TAIL-DOMINATOR-P) (:REWRITE acl2::MV-NTH-TO-VAL) (:REWRITE NOT-TAIL-DOMINATES-P-IMPLIES-NIL-PREFIX) (:REWRITE NOT-DOMINATES-FROM-DIVERGE-ONE) (:DEFINITION CONTAINS-PREFIXED-TAIL-DOMINATOR-P) (:DEFINITION HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN) (:REWRITE V0-TAIL-DOMINATES-TO-TAIL-DOMINATES-P) (:DEFINITION SHOW-SYNTAX-TAIL-DOMINATES-FN) ))))) (defthm pd-eval-syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (diverge (pd-eval t1 a) (pd-eval t2 a))) :hints (("Goal" :USE (:FUNCTIONAL-INSTANCE (:INSTANCE syntax-diverge-implies-diverge (a a) (t1 t1) (t2 t2)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defun syn::singleton (term) (declare (type t term)) (cond ((syn::consp term) (syn::null (syn::cdr term))) ((syn::quotep term) (let ((term (syn::dequote term))) (and (consp term) (not (consp (cdr term)))))) (t nil))) (defund syn::single-car (term) (declare (type (satisfies syn::singleton) term)) (if (syn::consp term) (syn::car term) (syn::enquote (car (syn::dequote term))))) (defthm pseudo-termp-single-car (implies (pseudo-termp term) (pseudo-termp (syn::single-car term))) :hints (("goal" :in-theory (enable pseudo-termp syn::single-car )))) (in-theory (disable syn::singleton )) (defignored show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant show-prefix-diverge-from-type-alist-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::hyp-for-show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (hyp-for-show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist-body (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body )))) (defthm show-prefix-diverge-from-alist-body-to-hyp-for (iff (show-prefix-diverge-from-alist-body x y type-alist) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body hyp-for-show-prefix-diverge-from-alist-body )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist-body (implies (and (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (hyp-for-show-prefix-diverge-from-alist-body bag::make-conjunction ) ( pd-eval-show-not-equal-from-type-alist-works-right )) :use (:instance pd-eval-show-not-equal-from-type-alist-works-right (x (syn::single-car x)) (y (syn::single-car y)) (n (BAG::USB16-FIX (LEN TYPE-ALIST))) (whole-type-alist type-alist) )) (and acl2::stable-under-simplificationp `(:in-theory (e/d ( syn::single-car syn::singleton diverge ) (pd-eval-show-not-equal-from-type-alist-works-right )))))) (defthmd syntax-quote-remove-common-prefix-pd-eval-diverge (implies (diverge (v0 (syntax-quote-remove-common-prefix x y)) (pd-eval (v1 (syntax-quote-remove-common-prefix x y)) bag::a)) (diverge x (pd-eval y bag::a)))) (defthmd syntax-remove-common-prefix-pd-eval-diverge (implies (diverge (pd-eval (v0 (syntax-remove-common-prefix x y)) bag::a) (pd-eval (v1 (syntax-remove-common-prefix x y)) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::open-nth syntax-quote-remove-common-prefix-pd-eval-diverge) (;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION WF-SYNTAX-PREFIX) (:DEFINITION TRUE-LISTP) (:REWRITE PD-EVAL-SYNTAX-DIVERGE-IMPLIES-EVAL-COMMUTE) (:DEFINITION SYNTAX-DIVERGE)))))) (defignored show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (show-prefix-diverge-from-alist-body x y type-alist))) (defirrelevant show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist show-prefix-diverge-from-alist-body-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) (defthm show-prefix-diverge-from-alist-to-hyp-for (iff (show-prefix-diverge-from-alist x y type-alist) (hyp-for-show-prefix-diverge-from-alist x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist )))) (defirrelevant hyp-for-show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist-body-irrelevant )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist (implies (and (hyp-for-show-prefix-diverge-from-alist x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-remove-common-prefix-pd-eval-diverge hyp-for-show-prefix-diverge-from-alist )))) (set-state-ok t) (defun show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((zed #+joe(and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc(~x0,~x1)?~%" x y)) nil)) (declare (ignore zed)) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-prefix-diverge-from-alist-fn nil x y type-alist) (acl2::prog2$ #+joe (and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc!~%")) nil (syn::true)) term)))) term)) (defun hyp-for-show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc state)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-prefix-diverge-from-alist-fn nil x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))) (syn::nil))) (defthm meta-rule-to-show-prefix-diverge (implies (pd-eval (hyp-for-show-prefix-diverge-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-prefix-diverge-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (diverge) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin hyp-for-show-prefix-diverge-from-alist-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (encapsulate () (local (encapsulate () (in-theory (disable all-diverge )) (defthm test1 (implies (all-diverge `((a b ,c d ,e) (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) (defthm test2 (implies (all-diverge `((a b ,c d ,e) ,z (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) ))) (defun show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-syntax-dominates-p-fn nil t x y type-alist) (syn::true) (if (show-syntax-dominates-p-fn nil t y x type-alist) `(if (list::equiv ,y ,x) ,(syn::true) ,(syn::nil)) term)))) term)) (defun hyp-for-show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t y x type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))))) (syn::nil))) (defthm pd-eval-syntax-domination-implies-domination (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :use (:functional-instance syntax-domination-implies-domination-helper (syn::eval pd-eval) (syn::eval-list pd-eval-list))))) (defthmd non-domination-from-not-equal-dominates (implies (and (dominates x y) (not (list::equiv x y))) (not (dominates y x))) :hints (("goal" :in-theory (enable dominates )))) (defthm meta-rule-to-show-prefix-domination (implies (pd-eval (hyp-for-show-domination-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-domination-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (dominates) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin non-domination-from-not-equal-dominates hyp-for-show-syntax-dominates-p-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (defun all-diverge-remove-prefix (paths) (if (not (syn::consp paths)) paths (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths))))) (defthm all-diverge-remove-prefix-open (implies (syn::consp paths) (equal (all-diverge-remove-prefix paths) (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths)))))) (defun all-diverge-prefix-meta-fn (term) (if (and (syn::consp term) (syn::consp (syn::cdr term)) (equal 'all-diverge (car term))) (if (syn-prefix-p (syn::cdr term)) (let ((pruned (all-diverge-remove-prefix (syn::cdr term)))) (list 'all-diverge pruned)) term) term)) (defthm not-syn-consp-all-diverge-prefix-meta-fn (implies (not (syn::consp term)) (equal (all-diverge-prefix-meta-fn term) term))) (defun syntax-dominates (p1 p2) (if (syn::consp p1) (and (syn::consp p2) (equal (syn::car p1) (syn::car p2)) (syntax-dominates (syn::cdr p1) (syn::cdr p2))) t)) #+joe ;; better definition later (defun syntax-dominated-by-some (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) t (syntax-dominated-by-some p (syn::cdr paths))) nil)) (defun remove-dominator (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) (syn::cdr paths) (syn::cons (syn::car paths) (remove-dominator p (syn::cdr paths)))) paths)) (syn::defevaluator meta-all-diverge-prefix-ev meta-all-diverge-prefix-ev-list ( (len x) (syn-prefix-p x) (cdr x) (if a b c) (all-diverge-remove-prefix x) (all-diverge-prefix-meta-fn x) (consp x) (cons x y) (equal x y) (path::diverge a b) (path::all-diverge x) (path::all-diverge-from-all x y) (car x) ;(cadr x) (syn::car x) (syn::cons x y) (syn::cdr x) (syn::consp x) (syntax-dominates p1 p2) ;(syntax-dominated-by-some p paths) (remove-dominator p paths) ;(show-mapping-from-type-alist a b) ;(all-diverge-mapping-from-type-alist a l) ;(all-diverge-mapping-from-mfc t m state) )) (defthm meta-all-diverge-prefix (equal (meta-all-diverge-prefix-ev term alist) (meta-all-diverge-prefix-ev (all-diverge-prefix-meta-fn term) alist)) :rule-classes ((:meta :trigger-fns (all-diverge))) :hints (("Goal" :do-not '(generalize eliminate-destructors) :induct (all-diverge-remove-prefix term)) ("Subgoal *1/1" :in-theory (disable all-diverge-prefix-meta-fn))) :otf-flg t) (in-theory (disable (:rewrite wf-syntax-prefix-implies-true-listp) (:definition wf-syntax-prefix)))
41865
#|-*-Lisp-*-=================================================================|# #| |# #| coi: Computational Object Inference |# #| |# #|===========================================================================|# (in-package "PATH") (include-book "../lists/basic") (include-book "../lists/map-cons") (include-book "../syntax/syntax") (include-book "../util/mv-nth") (local (include-book "../util/iff")) ;; jcd - changing this to path, speeds things up a lot (~100 seconds) and ;; separates paths from graphs. (include-book "path") ;; jcd - moved to :lists/map-cons ;; (defun map-cons (a list) ;; (declare (type t a list)) ;; (if (consp list) ;; (cons (cons a (car list)) ;; (map-cons a (cdr list))) ;; nil)) ;; jcd - moved to :lists/basic ;; (defun appendx (x y) ;; (declare (type t x y)) ;; (if (consp x) ;; (cons (car x) (appendx (cdr x) y)) ;; y)) ;; jcd - we use mbe now, no need for this rule ;; (defthm appendx-is-append ;; (equal (appendx x y) ;; (append x y))) ; 1.36 12.00 ; CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-MEMBERSHIP-DECONSTRUCTION ;jcd Trying this. -ews (local (in-theory (disable not-dominates-from-diverge-one not-dominates-from-diverge-two))) ;; Normalization: assume that (append (cons a b) list) = (cons a (append b list)) ;; (for quoted (cons a b) terms, too) (in-theory (disable LENS-<-WHEN-DOMINATES-BUT-NOT-CONG NOT-DOMINATES-FROM-<-OF-LEN-AND-LEN DOMINATES-WHEN-LENS-EQUAL ;; jcd - Cheapened this, going to try leaving it enabled ;; DOMINATES-WHEN-NOT-DIVERGE-AND-NOT-DOMINATES DOMINATES-ASYMMETRIC DOMINATES-TRANSITIVE-TWO dominates-means-not-diverge dominates-means-not-diverge-alt )) (in-theory (enable BAG::APPEND-COMMUTATIVE-INSIDE-PERM )) (local (in-theory (disable syn::open-len))) (defun syn::ts-consp (term fact) (declare (type (satisfies acl2::type-alist-entryp) fact) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alist-entryp))))) (let ((ts (cadr fact)) (tsterm (car fact))) (and (or (not (= (logand ts acl2::*ts-proper-cons*) acl2::*ts-empty*)) (not (= (logand ts acl2::*ts-improper-cons*) acl2::*ts-empty*))) (equal term tsterm)))) (defun sudo-len (term) (declare (type t term)) (if (syn::consp term) (1+ (sudo-len (syn::cdr term))) (if (syn::appendp term) (1+ (sudo-len (syn::arg 2 term))) (if (syn::quotep term) 1 0)))) (defthm integerp-sudo-len (integerp (sudo-len term)) :rule-classes (:rewrite :type-prescription)) (defthm sudo-len-linear (<= 0 (sudo-len ter)) :rule-classes (:linear)) (defun equal-len (path1 path2) (declare (type t path1 path2)) (cond ((and (syn::quotep path1) (syn::quotep path2)) (equal (len (syn::dequote path1)) (len (syn::dequote path2)))) ((and (syn::consp path1) (syn::consp path2)) (equal-len (syn::cdr path1) (syn::cdr path2))) ((and (syn::appendp path1) (syn::appendp path2)) (and (equal-len (syn::arg 1 path1) (syn::arg 1 path2)) (equal-len (syn::arg 2 path1) (syn::arg 2 path2)))) (t (equal path1 path2)))) (defthm equal-len-identity (equal-len x x)) (defun syntax-quote-diverge (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (or (and (syn::quotep v) (not (equal (car path1) (syn::dequote v))) (syn::true)) (syntax-quote-diverge (cdr path1) (syn::cdr path2))))) ((syn::quotep path2) (and (diverge path1 (syn::dequote path2)) (syn::true))) (t nil)) nil)) (defthm syntax-quote-diverge-implies-quote-true (implies (syntax-quote-diverge path1 path2) (equal (syntax-quote-diverge path1 path2) (syn::true)))) (defthm syntax-quote-diverge-implies-diverge (implies (syntax-quote-diverge x1 t2) (diverge x1 (syn::eval t2 a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (defun syntax-diverge (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (syntax-quote-diverge (syn::dequote path1) path2)) ((syn::quotep path2) (syntax-quote-diverge (syn::dequote path2) path1)) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (and (syn::quotep car1) (syn::quotep car2) (not (equal (syn::dequote car1) (syn::dequote car2)))) (syn::true) (syntax-diverge (syn::cdr path1) (syn::cdr path2))))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (and (equal arg11 arg12) (syntax-diverge (syn::arg 2 path1) (syn::arg 2 path2))))) (t nil))) (defthm syntax-diverge-implies-diverge (implies (syntax-diverge t1 t2) (diverge (syn::eval t1 a) (syn::eval t2 a))) :hints (("goal" :in-theory (enable syn::open-nth diverge-append-len-equal)))) (defun remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (and (consp path1) (consp path2)) (if (equal (car path1) (car path2)) (remove-common-prefix (cdr path1) (cdr path2)) (mv path1 path2)) (mv nil nil))) (defthm remove-common-prefix-identity (and (equal (v0 (remove-common-prefix x x)) nil) (equal (v1 (remove-common-prefix x x)) nil))) (defun syntax-quote-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (if (and (syn::quotep v) (equal (car path1) (syn::dequote v))) (syntax-quote-remove-common-prefix (cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((syn::quotep path2) (met ((path1 path2) (remove-common-prefix path1 (syn::dequote path2))) (mv path1 (syn::enquote path2)))) (t (mv path1 path2))) (mv path1 path2))) (defthm pseudo-termp-syntax-quote-remove-common-prefix (implies (and (pseudo-termp y)) (pseudo-termp (v1 (syntax-quote-remove-common-prefix x y)))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthm diverge-remove-common-prefix-noop (equal (diverge (v0 (remove-common-prefix t1 t2)) (v1 (remove-common-prefix t1 t2))) (diverge t1 t2))) (defthm syntax-quote-diverge-syntax-quote-remove-common-prefix-noop (equal (syntax-quote-diverge (v0 (syntax-quote-remove-common-prefix t1 t2)) (v1 (syntax-quote-remove-common-prefix t1 t2))) (syntax-quote-diverge t1 t2))) (defun syntax-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (met ((path1 path2) (syntax-quote-remove-common-prefix (syn::dequote path1) path2)) (mv (syn::enquote path1) path2))) ((syn::quotep path2) (met ((path2 path1) (syntax-quote-remove-common-prefix (syn::dequote path2) path1)) (mv path1 (syn::enquote path2)))) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (equal car1 car2) (syntax-remove-common-prefix (syn::cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (if (equal arg11 arg12) (syntax-remove-common-prefix (syn::arg 2 path1) (syn::arg 2 path2)) (mv path1 path2)))) ((equal path1 path2) (mv (syn::nil) (syn::nil))) (t (mv path1 path2)))) (defthm pseudo-termp-syntax-remove-common-prefix (implies (and (pseudo-termp x) (pseudo-termp y)) (and (pseudo-termp (v0 (syntax-remove-common-prefix x y))) (pseudo-termp (v1 (syntax-remove-common-prefix x y))))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthmd syntax-diverge-commute (equal (syntax-diverge x y) (syntax-diverge y x)) :rule-classes ((:rewrite :loop-stopper ((y x))))) (defthm syntax-diverge-syntax-remove-common-prefix-noop (equal (syntax-diverge (v0 (syntax-remove-common-prefix t1 t0)) (v1 (syntax-remove-common-prefix t1 t0))) (syntax-diverge t1 t0)) :hints (("goal" :in-theory (e/d (syntax-diverge-commute) (;for efficiency: SYN::OPEN-LEN SYNTAX-QUOTE-DIVERGE))))) (defun syntax-diverge-wrapper (term) (declare (type t term)) (if (syn::funcall 'diverge 2 term) (let ((arg1 (syn::arg 1 term)) (arg2 (syn::arg 2 term))) (met ((arg1 arg2) (syntax-remove-common-prefix arg1 arg2)) (let ((hit (syntax-diverge arg1 arg2))) (if hit hit term)))) term)) (defthm equal-len-implies-equal-len (implies (equal-len t1 t2) (iff (equal (len (syn::eval t1 a)) (len (syn::eval t2 a))) t)) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (syn::eval t1 a) (syn::eval t2 a)) (syn::eval (syntax-diverge t1 t2) a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (syn::extend-eval diverge-eval ( (diverge x y) )) (syn::defevthm diverge-eval syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (diverge-eval t1 a) (diverge-eval t2 a)) (diverge-eval (syntax-diverge t1 t2) a)))) (defthmd *meta*-syntax-diverge (iff (diverge-eval term a) (diverge-eval (syntax-diverge-wrapper term) a)) :hints (("goal" :in-theory (enable syn::open-nth))) :rule-classes ((:meta :trigger-fns (diverge)))) ;; Syntactic tail domination .. (defun true-p (x) (declare (type t x) (ignore x)) t) (defun remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (remove-prefix (cdr prefix) (cdr x)) (mv nil nil)) (mv t x))) (defun v0-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v0-remove-prefix (cdr prefix) (cdr x)) nil) t)) (defun v1-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v1-remove-prefix (cdr prefix) (cdr x)) nil) x)) (defthm v0-remove-prefix-reduction (equal (v0 (remove-prefix prefix x)) (v0-remove-prefix prefix x))) (defcong list::equiv equal (v0-remove-prefix prefix x) 2) (defthm v1-remove-prefix-reduction (equal (v1 (remove-prefix prefix x)) (v1-remove-prefix prefix x))) (defcong list::equiv list::equiv (v1-remove-prefix prefix x) 2) (defthm list-fix-v1-remove-prefix (equal (list::fix (v1-remove-prefix prefix x)) (v1-remove-prefix prefix (list::fix x)))) (defthm v0-remove-prefix-append (equal (v0-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v0-remove-prefix y (v1-remove-prefix x z))))) (defthm v1-remove-prefix-append (equal (v1-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v1-remove-prefix y (v1-remove-prefix x z))))) (defthm not-v0-implies-nil-v1-remove-prefix (implies (not (v0-remove-prefix x y)) (equal (v1-remove-prefix x y) nil))) #| (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) (mv nil nil)))) ((syn::quotep x) (remove-prefix prefix (syn::dequote x))) (t (mv nil nil))) (mv (syn::null x) nil))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v0-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v0-remove-prefix prefix (syn::dequote x))) (t nil)) (syn::null x))) (defirrelevant v0-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v1-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v1-remove-prefix prefix (syn::dequote x))) (t nil)) nil)) (defirrelevant v1-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defthm v0-to-v0-syntax-quote-remove-prefix (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-to-v1-syntax-quote-remove-prefix (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defcong list::equiv equal (v0-syntax-remove-prefix prefix x) 2) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix prefix x) 2) (defthm list-fix-v1-syntax-quote-remove-prefix (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x)))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix x y)) (equal (v1-syntax-quote-remove-prefix x y) nil))) #+joe (defignore syntax-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (if (and (syn::consp x) (equal (syn::car prefix) (syn::car x))) (syntax-remove-prefix (syn::cdr prefix) (syn::cdr x)) (mv nil nil))) ((syn::appendp prefix) (if (and (syn::appendp x) (equal (syn::arg 1 prefix) (syn::arg 1 x))) (syntax-remove-prefix (syn::arg 2 prefix) (syn::arg 2 x)) (mv nil nil))) ((syn::quotep prefix) (syntax-quote-remmove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) |# (defun tail-p (x y) (declare (type t x y)) (or (list::equiv x y) (and (consp y) (tail-p x (cdr y))))) (defthm v1-remove-prefix-is-tail-x (implies (v0-remove-prefix prefix x) (tail-p (v1-remove-prefix prefix x) x))) (defthm tail-p-implies (implies (tail-p x y) (<= (len x) (len y))) :rule-classes (:linear :rewrite)) #+joe (defignore syntax-alist-quote-remove-prefix bag::a (prefix x) (if (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (if (equal (car x) val) (syntax-alist-quote-remove-prefix prefix x) (mv nil nil))) (:append (met ((hit rest) (syntax- (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) x) nil)))) #| ;; DAG - I have removed this line of thinking. It just doesn't make any sense ;; .. if x is a quoted constant, then the prefix would have to be quoted as ;; well. (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) (mv nil nil)))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) (mv nil nil) (syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (remove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (prefix x) ) (defthmd list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1 (syntax-quote-remove-prefix prefix x))) (v1 (syntax-quote-remove-prefix prefix (list::fix x)))) (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0 (syntax-quote-remove-prefix prefix (list::fix x))) )))) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v0-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v0-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v0-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v0-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v1-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v1-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v1-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v1-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defthm v0-syntax-quote-remove-prefix-reduction (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-syntax-quote-remove-prefix-reduction (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defthmd vx-list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x))) (equal (v0-syntax-quote-remove-prefix prefix x) (v0-syntax-quote-remove-prefix prefix (list::fix x))))) :hints (("goal" :use (:instance list-fix-commutes-over-syntax-quote-remove-prefix)))) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defcong list::equiv equal (v0-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix prefix x)) (equal (v1-syntax-quote-remove-prefix prefix x) nil))) (defthm v0-syntax-quote-remove-prefix-implies-v2-cong (implies (v0-syntax-quote-remove-prefix prefix x) (and (list::equiv (v1-syntax-quote-remove-prefix prefix x) (v1-remove-prefix (syn::eval prefix bag::a) x)) (v0-remove-prefix (syn::eval prefix bag::a) x))) :hints (("goal" :induct (syntax-quote-remove-prefix prefix x)))) #+joe (defignore syntax-remove-term (term x) ..) #+joe (defignore syntax-remove-prefix (prefix x) ) |# (defignore syntax-quote-dominates-p bag::a (x y) (declare (type t x y) (xargs :measure (acl2-count y))) (if (consp x) (cond ((syn::consp y) (let ((v (syn::car y))) (and (syn::quotep v) (equal (car x) (syn::dequote v)) (syntax-quote-dominates-p (cdr x) (syn::cdr y))))) #+joe ((syn::appendp y) (met ((hit rest) (syntax-quote-remove-prefix x (syn::arg 1 y) x)) (and hit (syntax-quote-dominates-p rest (syn::arg 2 y))))) ((syn::quotep y) (dominates x (syn::dequote y))) (t nil)) t)) (defirrelevant syntax-quote-dominates-p 1 bag::a (x y) :hints (("goal" :in-theory (enable ;v0-syntax-quote-remove-prefix-irrelevant ;v1-syntax-quote-remove-prefix-irrelevant )))) (defthmd dominates-append-2 (equal (dominates x (append y z)) (or (dominates x y) (and (v0-remove-prefix y x) (dominates (v1-remove-prefix y x) z)))) :hints (("goal" :in-theory (enable dominates)))) (defthm syntax-quote-dominates-implies-dominates (implies (syntax-quote-dominates-p x y) (dominates x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable dominates dominates-append-2)))) (defignore show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (syn::ts-consp term entry) (show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defignore hyp-for-show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (and (syn::ts-consp term entry) `(consp ,term)) (hyp-for-show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant hyp-for-show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defthm pseudo-termp-hyp-for-show-syntax-consp-from-alist (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp-from-alist term type-alist)))) (defthm show-syntax-consp-from-alist-to-hyp-for (iff (show-syntax-consp-from-alist term type-alist) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defthm show-syntax-consp-from-alist-works (implies (and (hyp-for-show-syntax-consp-from-alist x type-alist) (syn::eval (hyp-for-show-syntax-consp-from-alist x type-alist) bag::a)) (consp (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG -- This could be improved by checking each append term for ;; consp. (defignored show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (or (syn::consp-rec term) (show-syntax-consp-from-alist term type-alist))) (defirrelevant show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defignored hyp-for-show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (if (syn::consp-rec term) (syn::true) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defirrelevant hyp-for-show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defthm show-syntax-consp-to-hyp-for (iff (show-syntax-consp term type-alist) (hyp-for-show-syntax-consp term type-alist)) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp )))) (defthm pseudo-termp-hyp-for-show-syntax-consp (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp term type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defthm show-syntax-consp-works (implies (and (hyp-for-show-syntax-consp term type-alist) (syn::eval (hyp-for-show-syntax-consp term type-alist) bag::a)) (consp (syn::eval term bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defignore show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (show-syntax-dominates-p (or flg (show-syntax-consp (syn::arg 1 x) type-alist)) (syn::arg 2 x) (syn::arg 2 y) type-alist))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or flg (show-syntax-consp x type-alist)))) (t (and (equal x y) (or flg (show-syntax-consp x type-alist)))))) (defcong iff iff (show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (hyp-for-show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (let ((hyp (if flg (syn::true) (hyp-for-show-syntax-consp (syn::arg 1 x) type-alist)))) (if hyp (syn::and hyp (hyp-for-show-syntax-dominates-p t (syn::arg 2 x) (syn::arg 2 y) type-alist)) (hyp-for-show-syntax-dominates-p nil (syn::arg 2 x) (syn::arg 2 y) type-alist))))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y) (syn::true)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))) (t (and (equal x y) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))))) (defcong iff iff (hyp-for-show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant hyp-for-show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defthm show-syntax-dominates-p-to-hyp-for (iff (show-syntax-dominates-p flg x y type-alist) (hyp-for-show-syntax-dominates-p flg x y type-alist)) :hints (("goal" :induct (hyp-for-show-syntax-dominates-p-fn bag::a flg x y type-alist)))) (defthm pseudo-termp-hyp-for-show-syntax-dominates-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-dominates-p flg x y type-alist))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defun contains (symbol term) (declare (type t symbol term)) (if (consp term) (if (consp (car term)) (or (contains symbol (car term)) (contains symbol (cdr term))) (or (equal symbol (car term)) (contains symbol (cdr term)))) (equal symbol term))) (defthmd syntax-domination-implies-domination (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syntaxp (contains 'syn::eval logical-x)) (equal (syn::eval x bag::a) logical-x)) (dominates logical-x (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-domination-implies-domination-helper (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-domination)))) (defthmd syntax-domination-implies-consp (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syn::eval (hyp-for-show-syntax-dominates-p flg x y type-alist) bag::a) (syntaxp (contains 'syn::eval logical-x)) (not flg) (equal logical-x (syn::eval x bag::a))) (consp logical-x)) :hints (("goal" :in-theory (enable SYN::CONJOIN syn::open-nth)))) (defun tail-dominates-p (x y) (declare (type t x y)) (cond ((consp x) (or (dominates x y) (tail-dominates-p (cdr x) y))) (t nil))) (defun tail-dominates (x y) (declare (type t x y)) (cond ((consp x) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))) (t (mv nil nil)))) (defthm booleanp-v0-tail-dominates (booleanp (v0 (tail-dominates x y)))) (defmacro wf-prefix (prefix) `(alistp ,prefix)) (defthm wf-prefix-v1-tail-dominates (wf-prefix (v1 (tail-dominates val v)))) (defthm v0-tail-dominates-to-tail-dominates-p (equal (v0 (tail-dominates x y)) (tail-dominates-p x y))) (defun prefixes (prefix) (declare (type (satisfies alistp) prefix)) (if (consp prefix) (let ((list (list::map-cons (cdar prefix) (prefixes (cdr prefix))))) (if (caar prefix) (cons nil list) list)) nil)) ;; jcd removing this for list::map-cons ;; (defthm non-consp-memberp-map-cons ;; (implies ;; (not (consp x)) ;; (not (list::memberp x (map-cons a z))))) (defthm consp-prefixes-v1-tail-dominates (implies (v0 (tail-dominates x y)) (consp (prefixes (v1 (tail-dominates x y)))))) (defun true-listp-list (list) (declare (type t list)) (if (consp list) (and (true-listp (car list)) (true-listp-list (cdr list))) (null list))) (defthm true-listp-car-true-listp-list (implies (true-listp-list list) (true-listp (car list)))) (defthm true-listp-list-prefixes (true-listp-list (prefixes list))) (defun prefixed-tail-dominator-p (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (dominates x y)))) (defthm not-consp-y-not-prefixed-tail-dominator-p (implies (not (consp y)) (not (prefixed-tail-dominator-p x prefix y)))) (defun list-prefixed-tail-dominator-p (x prefixes y) (declare (type t x prefixes y)) (if (consp prefixes) (or (prefixed-tail-dominator-p x (car prefixes) y) (list-prefixed-tail-dominator-p x (cdr prefixes) y)) nil)) (defthm not-consp-y-not-list-prefixed-tail-dominator-p (implies (not (consp y)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm not-consp-x-not-list-prefixed-tail-dominator-p (implies (not (consp x)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-p (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list-prefixed-tail-dominator-p x prefixes y))) #+joe (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-membership (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list::memberp prefix (list-prefixed-tail-dominator-p x prefixes y)))) (defthm prefixed-tail-dominator-p-implies-len (implies (prefixed-tail-dominator-p x prefix y) (< (len prefix) (len x))) :rule-classes (:forward-chaining)) (defthm consp-dominates-implies-tail-dominates-p (implies (and (consp x) (dominates x y)) (tail-dominates-p x y))) (defthm not-consp-not-tail-dominates-p (implies (not (consp y)) (not (tail-dominates-p x y)))) (defthm not-tail-dominates-p-implies-nil-prefix (implies (not (tail-dominates-p x y)) (equal (v1 (tail-dominates x y)) nil))) (defthm tail-dominates-append (implies (tail-dominates-p x z) (tail-dominates-p (append y x) z)) :hints (("goal" :in-theory (enable binary-append) :induct (append y x)))) (defun wf-syntax-prefix (prefix) (declare (type t prefix)) (if (consp prefix) (let ((entry (car prefix))) (and (consp entry) (case (car entry) (:cons (wf-syntax-prefix (cdr prefix))) (:append (wf-syntax-prefix (cdr prefix))) (:quote (and (null (cdr prefix)) (true-listp (cdr entry)))) (t nil)))) (null prefix))) (defthm wf-syntax-prefix-implies-true-listp (implies (wf-syntax-prefix prefix) (true-listp prefix)) :rule-classes (:rewrite :forward-chaining)) (defun s2l (prefix a) (declare (type (satisfies wf-syntax-prefix) prefix)) (if (consp prefix) (let ((entry (car prefix))) (case (car entry) (:cons (cons (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:append (list::appendx (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:quote (cdr entry)) (t nil))) nil)) (defthm true-listp-s2l (implies (wf-syntax-prefix pre) (true-listp (s2l pre a)))) (defignore syntax-quote-tail-dominates bag::a (x y) (declare (type t x y)) (if (consp x) (if (syntax-quote-dominates-p x y) (mv t nil) (met ((hit prefix) (syntax-quote-tail-dominates (cdr x) y)) (if hit (mv t (cons (cons :cons (syn::enquote (car x))) prefix)) (mv nil nil)))) (mv nil nil))) (defirrelevant syntax-quote-tail-dominates 1 bag::a (x y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant )))) (defthm wf-syntax-prefix-syntax-quote-tail-dominates (wf-syntax-prefix (v1 (syntax-quote-tail-dominates x y)))) (defthm syntax-quote-tail-dominates-implies-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (tail-dominates-p x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthmd not-consp-membership-implies-dominates (implies (and (not (consp pre)) (list::memberp pre (prefixes (v1 (tail-dominates x y))))) (dominates x y))) ;; jcd removing this for list::map-cons ;; (defthm memberp-x-map-cons ;; (equal (list::memberp x (map-cons a y)) ;; (and (consp x) ;; (equal (car x) a) ;; (list::memberp (cdr x) y)))) (defthmd memberp-not-consp-prefixes (implies (not (consp pre)) (equal (list::memberp pre (prefixes (val 1 (tail-dominates x y)))) (and (null pre) (consp x) (dominates x y)))) :hints (("goal" :in-theory (enable list::memberp not-consp-membership-implies-dominates) :expand (tail-dominates x y)))) (defthm s2l-membership-in-syntax-quote-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (list::memberp (s2l (v1 (syntax-quote-tail-dominates x y)) bag::a) (prefixes (v1 (tail-dominates x (syn::eval y bag::a)))))) :hints (("goal" :induct (syntax-quote-tail-dominates-fn bag::a x y)) (and acl2::stable-under-simplificationp `(:in-theory (enable memberp-not-consp-prefixes syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ))))) (defignore show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (if (show-syntax-dominates-p t x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::cdr x) y type-alist)) (if hit (mv t (cons (cons :cons (syn::car x)) prefix)) (mv nil nil))))) ((syn::appendp x) (if (show-syntax-dominates-p nil x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::arg 2 x) y type-alist)) (if hit (mv t (cons (cons :append (syn::arg 1 x)) prefix)) (mv nil nil))))) ((syn::quotep x) (if (syn::quotep y) (met ((hit prefix) (tail-dominates (syn::dequote x) (syn::dequote y))) (if hit (mv t (list (cons :quote (car (prefixes prefix))))) (mv nil nil))) (syntax-quote-tail-dominates (syn::dequote x) y))) (t (mv (show-syntax-dominates-p nil x y type-alist) nil)))) (defirrelevant show-syntax-tail-dominates 2 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (or (hyp-for-show-syntax-dominates-p t x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::cdr x) y type-alist))) ((syn::appendp x) (or (hyp-for-show-syntax-dominates-p nil x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::arg 2 x) y type-alist))) ((syn::quotep x) (if (syn::quotep y) (and (tail-dominates-p (syn::dequote x) (syn::dequote y)) (syn::true)) (met ((hit rest) (syntax-quote-tail-dominates (syn::dequote x) y)) (declare (ignore rest)) (and hit (syn::true))))) (t (hyp-for-show-syntax-dominates-p nil x y type-alist)))) (defirrelevant hyp-for-show-syntax-tail-dominates 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defthm show-syntax-tail-dominates-to-hyp-for (iff (v0 (show-syntax-tail-dominates x y type-alist)) (hyp-for-show-syntax-tail-dominates x y type-alist))) (defthm pseduo-termp-hyp-for-show-syntax-tail-dominates (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-tail-dominates x y type-alist)))) (defthm wf-syntax-prefix-show-syntax-tail-dominates (wf-syntax-prefix (v1 (show-syntax-tail-dominates x y type-alist)))) #+joe (defthm tail-dominates-p-from-dominates (implies (dominates x y) (tail-dominates-p x y))) (defthm show-syntax-tail-dominates-implies-tail-dominates (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (tail-dominates-p (syn::eval x bag::a) (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthm memberp-prefixes-implies-memberp-prefixes-append (implies (list::memberp list (prefixes (v1 (tail-dominates x y)))) (list::memberp (append z list) (prefixes (v1 (tail-dominates (append z x) y))))) :hints (("goal" :induct (len z) :in-theory (enable binary-append)))) (defthm s2l-membership-in-prefixes (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (list::memberp (s2l (v1 (show-syntax-tail-dominates x y type-alist)) bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory (e/d (syn::open-nth syn::conjoin syn::open-len syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ) ( ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION TRUE-LISTP) (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE list::CONSP-APPEND) (:REWRITE list::CDR-APPEND) (:REWRITE list::APPEND-OF-NON-CONSP-ONE) (:TYPE-PRESCRIPTION SYN::CONSP-REC) SYNTAX-QUOTE-DOMINATES-P-FN TAIL-DOMINATES-P SYNTAX-QUOTE-TAIL-DOMINATES-FN DOMINATES-SAME-LEN-CHEAP )) :induct (show-syntax-tail-dominates-fn bag::a x y type-alist)) )) (defignore syntax-quote-quote-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (syntax-quote-quote-prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (syntax-quote-dominates-p x y)))) #+joe (defignore syntax-quote-alist-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type (satisfies wf-syntax-prefix) prefix)) (and (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (equal (car x) val) (syntax-quote-alist-prefixed-tail-dominator-p (cdr x) (cdr prefix) y))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) (syntax-quote-dominates-p x y)))) (defirrelevant syntax-quote-quote-prefixed-tail-dominator-p 1 bag::a (x prefix y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant)))) (defthm syntax-quote-quote-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (syntax-quote-quote-prefixed-tail-dominator-p x prefix y) (prefixed-tail-dominator-p x prefix (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defignore show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)))) (t nil))) (show-syntax-dominates-p nil x y type-alist))) (defirrelevant show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)) (syn::true))) (t nil))) (hyp-for-show-syntax-dominates-p nil x y type-alist))) (defirrelevant hyp-for-show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm show-syntax-prefixed-tail-dominator-p-to-hyp-for (iff (show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist))) (defthm pseudo-termp-hyp-for-show-syntax-prefixed-tail-dominator-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist)))) (defthm prefixed-tail-dominator-p-append (implies (and (prefixed-tail-dominator-p x y z) (equal w k)) (prefixed-tail-dominator-p (append w x) (append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) #+joe (defthm list-prefixed-tail-dominator-p-append (implies (and (list-prefixed-tail-dominator-p x y z) (equal w k)) (list-prefixed-tail-dominator-p (append w x) (map-append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) (defun len-len-len-induction (x y z) (if (and (consp x) (consp y) (consp z)) (len-len-len-induction (cdr x) (cdr y) (cdr z)) (list x y z))) ;; I don't think this helps .. (defcong list::equiv equal (prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) #+joe (defcong list::equiv equal (list-prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) bag::a)) (prefixed-tail-dominator-p (syn::eval x bag::a) (s2l prefix bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-membership-implies-prefixed-tail-dominator (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (prefixed-tail-dominator-p x pre y)) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm prefixed-tail-dominator-membership-implies-tail-dominates-p (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (tail-dominates-p x y)) :hints (("goal" :in-theory (enable list::memberp))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm list-prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (list-prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-implies-membership-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (equal (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (true-listp pre))) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-memberp (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) bag::a) (wf-syntax-prefix pre)) (list::memberp (s2l pre bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory '(true-listp-s2l show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator prefixed-tail-dominator-implies-membership-tail-dominates )))) (defun contains-prefixed-tail-dominator-p (list pre x) (declare (type t x pre list)) (if (consp list) (or (prefixed-tail-dominator-p (car list) pre x) (contains-prefixed-tail-dominator-p (cdr list) pre x)) nil)) (defthm contains-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-prefixed-tail-dominator-p list pre y) (or (prefixed-tail-dominator-p v pre y) (contains-prefixed-tail-dominator-p (bag::remove-1 v list) pre y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) #+joe (defthm not-prefixed-tail-dominator-p-remove-1-reduction (implies (not (list-prefixed-tail-dominator-p x pre y)) (equal (contains-prefixed-tail-dominator-p (bag::remove-1 x list) pre y) (contains-prefixed-tail-dominator-p list pre y))) :hints (("goal" :in-theory (enable bag::remove-1)))) #+joe (defthm membership-reduction (implies (and (list::memberp x list) (prefixed-tail-dominator-p x pre y)) (contains-prefixed-tail-dominator-p list pre y)) :hints (("goal" :in-theory (enable list::memberp)))) (defcong bag::perm equal (contains-prefixed-tail-dominator-p list pre x) 1 :hints (("goal" :induct (bag::perm list bag::list-equiv) :in-theory (enable bag::perm)) (and acl2::stable-under-simplificationp `(:cases ((list-prefixed-tail-dominator-p (car list) pre x)))))) (defthm contains-prefixed-tail-dominator-p-append-2 (implies (contains-prefixed-tail-dominator-p list pre x) (contains-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-prefixed-tail-dominator-p-append-1 (implies (contains-prefixed-tail-dominator-p z pre x) (contains-prefixed-tail-dominator-p (append z a) pre x))) (defun contains-list-prefixed-tail-dominator-p (list prefixes x) (declare (type t x prefixes list)) (if (consp list) (or (list-prefixed-tail-dominator-p (car list) prefixes x) (contains-list-prefixed-tail-dominator-p (cdr list) prefixes x)) nil)) (local (in-theory (disable LIST-PREFIXED-TAIL-DOMINATOR-P))) (defthm contains-list-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-list-prefixed-tail-dominator-p list prefixes x) (or (list-prefixed-tail-dominator-p v prefixes x) (contains-list-prefixed-tail-dominator-p (bag::remove-1 v list) prefixes x)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) (defcong bag::perm equal (contains-list-prefixed-tail-dominator-p list prefixes x) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-list-prefixed-tail-dominator-p-append-2 (implies (contains-list-prefixed-tail-dominator-p list pre x) (contains-list-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-list-prefixed-tail-dominator-p-append-1 (implies (contains-list-prefixed-tail-dominator-p z pre x) (contains-list-prefixed-tail-dominator-p (append z a) pre x))) (defthmd member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (contains-prefixed-tail-dominator-p list pre x) (list::memberp pre prefixes)) (contains-list-prefixed-tail-dominator-p list prefixes x)) :hints (("goal" :in-theory (enable list::memberp)))) (in-theory (disable NOT-CONSP-MEMBERSHIP-IMPLIES-DOMINATES MEMBERP-NOT-CONSP-PREFIXES PREFIXED-TAIL-DOMINATOR-IMPLIES-MEMBERSHIP-TAIL-DOMINATES )) (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) (declare (type (integer 0 *) n) (type (satisfies wf-syntax-prefix) pre)) (if (consp list) (let ((z (car list))) (let ((m (len z))) (or (and (< n m) (syntax-quote-quote-prefixed-tail-dominator-p z pre x)) (syntax-quote-contains-prefixed-tail-dominator (cdr list) pre n x)))) nil)) (defirrelevant syntax-quote-contains-prefixed-tail-dominator 1 bag::a (list pre n x) :hints (("goal" :in-theory (enable syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-quote-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (syntax-quote-contains-prefixed-tail-dominator list pre n x) (contains-prefixed-tail-dominator-p list pre (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG - finish this function to fix problem identified below #+joe (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) ) (defignore syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))))) (t nil))) (defirrelevant syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable show-syntax-prefixed-tail-dominator-p-irrelevant hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (hyp-for-show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-contains-prefixed-tail-dominator-to-hyp-for (iff (syntax-contains-prefixed-tail-dominator list pre n x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist))) (defthm pseudo-termp-hyp-for-syntax-contains-prefixed-tail-dominator (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist)))) (defthm syntax-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a)) (contains-prefixed-tail-dominator-p (syn::eval list bag::a) (s2l pre bag::a) (syn::eval x bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin))) :rule-classes (:rewrite :forward-chaining)) (defthm member-syntax-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a) (list::memberp (s2l pre bag::a) prefixes)) (contains-list-prefixed-tail-dominator-p (syn::eval list bag::a) prefixes (syn::eval x bag::a))) :hints (("goal" :use (:instance member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (list (syn::eval list bag::a)) (pre (s2l pre bag::a)) (x (syn::eval x bag::a)) (prefixes prefixes))))) (defund tail-dominator-body (val rest x y) (declare (type t x y)) (met ((hit prex) (tail-dominates val x)) (or (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prex) y)) (met ((hit prey) (tail-dominates val y)) (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prey) x)))))) (defthm list-prefixed-tail-dominator-p-map-cons (equal (list-prefixed-tail-dominator-p w (list::map-cons a list) y) (and (consp w) (equal (car w) a) (list-prefixed-tail-dominator-p (cdr w) list y))) :hints (("goal" :in-theory (enable LIST-PREFIXED-TAIL-DOMINATOR-P) :induct (len list)))) (defun tail-dominator-body-body (v w x y) (met ((hitx prex) (tail-dominates v x)) (met ((hity prey) (tail-dominates v y)) (or (and hitx (list-prefixed-tail-dominator-p w (prefixes prex) y)) (and hity (list-prefixed-tail-dominator-p w (prefixes prey) x)))))) (defun tail-dominator-body-rec (val rest x y) (if (consp rest) (or (tail-dominator-body-body val (car rest) x y) (tail-dominator-body-rec val (cdr rest) x y)) nil)) (defthm tail-dominator-boody-to-tail-dominator-body-rec (equal (tail-dominator-body val rest x y) (tail-dominator-body-rec val rest x y)) :hints (("goal" :in-theory (enable tail-dominator-body) :induct (len rest)))) (in-theory (disable tail-dominator-body )) (defun tail-dominator-body-body-rec (w v x y) (if (and (consp w) (consp v)) (or (and (dominates w x) (dominates v y)) (and (dominates v x) (dominates w y)) (and (equal (car w) (car v)) (tail-dominator-body-body-rec (cdr w) (cdr v) x y))) nil)) (defthm open-tail-dominates (implies (consp x) (equal (tail-dominates x y) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))))) (defthm tail-dominator-body-body-is-tail-dominator-body-body-rec (equal (tail-dominator-body-body w v x y) (tail-dominator-body-body-rec w v x y)) :hints (("Goal" :in-theory (e/d (LIST-PREFIXED-TAIL-DOMINATOR-P) ( TAIL-DOMINATES ;efficiency CONSP-PREFIXES-V1-TAIL-DOMINATES STRICTLY-DOMINATES-IMPLIES-DOMINATES ;LIST::MV-NTH-TO-VAL ;LIST-PREFIXED-TAIL-DOMINATOR-P ;TAIL-DOMINATES-P )))) ) (defthm tail-dominator-body-body-commutes-first-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec w v x y))) (defthm tail-dominator-body-body-commutes-last-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec v w y x))) (defthm tail-dominator-body-commutes-last-2 (equal (tail-dominator-body-rec val rest x y) (tail-dominator-body-rec val rest y x))) (in-theory (disable tail-dominator-body-body )) (defthm tail-dominator-body-rec-membership-reduction (implies (list::memberp v rest) (equal (tail-dominator-body-rec val rest x y) (or (tail-dominator-body-body-rec val v x y) (tail-dominator-body-rec val (bag::remove-1 v rest) x y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len rest)))) (defcong bag::perm equal (tail-dominator-body-rec val rest x y) 2 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm rest bag::rest-equiv)))) (defun contains-unique-prefixed-tail-dominators (list x y) (declare (type t list x y)) (if (consp list) (let ((rest (cdr list)) (val (car list))) (or (tail-dominator-body val rest x y) (contains-unique-prefixed-tail-dominators rest x y))) nil)) (defthm contains-unique-prefixed-tail-dominators-membership-deconstruction (implies (list::memberp v list) (equal (contains-unique-prefixed-tail-dominators list x y) (or (tail-dominator-body v (bag::remove-1 v list) x y) (contains-unique-prefixed-tail-dominators (bag::remove-1 v list) x y)))) :hints (("goal" :in-theory (enable bag::remove-1)))) (defcong bag::perm equal (contains-unique-prefixed-tail-dominators list x y) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-unique-prefixed-tail-dominators-commutes (equal (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators list y x))) (defthm contains-unique-prefixed-tail-dominators-append-1 (implies (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators (append z list) x y)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append z list)))) (defthm contains-unique-prefixed-tail-dominators-append-2 (implies (contains-unique-prefixed-tail-dominators z x y) (contains-unique-prefixed-tail-dominators (append z a) x y))) (defignore syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist)) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist)) (syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)))) (t nil))) (defirrelevant syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant syntax-contains-prefixed-tail-dominator-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (;for efficiency: SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES PREFIXED-TAIL-DOMINATOR-P TAIL-DOMINATES-P ))))) (defignore hyp-for-syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist))) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) y type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist))) (hyp-for-syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN ))))) (defthm syntax-contains-unique-prefixed-tail-dominators-to-hyp-for (iff (syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist)) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm pseudo-termp-hyp-for-syntax-contains-unique-prefixed-tail-dominators (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist))) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm syntax-contains-unique-prefixed-tail-dominators-implies-contains-unique-prefixed-tail-dominators (implies (and (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (syn::eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (contains-unique-prefixed-tail-dominators (syn::eval list bag::a) (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth TAIL-DOMINATOR-BODY) (;TAIL-DOMINATOR-BODY SYNTAX-QUOTE-DOMINATES-P-FN ;these for efficiency TAIL-DOMINATES TAIL-DOMINATES-P CONTAINS-LIST-PREFIXED-TAIL-DOMINATOR-P LIST-PREFIXED-TAIL-DOMINATOR-P HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYNTAX-QUOTE-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN SHOW-SYNTAX-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN SHOW-SYNTAX-DOMINATES-P-FN TAIL-DOMINATOR-BOODY-TO-TAIL-DOMINATOR-BODY-REC (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) (:REWRITE BAG::SUBBAGP-CDR-LEMMA) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE BAG::SUBBAGP-WHEN-CDR-IS-NON-CONSP)) )))) (defthm diverge-tail-dominator-body-body-rec-implies-diverge (implies (and (tail-dominator-body-body-rec a b x y) (diverge a b)) (diverge x y)) :hints (("goal" :induct (tail-dominator-body-body-rec a b x y)))) (defthm all-diverge-from-all-tail-dominator-body-implies-diverge (implies (and (tail-dominator-body-rec val rest x y) (diverges-from-all val rest)) (diverge x y)) :hints (("goal" :in-theory (enable diverges-from-all)))) (defthm all-diverge-from-all-contains-unique-prefixed-tail-dominators-implies-diverge (implies (and (all-diverge list) (contains-unique-prefixed-tail-dominators list x y)) (diverge x y)) :hints (("goal" :in-theory (enable all-diverge)))) (defignored show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist)) (show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (show-prefix-diverge-from-type-alist syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant ) ( ;efficiency (bzo consider making some of these disables global?) HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (defignored hyp-for-show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syn::and (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist) fact)) (hyp-for-show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-show-prefix-diverge-from-type-alist ) (;efficiency: HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (local (in-theory (disable HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN))) (defthm to-hyp-for-show-prefix-diverge-from-type-alist (iff (show-prefix-diverge-from-type-alist a b alist wlist) (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-type-alist hyp-for-show-prefix-diverge-from-type-alist)))) (defthm psedu-termp-hyp-for-show-prefix-diverge-from-type-alist (implies (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-type-alist a b type-alist whole-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-type-alist)))) (syn::extend-eval pd-eval ( (diverge x y) (dominates x y) (diverges-from-all x list) (all-diverge-from-all x y) (all-diverge x) (list::equiv x y) ;; We do this to expediate functional instantiation. ;; This should not be necessary as bag:: should use ;; the syn:: evaluator as much as possible. (bag::hide x) (bag::hide-unique list) (bag::hide-subbagp x y) (bag::hide-disjoint x y) (bag::hide-memberp a x) (bag::perm x y) (bag::unique list) (bag::if a b c) (bag::consp x) (bag::true-listp x) (bag::binary-append x y) (bag::cons a b) (bag::meta-subbagp list1 list2) (bag::remove-bag x list) (bag::meta-remove-bag x list) (bag::remove-1 x list) (bag::unique-memberps x y list) (bag::unique-subbagps x y list) (bag::subbagp-pair x1 x2 list1 list2) (bag::meta-memberp x list) (bag::any-subbagp x list) ;remove this? (list::finalcdr x) (list::fix x) (bag::subbagp x y) (list::memberp a x) ; [Changed by <NAME>. to handle changes to member, assoc, etc. after ACL2 4.2 ; (replaced member by member-equal).] (acl2::member-equal a x) (bag::disjoint x y) )) (DEFTHM PD-EVAL-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (IMPLIES (and (hyp-for-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS LIST X Y type-alist) (pd-eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (PD-EVAL LIST BAG::A) (PD-EVAL X BAG::A) (PD-EVAL Y BAG::A))) :rule-classes (:rewrite :forward-chaining) :HINTS (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (bag::A bag::A) (Y Y) (X X) (type-alist type-alist) (LIST LIST)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defthm pd-eval-show-not-equal-from-type-alist-works-right (implies (and (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) (pd-eval (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) bag::a) ) (not (equal (pd-eval x bag::a) (pd-eval y bag::a)))) :rule-classes (:forward-chaining :rewrite) :hints (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE bag::show-not-equal-from-type-alist-works-right (bag::A bag::A) (bag::Y Y) (bag::X X) (bag::N n) (bag::type-alist type-alist) (bag::whole-type-alist whole-type-alist) ) (BAG::syntax-EV PD-EVAL) (bag::syntax-ev-list PD-EVAL-LIST))))) (defthm show-prefix-diverge-from-type-alist-works (implies (and (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) (pd-eval (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) bag::a)) (diverge (pd-eval a bag::a) (pd-eval b bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth hyp-for-show-prefix-diverge-from-type-alist) ( (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN) (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN) (:DEFINITION HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN) (:REWRITE PREFIXED-TAIL-DOMINATOR-MEMBERSHIP-IMPLIES-PREFIXED-TAIL-DOMINATOR) (:DEFINITION TAIL-DOMINATES-P) (:DEFINITION TAIL-DOMINATES) ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:DEFINITION HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN) (:DEFINITION PREFIXED-TAIL-DOMINATOR-P) (:REWRITE acl2::MV-NTH-TO-VAL) (:REWRITE NOT-TAIL-DOMINATES-P-IMPLIES-NIL-PREFIX) (:REWRITE NOT-DOMINATES-FROM-DIVERGE-ONE) (:DEFINITION CONTAINS-PREFIXED-TAIL-DOMINATOR-P) (:DEFINITION HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN) (:REWRITE V0-TAIL-DOMINATES-TO-TAIL-DOMINATES-P) (:DEFINITION SHOW-SYNTAX-TAIL-DOMINATES-FN) ))))) (defthm pd-eval-syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (diverge (pd-eval t1 a) (pd-eval t2 a))) :hints (("Goal" :USE (:FUNCTIONAL-INSTANCE (:INSTANCE syntax-diverge-implies-diverge (a a) (t1 t1) (t2 t2)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defun syn::singleton (term) (declare (type t term)) (cond ((syn::consp term) (syn::null (syn::cdr term))) ((syn::quotep term) (let ((term (syn::dequote term))) (and (consp term) (not (consp (cdr term)))))) (t nil))) (defund syn::single-car (term) (declare (type (satisfies syn::singleton) term)) (if (syn::consp term) (syn::car term) (syn::enquote (car (syn::dequote term))))) (defthm pseudo-termp-single-car (implies (pseudo-termp term) (pseudo-termp (syn::single-car term))) :hints (("goal" :in-theory (enable pseudo-termp syn::single-car )))) (in-theory (disable syn::singleton )) (defignored show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant show-prefix-diverge-from-type-alist-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::hyp-for-show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (hyp-for-show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist-body (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body )))) (defthm show-prefix-diverge-from-alist-body-to-hyp-for (iff (show-prefix-diverge-from-alist-body x y type-alist) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body hyp-for-show-prefix-diverge-from-alist-body )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist-body (implies (and (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (hyp-for-show-prefix-diverge-from-alist-body bag::make-conjunction ) ( pd-eval-show-not-equal-from-type-alist-works-right )) :use (:instance pd-eval-show-not-equal-from-type-alist-works-right (x (syn::single-car x)) (y (syn::single-car y)) (n (BAG::USB16-FIX (LEN TYPE-ALIST))) (whole-type-alist type-alist) )) (and acl2::stable-under-simplificationp `(:in-theory (e/d ( syn::single-car syn::singleton diverge ) (pd-eval-show-not-equal-from-type-alist-works-right )))))) (defthmd syntax-quote-remove-common-prefix-pd-eval-diverge (implies (diverge (v0 (syntax-quote-remove-common-prefix x y)) (pd-eval (v1 (syntax-quote-remove-common-prefix x y)) bag::a)) (diverge x (pd-eval y bag::a)))) (defthmd syntax-remove-common-prefix-pd-eval-diverge (implies (diverge (pd-eval (v0 (syntax-remove-common-prefix x y)) bag::a) (pd-eval (v1 (syntax-remove-common-prefix x y)) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::open-nth syntax-quote-remove-common-prefix-pd-eval-diverge) (;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION WF-SYNTAX-PREFIX) (:DEFINITION TRUE-LISTP) (:REWRITE PD-EVAL-SYNTAX-DIVERGE-IMPLIES-EVAL-COMMUTE) (:DEFINITION SYNTAX-DIVERGE)))))) (defignored show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (show-prefix-diverge-from-alist-body x y type-alist))) (defirrelevant show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist show-prefix-diverge-from-alist-body-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) (defthm show-prefix-diverge-from-alist-to-hyp-for (iff (show-prefix-diverge-from-alist x y type-alist) (hyp-for-show-prefix-diverge-from-alist x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist )))) (defirrelevant hyp-for-show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist-body-irrelevant )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist (implies (and (hyp-for-show-prefix-diverge-from-alist x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-remove-common-prefix-pd-eval-diverge hyp-for-show-prefix-diverge-from-alist )))) (set-state-ok t) (defun show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((zed #+joe(and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc(~x0,~x1)?~%" x y)) nil)) (declare (ignore zed)) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-prefix-diverge-from-alist-fn nil x y type-alist) (acl2::prog2$ #+joe (and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc!~%")) nil (syn::true)) term)))) term)) (defun hyp-for-show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc state)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-prefix-diverge-from-alist-fn nil x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))) (syn::nil))) (defthm meta-rule-to-show-prefix-diverge (implies (pd-eval (hyp-for-show-prefix-diverge-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-prefix-diverge-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (diverge) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin hyp-for-show-prefix-diverge-from-alist-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (encapsulate () (local (encapsulate () (in-theory (disable all-diverge )) (defthm test1 (implies (all-diverge `((a b ,c d ,e) (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) (defthm test2 (implies (all-diverge `((a b ,c d ,e) ,z (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) ))) (defun show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-syntax-dominates-p-fn nil t x y type-alist) (syn::true) (if (show-syntax-dominates-p-fn nil t y x type-alist) `(if (list::equiv ,y ,x) ,(syn::true) ,(syn::nil)) term)))) term)) (defun hyp-for-show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t y x type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))))) (syn::nil))) (defthm pd-eval-syntax-domination-implies-domination (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :use (:functional-instance syntax-domination-implies-domination-helper (syn::eval pd-eval) (syn::eval-list pd-eval-list))))) (defthmd non-domination-from-not-equal-dominates (implies (and (dominates x y) (not (list::equiv x y))) (not (dominates y x))) :hints (("goal" :in-theory (enable dominates )))) (defthm meta-rule-to-show-prefix-domination (implies (pd-eval (hyp-for-show-domination-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-domination-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (dominates) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin non-domination-from-not-equal-dominates hyp-for-show-syntax-dominates-p-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (defun all-diverge-remove-prefix (paths) (if (not (syn::consp paths)) paths (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths))))) (defthm all-diverge-remove-prefix-open (implies (syn::consp paths) (equal (all-diverge-remove-prefix paths) (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths)))))) (defun all-diverge-prefix-meta-fn (term) (if (and (syn::consp term) (syn::consp (syn::cdr term)) (equal 'all-diverge (car term))) (if (syn-prefix-p (syn::cdr term)) (let ((pruned (all-diverge-remove-prefix (syn::cdr term)))) (list 'all-diverge pruned)) term) term)) (defthm not-syn-consp-all-diverge-prefix-meta-fn (implies (not (syn::consp term)) (equal (all-diverge-prefix-meta-fn term) term))) (defun syntax-dominates (p1 p2) (if (syn::consp p1) (and (syn::consp p2) (equal (syn::car p1) (syn::car p2)) (syntax-dominates (syn::cdr p1) (syn::cdr p2))) t)) #+joe ;; better definition later (defun syntax-dominated-by-some (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) t (syntax-dominated-by-some p (syn::cdr paths))) nil)) (defun remove-dominator (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) (syn::cdr paths) (syn::cons (syn::car paths) (remove-dominator p (syn::cdr paths)))) paths)) (syn::defevaluator meta-all-diverge-prefix-ev meta-all-diverge-prefix-ev-list ( (len x) (syn-prefix-p x) (cdr x) (if a b c) (all-diverge-remove-prefix x) (all-diverge-prefix-meta-fn x) (consp x) (cons x y) (equal x y) (path::diverge a b) (path::all-diverge x) (path::all-diverge-from-all x y) (car x) ;(cadr x) (syn::car x) (syn::cons x y) (syn::cdr x) (syn::consp x) (syntax-dominates p1 p2) ;(syntax-dominated-by-some p paths) (remove-dominator p paths) ;(show-mapping-from-type-alist a b) ;(all-diverge-mapping-from-type-alist a l) ;(all-diverge-mapping-from-mfc t m state) )) (defthm meta-all-diverge-prefix (equal (meta-all-diverge-prefix-ev term alist) (meta-all-diverge-prefix-ev (all-diverge-prefix-meta-fn term) alist)) :rule-classes ((:meta :trigger-fns (all-diverge))) :hints (("Goal" :do-not '(generalize eliminate-destructors) :induct (all-diverge-remove-prefix term)) ("Subgoal *1/1" :in-theory (disable all-diverge-prefix-meta-fn))) :otf-flg t) (in-theory (disable (:rewrite wf-syntax-prefix-implies-true-listp) (:definition wf-syntax-prefix)))
true
#|-*-Lisp-*-=================================================================|# #| |# #| coi: Computational Object Inference |# #| |# #|===========================================================================|# (in-package "PATH") (include-book "../lists/basic") (include-book "../lists/map-cons") (include-book "../syntax/syntax") (include-book "../util/mv-nth") (local (include-book "../util/iff")) ;; jcd - changing this to path, speeds things up a lot (~100 seconds) and ;; separates paths from graphs. (include-book "path") ;; jcd - moved to :lists/map-cons ;; (defun map-cons (a list) ;; (declare (type t a list)) ;; (if (consp list) ;; (cons (cons a (car list)) ;; (map-cons a (cdr list))) ;; nil)) ;; jcd - moved to :lists/basic ;; (defun appendx (x y) ;; (declare (type t x y)) ;; (if (consp x) ;; (cons (car x) (appendx (cdr x) y)) ;; y)) ;; jcd - we use mbe now, no need for this rule ;; (defthm appendx-is-append ;; (equal (appendx x y) ;; (append x y))) ; 1.36 12.00 ; CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-MEMBERSHIP-DECONSTRUCTION ;jcd Trying this. -ews (local (in-theory (disable not-dominates-from-diverge-one not-dominates-from-diverge-two))) ;; Normalization: assume that (append (cons a b) list) = (cons a (append b list)) ;; (for quoted (cons a b) terms, too) (in-theory (disable LENS-<-WHEN-DOMINATES-BUT-NOT-CONG NOT-DOMINATES-FROM-<-OF-LEN-AND-LEN DOMINATES-WHEN-LENS-EQUAL ;; jcd - Cheapened this, going to try leaving it enabled ;; DOMINATES-WHEN-NOT-DIVERGE-AND-NOT-DOMINATES DOMINATES-ASYMMETRIC DOMINATES-TRANSITIVE-TWO dominates-means-not-diverge dominates-means-not-diverge-alt )) (in-theory (enable BAG::APPEND-COMMUTATIVE-INSIDE-PERM )) (local (in-theory (disable syn::open-len))) (defun syn::ts-consp (term fact) (declare (type (satisfies acl2::type-alist-entryp) fact) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alist-entryp))))) (let ((ts (cadr fact)) (tsterm (car fact))) (and (or (not (= (logand ts acl2::*ts-proper-cons*) acl2::*ts-empty*)) (not (= (logand ts acl2::*ts-improper-cons*) acl2::*ts-empty*))) (equal term tsterm)))) (defun sudo-len (term) (declare (type t term)) (if (syn::consp term) (1+ (sudo-len (syn::cdr term))) (if (syn::appendp term) (1+ (sudo-len (syn::arg 2 term))) (if (syn::quotep term) 1 0)))) (defthm integerp-sudo-len (integerp (sudo-len term)) :rule-classes (:rewrite :type-prescription)) (defthm sudo-len-linear (<= 0 (sudo-len ter)) :rule-classes (:linear)) (defun equal-len (path1 path2) (declare (type t path1 path2)) (cond ((and (syn::quotep path1) (syn::quotep path2)) (equal (len (syn::dequote path1)) (len (syn::dequote path2)))) ((and (syn::consp path1) (syn::consp path2)) (equal-len (syn::cdr path1) (syn::cdr path2))) ((and (syn::appendp path1) (syn::appendp path2)) (and (equal-len (syn::arg 1 path1) (syn::arg 1 path2)) (equal-len (syn::arg 2 path1) (syn::arg 2 path2)))) (t (equal path1 path2)))) (defthm equal-len-identity (equal-len x x)) (defun syntax-quote-diverge (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (or (and (syn::quotep v) (not (equal (car path1) (syn::dequote v))) (syn::true)) (syntax-quote-diverge (cdr path1) (syn::cdr path2))))) ((syn::quotep path2) (and (diverge path1 (syn::dequote path2)) (syn::true))) (t nil)) nil)) (defthm syntax-quote-diverge-implies-quote-true (implies (syntax-quote-diverge path1 path2) (equal (syntax-quote-diverge path1 path2) (syn::true)))) (defthm syntax-quote-diverge-implies-diverge (implies (syntax-quote-diverge x1 t2) (diverge x1 (syn::eval t2 a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (defun syntax-diverge (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (syntax-quote-diverge (syn::dequote path1) path2)) ((syn::quotep path2) (syntax-quote-diverge (syn::dequote path2) path1)) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (and (syn::quotep car1) (syn::quotep car2) (not (equal (syn::dequote car1) (syn::dequote car2)))) (syn::true) (syntax-diverge (syn::cdr path1) (syn::cdr path2))))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (and (equal arg11 arg12) (syntax-diverge (syn::arg 2 path1) (syn::arg 2 path2))))) (t nil))) (defthm syntax-diverge-implies-diverge (implies (syntax-diverge t1 t2) (diverge (syn::eval t1 a) (syn::eval t2 a))) :hints (("goal" :in-theory (enable syn::open-nth diverge-append-len-equal)))) (defun remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (and (consp path1) (consp path2)) (if (equal (car path1) (car path2)) (remove-common-prefix (cdr path1) (cdr path2)) (mv path1 path2)) (mv nil nil))) (defthm remove-common-prefix-identity (and (equal (v0 (remove-common-prefix x x)) nil) (equal (v1 (remove-common-prefix x x)) nil))) (defun syntax-quote-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (if (consp path1) (cond ((syn::consp path2) (let ((v (syn::car path2))) (if (and (syn::quotep v) (equal (car path1) (syn::dequote v))) (syntax-quote-remove-common-prefix (cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((syn::quotep path2) (met ((path1 path2) (remove-common-prefix path1 (syn::dequote path2))) (mv path1 (syn::enquote path2)))) (t (mv path1 path2))) (mv path1 path2))) (defthm pseudo-termp-syntax-quote-remove-common-prefix (implies (and (pseudo-termp y)) (pseudo-termp (v1 (syntax-quote-remove-common-prefix x y)))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthm diverge-remove-common-prefix-noop (equal (diverge (v0 (remove-common-prefix t1 t2)) (v1 (remove-common-prefix t1 t2))) (diverge t1 t2))) (defthm syntax-quote-diverge-syntax-quote-remove-common-prefix-noop (equal (syntax-quote-diverge (v0 (syntax-quote-remove-common-prefix t1 t2)) (v1 (syntax-quote-remove-common-prefix t1 t2))) (syntax-quote-diverge t1 t2))) (defun syntax-remove-common-prefix (path1 path2) (declare (type t path1 path2)) (cond ((syn::quotep path1) (met ((path1 path2) (syntax-quote-remove-common-prefix (syn::dequote path1) path2)) (mv (syn::enquote path1) path2))) ((syn::quotep path2) (met ((path2 path1) (syntax-quote-remove-common-prefix (syn::dequote path2) path1)) (mv path1 (syn::enquote path2)))) ((and (syn::consp path1) (syn::consp path2)) (let ((car1 (syn::car path1)) (car2 (syn::car path2))) (if (equal car1 car2) (syntax-remove-common-prefix (syn::cdr path1) (syn::cdr path2)) (mv path1 path2)))) ((and (syn::appendp path1) (syn::appendp path2)) (let ((arg11 (syn::arg 1 path1)) (arg12 (syn::arg 1 path2))) (if (equal arg11 arg12) (syntax-remove-common-prefix (syn::arg 2 path1) (syn::arg 2 path2)) (mv path1 path2)))) ((equal path1 path2) (mv (syn::nil) (syn::nil))) (t (mv path1 path2)))) (defthm pseudo-termp-syntax-remove-common-prefix (implies (and (pseudo-termp x) (pseudo-termp y)) (and (pseudo-termp (v0 (syntax-remove-common-prefix x y))) (pseudo-termp (v1 (syntax-remove-common-prefix x y))))) :hints (("goal" :in-theory (enable pseudo-termp)))) (defthmd syntax-diverge-commute (equal (syntax-diverge x y) (syntax-diverge y x)) :rule-classes ((:rewrite :loop-stopper ((y x))))) (defthm syntax-diverge-syntax-remove-common-prefix-noop (equal (syntax-diverge (v0 (syntax-remove-common-prefix t1 t0)) (v1 (syntax-remove-common-prefix t1 t0))) (syntax-diverge t1 t0)) :hints (("goal" :in-theory (e/d (syntax-diverge-commute) (;for efficiency: SYN::OPEN-LEN SYNTAX-QUOTE-DIVERGE))))) (defun syntax-diverge-wrapper (term) (declare (type t term)) (if (syn::funcall 'diverge 2 term) (let ((arg1 (syn::arg 1 term)) (arg2 (syn::arg 2 term))) (met ((arg1 arg2) (syntax-remove-common-prefix arg1 arg2)) (let ((hit (syntax-diverge arg1 arg2))) (if hit hit term)))) term)) (defthm equal-len-implies-equal-len (implies (equal-len t1 t2) (iff (equal (len (syn::eval t1 a)) (len (syn::eval t2 a))) t)) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (syn::eval t1 a) (syn::eval t2 a)) (syn::eval (syntax-diverge t1 t2) a))) :hints (("goal" :in-theory (enable diverge-append-len-equal)))) (syn::extend-eval diverge-eval ( (diverge x y) )) (syn::defevthm diverge-eval syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (equal (diverge (diverge-eval t1 a) (diverge-eval t2 a)) (diverge-eval (syntax-diverge t1 t2) a)))) (defthmd *meta*-syntax-diverge (iff (diverge-eval term a) (diverge-eval (syntax-diverge-wrapper term) a)) :hints (("goal" :in-theory (enable syn::open-nth))) :rule-classes ((:meta :trigger-fns (diverge)))) ;; Syntactic tail domination .. (defun true-p (x) (declare (type t x) (ignore x)) t) (defun remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (remove-prefix (cdr prefix) (cdr x)) (mv nil nil)) (mv t x))) (defun v0-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v0-remove-prefix (cdr prefix) (cdr x)) nil) t)) (defun v1-remove-prefix (prefix x) (declare (type t prefix x)) (if (consp prefix) (if (and (consp x) (equal (car prefix) (car x))) (v1-remove-prefix (cdr prefix) (cdr x)) nil) x)) (defthm v0-remove-prefix-reduction (equal (v0 (remove-prefix prefix x)) (v0-remove-prefix prefix x))) (defcong list::equiv equal (v0-remove-prefix prefix x) 2) (defthm v1-remove-prefix-reduction (equal (v1 (remove-prefix prefix x)) (v1-remove-prefix prefix x))) (defcong list::equiv list::equiv (v1-remove-prefix prefix x) 2) (defthm list-fix-v1-remove-prefix (equal (list::fix (v1-remove-prefix prefix x)) (v1-remove-prefix prefix (list::fix x)))) (defthm v0-remove-prefix-append (equal (v0-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v0-remove-prefix y (v1-remove-prefix x z))))) (defthm v1-remove-prefix-append (equal (v1-remove-prefix (append x y) z) (and (v0-remove-prefix x z) (v1-remove-prefix y (v1-remove-prefix x z))))) (defthm not-v0-implies-nil-v1-remove-prefix (implies (not (v0-remove-prefix x y)) (equal (v1-remove-prefix x y) nil))) #| (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) (mv nil nil)))) ((syn::quotep x) (remove-prefix prefix (syn::dequote x))) (t (mv nil nil))) (mv (syn::null x) nil))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v0-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v0-remove-prefix prefix (syn::dequote x))) (t nil)) (syn::null x))) (defirrelevant v0-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (if (consp prefix) (cond ((syn::consp x) (let ((v (syn::car x))) (if (and (syn::quotep v) (equal (car pefix) (syn::dequote v))) (v1-syntax-quote-x-remove-prefix (cdr prefix) (syn::cdr x)) nil))) ((syn::quotep x) (v1-remove-prefix prefix (syn::dequote x))) (t nil)) nil)) (defirrelevant v1-syntax-quote-remove-prefix 2 bag::a (px prefix x) ) (defthm v0-to-v0-syntax-quote-remove-prefix (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-to-v1-syntax-quote-remove-prefix (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defcong list::equiv equal (v0-syntax-remove-prefix prefix x) 2) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix prefix x) 2) (defthm list-fix-v1-syntax-quote-remove-prefix (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x)))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix x y)) (equal (v1-syntax-quote-remove-prefix x y) nil))) #+joe (defignore syntax-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (if (and (syn::consp x) (equal (syn::car prefix) (syn::car x))) (syntax-remove-prefix (syn::cdr prefix) (syn::cdr x)) (mv nil nil))) ((syn::appendp prefix) (if (and (syn::appendp x) (equal (syn::arg 1 prefix) (syn::arg 1 x))) (syntax-remove-prefix (syn::arg 2 prefix) (syn::arg 2 x)) (mv nil nil))) ((syn::quotep prefix) (syntax-quote-remmove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) |# (defun tail-p (x y) (declare (type t x y)) (or (list::equiv x y) (and (consp y) (tail-p x (cdr y))))) (defthm v1-remove-prefix-is-tail-x (implies (v0-remove-prefix prefix x) (tail-p (v1-remove-prefix prefix x) x))) (defthm tail-p-implies (implies (tail-p x y) (<= (len x) (len y))) :rule-classes (:linear :rewrite)) #+joe (defignore syntax-alist-quote-remove-prefix bag::a (prefix x) (if (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (if (equal (car x) val) (syntax-alist-quote-remove-prefix prefix x) (mv nil nil))) (:append (met ((hit rest) (syntax- (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) x) nil)))) #| ;; DAG - I have removed this line of thinking. It just doesn't make any sense ;; .. if x is a quoted constant, then the prefix would have to be quoted as ;; well. (defignore syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) (mv nil nil)))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) (mv nil nil) (syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (remove-prefix (syn::dequote prefix) x)) (t (mv nil nil)))) (defirrelevant syntax-quote-remove-prefix 2 bag::a (prefix x) ) (defthmd list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1 (syntax-quote-remove-prefix prefix x))) (v1 (syntax-quote-remove-prefix prefix (list::fix x)))) (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0 (syntax-quote-remove-prefix prefix (list::fix x))) )))) (defignore v0-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v0-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v0-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v0-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v0-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defignore v1-syntax-quote-remove-prefix bag::a (prefix x) (declare (type t prefix x)) (cond ((syn::consp prefix) (let ((v (syn::car prefix))) (if (and (syn::quotep v) (consp x) (equal (car x) (syn::dequote v))) (v1-syntax-quote-remove-prefix (syn::cdr prefix) (cdr x)) nil))) ((syn::appendp prefix) (met ((hit rest) (syntax-quote-remove-prefix (syn::arg 1 prefix) x)) (if (not hit) nil (v1-syntax-quote-remove-prefix (syn::arg 2 prefix) rest)))) ((syn::quotep prefix) (v1-remove-prefix (syn::dequote prefix) x)) (t nil))) (defirrelevant v1-syntax-quote-remove-prefix 1 bag::a (prefix x) :hints (("goal" :in-theory (enable syntax-quote-remove-prefix-irrelevant)))) (defthm v0-syntax-quote-remove-prefix-reduction (equal (v0 (syntax-quote-remove-prefix prefix x)) (v0-syntax-quote-remove-prefix prefix x))) (defthm v1-syntax-quote-remove-prefix-reduction (equal (v1 (syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix x))) (defthmd vx-list-fix-commutes-over-syntax-quote-remove-prefix (implies (syntaxp (symbolp x)) (and (equal (list::fix (v1-syntax-quote-remove-prefix prefix x)) (v1-syntax-quote-remove-prefix prefix (list::fix x))) (equal (v0-syntax-quote-remove-prefix prefix x) (v0-syntax-quote-remove-prefix prefix (list::fix x))))) :hints (("goal" :use (:instance list-fix-commutes-over-syntax-quote-remove-prefix)))) (defcong list::equiv list::equiv (v1-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defcong list::equiv equal (v0-syntax-quote-remove-prefix-fn a prefix x) 3 :hints (("goal" :in-theory '(list::equiv vx-list-fix-commutes-over-syntax-quote-remove-prefix )))) (defthm not-v0-implies-nil-v1-syntax-quote-remove-prefix (implies (not (v0-syntax-quote-remove-prefix prefix x)) (equal (v1-syntax-quote-remove-prefix prefix x) nil))) (defthm v0-syntax-quote-remove-prefix-implies-v2-cong (implies (v0-syntax-quote-remove-prefix prefix x) (and (list::equiv (v1-syntax-quote-remove-prefix prefix x) (v1-remove-prefix (syn::eval prefix bag::a) x)) (v0-remove-prefix (syn::eval prefix bag::a) x))) :hints (("goal" :induct (syntax-quote-remove-prefix prefix x)))) #+joe (defignore syntax-remove-term (term x) ..) #+joe (defignore syntax-remove-prefix (prefix x) ) |# (defignore syntax-quote-dominates-p bag::a (x y) (declare (type t x y) (xargs :measure (acl2-count y))) (if (consp x) (cond ((syn::consp y) (let ((v (syn::car y))) (and (syn::quotep v) (equal (car x) (syn::dequote v)) (syntax-quote-dominates-p (cdr x) (syn::cdr y))))) #+joe ((syn::appendp y) (met ((hit rest) (syntax-quote-remove-prefix x (syn::arg 1 y) x)) (and hit (syntax-quote-dominates-p rest (syn::arg 2 y))))) ((syn::quotep y) (dominates x (syn::dequote y))) (t nil)) t)) (defirrelevant syntax-quote-dominates-p 1 bag::a (x y) :hints (("goal" :in-theory (enable ;v0-syntax-quote-remove-prefix-irrelevant ;v1-syntax-quote-remove-prefix-irrelevant )))) (defthmd dominates-append-2 (equal (dominates x (append y z)) (or (dominates x y) (and (v0-remove-prefix y x) (dominates (v1-remove-prefix y x) z)))) :hints (("goal" :in-theory (enable dominates)))) (defthm syntax-quote-dominates-implies-dominates (implies (syntax-quote-dominates-p x y) (dominates x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable dominates dominates-append-2)))) (defignore show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (syn::ts-consp term entry) (show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defignore hyp-for-show-syntax-consp-from-alist bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist) (xargs :guard-hints (("goal" :in-theory (enable acl2::type-alistp))))) (if (endp type-alist) nil (let ((entry (car type-alist))) (or (and (syn::ts-consp term entry) `(consp ,term)) (hyp-for-show-syntax-consp-from-alist term (cdr type-alist)))))) (defirrelevant hyp-for-show-syntax-consp-from-alist 1 bag::a (term type-alist) ) (defthm pseudo-termp-hyp-for-show-syntax-consp-from-alist (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp-from-alist term type-alist)))) (defthm show-syntax-consp-from-alist-to-hyp-for (iff (show-syntax-consp-from-alist term type-alist) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defthm show-syntax-consp-from-alist-works (implies (and (hyp-for-show-syntax-consp-from-alist x type-alist) (syn::eval (hyp-for-show-syntax-consp-from-alist x type-alist) bag::a)) (consp (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG -- This could be improved by checking each append term for ;; consp. (defignored show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (or (syn::consp-rec term) (show-syntax-consp-from-alist term type-alist))) (defirrelevant show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defignored hyp-for-show-syntax-consp bag::a (term type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (if (syn::consp-rec term) (syn::true) (hyp-for-show-syntax-consp-from-alist term type-alist))) (defirrelevant hyp-for-show-syntax-consp 1 bag::a (term type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp hyp-for-show-syntax-consp-from-alist-irrelevant )))) (defthm show-syntax-consp-to-hyp-for (iff (show-syntax-consp term type-alist) (hyp-for-show-syntax-consp term type-alist)) :hints (("goal" :in-theory (enable show-syntax-consp hyp-for-show-syntax-consp )))) (defthm pseudo-termp-hyp-for-show-syntax-consp (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-consp term type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defthm show-syntax-consp-works (implies (and (hyp-for-show-syntax-consp term type-alist) (syn::eval (hyp-for-show-syntax-consp term type-alist) bag::a)) (consp (syn::eval term bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp )))) (defignore show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (show-syntax-dominates-p (or flg (show-syntax-consp (syn::arg 1 x) type-alist)) (syn::arg 2 x) (syn::arg 2 y) type-alist))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or flg (show-syntax-consp x type-alist)))) (t (and (equal x y) (or flg (show-syntax-consp x type-alist)))))) (defcong iff iff (show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-dominates-p bag::a (flg x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (and (syn::consp y) (equal (syn::car x) (syn::car y)) (hyp-for-show-syntax-dominates-p t (syn::cdr x) (syn::cdr y) type-alist))) ((syn::appendp x) (and (syn::appendp y) (equal (syn::arg 1 x) (syn::arg 1 y)) (let ((hyp (if flg (syn::true) (hyp-for-show-syntax-consp (syn::arg 1 x) type-alist)))) (if hyp (syn::and hyp (hyp-for-show-syntax-dominates-p t (syn::arg 2 x) (syn::arg 2 y) type-alist)) (hyp-for-show-syntax-dominates-p nil (syn::arg 2 x) (syn::arg 2 y) type-alist))))) ((syn::quotep x) (let ((x (syn::dequote x))) (and (or flg (consp x)) (syntax-quote-dominates-p x y) (syn::true)))) ((syn::appendp y) (and (equal x (syn::arg 1 y)) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))) (t (and (equal x y) (or (and flg (syn::true)) (hyp-for-show-syntax-consp x type-alist)))))) (defcong iff iff (hyp-for-show-syntax-dominates-p-fn a flg x y type-alist) 2) (defirrelevant hyp-for-show-syntax-dominates-p 1 bag::a (flg x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-consp-irrelevant syntax-quote-dominates-p-irrelevant )))) (defthm show-syntax-dominates-p-to-hyp-for (iff (show-syntax-dominates-p flg x y type-alist) (hyp-for-show-syntax-dominates-p flg x y type-alist)) :hints (("goal" :induct (hyp-for-show-syntax-dominates-p-fn bag::a flg x y type-alist)))) (defthm pseudo-termp-hyp-for-show-syntax-dominates-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-dominates-p flg x y type-alist))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defun contains (symbol term) (declare (type t symbol term)) (if (consp term) (if (consp (car term)) (or (contains symbol (car term)) (contains symbol (cdr term))) (or (equal symbol (car term)) (contains symbol (cdr term)))) (equal symbol term))) (defthmd syntax-domination-implies-domination (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syntaxp (contains 'syn::eval logical-x)) (equal (syn::eval x bag::a) logical-x)) (dominates logical-x (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth)))) (defthm syntax-domination-implies-domination-helper (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-domination)))) (defthmd syntax-domination-implies-consp (implies (and (hyp-for-show-syntax-dominates-p flg x y type-alist) (syn::eval (hyp-for-show-syntax-dominates-p flg x y type-alist) bag::a) (syntaxp (contains 'syn::eval logical-x)) (not flg) (equal logical-x (syn::eval x bag::a))) (consp logical-x)) :hints (("goal" :in-theory (enable SYN::CONJOIN syn::open-nth)))) (defun tail-dominates-p (x y) (declare (type t x y)) (cond ((consp x) (or (dominates x y) (tail-dominates-p (cdr x) y))) (t nil))) (defun tail-dominates (x y) (declare (type t x y)) (cond ((consp x) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))) (t (mv nil nil)))) (defthm booleanp-v0-tail-dominates (booleanp (v0 (tail-dominates x y)))) (defmacro wf-prefix (prefix) `(alistp ,prefix)) (defthm wf-prefix-v1-tail-dominates (wf-prefix (v1 (tail-dominates val v)))) (defthm v0-tail-dominates-to-tail-dominates-p (equal (v0 (tail-dominates x y)) (tail-dominates-p x y))) (defun prefixes (prefix) (declare (type (satisfies alistp) prefix)) (if (consp prefix) (let ((list (list::map-cons (cdar prefix) (prefixes (cdr prefix))))) (if (caar prefix) (cons nil list) list)) nil)) ;; jcd removing this for list::map-cons ;; (defthm non-consp-memberp-map-cons ;; (implies ;; (not (consp x)) ;; (not (list::memberp x (map-cons a z))))) (defthm consp-prefixes-v1-tail-dominates (implies (v0 (tail-dominates x y)) (consp (prefixes (v1 (tail-dominates x y)))))) (defun true-listp-list (list) (declare (type t list)) (if (consp list) (and (true-listp (car list)) (true-listp-list (cdr list))) (null list))) (defthm true-listp-car-true-listp-list (implies (true-listp-list list) (true-listp (car list)))) (defthm true-listp-list-prefixes (true-listp-list (prefixes list))) (defun prefixed-tail-dominator-p (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (dominates x y)))) (defthm not-consp-y-not-prefixed-tail-dominator-p (implies (not (consp y)) (not (prefixed-tail-dominator-p x prefix y)))) (defun list-prefixed-tail-dominator-p (x prefixes y) (declare (type t x prefixes y)) (if (consp prefixes) (or (prefixed-tail-dominator-p x (car prefixes) y) (list-prefixed-tail-dominator-p x (cdr prefixes) y)) nil)) (defthm not-consp-y-not-list-prefixed-tail-dominator-p (implies (not (consp y)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm not-consp-x-not-list-prefixed-tail-dominator-p (implies (not (consp x)) (not (list-prefixed-tail-dominator-p x prefix y)))) (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-p (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list-prefixed-tail-dominator-p x prefixes y))) #+joe (defthm list-prefixed-tail-dominator-p-from-memberp-prefixed-tail-dominator-membership (implies (and (prefixed-tail-dominator-p x prefix y) (list::memberp prefix prefixes)) (list::memberp prefix (list-prefixed-tail-dominator-p x prefixes y)))) (defthm prefixed-tail-dominator-p-implies-len (implies (prefixed-tail-dominator-p x prefix y) (< (len prefix) (len x))) :rule-classes (:forward-chaining)) (defthm consp-dominates-implies-tail-dominates-p (implies (and (consp x) (dominates x y)) (tail-dominates-p x y))) (defthm not-consp-not-tail-dominates-p (implies (not (consp y)) (not (tail-dominates-p x y)))) (defthm not-tail-dominates-p-implies-nil-prefix (implies (not (tail-dominates-p x y)) (equal (v1 (tail-dominates x y)) nil))) (defthm tail-dominates-append (implies (tail-dominates-p x z) (tail-dominates-p (append y x) z)) :hints (("goal" :in-theory (enable binary-append) :induct (append y x)))) (defun wf-syntax-prefix (prefix) (declare (type t prefix)) (if (consp prefix) (let ((entry (car prefix))) (and (consp entry) (case (car entry) (:cons (wf-syntax-prefix (cdr prefix))) (:append (wf-syntax-prefix (cdr prefix))) (:quote (and (null (cdr prefix)) (true-listp (cdr entry)))) (t nil)))) (null prefix))) (defthm wf-syntax-prefix-implies-true-listp (implies (wf-syntax-prefix prefix) (true-listp prefix)) :rule-classes (:rewrite :forward-chaining)) (defun s2l (prefix a) (declare (type (satisfies wf-syntax-prefix) prefix)) (if (consp prefix) (let ((entry (car prefix))) (case (car entry) (:cons (cons (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:append (list::appendx (syn::eval (cdr entry) a) (s2l (cdr prefix) a))) (:quote (cdr entry)) (t nil))) nil)) (defthm true-listp-s2l (implies (wf-syntax-prefix pre) (true-listp (s2l pre a)))) (defignore syntax-quote-tail-dominates bag::a (x y) (declare (type t x y)) (if (consp x) (if (syntax-quote-dominates-p x y) (mv t nil) (met ((hit prefix) (syntax-quote-tail-dominates (cdr x) y)) (if hit (mv t (cons (cons :cons (syn::enquote (car x))) prefix)) (mv nil nil)))) (mv nil nil))) (defirrelevant syntax-quote-tail-dominates 1 bag::a (x y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant )))) (defthm wf-syntax-prefix-syntax-quote-tail-dominates (wf-syntax-prefix (v1 (syntax-quote-tail-dominates x y)))) (defthm syntax-quote-tail-dominates-implies-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (tail-dominates-p x (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthmd not-consp-membership-implies-dominates (implies (and (not (consp pre)) (list::memberp pre (prefixes (v1 (tail-dominates x y))))) (dominates x y))) ;; jcd removing this for list::map-cons ;; (defthm memberp-x-map-cons ;; (equal (list::memberp x (map-cons a y)) ;; (and (consp x) ;; (equal (car x) a) ;; (list::memberp (cdr x) y)))) (defthmd memberp-not-consp-prefixes (implies (not (consp pre)) (equal (list::memberp pre (prefixes (val 1 (tail-dominates x y)))) (and (null pre) (consp x) (dominates x y)))) :hints (("goal" :in-theory (enable list::memberp not-consp-membership-implies-dominates) :expand (tail-dominates x y)))) (defthm s2l-membership-in-syntax-quote-tail-dominates (implies (v0 (syntax-quote-tail-dominates x y)) (list::memberp (s2l (v1 (syntax-quote-tail-dominates x y)) bag::a) (prefixes (v1 (tail-dominates x (syn::eval y bag::a)))))) :hints (("goal" :induct (syntax-quote-tail-dominates-fn bag::a x y)) (and acl2::stable-under-simplificationp `(:in-theory (enable memberp-not-consp-prefixes syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ))))) (defignore show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (if (show-syntax-dominates-p t x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::cdr x) y type-alist)) (if hit (mv t (cons (cons :cons (syn::car x)) prefix)) (mv nil nil))))) ((syn::appendp x) (if (show-syntax-dominates-p nil x y type-alist) (mv t nil) (met ((hit prefix) (show-syntax-tail-dominates (syn::arg 2 x) y type-alist)) (if hit (mv t (cons (cons :append (syn::arg 1 x)) prefix)) (mv nil nil))))) ((syn::quotep x) (if (syn::quotep y) (met ((hit prefix) (tail-dominates (syn::dequote x) (syn::dequote y))) (if hit (mv t (list (cons :quote (car (prefixes prefix))))) (mv nil nil))) (syntax-quote-tail-dominates (syn::dequote x) y))) (t (mv (show-syntax-dominates-p nil x y type-alist) nil)))) (defirrelevant show-syntax-tail-dominates 2 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defignore hyp-for-show-syntax-tail-dominates bag::a (x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp x) (or (hyp-for-show-syntax-dominates-p t x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::cdr x) y type-alist))) ((syn::appendp x) (or (hyp-for-show-syntax-dominates-p nil x y type-alist) (hyp-for-show-syntax-tail-dominates (syn::arg 2 x) y type-alist))) ((syn::quotep x) (if (syn::quotep y) (and (tail-dominates-p (syn::dequote x) (syn::dequote y)) (syn::true)) (met ((hit rest) (syntax-quote-tail-dominates (syn::dequote x) y)) (declare (ignore rest)) (and hit (syn::true))))) (t (hyp-for-show-syntax-dominates-p nil x y type-alist)))) (defirrelevant hyp-for-show-syntax-tail-dominates 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable syntax-quote-tail-dominates-irrelevant hyp-for-show-syntax-dominates-p-irrelevant )))) (defthm show-syntax-tail-dominates-to-hyp-for (iff (v0 (show-syntax-tail-dominates x y type-alist)) (hyp-for-show-syntax-tail-dominates x y type-alist))) (defthm pseduo-termp-hyp-for-show-syntax-tail-dominates (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-tail-dominates x y type-alist)))) (defthm wf-syntax-prefix-show-syntax-tail-dominates (wf-syntax-prefix (v1 (show-syntax-tail-dominates x y type-alist)))) #+joe (defthm tail-dominates-p-from-dominates (implies (dominates x y) (tail-dominates-p x y))) (defthm show-syntax-tail-dominates-implies-tail-dominates (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (tail-dominates-p (syn::eval x bag::a) (syn::eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination)))) (defthm memberp-prefixes-implies-memberp-prefixes-append (implies (list::memberp list (prefixes (v1 (tail-dominates x y)))) (list::memberp (append z list) (prefixes (v1 (tail-dominates (append z x) y))))) :hints (("goal" :induct (len z) :in-theory (enable binary-append)))) (defthm s2l-membership-in-prefixes (implies (and (hyp-for-show-syntax-tail-dominates x y type-alist) (syn::eval (hyp-for-show-syntax-tail-dominates x y type-alist) bag::a)) (list::memberp (s2l (v1 (show-syntax-tail-dominates x y type-alist)) bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory (e/d (syn::open-nth syn::conjoin syn::open-len syntax-domination-implies-domination syntax-domination-implies-consp memberp-not-consp-prefixes ) ( ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION TRUE-LISTP) (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE list::CONSP-APPEND) (:REWRITE list::CDR-APPEND) (:REWRITE list::APPEND-OF-NON-CONSP-ONE) (:TYPE-PRESCRIPTION SYN::CONSP-REC) SYNTAX-QUOTE-DOMINATES-P-FN TAIL-DOMINATES-P SYNTAX-QUOTE-TAIL-DOMINATES-FN DOMINATES-SAME-LEN-CHEAP )) :induct (show-syntax-tail-dominates-fn bag::a x y type-alist)) )) (defignore syntax-quote-quote-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type t x prefix y)) (and (consp x) (if (consp prefix) (and (equal (car prefix) (car x)) (syntax-quote-quote-prefixed-tail-dominator-p (cdr x) (cdr prefix) y)) (syntax-quote-dominates-p x y)))) #+joe (defignore syntax-quote-alist-prefixed-tail-dominator-p bag::a (x prefix y) (declare (type (satisfies wf-syntax-prefix) prefix)) (and (consp x) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (equal (car x) val) (syntax-quote-alist-prefixed-tail-dominator-p (cdr x) (cdr prefix) y))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y))) (:quote (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p x val y))) (t nil))) (syntax-quote-dominates-p x y)))) (defirrelevant syntax-quote-quote-prefixed-tail-dominator-p 1 bag::a (x prefix y) :hints (("goal" :in-theory (enable syntax-quote-dominates-p-irrelevant)))) (defthm syntax-quote-quote-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (syntax-quote-quote-prefixed-tail-dominator-p x prefix y) (prefixed-tail-dominator-p x prefix (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defignore show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)))) (t nil))) (show-syntax-dominates-p nil x y type-alist))) (defirrelevant show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable show-syntax-dominates-p-irrelevant hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-show-syntax-prefixed-tail-dominator-p bag::a (x prefix y type-alist) (declare (type (satisfies wf-syntax-prefix) prefix) (type (satisfies acl2::type-alistp) type-alist)) (if (consp prefix) (let ((key (caar prefix)) (val (cdar prefix))) (case key (:cons (and (syn::consp x) (equal (syn::car x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::cdr x) (cdr prefix) y type-alist))) (:append (and (syn::appendp x) (equal (syn::arg 1 x) val) (hyp-for-show-syntax-prefixed-tail-dominator-p (syn::arg 2 x) (cdr prefix) y type-alist))) (:quote (and (syn::quotep x) (if (syn::quotep y) (prefixed-tail-dominator-p (syn::dequote x) val (syn::dequote y)) (syntax-quote-quote-prefixed-tail-dominator-p (syn::dequote x) val y)) (syn::true))) (t nil))) (hyp-for-show-syntax-dominates-p nil x y type-alist))) (defirrelevant hyp-for-show-syntax-prefixed-tail-dominator-p 1 bag::a (x prefix y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-dominates-p-irrelevant syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm show-syntax-prefixed-tail-dominator-p-to-hyp-for (iff (show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist))) (defthm pseudo-termp-hyp-for-show-syntax-prefixed-tail-dominator-p (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist)))) (defthm prefixed-tail-dominator-p-append (implies (and (prefixed-tail-dominator-p x y z) (equal w k)) (prefixed-tail-dominator-p (append w x) (append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) #+joe (defthm list-prefixed-tail-dominator-p-append (implies (and (list-prefixed-tail-dominator-p x y z) (equal w k)) (list-prefixed-tail-dominator-p (append w x) (map-append k y) z)) :hints (("goal" :induct (list::len-len-induction w k)))) (defun len-len-len-induction (x y z) (if (and (consp x) (consp y) (consp z)) (len-len-len-induction (cdr x) (cdr y) (cdr z)) (list x y z))) ;; I don't think this helps .. (defcong list::equiv equal (prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) #+joe (defcong list::equiv equal (list-prefixed-tail-dominator-p x prefix y) 2 :hints (("goal" :induct (len-len-len-induction x prefix list::prefix-equiv)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x prefix y type-alist) bag::a)) (prefixed-tail-dominator-p (syn::eval x bag::a) (s2l prefix bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin syntax-domination-implies-consp syntax-domination-implies-domination))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-membership-implies-prefixed-tail-dominator (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (prefixed-tail-dominator-p x pre y)) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm prefixed-tail-dominator-membership-implies-tail-dominates-p (implies (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (tail-dominates-p x y)) :hints (("goal" :in-theory (enable list::memberp))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm list-prefixed-tail-dominator-p-implies-v0-tail-dominates (implies (list-prefixed-tail-dominator-p x pre y) (and (v0 (tail-dominates x y)) (tail-dominates-p x y))) :rule-classes (:rewrite :forward-chaining)) (defthm prefixed-tail-dominator-implies-membership-tail-dominates (implies (prefixed-tail-dominator-p x pre y) (equal (list::memberp pre (prefixes (v1 (tail-dominates x y)))) (true-listp pre))) :hints (("goal" :in-theory (enable list::memberp) :induct (list::len-len-induction pre x)))) (defthm show-syntax-prefixed-tail-dominator-p-implies-memberp (implies (and (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) (syn::eval (hyp-for-show-syntax-prefixed-tail-dominator-p x pre y type-alist) bag::a) (wf-syntax-prefix pre)) (list::memberp (s2l pre bag::a) (prefixes (v1 (tail-dominates (syn::eval x bag::a) (syn::eval y bag::a)))))) :hints (("goal" :in-theory '(true-listp-s2l show-syntax-prefixed-tail-dominator-p-implies-prefixed-tail-dominator prefixed-tail-dominator-implies-membership-tail-dominates )))) (defun contains-prefixed-tail-dominator-p (list pre x) (declare (type t x pre list)) (if (consp list) (or (prefixed-tail-dominator-p (car list) pre x) (contains-prefixed-tail-dominator-p (cdr list) pre x)) nil)) (defthm contains-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-prefixed-tail-dominator-p list pre y) (or (prefixed-tail-dominator-p v pre y) (contains-prefixed-tail-dominator-p (bag::remove-1 v list) pre y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) #+joe (defthm not-prefixed-tail-dominator-p-remove-1-reduction (implies (not (list-prefixed-tail-dominator-p x pre y)) (equal (contains-prefixed-tail-dominator-p (bag::remove-1 x list) pre y) (contains-prefixed-tail-dominator-p list pre y))) :hints (("goal" :in-theory (enable bag::remove-1)))) #+joe (defthm membership-reduction (implies (and (list::memberp x list) (prefixed-tail-dominator-p x pre y)) (contains-prefixed-tail-dominator-p list pre y)) :hints (("goal" :in-theory (enable list::memberp)))) (defcong bag::perm equal (contains-prefixed-tail-dominator-p list pre x) 1 :hints (("goal" :induct (bag::perm list bag::list-equiv) :in-theory (enable bag::perm)) (and acl2::stable-under-simplificationp `(:cases ((list-prefixed-tail-dominator-p (car list) pre x)))))) (defthm contains-prefixed-tail-dominator-p-append-2 (implies (contains-prefixed-tail-dominator-p list pre x) (contains-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-prefixed-tail-dominator-p-append-1 (implies (contains-prefixed-tail-dominator-p z pre x) (contains-prefixed-tail-dominator-p (append z a) pre x))) (defun contains-list-prefixed-tail-dominator-p (list prefixes x) (declare (type t x prefixes list)) (if (consp list) (or (list-prefixed-tail-dominator-p (car list) prefixes x) (contains-list-prefixed-tail-dominator-p (cdr list) prefixes x)) nil)) (local (in-theory (disable LIST-PREFIXED-TAIL-DOMINATOR-P))) (defthm contains-list-prefixed-tail-dominator-p-membership-reduction (implies (list::memberp v list) (equal (contains-list-prefixed-tail-dominator-p list prefixes x) (or (list-prefixed-tail-dominator-p v prefixes x) (contains-list-prefixed-tail-dominator-p (bag::remove-1 v list) prefixes x)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len list)))) (defcong bag::perm equal (contains-list-prefixed-tail-dominator-p list prefixes x) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-list-prefixed-tail-dominator-p-append-2 (implies (contains-list-prefixed-tail-dominator-p list pre x) (contains-list-prefixed-tail-dominator-p (append y list) pre x)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append y list)))) (defthm contains-list-prefixed-tail-dominator-p-append-1 (implies (contains-list-prefixed-tail-dominator-p z pre x) (contains-list-prefixed-tail-dominator-p (append z a) pre x))) (defthmd member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (contains-prefixed-tail-dominator-p list pre x) (list::memberp pre prefixes)) (contains-list-prefixed-tail-dominator-p list prefixes x)) :hints (("goal" :in-theory (enable list::memberp)))) (in-theory (disable NOT-CONSP-MEMBERSHIP-IMPLIES-DOMINATES MEMBERP-NOT-CONSP-PREFIXES PREFIXED-TAIL-DOMINATOR-IMPLIES-MEMBERSHIP-TAIL-DOMINATES )) (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) (declare (type (integer 0 *) n) (type (satisfies wf-syntax-prefix) pre)) (if (consp list) (let ((z (car list))) (let ((m (len z))) (or (and (< n m) (syntax-quote-quote-prefixed-tail-dominator-p z pre x)) (syntax-quote-contains-prefixed-tail-dominator (cdr list) pre n x)))) nil)) (defirrelevant syntax-quote-contains-prefixed-tail-dominator 1 bag::a (list pre n x) :hints (("goal" :in-theory (enable syntax-quote-quote-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-quote-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (syntax-quote-contains-prefixed-tail-dominator list pre n x) (contains-prefixed-tail-dominator-p list pre (syn::eval x bag::a))) :rule-classes (:rewrite :forward-chaining)) ;; DAG - finish this function to fix problem identified below #+joe (defignore syntax-quote-contains-prefixed-tail-dominator bag::a (list pre n x) ) (defignore syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))))) (t nil))) (defirrelevant syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable show-syntax-prefixed-tail-dominator-p-irrelevant hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defignore hyp-for-syntax-contains-prefixed-tail-dominator bag::a (list pre n x type-alist) (declare (type (satisfies wf-syntax-prefix) pre) (type (satisfies acl2::type-alistp) type-alist) (type (integer 0 *) n)) (cond ((syn::consp list) (let ((z (syn::car list))) (let ((m (sudo-len z))) (or (and (<= n m) (hyp-for-show-syntax-prefixed-tail-dominator-p z pre x type-alist)) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::cdr list) pre n x type-alist))))) ((syn::appendp list) (hyp-for-syntax-contains-prefixed-tail-dominator (syn::arg 2 list) pre n x type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG: We should not require this here .. (consp pre) (equal (caar pre) :quote) (let ((prefix (cdar pre))) (contains-prefixed-tail-dominator-p (syn::dequote list) prefix (syn::dequote x))) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-prefixed-tail-dominator 1 bag::a (list pre n x type-alist) :hints (("goal" :in-theory (enable hyp-for-show-syntax-prefixed-tail-dominator-p-irrelevant )))) (defthm syntax-contains-prefixed-tail-dominator-to-hyp-for (iff (syntax-contains-prefixed-tail-dominator list pre n x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist))) (defthm pseudo-termp-hyp-for-syntax-contains-prefixed-tail-dominator (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist)))) (defthm syntax-contains-prefixed-tail-dominator-implies-contains-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a)) (contains-prefixed-tail-dominator-p (syn::eval list bag::a) (s2l pre bag::a) (syn::eval x bag::a))) :hints (("goal" :in-theory (enable syn::open-nth syn::conjoin))) :rule-classes (:rewrite :forward-chaining)) (defthm member-syntax-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (implies (and (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) (syn::eval (hyp-for-syntax-contains-prefixed-tail-dominator list pre n x type-alist) bag::a) (list::memberp (s2l pre bag::a) prefixes)) (contains-list-prefixed-tail-dominator-p (syn::eval list bag::a) prefixes (syn::eval x bag::a))) :hints (("goal" :use (:instance member-contains-prefixed-tail-dominator-p-implies-contains-list-prefixed-tail-dominator-p (list (syn::eval list bag::a)) (pre (s2l pre bag::a)) (x (syn::eval x bag::a)) (prefixes prefixes))))) (defund tail-dominator-body (val rest x y) (declare (type t x y)) (met ((hit prex) (tail-dominates val x)) (or (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prex) y)) (met ((hit prey) (tail-dominates val y)) (and hit (contains-list-prefixed-tail-dominator-p rest (prefixes prey) x)))))) (defthm list-prefixed-tail-dominator-p-map-cons (equal (list-prefixed-tail-dominator-p w (list::map-cons a list) y) (and (consp w) (equal (car w) a) (list-prefixed-tail-dominator-p (cdr w) list y))) :hints (("goal" :in-theory (enable LIST-PREFIXED-TAIL-DOMINATOR-P) :induct (len list)))) (defun tail-dominator-body-body (v w x y) (met ((hitx prex) (tail-dominates v x)) (met ((hity prey) (tail-dominates v y)) (or (and hitx (list-prefixed-tail-dominator-p w (prefixes prex) y)) (and hity (list-prefixed-tail-dominator-p w (prefixes prey) x)))))) (defun tail-dominator-body-rec (val rest x y) (if (consp rest) (or (tail-dominator-body-body val (car rest) x y) (tail-dominator-body-rec val (cdr rest) x y)) nil)) (defthm tail-dominator-boody-to-tail-dominator-body-rec (equal (tail-dominator-body val rest x y) (tail-dominator-body-rec val rest x y)) :hints (("goal" :in-theory (enable tail-dominator-body) :induct (len rest)))) (in-theory (disable tail-dominator-body )) (defun tail-dominator-body-body-rec (w v x y) (if (and (consp w) (consp v)) (or (and (dominates w x) (dominates v y)) (and (dominates v x) (dominates w y)) (and (equal (car w) (car v)) (tail-dominator-body-body-rec (cdr w) (cdr v) x y))) nil)) (defthm open-tail-dominates (implies (consp x) (equal (tail-dominates x y) (met ((hit prefix) (tail-dominates (cdr x) y)) (let ((dom (dominates x y))) (if (or hit dom) (mv t (cons (cons dom (car x)) prefix)) (mv nil nil))))))) (defthm tail-dominator-body-body-is-tail-dominator-body-body-rec (equal (tail-dominator-body-body w v x y) (tail-dominator-body-body-rec w v x y)) :hints (("Goal" :in-theory (e/d (LIST-PREFIXED-TAIL-DOMINATOR-P) ( TAIL-DOMINATES ;efficiency CONSP-PREFIXES-V1-TAIL-DOMINATES STRICTLY-DOMINATES-IMPLIES-DOMINATES ;LIST::MV-NTH-TO-VAL ;LIST-PREFIXED-TAIL-DOMINATOR-P ;TAIL-DOMINATES-P )))) ) (defthm tail-dominator-body-body-commutes-first-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec w v x y))) (defthm tail-dominator-body-body-commutes-last-2 (equal (tail-dominator-body-body-rec v w x y) (tail-dominator-body-body-rec v w y x))) (defthm tail-dominator-body-commutes-last-2 (equal (tail-dominator-body-rec val rest x y) (tail-dominator-body-rec val rest y x))) (in-theory (disable tail-dominator-body-body )) (defthm tail-dominator-body-rec-membership-reduction (implies (list::memberp v rest) (equal (tail-dominator-body-rec val rest x y) (or (tail-dominator-body-body-rec val v x y) (tail-dominator-body-rec val (bag::remove-1 v rest) x y)))) :hints (("goal" :in-theory (enable list::memberp bag::remove-1) :induct (len rest)))) (defcong bag::perm equal (tail-dominator-body-rec val rest x y) 2 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm rest bag::rest-equiv)))) (defun contains-unique-prefixed-tail-dominators (list x y) (declare (type t list x y)) (if (consp list) (let ((rest (cdr list)) (val (car list))) (or (tail-dominator-body val rest x y) (contains-unique-prefixed-tail-dominators rest x y))) nil)) (defthm contains-unique-prefixed-tail-dominators-membership-deconstruction (implies (list::memberp v list) (equal (contains-unique-prefixed-tail-dominators list x y) (or (tail-dominator-body v (bag::remove-1 v list) x y) (contains-unique-prefixed-tail-dominators (bag::remove-1 v list) x y)))) :hints (("goal" :in-theory (enable bag::remove-1)))) (defcong bag::perm equal (contains-unique-prefixed-tail-dominators list x y) 1 :hints (("goal" :in-theory (enable bag::perm) :induct (bag::perm list bag::list-equiv)))) (defthm contains-unique-prefixed-tail-dominators-commutes (equal (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators list y x))) (defthm contains-unique-prefixed-tail-dominators-append-1 (implies (contains-unique-prefixed-tail-dominators list x y) (contains-unique-prefixed-tail-dominators (append z list) x y)) :hints (("goal" :in-theory (enable binary-append) :induct (binary-append z list)))) (defthm contains-unique-prefixed-tail-dominators-append-2 (implies (contains-unique-prefixed-tail-dominators z x y) (contains-unique-prefixed-tail-dominators (append z a) x y))) (defignore syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist)) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist)) (syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)))) (t nil))) (defirrelevant syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant syntax-contains-prefixed-tail-dominator-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (;for efficiency: SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES PREFIXED-TAIL-DOMINATOR-P TAIL-DOMINATES-P ))))) (defignore hyp-for-syntax-contains-unique-prefixed-tail-dominators bag::a (list x y type-alist) (declare (type (satisfies acl2::type-alistp) type-alist)) (cond ((syn::consp list) (let ((rest (syn::cdr list))) (met ((hit prex) (show-syntax-tail-dominates (syn::car list) x type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) x type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prex (len prex) y type-alist))) (met ((hit prey) (show-syntax-tail-dominates (syn::car list) y type-alist)) (or (and hit (syn::and (hyp-for-show-syntax-tail-dominates (syn::car list) y type-alist) (hyp-for-syntax-contains-prefixed-tail-dominator rest prey (len prey) x type-alist))) (hyp-for-syntax-contains-unique-prefixed-tail-dominators rest x y type-alist))))))) ((syn::appendp list) (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 2 list) x y type-alist)) ((syn::quotep list) (and (syn::quotep x) ;; DAG - fix .. we can do better than this. (syn::quotep y) (contains-unique-prefixed-tail-dominators (syn::dequote list) (syn::dequote x) (syn::dequote y)) (syn::true))) (t nil))) (defirrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators 1 bag::a (list x y type-alist) :hints (("goal" :in-theory (e/d (show-syntax-tail-dominates-irrelevant hyp-for-show-syntax-tail-dominates-irrelevant hyp-for-syntax-contains-prefixed-tail-dominator-irrelevant ) (HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-TAIL-DOMINATES-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN ))))) (defthm syntax-contains-unique-prefixed-tail-dominators-to-hyp-for (iff (syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist)) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm pseudo-termp-hyp-for-syntax-contains-unique-prefixed-tail-dominators (implies (acl2::type-alistp type-alist) (pseudo-termp (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist))) :hints (("Goal" :in-theory (disable ;efficiency: HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES-P HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN TAIL-DOMINATES HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN )))) (defthm syntax-contains-unique-prefixed-tail-dominators-implies-contains-unique-prefixed-tail-dominators (implies (and (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) (syn::eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (contains-unique-prefixed-tail-dominators (syn::eval list bag::a) (syn::eval x bag::a) (syn::eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth TAIL-DOMINATOR-BODY) (;TAIL-DOMINATOR-BODY SYNTAX-QUOTE-DOMINATES-P-FN ;these for efficiency TAIL-DOMINATES TAIL-DOMINATES-P CONTAINS-LIST-PREFIXED-TAIL-DOMINATOR-P LIST-PREFIXED-TAIL-DOMINATOR-P HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SYNTAX-QUOTE-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN SHOW-SYNTAX-TAIL-DOMINATES-FN HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN SHOW-SYNTAX-DOMINATES-P-FN TAIL-DOMINATOR-BOODY-TO-TAIL-DOMINATOR-BODY-REC (:REWRITE SYN::CONSP-REC-IMPLIES-CONSP) (:DEFINITION SYN::CONSP-REC) (:REWRITE BAG::SUBBAGP-CDR-LEMMA) ;(:REWRITE list::EQUAL-OF-BOOLEANS-REWRITE) (:rewrite acl2::equal-booleans-reducton) (:REWRITE list::EQUAL-CAR-DIFFERENTIAL) (:REWRITE BAG::SUBBAGP-WHEN-CDR-IS-NON-CONSP)) )))) (defthm diverge-tail-dominator-body-body-rec-implies-diverge (implies (and (tail-dominator-body-body-rec a b x y) (diverge a b)) (diverge x y)) :hints (("goal" :induct (tail-dominator-body-body-rec a b x y)))) (defthm all-diverge-from-all-tail-dominator-body-implies-diverge (implies (and (tail-dominator-body-rec val rest x y) (diverges-from-all val rest)) (diverge x y)) :hints (("goal" :in-theory (enable diverges-from-all)))) (defthm all-diverge-from-all-contains-unique-prefixed-tail-dominators-implies-diverge (implies (and (all-diverge list) (contains-unique-prefixed-tail-dominators list x y)) (diverge x y)) :hints (("goal" :in-theory (enable all-diverge)))) (defignored show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist)) (show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (show-prefix-diverge-from-type-alist syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant ) ( ;efficiency (bzo consider making some of these disables global?) HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (defignored hyp-for-show-prefix-diverge-from-type-alist bag::a (a b type-alist whole-alist) (declare (type t a b type-alist) (xargs :guard (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist) (pseudo-termp a) (pseudo-termp b) ) :hints (("Goal" :do-not '(generalize eliminate-destructors))) :guard-hints (("Goal" :do-not '(preprocess))) )) (if (endp type-alist) nil (let* ((entry (car type-alist)) (fact (car entry))) (or (and (syn::funcall 'all-diverge 1 fact) (bag::ts-non-nil (cadr entry)) (syn::and (hyp-for-syntax-contains-unique-prefixed-tail-dominators (syn::arg 1 fact) a b whole-alist) fact)) (hyp-for-show-prefix-diverge-from-type-alist a b (cdr type-alist) whole-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-type-alist 1 bag::a (a b type-alist whole-alist) :hints (("goal" :in-theory (e/d (hyp-for-syntax-contains-unique-prefixed-tail-dominators-irrelevant hyp-for-show-prefix-diverge-from-type-alist ) (;efficiency: HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN SYN::OPEN-LEN HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN ))))) (local (in-theory (disable HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN))) (defthm to-hyp-for-show-prefix-diverge-from-type-alist (iff (show-prefix-diverge-from-type-alist a b alist wlist) (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-type-alist hyp-for-show-prefix-diverge-from-type-alist)))) (defthm psedu-termp-hyp-for-show-prefix-diverge-from-type-alist (implies (and (acl2::type-alistp type-alist) (acl2::type-alistp whole-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-type-alist a b type-alist whole-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-type-alist)))) (syn::extend-eval pd-eval ( (diverge x y) (dominates x y) (diverges-from-all x list) (all-diverge-from-all x y) (all-diverge x) (list::equiv x y) ;; We do this to expediate functional instantiation. ;; This should not be necessary as bag:: should use ;; the syn:: evaluator as much as possible. (bag::hide x) (bag::hide-unique list) (bag::hide-subbagp x y) (bag::hide-disjoint x y) (bag::hide-memberp a x) (bag::perm x y) (bag::unique list) (bag::if a b c) (bag::consp x) (bag::true-listp x) (bag::binary-append x y) (bag::cons a b) (bag::meta-subbagp list1 list2) (bag::remove-bag x list) (bag::meta-remove-bag x list) (bag::remove-1 x list) (bag::unique-memberps x y list) (bag::unique-subbagps x y list) (bag::subbagp-pair x1 x2 list1 list2) (bag::meta-memberp x list) (bag::any-subbagp x list) ;remove this? (list::finalcdr x) (list::fix x) (bag::subbagp x y) (list::memberp a x) ; [Changed by PI:NAME:<NAME>END_PI. to handle changes to member, assoc, etc. after ACL2 4.2 ; (replaced member by member-equal).] (acl2::member-equal a x) (bag::disjoint x y) )) (DEFTHM PD-EVAL-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (IMPLIES (and (hyp-for-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS LIST X Y type-alist) (pd-eval (hyp-for-syntax-contains-unique-prefixed-tail-dominators list x y type-alist) bag::a)) (CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (PD-EVAL LIST BAG::A) (PD-EVAL X BAG::A) (PD-EVAL Y BAG::A))) :rule-classes (:rewrite :forward-chaining) :HINTS (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-IMPLIES-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS (bag::A bag::A) (Y Y) (X X) (type-alist type-alist) (LIST LIST)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defthm pd-eval-show-not-equal-from-type-alist-works-right (implies (and (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) (pd-eval (bag::hyp-for-show-not-equal-from-type-alist x y n type-alist whole-type-alist) bag::a) ) (not (equal (pd-eval x bag::a) (pd-eval y bag::a)))) :rule-classes (:forward-chaining :rewrite) :hints (("Goal" :in-theory (enable pd-eval-constraint-0) :USE (:FUNCTIONAL-INSTANCE (:INSTANCE bag::show-not-equal-from-type-alist-works-right (bag::A bag::A) (bag::Y Y) (bag::X X) (bag::N n) (bag::type-alist type-alist) (bag::whole-type-alist whole-type-alist) ) (BAG::syntax-EV PD-EVAL) (bag::syntax-ev-list PD-EVAL-LIST))))) (defthm show-prefix-diverge-from-type-alist-works (implies (and (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) (pd-eval (hyp-for-show-prefix-diverge-from-type-alist a b alist wlist) bag::a)) (diverge (pd-eval a bag::a) (pd-eval b bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (syn::conjoin syn::open-nth hyp-for-show-prefix-diverge-from-type-alist) ( (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-UNIQUE-PREFIXED-TAIL-DOMINATORS-FN) (:DEFINITION HYP-FOR-SYNTAX-CONTAINS-PREFIXED-TAIL-DOMINATOR-FN) (:DEFINITION HYP-FOR-SHOW-SYNTAX-PREFIXED-TAIL-DOMINATOR-P-FN) (:REWRITE PREFIXED-TAIL-DOMINATOR-MEMBERSHIP-IMPLIES-PREFIXED-TAIL-DOMINATOR) (:DEFINITION TAIL-DOMINATES-P) (:DEFINITION TAIL-DOMINATES) ;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:DEFINITION HYP-FOR-SHOW-SYNTAX-DOMINATES-P-FN) (:DEFINITION PREFIXED-TAIL-DOMINATOR-P) (:REWRITE acl2::MV-NTH-TO-VAL) (:REWRITE NOT-TAIL-DOMINATES-P-IMPLIES-NIL-PREFIX) (:REWRITE NOT-DOMINATES-FROM-DIVERGE-ONE) (:DEFINITION CONTAINS-PREFIXED-TAIL-DOMINATOR-P) (:DEFINITION HYP-FOR-SHOW-SYNTAX-TAIL-DOMINATES-FN) (:REWRITE V0-TAIL-DOMINATES-TO-TAIL-DOMINATES-P) (:DEFINITION SHOW-SYNTAX-TAIL-DOMINATES-FN) ))))) (defthm pd-eval-syntax-diverge-implies-eval-commute (implies (syntax-diverge t1 t2) (diverge (pd-eval t1 a) (pd-eval t2 a))) :hints (("Goal" :USE (:FUNCTIONAL-INSTANCE (:INSTANCE syntax-diverge-implies-diverge (a a) (t1 t1) (t2 t2)) (SYN::EVAL PD-EVAL) (SYN::EVAL-LIST PD-EVAL-LIST))))) (defun syn::singleton (term) (declare (type t term)) (cond ((syn::consp term) (syn::null (syn::cdr term))) ((syn::quotep term) (let ((term (syn::dequote term))) (and (consp term) (not (consp (cdr term)))))) (t nil))) (defund syn::single-car (term) (declare (type (satisfies syn::singleton) term)) (if (syn::consp term) (syn::car term) (syn::enquote (car (syn::dequote term))))) (defthm pseudo-termp-single-car (implies (pseudo-termp term) (pseudo-termp (syn::single-car term))) :hints (("goal" :in-theory (enable pseudo-termp syn::single-car )))) (in-theory (disable syn::singleton )) (defignored show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant show-prefix-diverge-from-type-alist-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist-body bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (let ((hit (syntax-diverge x y))) (or hit (or (and (syn::singleton x) (syn::singleton y) (bag::hyp-for-show-not-equal-from-type-alist (syn::single-car x) (syn::single-car y) (bag::usb16-fix (len type-alist)) type-alist type-alist)) (hyp-for-show-prefix-diverge-from-type-alist x y type-alist type-alist))))) (defirrelevant hyp-for-show-prefix-diverge-from-alist-body 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body bag::hyp-for-show-not-equal-from-type-alist-irrelevant hyp-for-show-prefix-diverge-from-type-alist-irrelevant )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist-body (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist-body )))) (defthm show-prefix-diverge-from-alist-body-to-hyp-for (iff (show-prefix-diverge-from-alist-body x y type-alist) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist-body hyp-for-show-prefix-diverge-from-alist-body )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist-body (implies (and (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist-body x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (e/d (hyp-for-show-prefix-diverge-from-alist-body bag::make-conjunction ) ( pd-eval-show-not-equal-from-type-alist-works-right )) :use (:instance pd-eval-show-not-equal-from-type-alist-works-right (x (syn::single-car x)) (y (syn::single-car y)) (n (BAG::USB16-FIX (LEN TYPE-ALIST))) (whole-type-alist type-alist) )) (and acl2::stable-under-simplificationp `(:in-theory (e/d ( syn::single-car syn::singleton diverge ) (pd-eval-show-not-equal-from-type-alist-works-right )))))) (defthmd syntax-quote-remove-common-prefix-pd-eval-diverge (implies (diverge (v0 (syntax-quote-remove-common-prefix x y)) (pd-eval (v1 (syntax-quote-remove-common-prefix x y)) bag::a)) (diverge x (pd-eval y bag::a)))) (defthmd syntax-remove-common-prefix-pd-eval-diverge (implies (diverge (pd-eval (v0 (syntax-remove-common-prefix x y)) bag::a) (pd-eval (v1 (syntax-remove-common-prefix x y)) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :in-theory (e/d (syn::open-nth syntax-quote-remove-common-prefix-pd-eval-diverge) (;jcd (:REWRITE CONSP-NON-NULL-TRUE-LIST) (:REWRITE WF-SYNTAX-PREFIX-IMPLIES-TRUE-LISTP) (:DEFINITION WF-SYNTAX-PREFIX) (:DEFINITION TRUE-LISTP) (:REWRITE PD-EVAL-SYNTAX-DIVERGE-IMPLIES-EVAL-COMMUTE) (:DEFINITION SYNTAX-DIVERGE)))))) (defignored show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (show-prefix-diverge-from-alist-body x y type-alist))) (defirrelevant show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist show-prefix-diverge-from-alist-body-irrelevant )))) (defignored hyp-for-show-prefix-diverge-from-alist bag::a (x y type-alist) (declare (type (satisfies pseudo-termp) x y) (type (satisfies acl2::type-alistp) type-alist)) (met ((x y) (syntax-remove-common-prefix x y)) (hyp-for-show-prefix-diverge-from-alist-body x y type-alist))) (defthm show-prefix-diverge-from-alist-to-hyp-for (iff (show-prefix-diverge-from-alist x y type-alist) (hyp-for-show-prefix-diverge-from-alist x y type-alist)) :hints (("goal" :in-theory (enable show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist )))) (defthm pseudo-termp-hyp-for-show-prefix-diverge-from-alist (implies (and (pseudo-termp x) (pseudo-termp y) (acl2::type-alistp type-alist)) (pseudo-termp (hyp-for-show-prefix-diverge-from-alist x y type-alist))) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist )))) (defirrelevant hyp-for-show-prefix-diverge-from-alist 1 bag::a (x y type-alist) :hints (("goal" :in-theory (enable hyp-for-show-prefix-diverge-from-alist hyp-for-show-prefix-diverge-from-alist-body-irrelevant )))) (defthm pd-eval-diverge-from-hyp-for-show-prefix-diverge-from-alist (implies (and (hyp-for-show-prefix-diverge-from-alist x y type-alist) (pd-eval (hyp-for-show-prefix-diverge-from-alist x y type-alist) bag::a)) (diverge (pd-eval x bag::a) (pd-eval y bag::a))) :rule-classes (:rewrite :forward-chaining) :hints (("goal" :in-theory (enable syntax-remove-common-prefix-pd-eval-diverge hyp-for-show-prefix-diverge-from-alist )))) (set-state-ok t) (defun show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((zed #+joe(and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc(~x0,~x1)?~%" x y)) nil)) (declare (ignore zed)) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-prefix-diverge-from-alist-fn nil x y type-alist) (acl2::prog2$ #+joe (and (@ show-prefix-diverge-from-mfc) (cw "** show-prefix-diverge-from-mfc!~%")) nil (syn::true)) term)))) term)) (defun hyp-for-show-prefix-diverge-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term)) (type t term mfc state)) (if (syn::funcall 'diverge 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-prefix-diverge-from-alist-fn nil x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))) (syn::nil))) (defthm meta-rule-to-show-prefix-diverge (implies (pd-eval (hyp-for-show-prefix-diverge-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-prefix-diverge-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (diverge) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin hyp-for-show-prefix-diverge-from-alist-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (encapsulate () (local (encapsulate () (in-theory (disable all-diverge )) (defthm test1 (implies (all-diverge `((a b ,c d ,e) (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) (defthm test2 (implies (all-diverge `((a b ,c d ,e) ,z (a b ,c x ,y z))) (diverge `(d ,e) `(x ,y z)))) ))) (defun show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (if (show-syntax-dominates-p-fn nil t x y type-alist) (syn::true) (if (show-syntax-dominates-p-fn nil t y x type-alist) `(if (list::equiv ,y ,x) ,(syn::true) ,(syn::nil)) term)))) term)) (defun hyp-for-show-domination-from-mfc (term mfc state) (declare (ignore state) (xargs :guard (pseudo-termp term))) (if (syn::funcall 'dominates 2 term) (let ((x (syn::arg 1 term)) (y (syn::arg 2 term))) (let ((type-alist (acl2::mfc-type-alist mfc))) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t x y type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (let ((hyp (hyp-for-show-syntax-dominates-p-fn nil t y x type-alist))) (if hyp (bag::bind-extra-vars-in-hyp hyp term) (syn::nil))))))) (syn::nil))) (defthm pd-eval-syntax-domination-implies-domination (implies (hyp-for-show-syntax-dominates-p flg x y type-alist) (dominates (pd-eval x bag::a) (pd-eval y bag::a))) :hints (("goal" :use (:functional-instance syntax-domination-implies-domination-helper (syn::eval pd-eval) (syn::eval-list pd-eval-list))))) (defthmd non-domination-from-not-equal-dominates (implies (and (dominates x y) (not (list::equiv x y))) (not (dominates y x))) :hints (("goal" :in-theory (enable dominates )))) (defthm meta-rule-to-show-prefix-domination (implies (pd-eval (hyp-for-show-domination-from-mfc term mfc state) bag::a) (equal (pd-eval term bag::a) (pd-eval (show-domination-from-mfc term mfc state) bag::a))) :rule-classes ((:meta :trigger-fns (dominates) :backchain-limit-lst 0 ;just in case... )) :hints (("Goal" :do-not-induct t :in-theory (enable syn::open-nth syn::conjoin non-domination-from-not-equal-dominates hyp-for-show-syntax-dominates-p-irrelevant bag::make-conjunction ) :do-not '(generalize eliminate-destructors)))) (defun all-diverge-remove-prefix (paths) (if (not (syn::consp paths)) paths (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths))))) (defthm all-diverge-remove-prefix-open (implies (syn::consp paths) (equal (all-diverge-remove-prefix paths) (syn::cons (syn::cdr (syn::car paths)) (all-diverge-remove-prefix (syn::cdr paths)))))) (defun all-diverge-prefix-meta-fn (term) (if (and (syn::consp term) (syn::consp (syn::cdr term)) (equal 'all-diverge (car term))) (if (syn-prefix-p (syn::cdr term)) (let ((pruned (all-diverge-remove-prefix (syn::cdr term)))) (list 'all-diverge pruned)) term) term)) (defthm not-syn-consp-all-diverge-prefix-meta-fn (implies (not (syn::consp term)) (equal (all-diverge-prefix-meta-fn term) term))) (defun syntax-dominates (p1 p2) (if (syn::consp p1) (and (syn::consp p2) (equal (syn::car p1) (syn::car p2)) (syntax-dominates (syn::cdr p1) (syn::cdr p2))) t)) #+joe ;; better definition later (defun syntax-dominated-by-some (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) t (syntax-dominated-by-some p (syn::cdr paths))) nil)) (defun remove-dominator (p paths) (if (syn::consp paths) (if (syntax-dominates (syn::car paths) p) (syn::cdr paths) (syn::cons (syn::car paths) (remove-dominator p (syn::cdr paths)))) paths)) (syn::defevaluator meta-all-diverge-prefix-ev meta-all-diverge-prefix-ev-list ( (len x) (syn-prefix-p x) (cdr x) (if a b c) (all-diverge-remove-prefix x) (all-diverge-prefix-meta-fn x) (consp x) (cons x y) (equal x y) (path::diverge a b) (path::all-diverge x) (path::all-diverge-from-all x y) (car x) ;(cadr x) (syn::car x) (syn::cons x y) (syn::cdr x) (syn::consp x) (syntax-dominates p1 p2) ;(syntax-dominated-by-some p paths) (remove-dominator p paths) ;(show-mapping-from-type-alist a b) ;(all-diverge-mapping-from-type-alist a l) ;(all-diverge-mapping-from-mfc t m state) )) (defthm meta-all-diverge-prefix (equal (meta-all-diverge-prefix-ev term alist) (meta-all-diverge-prefix-ev (all-diverge-prefix-meta-fn term) alist)) :rule-classes ((:meta :trigger-fns (all-diverge))) :hints (("Goal" :do-not '(generalize eliminate-destructors) :induct (all-diverge-remove-prefix term)) ("Subgoal *1/1" :in-theory (disable all-diverge-prefix-meta-fn))) :otf-flg t) (in-theory (disable (:rewrite wf-syntax-prefix-implies-true-listp) (:definition wf-syntax-prefix)))
[ { "context": "interface for Common Lisp,\n;;;; Copyright (c) 2004 Marcelo Ramos <[email protected]>\n;;;;\n;;;; Permission i", "end": 113, "score": 0.9998763799667358, "start": 100, "tag": "NAME", "value": "Marcelo Ramos" }, { "context": "mmon Lisp,\n;;;; Copyright (c) 2004 Marcelo Ramos <[email protected]>\n;;;;\n;;;; Permission is hereby granted, free of ", "end": 139, "score": 0.9999343752861023, "start": 115, "tag": "EMAIL", "value": "[email protected]" } ]
addchstr.lisp
simbasailor/cl-ncurses
1
;;;; This file is part of cl-ncurses, an ncurses interface for Common Lisp, ;;;; Copyright (c) 2004 Marcelo Ramos <[email protected]> ;;;; ;;;; Permission is hereby granted, free of charge, to any person obtaining ;;;; a copy of this software and associated documentation files (the ;;;; "Software"), to deal in the Software without restriction, including ;;;; without limitation the rights to use, copy, modify, merge, publish, ;;;; distribute, sublicense, and/or sell copies of the Software, and to ;;;; permit persons to whom the Software is furnished to do so, subject to ;;;; the following conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be included ;;;; in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ;;;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ;;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ;;;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;;;;;;;;;;;;;; ;; ADDCHSTR ;; ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Routines: addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr, ;; ;; mvaddchnstr, mvwaddchstr, mvwaddchnstr ;; ;; Purpose: Add a string of characters (and attributes) to a curses window. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; TODO ; C Prototype: int addchstr(const chtype *chstr); ; C Prototype: int addchnstr(const chtype *chstr, int n); ; C Prototype: int waddchstr(WINDOW *win, const chtype *chstr); ; C Prototype: int waddchnstr(WINDOW *win, const chtype *chstr, int n); ; C Prototype: int mvaddchstr(int y, int x, const chtype *chstr); ; C Prototype: int mvaddchnstr(int y, int x, const chtype *chstr, int n); ; C Prototype: int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr); ; C Prototype: int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);
66280
;;;; This file is part of cl-ncurses, an ncurses interface for Common Lisp, ;;;; Copyright (c) 2004 <NAME> <<EMAIL>> ;;;; ;;;; Permission is hereby granted, free of charge, to any person obtaining ;;;; a copy of this software and associated documentation files (the ;;;; "Software"), to deal in the Software without restriction, including ;;;; without limitation the rights to use, copy, modify, merge, publish, ;;;; distribute, sublicense, and/or sell copies of the Software, and to ;;;; permit persons to whom the Software is furnished to do so, subject to ;;;; the following conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be included ;;;; in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ;;;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ;;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ;;;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;;;;;;;;;;;;;; ;; ADDCHSTR ;; ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Routines: addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr, ;; ;; mvaddchnstr, mvwaddchstr, mvwaddchnstr ;; ;; Purpose: Add a string of characters (and attributes) to a curses window. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; TODO ; C Prototype: int addchstr(const chtype *chstr); ; C Prototype: int addchnstr(const chtype *chstr, int n); ; C Prototype: int waddchstr(WINDOW *win, const chtype *chstr); ; C Prototype: int waddchnstr(WINDOW *win, const chtype *chstr, int n); ; C Prototype: int mvaddchstr(int y, int x, const chtype *chstr); ; C Prototype: int mvaddchnstr(int y, int x, const chtype *chstr, int n); ; C Prototype: int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr); ; C Prototype: int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);
true
;;;; This file is part of cl-ncurses, an ncurses interface for Common Lisp, ;;;; Copyright (c) 2004 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ;;;; ;;;; Permission is hereby granted, free of charge, to any person obtaining ;;;; a copy of this software and associated documentation files (the ;;;; "Software"), to deal in the Software without restriction, including ;;;; without limitation the rights to use, copy, modify, merge, publish, ;;;; distribute, sublicense, and/or sell copies of the Software, and to ;;;; permit persons to whom the Software is furnished to do so, subject to ;;;; the following conditions: ;;;; ;;;; The above copyright notice and this permission notice shall be included ;;;; in all copies or substantial portions of the Software. ;;;; ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ;;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ;;;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ;;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ;;;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;;;;;;;;;;;;;; ;; ADDCHSTR ;; ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Routines: addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr, ;; ;; mvaddchnstr, mvwaddchstr, mvwaddchnstr ;; ;; Purpose: Add a string of characters (and attributes) to a curses window. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; TODO ; C Prototype: int addchstr(const chtype *chstr); ; C Prototype: int addchnstr(const chtype *chstr, int n); ; C Prototype: int waddchstr(WINDOW *win, const chtype *chstr); ; C Prototype: int waddchnstr(WINDOW *win, const chtype *chstr, int n); ; C Prototype: int mvaddchstr(int y, int x, const chtype *chstr); ; C Prototype: int mvaddchnstr(int y, int x, const chtype *chstr, int n); ; C Prototype: int mvwaddchstr(WINDOW *win, int y, int x, const chtype *chstr); ; C Prototype: int mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n);
[ { "context": "RITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)))\n(DUMB)\n(MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR\n (5 5 (", "end": 661990, "score": 0.6863499879837036, "start": 661987, "tag": "NAME", "value": "UMB" } ]
books/coi/super-ihs/[email protected]
nzt/acl2
1
(SBP-LOGHEAD-HELPER (128 4 (:REWRITE LOGHEAD-IDENTITY)) (100 4 (:DEFINITION UNSIGNED-BYTE-P)) (76 4 (:DEFINITION INTEGER-RANGE-P)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 14 (:REWRITE DEFAULT-<-2)) (16 14 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR LOGHEAD-LEQ)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:META META-RULE-ERIC)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (SBP-LOGHEAD (39 31 (:REWRITE DEFAULT-<-2)) (39 3 (:REWRITE LOGHEAD-IDENTITY)) (36 31 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE TOP-BIT-MEANS-<)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (25 25 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (18 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE SBP-LOGHEAD-HELPER)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:TYPE-PRESCRIPTION LOGHEAD-TYPE))) (LOGCAR-LOGXOR (7052 3 (:DEFINITION LOGIOR*)) (7037 8 (:REWRITE LOGCDR-LOGAND)) (6849 14 (:DEFINITION LOGAND*)) (6448 28 (:REWRITE LOGCDR-LOGNOT)) (6065 199 (:DEFINITION UNSIGNED-BYTE-P*)) (5123 276 (:REWRITE LOGCAR-IDENTITY)) (5062 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (5003 68 (:REWRITE LOGNOT-ZIP)) (4994 12 (:DEFINITION LOGMASKP*)) (4868 34 (:DEFINITION LOGNOT*)) (4769 32 (:REWRITE ZIP-OPEN)) (3818 138 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (3697 188 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3117 184 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (1842 1842 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (1678 126 (:REWRITE EQUAL-BIT-1)) (1673 414 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1630 6 (:REWRITE LOGIOR-AS-B-IOR)) (1502 62 (:REWRITE B-NOT-OPEN-1)) (1013 276 (:REWRITE LOGCAR-EVENP)) (752 2 (:REWRITE LOGCDR-LOGXOR)) (608 10 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (601 601 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (546 546 (:TYPE-PRESCRIPTION EVENP)) (520 118 (:REWRITE EQUAL-1-HACK)) (480 276 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (470 294 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (416 108 (:REWRITE LOGCAR-0-REWRITE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (366 289 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (349 349 (:REWRITE TOP-BIT-MEANS-<)) (333 333 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (325 304 (:REWRITE DEFAULT-<-1)) (304 304 (:REWRITE DEFAULT-<-2)) (258 258 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (224 18 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (203 14 (:REWRITE LOGNOT-NEG)) (191 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (171 29 (:REWRITE LOGCDR-<-0)) (147 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (132 132 (:TYPE-PRESCRIPTION LOGNOT)) (101 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (88 2 (:REWRITE LOGIOR-=-0)) (76 76 (:TYPE-PRESCRIPTION LOGMASKP)) (76 76 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (70 70 (:TYPE-PRESCRIPTION ZIP)) (55 28 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (55 28 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (54 2 (:REWRITE LOGAND-NEG)) (52 12 (:REWRITE EQUAL-0-LOGAND-BIT)) (40 40 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE)) (20 4 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGXOR)) (18 18 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (18 10 (:REWRITE IFIX-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EQUAL-LOGAND---EXPT-0-REWRITE)) (10 2 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (8 8 (:TYPE-PRESCRIPTION BINARY-LOGIOR)) (6 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-B-NOT)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGCAR)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (LOGXOR-LOGNOT-ONE (141 10 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (41 41 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 10 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 10 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-LOGNOT-TWO (117 9 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (16 9 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (15 9 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-NEG (116 8 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (50 6 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (27 15 (:REWRITE LOGAND-WITH-MASK-ERIC)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (21 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (17 17 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 8 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP))) (INTEGERP-LOGAND) (INTEGERP-LOGXOR) (INTEGERP-LOGIOR) (INTEGERP-LOGEXT) (RATIONALP-LOGAND) (RATIONALP-LOGXOR) (RATIONALP-LOGIOR) (RATIONALP-LOGEXT) (LOGBITP-TOO-BIG (91 91 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (27 17 (:REWRITE DEFAULT-<-2)) (24 17 (:REWRITE DEFAULT-<-1)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 3 (:LINEAR EXPT->-1)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 1 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (USBP-LOGEXT-NARROWER (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE TOP-BIT-MEANS-<)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META META-RULE-ERIC))) (PERHAPS-<=-1-IS-USB1? (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE DEFAULT-<-1))) (SIGNED-BYTE-P-OF-LOGEXT (186 6 (:REWRITE LOGEXT-IDENTITY)) (158 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (138 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:LINEAR LOGCAR-RANGE-LINEAR)) (72 9 (:REWRITE LOGCAR-IDENTITY)) (45 9 (:REWRITE LOGCAR-EVENP)) (40 40 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (22 17 (:REWRITE DEFAULT-<-2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (21 21 (:TYPE-PRESCRIPTION EVENP)) (21 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 17 (:REWRITE DEFAULT-<-1)) (18 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 3 (:REWRITE LOGCAR-0-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR LOGEXT-BOUNDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGXOR-CANCEL2 (24 17 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (21 17 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 4 (:REWRITE IFIX-INTEGERP))) (SBP32-NEGATION (80 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (51 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (44 1 (:REWRITE SIGNED-BYTE-P--2)) (29 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE SBP-BOUND-1)) (5 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-LOGEXT-BETTER (85 85 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 4 (:REWRITE LOGEXT-IDENTITY)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (10 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (8 4 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-+-EXPT (21595 114 (:REWRITE LOGEXT-IDENTITY)) (18961 206 (:DEFINITION SIGNED-BYTE-P*)) (17578 405 (:DEFINITION UNSIGNED-BYTE-P*)) (17372 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (12767 644 (:REWRITE LOGCAR-IDENTITY)) (10740 1038 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10229 327 (:REWRITE EQUAL-BIT-1)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (6422 308 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (5783 195 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5554 358 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4845 81 (:REWRITE NORMALIZE-EQUAL-0)) (3257 88 (:REWRITE SIGNED-BYTE-P-+)) (2444 47 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1578 1061 (:REWRITE DEFAULT-<-1)) (1481 316 (:REWRITE EQUAL-1-HACK)) (1354 1354 (:REWRITE TOP-BIT-MEANS-<)) (1352 364 (:REWRITE <-+-CONSTANT-CONSTANT)) (1261 848 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1233 1233 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1215 1066 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1061 1061 (:REWRITE DEFAULT-<-2)) (1044 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (933 722 (:REWRITE DEFAULT-+-2)) (925 925 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (784 722 (:REWRITE DEFAULT-+-1)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (730 557 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (626 626 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (626 626 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (479 358 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (416 283 (:LINEAR EXPT-LESS-THAN-1-HACK)) (408 408 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (382 123 (:REWRITE DEFAULT-UNARY-MINUS)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (238 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (155 17 (:REWRITE LOGCONS-<-0)) (149 149 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (77 11 (:REWRITE LOGCDR-+2)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 12 (:REWRITE LOGCDR-<-0)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (42 42 (:TYPE-PRESCRIPTION BITP)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (22 22 (:REWRITE SBP-BOUND-1)) (22 22 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (22 11 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (22 11 (:REWRITE UNSIGNED-BYTE-P-LOGCDR-BRIDGE5)) (22 11 (:REWRITE UNSIGNED-BYTE-P-1+)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT (26036 114 (:REWRITE LOGEXT-IDENTITY)) (20875 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (20663 489 (:DEFINITION UNSIGNED-BYTE-P*)) (20553 210 (:DEFINITION SIGNED-BYTE-P*)) (13627 644 (:REWRITE LOGCAR-IDENTITY)) (11585 1195 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10269 331 (:REWRITE EQUAL-BIT-1)) (7201 207 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (7044 132 (:REWRITE ARITH-MOVE-NEGATED-TERM)) (6434 320 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3545 88 (:REWRITE SIGNED-BYTE-P-+)) (3499 84 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (2466 58 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1745 1199 (:REWRITE DEFAULT-+-2)) (1616 1199 (:REWRITE DEFAULT-+-1)) (1603 932 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1552 307 (:REWRITE <-+-CONSTANT-CONSTANT)) (1523 1330 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1514 327 (:REWRITE EQUAL-1-HACK)) (1485 179 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1406 1406 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1332 1332 (:REWRITE TOP-BIT-MEANS-<)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1201 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1199 1199 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1195 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1041 951 (:REWRITE DEFAULT-<-2)) (974 951 (:REWRITE DEFAULT-<-1)) (906 689 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (877 877 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (828 28 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (634 634 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (634 634 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (550 377 (:LINEAR EXPT-LESS-THAN-1-HACK)) (500 15 (:REWRITE NORMALIZE-EQUAL-0)) (416 416 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (322 179 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (265 87 (:REWRITE DEFAULT-UNARY-MINUS)) (252 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (193 193 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (176 88 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (144 8 (:REWRITE SIGNED-BYTE-P--2)) (131 13 (:REWRITE LOGCONS-<-0)) (112 8 (:REWRITE EQUAL-MINUS-MINUS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (66 66 (:TYPE-PRESCRIPTION BITP)) (66 6 (:REWRITE <-+-NEGATIVE-0-1)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (40 4 (:REWRITE LOGCDR-EXPT)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (34 17 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (24 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE EXPT-2-EQUAL-1-REWRITE)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 4 (:DEFINITION =)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT-ALT (261 257 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (204 10 (:REWRITE LOGEXT-IDENTITY)) (84 4 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (60 6 (:REWRITE SIGNED-BYTE-P-+)) (48 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 10 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 19 (:REWRITE DEFAULT-+-2)) (22 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 19 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 5 (:REWRITE DEFAULT-UNARY-MINUS)) (14 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE TOP-BIT-MEANS-<)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 2 (:REWRITE SIGNED-BYTE-P--2)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-TO-SIGNED) (SIGNED-TO-UNSIGNED) (LOGHEAD--OF--LOGEXT-WHEN-UNSIGNED-BYTE-P (504 2 (:LINEAR LOGHEAD-LEQ)) (438 4 (:LINEAR LOGEXT-BOUNDS)) (310 5 (:REWRITE LOGEXT-IDENTITY)) (269 5 (:DEFINITION SIGNED-BYTE-P)) (104 104 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (80 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (72 8 (:LINEAR EXPT->-1)) (69 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (65 49 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (45 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 25 (:REWRITE DEFAULT-<-2)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 7 (:REWRITE DEFAULT-UNARY-MINUS)) (27 25 (:REWRITE DEFAULT-<-1)) (21 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (17 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE))) (LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P (450 10 (:REWRITE LOGHEAD-IDENTITY)) (410 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (256 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (228 228 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (212 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (106 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (98 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 53 (:REWRITE DEFAULT-<-2)) (70 70 (:REWRITE TOP-BIT-MEANS-<)) (60 53 (:REWRITE DEFAULT-<-1)) (58 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (44 44 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (40 10 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 5 (:LINEAR EXPT->-1)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (30 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 4 (:REWRITE LOGHEAD-<)) (24 4 (:LINEAR LOGHEAD-LEQ)) (20 14 (:REWRITE DEFAULT-+-2)) (20 14 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE SBP-LOGHEAD)) (14 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (11 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (11 2 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE FIX-DOES-NOTHING)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE SBP-BOUND-1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT))) (LOGHEAD-EQUAL-REWRITE (288 288 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (260 5 (:REWRITE LOGHEAD-IDENTITY)) (234 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (68 3 (:LINEAR LOGHEAD-LEQ)) (54 39 (:REWRITE DEFAULT-<-2)) (50 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (49 49 (:REWRITE TOP-BIT-MEANS-<)) (49 49 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (49 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (45 39 (:REWRITE DEFAULT-<-1)) (44 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (32 24 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (29 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (14 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1))) (LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE (329 5 (:REWRITE LOGHEAD-IDENTITY)) (299 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (246 246 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (94 70 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (76 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (48 29 (:REWRITE DEFAULT-<-2)) (46 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (40 4 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 29 (:REWRITE DEFAULT-<-1)) (38 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (38 3 (:LINEAR LOGHEAD-LEQ)) (36 6 (:LINEAR EXPT->-1)) (34 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (27 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE RATIONALP-+)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE (113 4 (:REWRITE SBP-BOUND)) (48 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 19 (:REWRITE DEFAULT-<-1)) (31 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (31 19 (:REWRITE DEFAULT-<-2)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (24 24 (:REWRITE TOP-BIT-MEANS-<)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (21 2 (:LINEAR EXPT->-1)) (20 13 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:DEFINITION FIX)) (12 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO (175 5 (:REWRITE SBP-BOUND)) (64 28 (:REWRITE DEFAULT-<-1)) (59 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (55 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 21 (:REWRITE DEFAULT-+-2)) (45 28 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 21 (:REWRITE DEFAULT-+-1)) (31 3 (:LINEAR EXPT->-1)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (10 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (7 7 (:REWRITE SBP-BOUND-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE RATIONALP-+)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE (263 247 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (198 4 (:REWRITE SBP-BOUND)) (93 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (68 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (61 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE DEFAULT-<-1)) (41 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (41 4 (:LINEAR EXPT->-1)) (39 27 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (37 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 23 (:REWRITE DEFAULT-<-2)) (33 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (32 32 (:REWRITE TOP-BIT-MEANS-<)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 13 (:REWRITE DEFAULT-+-1)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR (357 357 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (49 24 (:REWRITE DEFAULT-<-1)) (47 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 24 (:REWRITE DEFAULT-<-2)) (31 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE TOP-BIT-MEANS-<)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (21 13 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 1 (:REWRITE SBP-BOUND)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SB-FREE-BACKCHAIN (140 4 (:REWRITE SBP-BOUND)) (24 12 (:REWRITE DEFAULT-+-2)) (21 12 (:REWRITE DEFAULT-+-1)) (19 8 (:REWRITE DEFAULT-<-1)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 8 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (SB-FREE-BACKCHAIN1 (200 4 (:REWRITE SBP-BOUND)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (33 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (30 18 (:REWRITE DEFAULT-+-2)) (27 18 (:REWRITE DEFAULT-+-1)) (22 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 8 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE DEFAULT-<-2)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (11 11 (:REWRITE EXPONENTS-ADD)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (UNSIGNED-BYTE-P-LOGAPP-BETTER (181 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (146 9 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (101 101 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (95 70 (:REWRITE DEFAULT-<-1)) (86 86 (:REWRITE TOP-BIT-MEANS-<)) (86 86 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 70 (:REWRITE DEFAULT-<-2)) (79 67 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (78 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (51 6 (:LINEAR EXPT->-1)) (44 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (44 3 (:REWRITE SBP-BOUND)) (43 37 (:REWRITE DEFAULT-+-2)) (40 40 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (39 37 (:REWRITE DEFAULT-+-1)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (17 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 1 (:REWRITE LOGHEAD-IDENTITY)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 3 (:REWRITE ASH-0)) (12 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 4 (:REWRITE IFIX-INTEGERP)) (6 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (ASH-<=-TO-SBP (197 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (172 2 (:REWRITE <-*-/-LEFT)) (135 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (100 2 (:REWRITE EXPONENTS-ADD)) (88 2 (:REWRITE EXPT-MINUS)) (70 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 3 (:LINEAR X*Y>1-POSITIVE)) (56 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (42 23 (:REWRITE DEFAULT-<-2)) (36 36 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 3 (:LINEAR EXPT->-1)) (30 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 1 (:REWRITE ASH-BOUND3)) (25 23 (:REWRITE DEFAULT-<-1)) (25 7 (:REWRITE DEFAULT-*-2)) (22 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (19 7 (:REWRITE DEFAULT-*-1)) (18 2 (:REWRITE COMMUTATIVITY-OF-*)) (17 1 (:REWRITE EQUAL-1-HACK)) (16 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 3 (:REWRITE ASH-0)) (12 1 (:REWRITE INTEGERP-EXPT)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (11 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE <-1-EXPT)) (8 1 (:REWRITE EQUAL-BIT-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 1 (:REWRITE ASH-BOUND4A)) (6 1 (:REWRITE ASH-BOUND2A)) (6 1 (:REWRITE ASH-BOUND1)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 1 (:REWRITE DEFAULT-NUMERATOR))) (LOGEXT-BOUNDS-2 (518 8 (:REWRITE LOGEXT-IDENTITY)) (159 159 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 4 (:REWRITE SBP-BOUND)) (136 8 (:LINEAR LOGCAR-RANGE-LINEAR)) (110 10 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (98 3 (:LINEAR LOGEXT-BOUNDS)) (96 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 10 (:REWRITE LOGCAR-IDENTITY)) (60 6 (:LINEAR EXPT->-1)) (52 48 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 10 (:REWRITE LOGCAR-EVENP)) (34 34 (:REWRITE TOP-BIT-MEANS-<)) (34 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (33 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 18 (:REWRITE DEFAULT-<-1)) (29 17 (:REWRITE DEFAULT-+-1)) (26 18 (:REWRITE DEFAULT-<-2)) (25 17 (:REWRITE DEFAULT-+-2)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (22 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (20 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (12 2 (:REWRITE COMMUTATIVITY-OF-+)) (10 10 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 10 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE RATIONALP-+))) (BITP-SIGNED-BYTE-P-32 (8 1 (:REWRITE EQUAL-BIT-1)) (2 2 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (NEGATIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 2 (:LINEAR MOD-TYPE . 2)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (40 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (26 18 (:REWRITE DEFAULT-<-2)) (26 18 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (18 18 (:REWRITE TOP-BIT-MEANS-<)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (POSITIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (50 2 (:LINEAR MOD-TYPE . 2)) (45 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (41 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (28 20 (:REWRITE DEFAULT-<-2)) (28 20 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (20 20 (:REWRITE TOP-BIT-MEANS-<)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-NON-ZERO-TYPE (28 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 4 (:LINEAR LOGHEAD-BOUND)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (10 4 (:LINEAR LOGHEAD-LEQ)) (5 1 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-OF-LOGCAR (272 12 (:REWRITE LOGCAR-IDENTITY)) (56 12 (:REWRITE LOGCAR-EVENP)) (38 34 (:REWRITE DEFAULT-<-1)) (37 34 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE EXPT-COMPARE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 1 (:REWRITE EQUAL-BIT-1)) (23 15 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (21 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE EQUAL-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (SIGNED-BYTE-P-OF-LOGCAR (109 7 (:REWRITE MOD-=-0 . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (63 28 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (62 35 (:REWRITE DEFAULT-<-1)) (44 35 (:REWRITE DEFAULT-<-2)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 39 (:REWRITE EXPT-COMPARE)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (37 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE DEFAULT-*-2)) (25 25 (:REWRITE DEFAULT-*-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 7 (:REWRITE FOLD-CONSTS-IN-*)) (18 1 (:LINEAR MOD-TYPE . 2)) (16 16 (:REWRITE INTEGERP-+-MINUS-*-4)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 1 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE DEFAULT-+-2)) (9 2 (:REWRITE EQUAL-1-HACK)) (7 7 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE DEFAULT-+-1)) (6 2 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGBITP-TEST-OF-TOP-BIT (765 363 (:REWRITE DEFAULT-*-2)) (705 363 (:REWRITE DEFAULT-*-1)) (510 50 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (493 5 (:REWRITE RTL1)) (456 182 (:REWRITE DEFAULT-+-2)) (418 418 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (358 31 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (302 38 (:REWRITE POWER2-INTEGER)) (283 5 (:REWRITE FLOOR-=-X/Y . 3)) (267 8 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (252 240 (:REWRITE EXPT-COMPARE)) (239 239 (:REWRITE TOP-BIT-MEANS-<)) (239 239 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (222 182 (:REWRITE DEFAULT-+-1)) (213 159 (:REWRITE DEFAULT-<-1)) (213 61 (:REWRITE EXPT-COMPARE-EQUAL)) (209 209 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (195 159 (:REWRITE DEFAULT-<-2)) (187 19 (:REWRITE INTEGERP-+-MINUS-*-4)) (147 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (125 25 (:REWRITE DEFAULT-UNARY-/)) (104 1 (:REWRITE EVENP-COLLECT-1)) (93 15 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (92 7 (:REWRITE EVENP-COLLAPSE)) (87 3 (:REWRITE EVENP-*)) (85 1 (:REWRITE EVENP-+)) (83 5 (:REWRITE FLOOR-=-X/Y . 2)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (65 5 (:REWRITE FLOOR-DETERMINED-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (63 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (61 5 (:REWRITE FLOOR-SIMPLE-CASES)) (58 8 (:LINEAR EXPT->-1)) (57 19 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (55 55 (:TYPE-PRESCRIPTION POWER2P)) (53 2 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 9 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (34 34 (:REWRITE POWER2P-EXPT2-I)) (32 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (27 27 (:REWRITE EXPO-EXPT2)) (23 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 5 (:REWRITE FLOOR-TYPE-3 . 3)) (23 5 (:REWRITE FLOOR-TYPE-3 . 2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:REWRITE FOLD-CONSTS-IN-*)) (21 1 (:LINEAR X*Y>1-POSITIVE)) (20 5 (:REWRITE FLOOR-TYPE-4 . 3)) (20 5 (:REWRITE FLOOR-TYPE-4 . 2)) (20 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (18 18 (:REWRITE SBP-BOUND-1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 7 (:REWRITE POWER2P-INVERSE)) (14 1 (:REWRITE EVENP-+-ALT)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (13 1 (:REWRITE SBP-BOUND)) (12 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 1 (:REWRITE DISTRIBUTIVITY)) (10 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 1 (:REWRITE POWER2P-SHIFT-2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-PROD-3)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGBITP-TEST-OF-TOP-BIT-ALT (297 5 (:REWRITE RTL1)) (194 3 (:REWRITE FLOOR-=-X/Y . 3)) (93 17 (:REWRITE POWER2-INTEGER)) (91 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (69 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (62 46 (:REWRITE DEFAULT-<-2)) (58 8 (:LINEAR EXPT->-1)) (56 56 (:REWRITE TOP-BIT-MEANS-<)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (55 3 (:REWRITE FLOOR-=-X/Y . 2)) (54 46 (:REWRITE DEFAULT-<-1)) (53 5 (:REWRITE FLOOR-DETERMINED-1)) (47 14 (:REWRITE DEFAULT-*-2)) (45 15 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (37 37 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (35 9 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (25 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 7 (:REWRITE EXPT-COMPARE-EQUAL)) (20 12 (:REWRITE DEFAULT-+-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (18 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 3 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-*-1)) (14 12 (:REWRITE DEFAULT-+-1)) (13 3 (:REWRITE FLOOR-TYPE-3 . 3)) (13 1 (:REWRITE SBP-BOUND)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE EVENP-COLLAPSE)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE SBP-BOUND-1)) (8 3 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (7 5 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (4 2 (:REWRITE POWER2P-INVERSE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGHEAD-LOGCDR (58 3 (:REWRITE LOGHEAD-IDENTITY)) (44 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (18 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (7 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 5 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE DEFAULT-<-1)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-+-LOGHEAD-SIMPLE (140 3 (:REWRITE LOGBITP-+-TOO-BIG)) (48 6 (:REWRITE LOGHEAD-IDENTITY)) (41 2 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (29 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 6 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE DEFAULT-+-1)) (6 6 (:META META-RULE-ERIC)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (95 95 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (79 41 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (44 44 (:REWRITE TOP-BIT-MEANS-<)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (41 41 (:REWRITE POWER2-INTEGER)) (41 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (34 28 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (115 115 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 39 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (47 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 43 (:REWRITE TOP-BIT-MEANS-<)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (39 39 (:REWRITE POWER2-INTEGER)) (39 27 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (33 27 (:REWRITE DEFAULT-<-1)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (*ARK*-LOGAND-B-AND (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-IOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-XOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (22 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE B-NOT-OPEN-1)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (6 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (*ARK*-LOGAND-LOGCAR (132 20 (:REWRITE LOGCAR-IDENTITY)) (100 20 (:REWRITE LOGCAR-EVENP)) (52 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (48 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (35 35 (:REWRITE POWER2-INTEGER)) (35 35 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 32 (:TYPE-PRESCRIPTION EVENP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (LOGXOR-1 (11 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (5 1 (:REWRITE LOGAND---EXPT-REWRITE)) (4 4 (:TYPE-PRESCRIPTION LOGNOT)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 1 (:REWRITE LOGNOT-ZIP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE B-NOT-OPEN-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 1 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (IFIX-LOGXOR (4 2 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-REWRITE)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (EQUAL-LOGCAR-1 (38 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 4 (:REWRITE LOGCAR-IDENTITY)) (19 4 (:REWRITE LOGCAR-EVENP)) (11 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 4 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGCAR-OF-B-XOR (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 3 (:REWRITE LOGCAR-EVENP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (6 4 (:REWRITE B-NOT-OPEN-1)) (6 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION BITP-OF-B-IOR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION))) (LOGCAR-OF-B-AND (32 4 (:REWRITE EQUAL-BIT-1)) (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 3 (:REWRITE LOGCAR-EVENP)) (12 4 (:REWRITE EQUAL-1-HACK)) (12 4 (:REWRITE BFIX-BITP)) (10 3 (:REWRITE LOGCAR-IDENTITY)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:TYPE-PRESCRIPTION BITP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEXT-BOUND-2 (103 7 (:REWRITE LOGEXT-IDENTITY)) (52 2 (:LINEAR LOGEXT-BOUNDS)) (48 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 12 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE EXPT-COMPARE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-BOUND-REWRITE-1) (LOGEXT-BOUND-REWRITE-2) (LOGEXT-BOUND-UPPER (111 111 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (13 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE EXPONENTS-ADD)) (8 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-LOGHEAD-BETTER (811 35 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (451 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (286 41 (:REWRITE LOGCAR-IDENTITY)) (188 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 114 (:REWRITE EXPT-COMPARE)) (164 15 (:REWRITE LOGHEAD-IDENTITY)) (136 100 (:REWRITE DEFAULT-<-2)) (125 125 (:REWRITE POWER2-INTEGER)) (125 125 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (116 100 (:REWRITE DEFAULT-<-1)) (113 43 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (110 110 (:REWRITE TOP-BIT-MEANS-<)) (97 97 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (90 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (85 85 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (77 77 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (72 35 (:REWRITE LOGBITP-TOO-BIG)) (72 4 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (64 64 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (37 3 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (36 9 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (36 4 (:LINEAR LOGHEAD-LEQ)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 3 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (27 27 (:REWRITE EXPT-COMPARE-EQUAL)) (27 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (26 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 10 (:REWRITE IFIX-INTEGERP)) (21 21 (:REWRITE LOGHEAD-SUBST2)) (21 21 (:REWRITE LOGHEAD-SUBST)) (21 21 (:META META-RULE-ERIC)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (11 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 5 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE POWER2P-EXPT2-I)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1))) (LOGBIT-LOGHEAD-BETTER (548 6 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (504 14 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (486 16 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (469 75 (:REWRITE EXPT-COMPARE-EQUAL)) (392 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (352 80 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (195 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (183 183 (:REWRITE EXPT-COMPARE)) (182 182 (:REWRITE TOP-BIT-MEANS-<)) (167 150 (:REWRITE DEFAULT-<-2)) (154 150 (:REWRITE DEFAULT-<-1)) (137 18 (:REWRITE LOGCAR-IDENTITY)) (126 21 (:REWRITE EQUAL-BIT-1)) (126 14 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (125 8 (:LINEAR LOGHEAD-LEQ)) (117 3 (:REWRITE LOGHEAD-OF-MINUS)) (116 17 (:REWRITE <-+-CONSTANT-CONSTANT)) (112 112 (:REWRITE POWER2-INTEGER)) (112 112 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (112 14 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (107 18 (:REWRITE LOGCAR-EVENP)) (101 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (95 95 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (93 21 (:REWRITE EQUAL-1-HACK)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (79 55 (:REWRITE DEFAULT-+-2)) (71 71 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 55 (:REWRITE DEFAULT-+-1)) (66 21 (:REWRITE EXPO-OF-NOT-RATIONALP)) (66 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (65 18 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (57 3 (:REWRITE LOGBITP-+-TOO-BIG)) (55 55 (:REWRITE LOGHEAD-SUBST2)) (55 55 (:REWRITE LOGHEAD-SUBST)) (55 55 (:META META-RULE-ERIC)) (54 3 (:REWRITE <-*-0)) (52 49 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 28 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (27 27 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 21 (:REWRITE EXPO-EXPT2)) (24 3 (:REWRITE NORMALIZE-EQUAL-0)) (21 21 (:REWRITE POWER2P-EXPT2-I)) (21 21 (:REWRITE EXPO-MINUS-ERIC)) (21 3 (:DEFINITION IFF)) (19 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD-SIMPLE)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD)) (18 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-1+)) (13 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (9 5 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 1 (:REWRITE LOGCONS-<-0)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT))) (LOGCAR-LOGAPP-BETTER (230 34 (:REWRITE LOGCAR-IDENTITY)) (210 35 (:REWRITE LOGCAR-EVENP)) (120 34 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (114 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (96 56 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (56 56 (:REWRITE POWER2-INTEGER)) (56 5 (:REWRITE B-NOT-OPEN-1)) (36 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (34 1 (:REWRITE EVENP-+-ALT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:TYPE-PRESCRIPTION NFIX)) (20 20 (:TYPE-PRESCRIPTION IFIX)) (15 1 (:REWRITE LOGHEAD-IDENTITY)) (14 1 (:REWRITE EVENP-*)) (12 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE EVENP-OF-LOGHEAD)) (6 2 (:REWRITE IFIX-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-LOGAPP-BETTER (1177 220 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (910 126 (:REWRITE LOGCAR-IDENTITY)) (468 32 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (416 416 (:REWRITE TOP-BIT-MEANS-<)) (416 416 (:REWRITE EXPT-COMPARE)) (404 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (362 319 (:REWRITE DEFAULT-<-2)) (360 319 (:REWRITE DEFAULT-<-1)) (287 257 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (260 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (257 257 (:REWRITE POWER2-INTEGER)) (228 220 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (220 220 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (208 112 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 174 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (155 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z)) (154 154 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (132 124 (:REWRITE DEFAULT-+-2)) (128 124 (:REWRITE DEFAULT-+-1)) (121 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (107 107 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (102 102 (:REWRITE LOGBITP-TOO-BIG)) (98 2 (:REWRITE SBP-BOUND)) (87 9 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (73 73 (:REWRITE EXPT-COMPARE-EQUAL)) (73 14 (:REWRITE INTEGERP-UNARY-)) (70 7 (:REWRITE LOGHEAD-IDENTITY)) (66 10 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (61 3 (:DEFINITION MAX)) (58 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (54 18 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (38 36 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (36 36 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (35 19 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (34 31 (:REWRITE DEFAULT-UNARY-MINUS)) (34 6 (:LINEAR EXPT->-1)) (32 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (30 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (24 12 (:DEFINITION FIX)) (22 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 14 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (18 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (16 4 (:REWRITE ASH-0)) (16 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 2 (:REWRITE <-0-+-NEGATIVE-1)) (16 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (13 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE RATIONALP-UNARY--)) (10 5 (:REWRITE RATIONALP-+)) (10 2 (:REWRITE FOLD-CONSTS-IN-+)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-ZERO)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0))) (LOGEXT-OF-LOGEXT-SAME (1020 973 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (646 304 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (498 10 (:REWRITE LOGHEAD-IDENTITY)) (394 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (344 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (336 75 (:REWRITE INTEGERP-+-MINUS-*-2)) (304 304 (:REWRITE POWER2-INTEGER)) (264 132 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (261 12 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (175 175 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (141 141 (:REWRITE TOP-BIT-MEANS-<)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (141 141 (:REWRITE EXPT-COMPARE)) (136 71 (:REWRITE FIX-DOES-NOTHING)) (136 31 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (129 86 (:REWRITE DEFAULT-<-1)) (127 127 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (126 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (120 9 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (115 86 (:REWRITE DEFAULT-<-2)) (108 12 (:LINEAR LOGHEAD-LEQ)) (107 75 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (99 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (94 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (92 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 56 (:REWRITE RATIONALP-+)) (82 6 (:LINEAR EXPT->-1)) (78 3 (:REWRITE NORMALIZE-EQUAL-0)) (68 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (64 37 (:REWRITE DEFAULT-+-2)) (64 8 (:REWRITE LOGCAR-IDENTITY)) (56 8 (:REWRITE INTEGERP-UNARY-)) (52 50 (:META META-RULE-ERIC)) (51 3 (:REWRITE EQUAL-MINUS-MINUS)) (50 37 (:REWRITE DEFAULT-+-1)) (49 49 (:REWRITE LOGHEAD-SUBST2)) (45 8 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 8 (:REWRITE INTEGERP-+-MINUS-*-1)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (26 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (25 8 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (24 3 (:REWRITE EQUAL-BIT-1)) (23 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 4 (:REWRITE RATIONALP-UNARY--)) (14 1 (:REWRITE IFIX-INTEGERP)) (14 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (12 12 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (11 6 (:REWRITE DEFAULT-UNARY-MINUS)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 3 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-1+)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (LOGEXT-+-LOGEXT-BETTER-ALT (165 6 (:LINEAR LOGEXT-BOUND-UPPER)) (107 8 (:REWRITE LOGEXT-IDENTITY)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (60 33 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 33 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE TOP-BIT-MEANS-<)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (28 18 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE POWER2-INTEGER)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (16 10 (:REWRITE DEFAULT-+-2)) (15 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE DEFAULT-+-1)) (9 9 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (9 9 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 6 (:REWRITE FIX-DOES-NOTHING)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE LOGEXT-+-CANCEL)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-OF-PRODUCT-WITH-2 (974 69 (:REWRITE POWER2-INTEGER)) (743 4 (:REWRITE FLOOR-=-X/Y . 3)) (712 46 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (524 14 (:REWRITE <-*-/-LEFT)) (504 9 (:REWRITE <-*-Y-X-Y)) (424 13 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (410 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (300 6 (:REWRITE 0-<-*)) (280 4 (:REWRITE RTL1)) (280 4 (:REWRITE FLOOR-SIMPLE-CASES)) (280 4 (:REWRITE FLOOR-DETERMINED-1)) (261 6 (:REWRITE <-*-0)) (249 5 (:REWRITE EVENP-COLLAPSE)) (243 4 (:REWRITE FLOOR-TYPE-3 . 3)) (236 27 (:REWRITE INTEGERP-+-MINUS-*-4)) (232 4 (:REWRITE FLOOR-TYPE-4 . 2)) (222 37 (:LINEAR X*Y>1-POSITIVE)) (219 4 (:REWRITE FLOOR-TYPE-3 . 2)) (217 4 (:REWRITE FLOOR-TYPE-4 . 3)) (215 215 (:REWRITE TOP-BIT-MEANS-<)) (215 215 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (215 215 (:REWRITE EXPT-COMPARE)) (207 11 (:REWRITE EXPO-SHIFT-CONSTANT)) (198 21 (:REWRITE EXPO-/-POWER2P-ALT)) (196 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (185 14 (:REWRITE <-*-/-RIGHT)) (184 63 (:REWRITE EXPT-COMPARE-EQUAL)) (179 79 (:REWRITE DEFAULT-*-2)) (177 4 (:REWRITE EVENP-*)) (160 124 (:REWRITE DEFAULT-<-2)) (148 14 (:REWRITE NORMALIZE-EQUAL-0)) (136 18 (:LINEAR EXPT->-1)) (134 13 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (129 12 (:DEFINITION IFF)) (126 124 (:REWRITE DEFAULT-<-1)) (126 13 (:REWRITE INTEGERP-PROD-3)) (112 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (111 21 (:REWRITE COMMUTATIVITY-OF-+)) (102 7 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 4 (:REWRITE FLOOR-=-X/Y . 2)) (97 79 (:REWRITE DEFAULT-*-1)) (91 29 (:REWRITE EXPO-OF-NOT-RATIONALP)) (87 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (77 29 (:REWRITE FOLD-CONSTS-IN-*)) (67 67 (:TYPE-PRESCRIPTION POWER2P)) (62 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 56 (:REWRITE DEFAULT-+-2)) (59 56 (:REWRITE DEFAULT-+-1)) (53 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 50 (:REWRITE POWER2P-EXPT2-I)) (45 21 (:REWRITE UNICITY-OF-0)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (42 21 (:REWRITE POWER2P-INVERSE)) (40 11 (:REWRITE POWER2P-SHIFT-2)) (33 29 (:REWRITE EXPO-EXPT2)) (32 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (31 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (29 29 (:REWRITE EXPO-MINUS-ERIC)) (26 23 (:REWRITE DEFAULT-UNARY-MINUS)) (24 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 4 (:REWRITE DEFAULT-UNARY-/)) (20 15 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (17 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE TIMES-ZERO)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 13 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 8 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-+)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGBITP-OF-PRODUCT-WITH-1/2 (1584 78 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1522 12 (:REWRITE FLOOR-=-X/Y . 3)) (1184 104 (:REWRITE POWER2-INTEGER)) (993 40 (:REWRITE <-*-/-LEFT)) (401 12 (:REWRITE RTL1)) (401 12 (:REWRITE FLOOR-SIMPLE-CASES)) (401 12 (:REWRITE FLOOR-DETERMINED-1)) (399 8 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (383 61 (:REWRITE INTEGERP-+-MINUS-*-4)) (371 56 (:LINEAR X*Y>1-POSITIVE)) (351 131 (:REWRITE DEFAULT-*-2)) (330 8 (:REWRITE EVENP-*)) (320 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (300 8 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (279 279 (:REWRITE TOP-BIT-MEANS-<)) (279 279 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (279 279 (:REWRITE EXPT-COMPARE)) (265 12 (:REWRITE FLOOR-TYPE-3 . 3)) (265 12 (:REWRITE FLOOR-TYPE-3 . 2)) (253 196 (:REWRITE DEFAULT-<-2)) (249 12 (:REWRITE FLOOR-TYPE-4 . 3)) (249 12 (:REWRITE FLOOR-TYPE-4 . 2)) (234 26 (:REWRITE EXPO-/-POWER2P-ALT)) (230 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (210 30 (:LINEAR EXPT->-1)) (210 16 (:REWRITE <-*-/-RIGHT)) (203 196 (:REWRITE DEFAULT-<-1)) (202 12 (:REWRITE FLOOR-=-X/Y . 2)) (187 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (166 131 (:REWRITE DEFAULT-*-1)) (130 26 (:REWRITE COMMUTATIVITY-OF-+)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (104 104 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (100 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (96 32 (:REWRITE EXPO-OF-NOT-RATIONALP)) (82 61 (:REWRITE DEFAULT-+-2)) (80 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (69 69 (:TYPE-PRESCRIPTION POWER2P)) (66 33 (:REWRITE FOLD-CONSTS-IN-*)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 30 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (61 61 (:REWRITE DEFAULT-+-1)) (61 13 (:REWRITE EXPT-COMPARE-EQUAL)) (60 60 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (58 58 (:REWRITE POWER2P-EXPT2-I)) (52 26 (:REWRITE UNICITY-OF-0)) (52 26 (:REWRITE POWER2P-INVERSE)) (40 8 (:REWRITE DEFAULT-UNARY-/)) (36 30 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (32 32 (:REWRITE EXPO-MINUS-ERIC)) (32 32 (:REWRITE EXPO-EXPT2)) (30 30 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE DEFAULT-UNARY-MINUS)) (20 5 (:REWRITE POWER2P-SHIFT-2)) (18 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE SBP-BOUND-1)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-PROD-3)) (6 6 (:REWRITE ODDP-OF-*)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (5 5 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE ODDP-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGBITP-OF-*-EXPT-2-SPECIAL (309 24 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (158 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (95 18 (:REWRITE LOGCAR-IDENTITY)) (76 28 (:REWRITE DEFAULT-*-2)) (68 21 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (62 46 (:REWRITE DEFAULT-<-2)) (57 57 (:REWRITE TOP-BIT-MEANS-<)) (57 57 (:REWRITE EXPT-COMPARE)) (56 56 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (54 46 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE POWER2-INTEGER)) (42 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (42 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 28 (:REWRITE DEFAULT-*-1)) (37 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 36 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 24 (:REWRITE LOGBITP-TOO-BIG)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (18 18 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE ZIP-OPEN))) (LOGBITP-OF-*-EXPT-2-SPECIAL-CONST (96 7 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (51 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 9 (:REWRITE LOGCAR-IDENTITY)) (19 15 (:REWRITE DEFAULT-<-2)) (17 15 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 8 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (9 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC))) (THE-CHECK-NOOP) (LOGAND-BOUND (74 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (43 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGNOT-BOUND (16 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 3 (:REWRITE LOGNOT-ZIP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (5 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 3 (:REWRITE ZIP-OPEN)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGEQV-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGIOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (5 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGXOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGXOR-BIT-BOUND (4 4 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGIOR-BOUND1) (LOGAND-BOUND-REWRITE-1 (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-BOUND-REWRITE-2 (3 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (ASH--15-HACK (17 1 (:REWRITE ASH-BOUND4)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:REWRITE ASH-BOUND2)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 1 (:REWRITE ASH-0)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0))) (ASH--8-HACK (17 1 (:REWRITE ASH-BOUND4)) (17 1 (:REWRITE ASH-BOUND3)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (6 1 (:REWRITE ASH-BOUND2)) (6 1 (:REWRITE ASH-BOUND1)) (6 1 (:REWRITE <-*-/-RIGHT-COMMUTED)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 1 (:REWRITE ASH-BOUND2A)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-BOUND4A))) (LOGIOR-BOUND-REWRITE-7 (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (*ARK*-+* (2116 1460 (:REWRITE DEFAULT-+-2)) (1790 1460 (:REWRITE DEFAULT-+-1)) (1459 1071 (:REWRITE DEFAULT-*-2)) (1071 1071 (:REWRITE DEFAULT-*-1)) (934 788 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (780 780 (:REWRITE EXPT-COMPARE-EQUAL)) (680 105 (:REWRITE EQUAL-1-HACK)) (552 398 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (443 279 (:REWRITE SUM-POWER-OF-TWO)) (435 58 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (174 29 (:REWRITE <-+-CONSTANT-CONSTANT)) (169 169 (:REWRITE POWER2-INTEGER)) (123 41 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (96 32 (:REWRITE BFIX-BITP)) (92 92 (:TYPE-PRESCRIPTION BITP)) (89 89 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (89 89 (:REWRITE EXPT-COMPARE)) (78 14 (:REWRITE EQUAL-LOGCONS)) (75 66 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE DEFAULT-UNARY-MINUS)) (41 41 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (41 41 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (31 31 (:REWRITE DEFAULT-<-2)) (31 31 (:REWRITE DEFAULT-<-1)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:TYPE-PRESCRIPTION LOGCDR-LOGCDR-INDUCTION))) (*ARK*-SIGNED-BYTE-P-+-BRIDGE (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (*ARK*-SIGNED-BYTE-P-31-23-BRIDGE (4 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (SIGNED-BYTE-P-32-BRIDGE (8 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (SIGNED-BYTE-P-32-BRIDGE2 (44 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (25 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 2 (:REWRITE ERIC9)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-32-+-BRIDGE (17 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (6 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-+--EXPT-17-BRIDGE (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-LOGHEAD-7-65535 (26 2 (:REWRITE MOD-=-0 . 2)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (13 1 (:LINEAR MOD-TYPE . 2)) (12 8 (:REWRITE DEFAULT-<-2)) (12 8 (:REWRITE DEFAULT-<-1)) (12 3 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (9 6 (:REWRITE DEFAULT-*-2)) (9 6 (:REWRITE DEFAULT-*-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-31-LOGCDR-BRIDGE (187 14 (:REWRITE MOD-=-0 . 2)) (185 15 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (169 98 (:REWRITE DEFAULT-*-2)) (167 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (158 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (121 98 (:REWRITE DEFAULT-*-1)) (104 74 (:REWRITE DEFAULT-<-2)) (104 74 (:REWRITE DEFAULT-<-1)) (90 90 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (90 90 (:REWRITE EXPT-COMPARE)) (90 50 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (88 87 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (78 6 (:LINEAR MOD-TYPE . 2)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 50 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 40 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (35 17 (:REWRITE DEFAULT-+-2)) (33 33 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 15 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (24 2 (:LINEAR FLOOR-TYPE-2 . 2)) (24 2 (:LINEAR FLOOR-TYPE-2 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (22 14 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 2 (:LINEAR FLOOR-TYPE-1 . 2)) (22 2 (:LINEAR FLOOR-TYPE-1 . 1)) (17 17 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (10 2 (:REWRITE CANCEL-MOD-+-BASIC)) (6 6 (:LINEAR MOD-TYPE . 3)) (6 6 (:LINEAR MOD-TYPE . 1)) (6 1 (:REWRITE DISTRIBUTIVITY-ALT)) (6 1 (:DEFINITION IFIX)) (4 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (*ARK*-LOGAND-BIT-CONSTANT (714 7 (:DEFINITION BINARY-LOGAND)) (252 14 (:REWRITE FLOOR-BY-TWICE-HACK)) (182 14 (:REWRITE FLOOR-OF-SHIFT-RIGHT-2)) (126 21 (:REWRITE COMMUTATIVITY-OF-+)) (84 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 56 (:REWRITE DEFAULT-+-2)) (77 56 (:REWRITE DEFAULT-+-1)) (70 63 (:REWRITE DEFAULT-*-2)) (70 14 (:REWRITE FOLD-CONSTS-IN-*)) (63 63 (:REWRITE DEFAULT-*-1)) (56 56 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (42 28 (:REWRITE FIX-DOES-NOTHING)) (42 14 (:REWRITE UNICITY-OF-0)) (42 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (36 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (36 9 (:REWRITE LOGCAR-EVENP)) (32 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (28 28 (:TYPE-PRESCRIPTION LOGMASKP)) (28 28 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (28 14 (:REWRITE UNICITY-OF-1)) (17 9 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE POWER2-INTEGER)) (14 14 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION IFIX)) (7 7 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGIOR-LOGXOR (123 16 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (30 16 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (27 16 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (16 16 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGNOT-ZIP)) (12 8 (:REWRITE LOGAND-WITH-MASK-ERIC)) (12 8 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION LOGNOT)) (8 8 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGIOR-LOGIOR-CONST)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE ZIP-OPEN))) (LOGXOR-LOGIOR (153 23 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (76 8 (:REWRITE LOGNOT-ZIP)) (63 2 (:REWRITE ZIP-OPEN)) (49 30 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (48 30 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (46 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (42 30 (:REWRITE LOGAND-WITH-MASK-ERIC)) (40 23 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (40 23 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (23 23 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE LOGIOR-LOGIOR-CONST)) (5 1 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGIOR-=-0)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE EQUAL-LOGIOR-CONST-CONST))) (*ARK*-FOLD-IN-TWO-CROCK (137 43 (:REWRITE DEFAULT-*-2)) (84 84 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (64 7 (:REWRITE ZIP-OPEN)) (60 12 (:LINEAR X*Y>1-POSITIVE)) (43 43 (:REWRITE DEFAULT-*-1)) (43 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (34 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (33 27 (:REWRITE DEFAULT-+-1)) (33 3 (:REWRITE NORMALIZE-EQUAL-0)) (32 32 (:REWRITE EXPT-COMPARE)) (27 27 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-<-2)) (26 26 (:REWRITE DEFAULT-<-1)) (24 3 (:REWRITE EQUAL-MINUS-MINUS)) (16 4 (:REWRITE SUM-POWER-OF-TWO)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:REWRITE EXPT-2-CRUNCHER)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EXPO-MINUS-ERIC))) (*ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE (56 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (17 1 (:REWRITE EQUAL-1-HACK)) (15 2 (:REWRITE POWER2-INTEGER)) (5 3 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (*ARK*-ASH-POS-LOGHEAD-CHEATER (4324 55 (:REWRITE LOGHEAD-IDENTITY)) (4167 125 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (2807 51 (:DEFINITION UNSIGNED-BYTE-P*)) (746 719 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (676 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (618 618 (:REWRITE EXPT-COMPARE)) (553 553 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (512 153 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (374 374 (:REWRITE DEFAULT-<-2)) (374 374 (:REWRITE DEFAULT-<-1)) (351 17 (:REWRITE ZIP-OPEN)) (331 21 (:REWRITE ASH-0)) (297 27 (:REWRITE NORMALIZE-EQUAL-0)) (288 12 (:DEFINITION EXPT)) (278 278 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (244 244 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (239 223 (:REWRITE DEFAULT-+-2)) (226 223 (:REWRITE DEFAULT-+-1)) (216 27 (:REWRITE EQUAL-MINUS-MINUS)) (179 179 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (174 151 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (153 153 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (135 27 (:REWRITE SUM-POWER-OF-TWO)) (135 27 (:REWRITE EQUAL-1-HACK)) (119 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (119 64 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (115 115 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (113 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (99 99 (:REWRITE EXPT-COMPARE-EQUAL)) (66 6 (:LINEAR LOGHEAD-LEQ)) (64 64 (:META META-RULE-ERIC)) (64 25 (:REWRITE ASH-GOES-TO-0)) (63 40 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 38 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (60 45 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (60 27 (:REWRITE DEFAULT-*-2)) (50 25 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (48 33 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (46 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (44 26 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (39 12 (:REWRITE COMMUTATIVITY-OF-+)) (35 25 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (32 32 (:REWRITE LOGHEAD-SUBST)) (27 27 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (27 27 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE DEFAULT-*-1)) (27 9 (:REWRITE EXPT-2-CRUNCHER)) (23 23 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (21 3 (:REWRITE LOGCDR-<-0)) (13 13 (:TYPE-PRESCRIPTION ZIP)) (9 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (*ARK*-ASH-POS-LOGHEAD-CHEATER2 (8591 131 (:REWRITE LOGHEAD-IDENTITY)) (8032 237 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5344 109 (:DEFINITION UNSIGNED-BYTE-P*)) (1448 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1258 1258 (:REWRITE EXPT-COMPARE)) (1104 299 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1095 1095 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (774 766 (:REWRITE DEFAULT-<-2)) (766 766 (:REWRITE DEFAULT-<-1)) (644 90 (:REWRITE EQUAL-1-HACK)) (638 557 (:REWRITE DEFAULT-+-2)) (565 557 (:REWRITE DEFAULT-+-1)) (536 536 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (526 74 (:REWRITE ASH-0)) (472 472 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (448 12 (:REWRITE ZIP-OPEN)) (373 77 (:REWRITE SUM-POWER-OF-TWO)) (363 88 (:REWRITE LOGCAR-EVENP)) (340 293 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (299 299 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (271 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (260 260 (:REWRITE EXPT-COMPARE-EQUAL)) (257 140 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (239 239 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 150 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (192 129 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (184 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (156 78 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (148 79 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (140 140 (:META META-RULE-ERIC)) (140 12 (:LINEAR LOGHEAD-LEQ)) (135 88 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (129 82 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (115 78 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (99 46 (:REWRITE DEFAULT-*-2)) (90 82 (:REWRITE DEFAULT-UNARY-MINUS)) (78 78 (:REWRITE ASH-GOES-TO-0)) (74 74 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (70 70 (:REWRITE LOGHEAD-SUBST2)) (70 70 (:REWRITE LOGHEAD-SUBST)) (61 61 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (49 7 (:REWRITE LOGCDR-<-0)) (46 46 (:REWRITE DEFAULT-*-1)) (21 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 18 (:REWRITE POWER2-INTEGER)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (ASH-LOGXOR (504 4 (:REWRITE ASH-0)) (496 4 (:REWRITE ZIP-OPEN)) (204 8 (:LINEAR LOGAND-BOUND)) (160 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (136 8 (:LINEAR LOGNOT-BOUND)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (68 4 (:REWRITE SIGNED-BYTE-P-LOGOPS)) (59 4 (:REWRITE LOGIOR-AS-B-IOR)) (52 4 (:REWRITE LOGNOT-NEG)) (32 4 (:REWRITE EQUAL-0-LOGAND-BIT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE EXPT-COMPARE)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 16 (:REWRITE DEFAULT-<-2)) (17 16 (:REWRITE DEFAULT-<-1)) (16 16 (:TYPE-PRESCRIPTION LOGNOT)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 4 (:REWRITE ASH-AS-LOGTAIL)) (11 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (10 4 (:REWRITE LOGNOT-ZIP)) (8 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE))) (ASH-LOGAND-NEG (184 8 (:LINEAR LOGAND-BOUND)) (136 8 (:REWRITE SIGNED-BYTE-P-ASH)) (58 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (58 8 (:REWRITE LOGTAIL-IDENTITY)) (56 8 (:REWRITE <=-0-ASH)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (36 36 (:REWRITE EXPT-COMPARE)) (31 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (28 28 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (19 9 (:REWRITE LOGAND-WITH-MASK-ERIC)) (17 17 (:REWRITE DEFAULT-UNARY-MINUS)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (13 9 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (13 9 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:TYPE-PRESCRIPTION LOGMASKP)) (10 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (8 8 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:TYPE-PRESCRIPTION ADD1-INDUCTION)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (ASH-LEAVES-ONE-BIT-LEFT-HELPER (431 4 (:REWRITE LOGTAIL-IDENTITY)) (325 11 (:DEFINITION EXPT)) (158 154 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 4 (:REWRITE ZIP-OPEN)) (71 62 (:REWRITE DEFAULT-<-2)) (64 62 (:REWRITE DEFAULT-<-1)) (63 59 (:REWRITE DEFAULT-+-1)) (59 59 (:REWRITE DEFAULT-+-2)) (55 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 31 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 4 (:REWRITE NORMALIZE-EQUAL-0)) (42 12 (:REWRITE COMMUTATIVITY-OF-+)) (32 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 4 (:REWRITE EQUAL-MINUS-MINUS)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (26 26 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (25 5 (:REWRITE EQUAL-1-HACK)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 6 (:REWRITE LOGBITP-TOO-BIG)) (21 7 (:REWRITE EXPT-2-CRUNCHER)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 4 (:REWRITE SUM-POWER-OF-TWO)) (19 5 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPONENTS-ADD)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ZP-OPEN))) (ASH-LEAVES-ONE-BIT-LEFT (302 2 (:REWRITE LOGTAIL-IDENTITY)) (235 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (189 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (87 31 (:REWRITE EXPT-COMPARE)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (78 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 4 (:REWRITE POWER2-INTEGER)) (51 3 (:REWRITE EQUAL-1-HACK)) (40 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (38 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 19 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 7 (:REWRITE EXPO-OF-NOT-RATIONALP)) (19 19 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (16 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE UNICITY-OF-0)) (12 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 9 (:REWRITE POWER2P-EXPT2-I)) (9 7 (:REWRITE EXPO-EXPT2)) (9 3 (:REWRITE DEFAULT-NUMERATOR)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE INVERSE-OF-+)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (ASH-NEG-LOGHEAD (839 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (432 130 (:REWRITE EXPT-COMPARE)) (315 7 (:REWRITE EXPT-MINUS)) (252 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (234 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (157 10 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (144 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (142 13 (:REWRITE LOGHEAD-IDENTITY)) (123 123 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE DEFAULT-+-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (85 5 (:REWRITE EQUAL-1-HACK)) (67 57 (:REWRITE DEFAULT-<-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (61 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (59 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (57 57 (:REWRITE DEFAULT-<-2)) (57 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 9 (:REWRITE POWER2-INTEGER)) (41 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (38 2 (:REWRITE EXPO-SHIFT-CONSTANT)) (36 4 (:LINEAR LOGHEAD-LEQ)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 7 (:REWRITE DEFAULT-UNARY-/)) (33 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE DEFAULT-UNARY-MINUS)) (27 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE POWER2P-EXPT2-I)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 19 (:REWRITE EXPO-EXPT2)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (19 11 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:META META-RULE-ERIC)) (18 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 5 (:REWRITE DEFAULT-NUMERATOR)) (14 7 (:REWRITE POWER2P-INVERSE)) (13 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 2 (:REWRITE POWER2P-SHIFT-2)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE LOGCDR-<-0)) (6 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE EXPONENTS-ADD)) (3 3 (:TYPE-PRESCRIPTION ADD1-SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE ZP-OPEN))) (SIGNED-BYTE-P-OF-LOGTAIL (342 132 (:REWRITE EXPT-COMPARE)) (256 8 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (255 8 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (245 8 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (159 91 (:REWRITE DEFAULT-<-2)) (152 23 (:LINEAR EXPT->-1)) (139 53 (:REWRITE DEFAULT-*-2)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (104 47 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (102 91 (:REWRITE DEFAULT-<-1)) (93 53 (:REWRITE DEFAULT-*-1)) (87 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (70 5 (:REWRITE LOGTAIL-IDENTITY)) (60 51 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (60 24 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 1 (:REWRITE INTEGERP-UNARY-)) (35 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 8 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE FOLD-CONSTS-IN-*)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL))) (USBP-OVER-LOGAND (242 4 (:LINEAR LOGAND-BOUND)) (118 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (116 44 (:REWRITE EXPT-COMPARE)) (98 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (93 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (42 30 (:REWRITE DEFAULT-<-2)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 30 (:REWRITE DEFAULT-<-1)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 3 (:LINEAR EXPT->-1)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:TYPE-PRESCRIPTION POWER2P)) (12 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPO-EXPT2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 2 (:REWRITE LOGAND-NEG)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-OF-LOGEXT (761 6 (:LINEAR LOGHEAD-LEQ)) (727 28 (:REWRITE LOGEXT-IDENTITY)) (640 23 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (363 21 (:REWRITE LOGHEAD-IDENTITY)) (315 70 (:REWRITE LOGCAR-EVENP)) (306 34 (:LINEAR LOGCAR-RANGE-LINEAR)) (247 10 (:LINEAR LOGEXT-BOUNDS-2)) (236 236 (:REWRITE POWER2-INTEGER)) (184 10 (:LINEAR LOGEXT-BOUNDS)) (163 5 (:LINEAR LOGEXT-BOUND-UPPER)) (156 156 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (150 87 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (150 26 (:REWRITE LOGCAR-0-REWRITE)) (147 147 (:TYPE-PRESCRIPTION EVENP)) (140 91 (:REWRITE DEFAULT-<-2)) (128 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 91 (:REWRITE DEFAULT-<-1)) (94 94 (:REWRITE EXPT-COMPARE)) (94 15 (:REWRITE USBP-LOGEXT-NARROWER)) (91 91 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (78 78 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (63 5 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (59 59 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 56 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (54 3 (:REWRITE LOGBITP-LOGCAR)) (48 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (40 40 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (37 34 (:REWRITE LOGHEAD-SUBST2)) (34 34 (:REWRITE LOGHEAD-SUBST)) (34 34 (:META META-RULE-ERIC)) (31 31 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (21 3 (:LINEAR EXPT->-1)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-OF-1 (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 7 (:REWRITE DEFAULT-<-1)) (9 9 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-<-2)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE POWER2-INTEGER)) (4 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X (56 1 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (49 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (45 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (33 28 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (24 4 (:LINEAR EXPT->-1)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 20 (:REWRITE POWER2-INTEGER)) (17 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 4 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGIOR-UNSIGNED-BYTE-P-16-ONE (10 1 (:REWRITE LOGIOR-AS-B-IOR)) (6 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION))) (LOGIOR-UNSIGNED-BYTE-P-16-TWO (30 3 (:REWRITE LOGIOR-AS-B-IOR)) (12 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-MINUS (3500 158 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1543 236 (:REWRITE EXPT-COMPARE-EQUAL)) (1073 133 (:LINEAR EXPT->-1)) (1000 21 (:REWRITE RTL1)) (1000 21 (:REWRITE FLOOR-SIMPLE-CASES)) (1000 21 (:REWRITE FLOOR-DETERMINED-1)) (876 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (812 266 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (630 477 (:REWRITE DEFAULT-<-2)) (624 124 (:REWRITE POWER2-INTEGER)) (567 567 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (567 567 (:REWRITE EXPT-COMPARE)) (553 79 (:REWRITE DEFAULT-UNARY-/)) (537 498 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (477 477 (:REWRITE DEFAULT-<-1)) (462 124 (:REWRITE DEFAULT-+-2)) (440 139 (:REWRITE DEFAULT-UNARY-MINUS)) (408 135 (:REWRITE DEFAULT-*-2)) (366 102 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (346 7 (:REWRITE ODDP-OF-*)) (326 8 (:REWRITE FLOOR-=-X/Y . 2)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (292 73 (:REWRITE EXPO-OF-NOT-RATIONALP)) (288 249 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (280 56 (:REWRITE EQUAL-1-HACK)) (258 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (244 61 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (229 124 (:REWRITE DEFAULT-+-1)) (216 54 (:REWRITE EXPT-2-CRUNCHER)) (211 211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 51 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (200 200 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 133 (:LINEAR EXPT-LESS-THAN-1-HACK)) (164 12 (:REWRITE EXPO-/-POWER2P-ALT)) (153 153 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (146 146 (:TYPE-PRESCRIPTION POWER2P)) (146 73 (:REWRITE EXPO-EXPT2)) (135 135 (:REWRITE DEFAULT-*-1)) (130 10 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 102 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (91 13 (:REWRITE FLOOR-TYPE-3 . 3)) (91 13 (:REWRITE FLOOR-TYPE-3 . 2)) (88 25 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (85 85 (:REWRITE POWER2P-EXPT2-I)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (82 25 (:LINEAR MOD-TYPE . 3)) (82 25 (:LINEAR MOD-TYPE . 1)) (78 13 (:REWRITE FLOOR-TYPE-4 . 3)) (78 13 (:REWRITE FLOOR-TYPE-4 . 2)) (73 73 (:REWRITE EXPO-MINUS-ERIC)) (56 56 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (26 26 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (26 26 (:REWRITE EXPONENTS-ADD)) (26 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (25 25 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (24 12 (:REWRITE POWER2P-INVERSE)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (PLUS-OF-LOGAPP-SUCK-IN (92 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (81 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (64 30 (:REWRITE DEFAULT-+-2)) (42 30 (:REWRITE DEFAULT-+-1)) (34 29 (:REWRITE DEFAULT-<-2)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 29 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 2 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 5 (:LINEAR EXPT->-1)) (19 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 3 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (PLUS-OF-LOGAPP-SUCK-IN-ALT (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (PLUS-MINUS-HALF-COLLECT) (LOGHEAD-OF-PROD-OF-LOGEXT-HELPER (52714 108 (:REWRITE <-*-0)) (52714 108 (:REWRITE 0-<-*)) (43020 216 (:DEFINITION IFF)) (20420 387 (:REWRITE FLOOR-=-X/Y . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 2)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 3)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 2)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (11778 1198 (:REWRITE INTEGERP-+-MINUS-*-4)) (10073 2195 (:REWRITE DEFAULT-*-2)) (9895 1462 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9752 174 (:LINEAR MOD-TYPE . 2)) (7135 387 (:REWRITE FLOOR-=-X/Y . 2)) (6437 3307 (:REWRITE DEFAULT-<-2)) (6174 190 (:REWRITE MOD-=-0 . 2)) (5628 389 (:REWRITE RTL1)) (5628 389 (:REWRITE FLOOR-DETERMINED-1)) (4699 4699 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4699 4699 (:REWRITE EXPT-COMPARE)) (4580 67 (:REWRITE NORMALIZE-EQUAL-0)) (4312 3307 (:REWRITE DEFAULT-<-1)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4015 365 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3625 725 (:REWRITE DEFAULT-UNARY-/)) (3469 1106 (:REWRITE EXPT-COMPARE-EQUAL)) (3294 366 (:REWRITE EXPO-/-POWER2P-ALT)) (3110 2195 (:REWRITE DEFAULT-*-1)) (2304 2304 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2211 2211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2154 718 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1998 30 (:REWRITE INTEGERP-+-MINUS-*-2)) (1977 659 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1688 67 (:REWRITE EQUAL-MINUS-MINUS)) (1545 309 (:LINEAR X*Y>1-POSITIVE)) (1495 60 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1488 24 (:REWRITE MOD-=-0 . 1)) (1458 810 (:REWRITE DEFAULT-+-2)) (1438 126 (:REWRITE INTEGERP-PROD-3)) (1426 126 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (1347 67 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1275 1275 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1244 4 (:REWRITE CANCEL-FLOOR-+-BASIC)) (1050 1050 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1032 718 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1024 64 (:REWRITE <-0-+-NEGATIVE-1)) (993 471 (:REWRITE DEFAULT-UNARY-MINUS)) (957 286 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (837 810 (:REWRITE DEFAULT-+-1)) (732 366 (:REWRITE UNICITY-OF-0)) (732 366 (:REWRITE POWER2P-INVERSE)) (659 659 (:REWRITE EXPO-MINUS-ERIC)) (573 191 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (570 190 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (552 24 (:REWRITE MOD-TYPE)) (540 174 (:LINEAR MOD-TYPE . 3)) (538 174 (:LINEAR MOD-TYPE . 1)) (533 529 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (320 64 (:REWRITE SUM-POWER-OF-TWO)) (316 191 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (256 256 (:LINEAR EXPT-LESS-THAN-1-HACK)) (224 112 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (192 6 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (182 90 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (182 90 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (112 112 (:TYPE-PRESCRIPTION EVENP)) (64 64 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (32 32 (:TYPE-PRESCRIPTION IFF)) (30 30 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 2 (:REWRITE INTEGERP-UNARY-)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT))) (LOGHEAD-OF-PROD-OF-LOGEXT (466 4 (:LINEAR LOGHEAD-LEQ)) (414 4 (:REWRITE <-*-0)) (168 12 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:DEFINITION IFF)) (122 84 (:REWRITE DEFAULT-<-2)) (92 84 (:REWRITE DEFAULT-<-1)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (88 4 (:REWRITE LOGEXT-IDENTITY)) (84 12 (:LINEAR LOGEXT-BOUNDS-2)) (84 12 (:LINEAR LOGEXT-BOUNDS)) (72 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 68 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (54 54 (:REWRITE POWER2-INTEGER)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (46 46 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (38 38 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (32 32 (:TYPE-PRESCRIPTION IFIX)) (32 8 (:REWRITE LOGCAR-EVENP)) (24 24 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (22 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 10 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (14 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR EXPT->-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (10 10 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT (60 60 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 3 (:REWRITE LOGTAIL-IDENTITY)) (42 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (39 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE EXPT-COMPARE)) (24 3 (:REWRITE LOGHEAD-IDENTITY)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SPLIT (153 11 (:REWRITE LOGHEAD-IDENTITY)) (140 140 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 28 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE DEFAULT-<-2)) (26 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 13 (:META META-RULE-ERIC)) (13 13 (:REWRITE POWER2-INTEGER)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-EQUAL-LOGAPP-REWRITE-HELPER (291 23 (:REWRITE LOGHEAD-IDENTITY)) (137 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (100 91 (:REWRITE DEFAULT-<-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (91 91 (:REWRITE DEFAULT-<-2)) (79 10 (:LINEAR LOGHEAD-LEQ)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (57 57 (:REWRITE POWER2-INTEGER)) (52 51 (:META META-RULE-ERIC)) (41 41 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (36 6 (:REWRITE ASH-AS-LOGTAIL)) (30 5 (:LINEAR EXPT->-1)) (25 10 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (12 3 (:REWRITE ASH-0)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 5 (:REWRITE IFIX-INTEGERP)) (8 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE CANCEL-EQUAL-+-*))) (LOGAPP-EQUAL-LOGAPP-REWRITE (574 49 (:REWRITE LOGHEAD-IDENTITY)) (304 304 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (280 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (255 45 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (186 143 (:REWRITE DEFAULT-<-1)) (167 143 (:REWRITE DEFAULT-<-2)) (145 145 (:REWRITE POWER2-INTEGER)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (143 143 (:REWRITE EXPT-COMPARE)) (109 109 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (94 49 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (93 12 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (81 12 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (74 74 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (67 67 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (56 7 (:LINEAR LOGHEAD-LEQ)) (53 53 (:META META-RULE-ERIC)) (49 49 (:REWRITE LOGHEAD-SUBST)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 15 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (27 4 (:LINEAR EXPT->-1)) (22 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGAPP-EQUAL-LOGAPP-REWRITE-NO-SPLIT (44 44 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 44 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (44 4 (:REWRITE LOGHEAD-IDENTITY)) (16 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-SPLIT-SPECIAL (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-SPLIT (235 17 (:REWRITE LOGHEAD-IDENTITY)) (201 201 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (134 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (72 72 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (53 48 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (30 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (20 19 (:META META-RULE-ERIC)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (15 15 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-TWO-LOGEXTS-REWRITE-HELPER (1446 1446 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1241 78 (:REWRITE LOGHEAD-IDENTITY)) (856 102 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (476 476 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (476 476 (:REWRITE EXPT-COMPARE)) (456 17 (:LINEAR LOGHEAD-LEQ)) (325 35 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (270 255 (:REWRITE DEFAULT-<-1)) (266 266 (:REWRITE POWER2-INTEGER)) (265 255 (:REWRITE DEFAULT-<-2)) (200 102 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (179 94 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (149 149 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (133 129 (:REWRITE DEFAULT-+-1)) (133 123 (:META META-RULE-ERIC)) (133 78 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (129 129 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE LOGHEAD-SPLIT-SPECIAL)) (113 113 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (104 104 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (84 6 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (83 10 (:LINEAR EXPT->-1)) (71 71 (:REWRITE EXPT-COMPARE-EQUAL)) (70 70 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (60 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 4 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (50 4 (:REWRITE ASH-AS-LOGTAIL)) (40 20 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (40 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 35 (:REWRITE LOGBITP-TOO-BIG)) (26 14 (:REWRITE FOLD-CONSTS-IN-+)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 10 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (12 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 8 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RIGHT-CANCELLATION-FOR-+)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE ASH-0)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (EQUAL-OF-TWO-LOGEXTS-REWRITE (468 38 (:REWRITE LOGEXT-IDENTITY)) (220 52 (:REWRITE LOGCAR-EVENP)) (154 6 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (142 142 (:REWRITE POWER2-INTEGER)) (105 14 (:REWRITE LOGHEAD-IDENTITY)) (96 96 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (96 12 (:LINEAR LOGEXT-BOUND-UPPER)) (94 52 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (90 90 (:TYPE-PRESCRIPTION EVENP)) (90 48 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (88 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (76 38 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 66 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (56 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (51 35 (:REWRITE DEFAULT-<-1)) (50 35 (:REWRITE DEFAULT-<-2)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE EXPT-COMPARE)) (36 6 (:REWRITE LOGCAR-0-REWRITE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 31 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (30 30 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (30 30 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (30 30 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:META META-RULE-ERIC)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGEXT-OF-PRODUCT-OF-LOGEXT (2889 28 (:REWRITE FLOOR-=-X/Y . 3)) (1826 142 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1752 48 (:REWRITE <-*-0)) (1752 48 (:REWRITE 0-<-*)) (1680 96 (:DEFINITION IFF)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (1371 34 (:REWRITE FLOOR-SIMPLE-CASES)) (1363 34 (:REWRITE RTL1)) (1363 34 (:REWRITE FLOOR-DETERMINED-1)) (1336 76 (:REWRITE INTEGERP-+-MINUS-*-4)) (1263 988 (:REWRITE DEFAULT-<-2)) (1258 46 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (1253 294 (:REWRITE DEFAULT-*-2)) (1211 988 (:REWRITE DEFAULT-<-1)) (1189 1189 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1189 1189 (:REWRITE EXPT-COMPARE)) (861 28 (:REWRITE FLOOR-=-X/Y . 2)) (822 215 (:REWRITE DEFAULT-+-2)) (795 159 (:LINEAR X*Y>1-POSITIVE)) (770 462 (:REWRITE EXPT-COMPARE-EQUAL)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (707 71 (:REWRITE DEFAULT-UNARY-/)) (703 294 (:REWRITE DEFAULT-*-1)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (599 28 (:REWRITE FLOOR-TYPE-3 . 3)) (599 28 (:REWRITE FLOOR-TYPE-3 . 2)) (590 29 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (590 29 (:REWRITE INTEGERP-PROD-3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 2)) (556 556 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (532 38 (:REWRITE EXPO-/-POWER2P-ALT)) (450 215 (:REWRITE DEFAULT-+-1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (394 98 (:REWRITE DEFAULT-UNARY-MINUS)) (385 326 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (364 44 (:LINEAR EXPT->-1)) (303 21 (:REWRITE EQUAL-1-HACK)) (288 72 (:REWRITE EXPT-2-CRUNCHER)) (260 65 (:REWRITE EXPO-OF-NOT-RATIONALP)) (256 88 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (250 19 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (238 238 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (222 163 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (211 58 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (197 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (168 14 (:REWRITE NORMALIZE-EQUAL-0)) (162 6 (:DEFINITION ZEROP)) (156 54 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (147 43 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (136 43 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (136 34 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (131 54 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (118 44 (:LINEAR EXPT-LESS-THAN-1-HACK)) (112 14 (:REWRITE EQUAL-MINUS-MINUS)) (90 90 (:REWRITE FOLD-CONSTS-IN-*)) (80 38 (:REWRITE UNICITY-OF-0)) (76 38 (:REWRITE POWER2P-INVERSE)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 69 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (65 65 (:REWRITE EXPO-MINUS-ERIC)) (56 4 (:REWRITE ASSOCIATIVITY-OF-*)) (40 7 (:REWRITE DEFAULT-NUMERATOR)) (38 19 (:REWRITE INTEGERP-+-MINUS-*-2)) (31 31 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (31 31 (:REWRITE EXPONENTS-ADD)) (19 19 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (14 14 (:REWRITE FOLD-CONSTS-IN-+)) (14 14 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (7 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (7 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-PRODUCT-OF-LOGEXT-ALT (346 8 (:LINEAR LOGEXT-BOUND-UPPER)) (240 2 (:REWRITE <-*-0)) (112 16 (:LINEAR LOGEXT-BOUNDS-2)) (112 16 (:LINEAR LOGEXT-BOUNDS)) (90 2 (:LINEAR X*Y>1-POSITIVE)) (86 51 (:REWRITE DEFAULT-<-2)) (53 53 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 53 (:REWRITE EXPT-COMPARE)) (51 51 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 2 (:DEFINITION IFF)) (33 33 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 3 (:REWRITE LOGEXT-IDENTITY)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (ASH-OF-LOGTAIL-DOES-NOTHING-REWRITE (1858 115 (:LINEAR X*Y>1-POSITIVE)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (901 13 (:LINEAR FLOOR-TYPE-2 . 1)) (897 13 (:LINEAR FLOOR-TYPE-2 . 2)) (894 26 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (886 13 (:LINEAR FLOOR-TYPE-1 . 2)) (886 13 (:LINEAR FLOOR-TYPE-1 . 1)) (705 45 (:REWRITE RATIONALP-*)) (558 326 (:REWRITE DEFAULT-<-1)) (558 12 (:REWRITE RTL1)) (539 326 (:REWRITE DEFAULT-<-2)) (530 35 (:REWRITE <-*-0)) (470 32 (:REWRITE 0-<-*)) (466 30 (:REWRITE <-*-/-LEFT)) (453 138 (:REWRITE POWER2-INTEGER)) (440 109 (:REWRITE DEFAULT-*-2)) (440 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (432 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (404 26 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (389 12 (:REWRITE FLOOR-SIMPLE-CASES)) (374 12 (:REWRITE FLOOR-TYPE-3 . 2)) (361 12 (:REWRITE FLOOR-DETERMINED-1)) (359 12 (:REWRITE FLOOR-TYPE-4 . 3)) (351 76 (:LINEAR EXPT->-1)) (338 12 (:REWRITE FLOOR-TYPE-4 . 2)) (329 12 (:REWRITE FLOOR-TYPE-3 . 3)) (288 12 (:REWRITE FLOOR-=-X/Y . 3)) (273 109 (:REWRITE DEFAULT-*-1)) (254 12 (:REWRITE FLOOR-=-X/Y . 2)) (243 81 (:REWRITE EXPO-OF-NOT-RATIONALP)) (184 152 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (177 177 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (166 52 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 76 (:LINEAR EXPT-LESS-THAN-1-HACK)) (145 57 (:REWRITE EXPT-COMPARE-EQUAL)) (100 100 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (100 12 (:REWRITE <-*-/-RIGHT)) (96 1 (:REWRITE MOD-=-0 . 2)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (81 81 (:REWRITE EXPO-MINUS-ERIC)) (81 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (67 1 (:REWRITE FLOOR-=-X/Y . 4)) (65 13 (:REWRITE DEFAULT-UNARY-/)) (55 11 (:DEFINITION IFF)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (33 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (31 31 (:REWRITE FOLD-CONSTS-IN-*)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (17 1 (:REWRITE EVENP-COLLAPSE)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (15 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (11 11 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:TYPE-PRESCRIPTION EVENP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ASH (943 14 (:REWRITE FLOOR-SIMPLE-CASES)) (927 56 (:LINEAR X*Y>1-POSITIVE)) (811 334 (:REWRITE EXPT-COMPARE)) (499 14 (:REWRITE RTL1)) (499 14 (:REWRITE FLOOR-DETERMINED-1)) (357 251 (:REWRITE DEFAULT-<-1)) (356 251 (:REWRITE DEFAULT-<-2)) (323 5 (:REWRITE FLOOR-=-X/Y . 3)) (310 10 (:REWRITE 0-<-*)) (305 10 (:REWRITE <-*-0)) (296 38 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (291 291 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (273 115 (:REWRITE DEFAULT-*-2)) (262 6 (:LINEAR FLOOR-TYPE-2 . 2)) (254 6 (:LINEAR FLOOR-TYPE-2 . 1)) (252 30 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (252 30 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (252 6 (:LINEAR FLOOR-TYPE-1 . 1)) (248 6 (:LINEAR FLOOR-TYPE-1 . 2)) (235 36 (:LINEAR EXPT->-1)) (205 20 (:DEFINITION IFF)) (193 115 (:REWRITE DEFAULT-*-1)) (153 51 (:REWRITE EXPO-OF-NOT-RATIONALP)) (150 150 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (150 39 (:REWRITE POWER2-INTEGER)) (135 5 (:REWRITE FLOOR-=-X/Y . 2)) (125 1 (:REWRITE FLOOR-=-X/Y . 4)) (123 5 (:REWRITE FLOOR-TYPE-3 . 3)) (121 5 (:REWRITE FLOOR-TYPE-3 . 2)) (119 7 (:REWRITE COMMUTATIVITY-2-OF-*)) (117 5 (:REWRITE FLOOR-TYPE-4 . 3)) (116 5 (:REWRITE FLOOR-TYPE-4 . 2)) (104 64 (:REWRITE EXPT-COMPARE-EQUAL)) (102 102 (:TYPE-PRESCRIPTION POWER2P)) (83 19 (:REWRITE DEFAULT-UNARY-/)) (78 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (75 33 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 72 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 51 (:REWRITE EXPO-EXPT2)) (57 33 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (54 54 (:REWRITE POWER2P-EXPT2-I)) (51 51 (:REWRITE EXPO-MINUS-ERIC)) (46 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (46 2 (:REWRITE INTEGERP-PROD-3)) (44 4 (:REWRITE EQUAL-1-HACK)) (42 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 3 (:REWRITE <-*-RIGHT-CANCEL)) (32 16 (:REWRITE DEFAULT-+-2)) (31 13 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (24 4 (:REWRITE /-CANCELLATION-ON-RIGHT)) (22 22 (:REWRITE FOLD-CONSTS-IN-*)) (22 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (22 2 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 16 (:REWRITE DEFAULT-+-1)) (15 3 (:REWRITE COMMUTATIVITY-OF-+)) (13 13 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE UNICITY-OF-0)) (6 3 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (B-NOT-EQUAL-0-REWRITE (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE EQUAL-1-HACK)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER))) (B-NOT-EQUAL-1-REWRITE (10 3 (:REWRITE EQUAL-1-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (UNSIGNED-BYTE-P-1-CHOICES) (LOGEXT-OF-PROD-OF-LOGHEAD (468 26 (:REWRITE LOGEXT-IDENTITY)) (276 4 (:LINEAR LOGEXT-BOUND-UPPER)) (250 28 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (224 4 (:REWRITE <-*-0)) (60 4 (:DEFINITION IFF)) (56 56 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (51 26 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (42 6 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:TYPE-PRESCRIPTION IFIX)) (36 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (28 28 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (25 23 (:REWRITE DEFAULT-<-2)) (24 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (17 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (17 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (17 1 (:LINEAR LOGHEAD-BOUND)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 2 (:REWRITE LOGHEAD-<=)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE LOGHEAD-NON-ZERO-TYPE)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK))) (ASH-LOGEXT (43467 47 (:REWRITE ASH-0)) (43357 22 (:REWRITE ZIP-OPEN)) (16868 164 (:DEFINITION LOGEXT*-BETTER)) (15577 328 (:REWRITE LOGEXT-IDENTITY)) (14339 19 (:REWRITE EQUAL-LOGEXT-0)) (9000 344 (:DEFINITION SIGNED-BYTE-P*)) (8244 164 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (8019 114 (:REWRITE LOGHEAD-IDENTITY)) (6777 57 (:DEFINITION LOGHEAD*-BETTER)) (5381 19 (:LINEAR LOGHEAD-UPPER-BOUND)) (4699 1545 (:REWRITE <-+-CONSTANT-CONSTANT)) (4668 114 (:DEFINITION UNSIGNED-BYTE-P*)) (4386 57 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (3821 19 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (3516 228 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2752 344 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2169 2169 (:REWRITE EXPT-COMPARE)) (2167 2167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2068 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (1960 280 (:REWRITE <-0-+-NEGATIVE-1)) (1758 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1743 1431 (:REWRITE DEFAULT-<-2)) (1647 1431 (:REWRITE DEFAULT-<-1)) (1636 164 (:REWRITE EQUAL-1-HACK)) (1591 1591 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1586 194 (:REWRITE EXPONENTS-ADD)) (1540 385 (:REWRITE LOGCAR-EVENP)) (1454 883 (:REWRITE DEFAULT-+-2)) (1198 1070 (:REWRITE EXPT-COMPARE-EQUAL)) (934 934 (:TYPE-PRESCRIPTION EVENP)) (883 883 (:REWRITE DEFAULT-+-1)) (856 566 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (852 852 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (852 852 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (816 136 (:REWRITE SUM-POWER-OF-TWO)) (784 16 (:REWRITE EXPT-MINUS)) (742 19 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (713 713 (:REWRITE FOLD-CONSTS-IN-+)) (688 688 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (679 679 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (650 650 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (640 32 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (637 331 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (619 619 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (595 75 (:LINEAR EXPT-LESS-THAN-1-HACK)) (570 570 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (549 549 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (492 328 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (393 89 (:REWRITE DEFAULT-UNARY-MINUS)) (385 385 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (357 150 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (328 164 (:REWRITE LOGCAR-0-REWRITE)) (300 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (292 40 (:LINEAR LOGEXT-BOUND-UPPER)) (285 285 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (272 272 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (267 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (256 16 (:REWRITE COMMUTATIVITY-2-OF-*)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (228 228 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (221 221 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (179 47 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (179 47 (:REWRITE ASH-AS-LOGTAIL)) (171 114 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (164 164 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (162 162 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (152 152 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (144 48 (:REWRITE DEFAULT-*-2)) (144 48 (:REWRITE DEFAULT-*-1)) (136 136 (:REWRITE EQUAL-CONSTANT-+)) (133 19 (:LINEAR LOGHEAD-LEQ)) (128 16 (:REWRITE /-CANCELLATION-ON-LEFT)) (114 114 (:META META-RULE-ERIC)) (112 16 (:REWRITE COMMUTATIVITY-OF-*)) (89 47 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (80 16 (:REWRITE DEFAULT-UNARY-/)) (69 47 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (69 47 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (57 57 (:REWRITE LOGHEAD-SUBST2)) (57 57 (:REWRITE LOGHEAD-SUBST)) (48 48 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (48 16 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (48 16 (:REWRITE EXPO-OF-NOT-RATIONALP)) (47 47 (:REWRITE ASH-GOES-TO-0)) (32 32 (:TYPE-PRESCRIPTION POWER2P)) (32 32 (:REWRITE FOLD-CONSTS-IN-*)) (25 25 (:TYPE-PRESCRIPTION ZIP)) (16 16 (:REWRITE POWER2P-EXPT2-I)) (16 16 (:REWRITE EXPO-MINUS-ERIC)) (16 16 (:REWRITE EXPO-EXPT2)) (14 2 (:REWRITE <=-0-ASH)) (3 3 (:REWRITE POWER2-INTEGER))) (ASH-PLUS-CONSTANT-SUCK-IN (34 34 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (34 34 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (14 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (12 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (7 5 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (7 1 (:REWRITE ASH-AS-LOGTAIL)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:LINEAR EXPT->-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (<-OF-LOGTAIL (1666 22 (:REWRITE FLOOR-=-X/Y . 3)) (880 40 (:REWRITE INTEGERP-+-MINUS-*-4)) (806 66 (:REWRITE POWER2-INTEGER)) (752 100 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (490 22 (:REWRITE RTL1)) (490 22 (:REWRITE FLOOR-SIMPLE-CASES)) (490 22 (:REWRITE FLOOR-DETERMINED-1)) (442 22 (:REWRITE FLOOR-=-X/Y . 2)) (419 271 (:REWRITE DEFAULT-<-2)) (409 123 (:REWRITE DEFAULT-*-2)) (347 299 (:REWRITE EXPT-COMPARE)) (312 52 (:LINEAR EXPT->-1)) (295 295 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (280 20 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (273 271 (:REWRITE DEFAULT-<-1)) (250 50 (:REWRITE DEFAULT-UNARY-/)) (207 47 (:REWRITE EXPT-COMPARE-EQUAL)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (180 20 (:REWRITE EXPO-/-POWER2P-ALT)) (144 144 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (144 16 (:LINEAR X*Y>1-POSITIVE)) (142 22 (:REWRITE FLOOR-TYPE-3 . 3)) (142 22 (:REWRITE FLOOR-TYPE-3 . 2)) (139 123 (:REWRITE DEFAULT-*-1)) (136 2 (:REWRITE FLOOR-=-X/Y . 4)) (132 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (122 22 (:REWRITE FLOOR-TYPE-4 . 3)) (122 22 (:REWRITE FLOOR-TYPE-4 . 2)) (104 104 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (100 20 (:REWRITE COMMUTATIVITY-OF-+)) (92 48 (:REWRITE DEFAULT-+-2)) (88 88 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (66 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (64 64 (:REWRITE POWER2P-EXPT2-I)) (64 2 (:REWRITE EQUAL-*-/-2)) (60 20 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (56 48 (:REWRITE DEFAULT-+-1)) (52 52 (:LINEAR EXPT-LESS-THAN-1-HACK)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 44 (:REWRITE EXPO-EXPT2)) (40 20 (:REWRITE UNICITY-OF-0)) (40 20 (:REWRITE POWER2P-INVERSE)) (28 4 (:LINEAR FLOOR-TYPE-2 . 2)) (28 4 (:LINEAR FLOOR-TYPE-2 . 1)) (24 4 (:LINEAR FLOOR-TYPE-1 . 2)) (24 4 (:LINEAR FLOOR-TYPE-1 . 1)) (22 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 22 (:REWRITE FIX-DOES-NOTHING)) (20 20 (:REWRITE DEFAULT-UNARY-MINUS)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-< (5114 164 (:REWRITE INTEGERP-+-MINUS-*-4)) (4742 342 (:REWRITE POWER2-INTEGER)) (4409 414 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (3826 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3445 1450 (:REWRITE DEFAULT-*-2)) (3376 358 (:LINEAR X*Y>1-POSITIVE)) (3025 40 (:REWRITE FLOOR-=-X/Y . 3)) (2883 2275 (:REWRITE EXPT-COMPARE)) (2791 1450 (:REWRITE DEFAULT-*-1)) (2650 98 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2522 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (2498 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (2119 1645 (:REWRITE DEFAULT-<-1)) (2100 1645 (:REWRITE DEFAULT-<-2)) (1621 763 (:REWRITE DEFAULT-+-2)) (1442 206 (:LINEAR EXPT->-1)) (1388 1388 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1264 254 (:REWRITE EXPT-COMPARE-EQUAL)) (1065 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1035 207 (:REWRITE DEFAULT-UNARY-/)) (990 110 (:REWRITE EXPO-/-POWER2P-ALT)) (956 956 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (948 14 (:LINEAR MOD-TYPE . 2)) (922 763 (:REWRITE DEFAULT-+-1)) (887 40 (:REWRITE RTL1)) (887 40 (:REWRITE FLOOR-SIMPLE-CASES)) (887 40 (:REWRITE FLOOR-DETERMINED-1)) (777 259 (:REWRITE EXPO-OF-NOT-RATIONALP)) (733 40 (:REWRITE FLOOR-=-X/Y . 2)) (704 704 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (694 694 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (514 514 (:TYPE-PRESCRIPTION POWER2P)) (412 412 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (369 369 (:REWRITE POWER2P-EXPT2-I)) (303 101 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (275 107 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (271 40 (:REWRITE FLOOR-TYPE-3 . 3)) (271 40 (:REWRITE FLOOR-TYPE-3 . 2)) (259 259 (:REWRITE EXPO-MINUS-ERIC)) (259 259 (:REWRITE EXPO-EXPT2)) (259 163 (:REWRITE DEFAULT-UNARY-MINUS)) (258 258 (:META CANCEL_TIMES-EQUAL-CORRECT)) (238 40 (:REWRITE FLOOR-TYPE-4 . 3)) (238 40 (:REWRITE FLOOR-TYPE-4 . 2)) (220 110 (:REWRITE POWER2P-INVERSE)) (206 206 (:LINEAR EXPT-LESS-THAN-1-HACK)) (142 142 (:REWRITE FOLD-CONSTS-IN-*)) (140 2 (:REWRITE FLOOR-=-X/Y . 4)) (135 55 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (113 107 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (108 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (83 83 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (72 2 (:REWRITE EQUAL-*-/-2)) (55 55 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (54 6 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 6 (:LINEAR FLOOR-TYPE-2 . 2)) (48 6 (:LINEAR FLOOR-TYPE-2 . 1)) (42 6 (:LINEAR FLOOR-TYPE-1 . 2)) (42 6 (:LINEAR FLOOR-TYPE-1 . 1)) (30 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (30 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (14 14 (:LINEAR MOD-TYPE . 3)) (14 14 (:LINEAR MOD-TYPE . 1)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGAPP-<= (335 335 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (220 2 (:REWRITE LOGHEAD-<=)) (218 4 (:REWRITE LOGHEAD-<)) (164 8 (:REWRITE LOGTAIL-IDENTITY)) (159 12 (:REWRITE LOGHEAD-IDENTITY)) (152 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (131 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (117 97 (:REWRITE DEFAULT-<-2)) (113 97 (:REWRITE DEFAULT-<-1)) (111 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (105 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (97 97 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (97 97 (:REWRITE EXPT-COMPARE)) (97 97 (:META CANCEL_PLUS-LESSP-CORRECT)) (82 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (64 8 (:LINEAR LOGTAIL-LEQ)) (57 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (48 6 (:REWRITE LOGTAIL-LESSP)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:REWRITE <-OF-LOGTAIL)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 4 (:LINEAR EXPT->-1)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (ASH-LOGCDR-1-BETTER (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (14 12 (:REWRITE DEFAULT-*-2)) (13 12 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 1 (:DEFINITION IFIX)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGCDR-LOGAPP (144 9 (:REWRITE LOGHEAD-IDENTITY)) (92 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (68 68 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (68 68 (:REWRITE EXPT-COMPARE)) (68 68 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 64 (:REWRITE POWER2-INTEGER)) (62 50 (:REWRITE DEFAULT-<-1)) (62 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 50 (:REWRITE DEFAULT-<-2)) (48 48 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 28 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 2 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE ASH-0)) (9 1 (:REWRITE LOGCDR-<-0)) (8 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 6 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE ZIP-OPEN)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKYY (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (USB-TIGHTEN (638 2 (:REWRITE FLOOR-=-X/Y . 3)) (340 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (280 21 (:REWRITE POWER2-INTEGER)) (132 4 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (107 11 (:REWRITE EXPT-COMPARE-EQUAL)) (97 4 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (88 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (85 35 (:REWRITE DEFAULT-*-2)) (85 2 (:REWRITE FLOOR-=-X/Y . 2)) (83 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (82 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (73 2 (:REWRITE FLOOR-TYPE-3 . 2)) (72 4 (:REWRITE INTEGERP-PROD-3)) (64 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (64 38 (:REWRITE DEFAULT-<-2)) (64 2 (:REWRITE RTL1)) (64 2 (:REWRITE FLOOR-DETERMINED-1)) (60 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (59 59 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (59 59 (:REWRITE EXPT-COMPARE)) (59 59 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (50 4 (:REWRITE COMMUTATIVITY-2-OF-*)) (41 41 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 35 (:REWRITE DEFAULT-*-1)) (38 38 (:REWRITE DEFAULT-<-1)) (38 35 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 27 (:TYPE-PRESCRIPTION POWER2P)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE POWER2P-EXPT2-I)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 5 (:REWRITE POWER2P-SHIFT-2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:REWRITE EXPO-EXPT2)) (12 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (4 4 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 1 (:REWRITE IFIX-INTEGERP))) (LOGHEAD-WHEN-KNOW-TOP-BIT (134 134 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (48 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (19 17 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (16 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE USB-TIGHTEN)) (11 10 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-TWO (123 123 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 18 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (15 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 10 (:META META-RULE-ERIC)) (11 7 (:REWRITE USB-TIGHTEN)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE POWER2-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-THREE (217 217 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (197 13 (:REWRITE LOGHEAD-IDENTITY)) (135 3 (:LINEAR LOGHEAD-LEQ)) (125 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (121 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (81 81 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (81 81 (:REWRITE EXPT-COMPARE)) (79 79 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 42 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE DEFAULT-<-2)) (26 20 (:META META-RULE-ERIC)) (26 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 8 (:REWRITE FOLD-CONSTS-IN-+)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (17 17 (:REWRITE DEFAULT-+-2)) (17 17 (:REWRITE DEFAULT-+-1)) (16 16 (:REWRITE POWER2-INTEGER)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (LOGTAIL-LEAVES-SINGLE-BIT (172 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (90 54 (:REWRITE DEFAULT-<-2)) (84 4 (:REWRITE FLOOR-=-X/Y . 3)) (82 54 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE RTL1)) (72 4 (:REWRITE FLOOR-DETERMINED-1)) (64 4 (:REWRITE FLOOR-=-X/Y . 2)) (58 58 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (58 58 (:REWRITE EXPT-COMPARE)) (58 58 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 12 (:REWRITE DEFAULT-UNARY-/)) (54 26 (:REWRITE DEFAULT-*-2)) (52 4 (:REWRITE FLOOR-TYPE-3 . 3)) (52 4 (:REWRITE FLOOR-TYPE-3 . 2)) (48 4 (:REWRITE FLOOR-TYPE-4 . 3)) (48 4 (:REWRITE FLOOR-TYPE-4 . 2)) (48 4 (:REWRITE EQUAL-1-HACK)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 26 (:REWRITE DEFAULT-*-1)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 2 (:LINEAR FLOOR-TYPE-2 . 2)) (26 2 (:LINEAR FLOOR-TYPE-2 . 1)) (24 2 (:LINEAR FLOOR-TYPE-1 . 2)) (24 2 (:LINEAR FLOOR-TYPE-1 . 1)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (22 2 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 8 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (10 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 3 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (ASH-SUCK-IN-SPECIAL (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (88 8 (:LINEAR X*Y>1-POSITIVE)) (88 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (68 8 (:DEFINITION IFF)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 24 (:REWRITE DEFAULT-<-2)) (32 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (24 24 (:REWRITE DEFAULT-<-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 15 (:REWRITE DEFAULT-*-2)) (19 15 (:REWRITE DEFAULT-*-1)) (18 10 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 8 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE POWER2-INTEGER))) (UNSIGNED-BYTE-P-OF-ONE-MORE-THAN-X (55 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (38 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (35 5 (:LINEAR EXPT->-1)) (30 20 (:REWRITE DEFAULT-<-2)) (27 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE DEFAULT-<-1)) (17 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 6 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2))) (LOGTAIL-SHIFT-16 (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (449 233 (:REWRITE DEFAULT-*-2)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (305 161 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (273 233 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (161 161 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (49 49 (:REWRITE POWER2-INTEGER)) (48 48 (:REWRITE INTEGERP-+-MINUS-*-4)) (36 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1))) (EVENP-OF-MOD (28 1 (:REWRITE MOD-=-0 . 2)) (21 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 8 (:REWRITE DEFAULT-*-1)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 12 (:REWRITE DEFAULT-<-2)) (13 12 (:REWRITE DEFAULT-<-1)) (13 8 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE POWER2-INTEGER)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:REWRITE RTL1)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (8 1 (:REWRITE FLOOR-SIMPLE-CASES)) (8 1 (:REWRITE FLOOR-DETERMINED-1)) (8 1 (:REWRITE FLOOR-=-X/Y . 3)) (8 1 (:REWRITE FLOOR-=-X/Y . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (6 1 (:REWRITE DEFAULT-UNARY-MINUS)) (6 1 (:REWRITE DEFAULT-+-2)) (5 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:DEFINITION ZEROP)) (2 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (LOGTAIL-OF-ONE-MORE-WHEN-EVEN (713 713 (:REWRITE EXPT-COMPARE)) (654 59 (:REWRITE FLOOR-TYPE-3 . 3)) (654 59 (:REWRITE FLOOR-TYPE-3 . 2)) (578 59 (:REWRITE FLOOR-TYPE-4 . 3)) (578 59 (:REWRITE FLOOR-TYPE-4 . 2)) (564 524 (:REWRITE DEFAULT-<-2)) (547 507 (:REWRITE DEFAULT-*-1)) (502 59 (:REWRITE RTL1)) (502 59 (:REWRITE FLOOR-DETERMINED-1)) (482 50 (:REWRITE FLOOR-=-X/Y . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (297 297 (:REWRITE DEFAULT-+-1)) (196 196 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (163 163 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (141 13 (:LINEAR FLOOR-TYPE-2 . 2)) (141 13 (:LINEAR FLOOR-TYPE-2 . 1)) (135 34 (:REWRITE CANCEL-FLOOR-+-BASIC)) (125 13 (:LINEAR FLOOR-TYPE-1 . 2)) (125 13 (:LINEAR FLOOR-TYPE-1 . 1)) (116 8 (:REWRITE FLOOR-=-X/Y . 4)) (105 105 (:REWRITE POWER2-INTEGER)) (79 63 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-4)) (63 63 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (43 43 (:REWRITE EXPT-COMPARE-EQUAL)) (42 42 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (33 1 (:REWRITE EQUAL-*-/-1)) (26 10 (:REWRITE SUM-POWER-OF-TWO)) (23 20 (:REWRITE INTEGERP-+-MINUS-*-2)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (20 20 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (17 17 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (15 2 (:REWRITE IFIX-INTEGERP)) (12 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (7 7 (:REWRITE MY-EQUAL-/)) (7 2 (:LINEAR X*Y>1-POSITIVE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1))) (SUM-WITH-SHIFT-BECOMES-LOGAPP (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 3 (:REWRITE DEFAULT-*-2)) (7 1 (:LINEAR EXPT->-1)) (6 2 (:REWRITE DEFAULT-+-2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 3 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SUM-WITH-SHIFT-BECOMES-LOGAPP-CONSTANT-VERSION (396 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (303 303 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (273 2 (:REWRITE LOGTAIL-IDENTITY)) (254 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 34 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (100 40 (:REWRITE EXPT-COMPARE)) (71 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (71 3 (:LINEAR EXPT->-1)) (60 30 (:REWRITE DEFAULT-<-2)) (50 50 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 30 (:REWRITE DEFAULT-<-1)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (38 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (36 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (32 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (22 11 (:REWRITE USB-TIGHTEN)) (22 1 (:REWRITE NATP-RW)) (22 1 (:REWRITE LOGHEAD-CANCEL-LEMMA-ALT)) (20 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (17 7 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (14 4 (:REWRITE EXPO-EXPT2)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 1 (:LINEAR EXPO-LOWER-BOUND)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:LINEAR EXPO-LOWER-POS)) (7 1 (:LINEAR EXPO-LOWER-BOUND-2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:DEFINITION ABS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE EXPO-OF-INTEGER)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-PLUS-ASH (4879 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (4860 72 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (4859 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4585 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (4565 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3602 117 (:LINEAR X*Y>1-POSITIVE)) (3564 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (2886 74 (:REWRITE 0-<-*)) (2812 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (2775 74 (:REWRITE <-*-0)) (2484 1326 (:REWRITE EXPT-COMPARE)) (2399 123 (:REWRITE INTEGERP-+-MINUS-*-4)) (2250 276 (:REWRITE POWER2-INTEGER)) (2105 22 (:REWRITE MOD-=-0 . 2)) (1739 148 (:DEFINITION IFF)) (1432 36 (:LINEAR FLOOR-TYPE-2 . 2)) (1416 10 (:LINEAR MOD-TYPE . 2)) (1414 979 (:REWRITE DEFAULT-<-1)) (1404 36 (:LINEAR FLOOR-TYPE-2 . 1)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 2)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 1)) (1326 1326 (:META CANCEL_PLUS-LESSP-CORRECT)) (1241 1241 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1178 17 (:REWRITE FLOOR-TYPE-3 . 3)) (1164 979 (:REWRITE DEFAULT-<-2)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 3)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 2)) (1127 17 (:REWRITE FLOOR-TYPE-3 . 2)) (1031 94 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1027 375 (:REWRITE DEFAULT-*-2)) (833 833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (781 104 (:LINEAR EXPT->-1)) (732 375 (:REWRITE DEFAULT-*-1)) (687 26 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (683 683 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (621 351 (:REWRITE EXPT-COMPARE-EQUAL)) (600 40 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (566 17 (:REWRITE RTL1)) (566 17 (:REWRITE FLOOR-SIMPLE-CASES)) (566 17 (:REWRITE FLOOR-DETERMINED-1)) (507 169 (:REWRITE EXPO-OF-NOT-RATIONALP)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (475 104 (:LINEAR EXPT-LESS-THAN-1-HACK)) (459 169 (:REWRITE DEFAULT-+-2)) (442 13 (:REWRITE DISTRIBUTIVITY-ALT)) (438 146 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (391 17 (:REWRITE FLOOR-=-X/Y . 3)) (391 17 (:REWRITE FLOOR-=-X/Y . 2)) (360 40 (:REWRITE EXPO-/-POWER2P-ALT)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (325 325 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (321 321 (:TYPE-PRESCRIPTION POWER2P)) (297 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (239 169 (:REWRITE EXPO-EXPT2)) (235 47 (:REWRITE DEFAULT-UNARY-/)) (209 209 (:REWRITE POWER2P-EXPT2-I)) (208 208 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (195 169 (:REWRITE DEFAULT-+-1)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (171 171 (:REWRITE FOLD-CONSTS-IN-*)) (169 169 (:REWRITE EXPO-MINUS-ERIC)) (146 146 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (116 36 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (106 106 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 23 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (81 27 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (80 40 (:REWRITE POWER2P-INVERSE)) (74 74 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (69 23 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (66 22 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (50 10 (:LINEAR MOD-TYPE . 3)) (48 10 (:LINEAR MOD-TYPE . 1)) (40 40 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (19 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 13 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (10 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-LINEAR (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 60 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (34 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (28 2 (:LINEAR LOGTAIL-LEQ)) (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 1 (:REWRITE LOGTAIL-IDENTITY)) (20 10 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (12 6 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 8 (:REWRITE DEFAULT-+-1)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE DEFAULT-+-2)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (3 3 (:REWRITE ASH-AS-LOGTAIL)) (3 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (3 3 (:META META-RULE-ERIC)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-OF-ONE-LESS-THAN-X (271 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (107 1 (:REWRITE EQUAL-MINUS-MINUS)) (82 6 (:LINEAR EXPT->-1)) (77 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (60 22 (:REWRITE POWER2-INTEGER)) (60 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (42 26 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE EXPT-COMPARE)) (41 41 (:META CANCEL_PLUS-LESSP-CORRECT)) (37 26 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE SIGNED-BYTE-P-+)) (32 10 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 6 (:REWRITE EXPT-COMPARE-EQUAL)) (29 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (22 2 (:REWRITE EXPO-EXPT2)) (19 13 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 6 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 1 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (1 1 (:TYPE-PRESCRIPTION EVENP))) (LOGBITP-OF-ONE-LESS-CASE-1 (197 4 (:REWRITE RTL1)) (104 1 (:REWRITE MOD-=-0 . 2)) (98 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (75 4 (:REWRITE FLOOR-DETERMINED-1)) (56 8 (:LINEAR EXPT->-1)) (52 37 (:REWRITE DEFAULT-<-2)) (49 49 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 3 (:REWRITE ODDP-OF-*)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 37 (:REWRITE DEFAULT-<-1)) (36 12 (:REWRITE DEFAULT-*-2)) (30 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (30 6 (:REWRITE DEFAULT-UNARY-/)) (28 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (24 2 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE DEFAULT-+-1)) (13 1 (:LINEAR MOD-TYPE . 4)) (13 1 (:LINEAR MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (12 12 (:REWRITE DEFAULT-*-1)) (12 1 (:LINEAR MOD-TYPE . 2)) (12 1 (:LINEAR MOD-TYPE . 1)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (FLOOR-OF-MINUS-1-CASE-1 (1225 1212 (:REWRITE DEFAULT-*-2)) (1212 1212 (:REWRITE DEFAULT-*-1)) (1175 44 (:REWRITE FLOOR-=-X/Y . 3)) (1100 430 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (956 956 (:REWRITE EXPT-COMPARE)) (923 44 (:REWRITE FLOOR-=-X/Y . 2)) (852 49 (:REWRITE RTL1)) (813 58 (:REWRITE CANCEL-FLOOR-+-BASIC)) (758 659 (:REWRITE DEFAULT-<-1)) (659 659 (:REWRITE DEFAULT-<-2)) (572 572 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (537 44 (:REWRITE FLOOR-TYPE-3 . 3)) (523 49 (:REWRITE FLOOR-SIMPLE-CASES)) (523 49 (:REWRITE FLOOR-DETERMINED-1)) (522 44 (:REWRITE FLOOR-TYPE-3 . 2)) (498 447 (:REWRITE DEFAULT-+-2)) (474 44 (:REWRITE FLOOR-TYPE-4 . 2)) (447 447 (:REWRITE DEFAULT-+-1)) (434 70 (:LINEAR X*Y>1-POSITIVE)) (424 44 (:REWRITE FLOOR-TYPE-4 . 3)) (402 67 (:REWRITE EQUAL-1-HACK)) (317 215 (:REWRITE DEFAULT-UNARY-/)) (312 312 (:REWRITE POWER2-INTEGER)) (264 264 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (234 234 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (216 72 (:REWRITE INTEGERP-UNARY-)) (194 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (174 6 (:REWRITE FLOOR-=-X/Y . 4)) (170 11 (:LINEAR FLOOR-TYPE-2 . 2)) (170 11 (:LINEAR FLOOR-TYPE-2 . 1)) (151 151 (:META CANCEL_TIMES-EQUAL-CORRECT)) (151 11 (:LINEAR FLOOR-TYPE-1 . 2)) (151 11 (:LINEAR FLOOR-TYPE-1 . 1)) (145 145 (:REWRITE EXPT-COMPARE-EQUAL)) (123 123 (:REWRITE DEFAULT-UNARY-MINUS)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (96 72 (:REWRITE INTEGERP-+-MINUS-*-1)) (92 92 (:REWRITE FOLD-CONSTS-IN-*)) (84 49 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (69 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (67 67 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (56 56 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (49 49 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (36 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 1 (:REWRITE EVENP-COLLECT-1)) (32 20 (:REWRITE /-CANCELLATION-ON-RIGHT)) (30 30 (:REWRITE FOLD-CONSTS-IN-+)) (25 1 (:REWRITE EVENP-+-ALT)) (17 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (16 12 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (16 12 (:REWRITE INTEGERP-PROD-3)) (15 3 (:REWRITE EVENP-COLLAPSE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT))) (LOGBITP-OF-ONE-LESS-CASE-2 (104 1 (:REWRITE MOD-=-0 . 2)) (90 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (65 2 (:REWRITE FLOOR-=-X/Y . 2)) (49 9 (:REWRITE POWER2-INTEGER)) (48 4 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 33 (:REWRITE DEFAULT-<-2)) (39 33 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (36 36 (:REWRITE EXPT-COMPARE)) (36 36 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 5 (:LINEAR EXPT->-1)) (31 2 (:REWRITE RTL1)) (31 2 (:REWRITE FLOOR-SIMPLE-CASES)) (31 2 (:REWRITE FLOOR-DETERMINED-1)) (27 7 (:REWRITE EXPT-COMPARE-EQUAL)) (26 2 (:LINEAR MOD-TYPE . 4)) (26 2 (:LINEAR MOD-TYPE . 3)) (24 2 (:LINEAR MOD-TYPE . 2)) (24 2 (:LINEAR MOD-TYPE . 1)) (21 7 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 2 (:REWRITE FLOOR-TYPE-3 . 3)) (9 2 (:REWRITE FLOOR-TYPE-3 . 2)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (8 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (8 2 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-=-X/Y . 3)) (2 1 (:REWRITE UNICITY-OF-0)) (2 1 (:REWRITE POWER2P-INVERSE)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-LESS (495 44 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (466 11 (:REWRITE RTL1)) (230 5 (:REWRITE ODDP-OF-*)) (216 11 (:REWRITE FLOOR-DETERMINED-1)) (203 29 (:LINEAR EXPT->-1)) (188 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (184 4 (:REWRITE FLOOR-=-X/Y . 2)) (146 62 (:REWRITE DEFAULT-*-2)) (142 106 (:REWRITE DEFAULT-<-2)) (141 3 (:REWRITE INTEGERP-UNARY-)) (139 139 (:META CANCEL_PLUS-LESSP-CORRECT)) (134 24 (:REWRITE EXPT-COMPARE-EQUAL)) (117 106 (:REWRITE DEFAULT-<-1)) (117 97 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (110 22 (:REWRITE DEFAULT-UNARY-/)) (108 36 (:REWRITE EXPO-OF-NOT-RATIONALP)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 62 (:REWRITE DEFAULT-*-1)) (68 68 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 2 (:REWRITE DISTRIBUTIVITY-ALT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (61 23 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (58 58 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 48 (:REWRITE DEFAULT-+-2)) (52 48 (:REWRITE DEFAULT-+-1)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (40 5 (:REWRITE FLOOR-TYPE-3 . 3)) (40 5 (:REWRITE FLOOR-TYPE-3 . 2)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:REWRITE EXPO-MINUS-ERIC)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (35 5 (:REWRITE FLOOR-TYPE-4 . 3)) (35 5 (:REWRITE FLOOR-TYPE-4 . 2)) (34 2 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (30 23 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 20 (:REWRITE DEFAULT-UNARY-MINUS)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (24 24 (:META CANCEL_PLUS-EQUAL-CORRECT)) (22 1 (:REWRITE MOD-=-0 . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ONE-LESS-THAN-X (1976 48 (:REWRITE RTL1)) (1223 140 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (851 48 (:REWRITE FLOOR-DETERMINED-1)) (652 20 (:REWRITE FLOOR-=-X/Y . 2)) (634 226 (:REWRITE DEFAULT-*-2)) (489 301 (:REWRITE DEFAULT-<-2)) (412 412 (:META CANCEL_PLUS-LESSP-CORRECT)) (406 58 (:LINEAR EXPT->-1)) (375 65 (:REWRITE EXPT-COMPARE-EQUAL)) (350 70 (:REWRITE DEFAULT-UNARY-/)) (333 301 (:REWRITE DEFAULT-<-1)) (302 226 (:REWRITE DEFAULT-*-1)) (276 92 (:REWRITE EXPO-OF-NOT-RATIONALP)) (261 93 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (212 58 (:REWRITE <-+-CONSTANT-CONSTANT)) (184 114 (:REWRITE DEFAULT-+-2)) (168 21 (:REWRITE FLOOR-TYPE-3 . 3)) (168 21 (:REWRITE FLOOR-TYPE-3 . 2)) (166 166 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (152 114 (:REWRITE DEFAULT-+-1)) (147 21 (:REWRITE FLOOR-TYPE-4 . 3)) (147 21 (:REWRITE FLOOR-TYPE-4 . 2)) (142 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (141 3 (:REWRITE INTEGERP-UNARY-)) (129 1 (:REWRITE FLOOR-=-X/Y . 4)) (116 116 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (112 93 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (106 8 (:LINEAR FLOOR-TYPE-2 . 2)) (106 8 (:LINEAR FLOOR-TYPE-2 . 1)) (102 4 (:LINEAR X*Y>1-POSITIVE)) (93 31 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (92 92 (:REWRITE EXPO-MINUS-ERIC)) (92 8 (:LINEAR FLOOR-TYPE-1 . 2)) (92 8 (:LINEAR FLOOR-TYPE-1 . 1)) (91 91 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (73 41 (:REWRITE DEFAULT-UNARY-MINUS)) (65 65 (:META CANCEL_TIMES-EQUAL-CORRECT)) (65 65 (:META CANCEL_PLUS-EQUAL-CORRECT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (58 58 (:LINEAR EXPT-LESS-THAN-1-HACK)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (22 1 (:REWRITE MOD-=-0 . 2)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-ONE-LESS-THAN-X (337 20 (:DEFINITION UNSIGNED-BYTE-P)) (329 17 (:REWRITE LOGHEAD-IDENTITY)) (277 20 (:DEFINITION INTEGER-RANGE-P)) (226 226 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (136 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (100 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (82 2 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (53 47 (:REWRITE DEFAULT-<-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (47 47 (:REWRITE DEFAULT-<-2)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:META META-RULE-ERIC)) (35 23 (:REWRITE DEFAULT-+-2)) (34 1 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (33 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 3 (:LINEAR LOGHEAD-LEQ)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 23 (:REWRITE DEFAULT-+-1)) (22 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 3 (:REWRITE LOGHEAD-<)) (10 10 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (7 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGAPP-<))) (EQUAL-+-HACK-GEN (42 40 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 5 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:REWRITE DEFAULT-+-2)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE))) (EQUAL-CONSTANT-+-BLAH (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE SUM-POWER-OF-TWO)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKY) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT (453 14 (:REWRITE LOGHEAD-IDENTITY)) (243 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (224 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (59 46 (:REWRITE DEFAULT-<-2)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (55 55 (:REWRITE EXPT-COMPARE)) (55 55 (:META CANCEL_PLUS-LESSP-CORRECT)) (52 46 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (29 29 (:REWRITE POWER2-INTEGER)) (27 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (26 16 (:REWRITE DEFAULT-+-2)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (23 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE LOGEXT-IDENTITY)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE DEFAULT-+-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 15 (:META META-RULE-ERIC)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE DEFAULT-*-1)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT-BLAH (360 8 (:REWRITE LOGHEAD-IDENTITY)) (216 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (184 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (72 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (60 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (46 36 (:REWRITE DEFAULT-<-2)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 36 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1))) (REMOVEME4 (524 16 (:REWRITE LOGHEAD-IDENTITY)) (257 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (237 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (158 4 (:LINEAR LOGHEAD-LEQ)) (109 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 3 (:REWRITE LOGEXT-IDENTITY)) (77 55 (:REWRITE DEFAULT-<-2)) (68 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (67 55 (:REWRITE DEFAULT-<-1)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (66 42 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (54 27 (:REWRITE USB-TIGHTEN)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 48 (:REWRITE POWER2-INTEGER)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 8 (:REWRITE LOGCAR-EVENP)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (31 18 (:REWRITE DEFAULT-+-2)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 18 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (REMOVEME7 (556 14 (:REWRITE LOGHEAD-IDENTITY)) (244 10 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (234 31 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (176 4 (:LINEAR LOGHEAD-LEQ)) (108 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (101 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (91 10 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 49 (:REWRITE DEFAULT-<-2)) (63 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (62 31 (:REWRITE USB-TIGHTEN)) (51 49 (:REWRITE DEFAULT-<-1)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 8 (:LINEAR X*Y>1-POSITIVE)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 21 (:REWRITE DEFAULT-+-2)) (35 18 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (33 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE POWER2-INTEGER)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (31 31 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 21 (:REWRITE DEFAULT-+-1)) (28 4 (:REWRITE COMMUTATIVITY-OF-+)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:TYPE-PRESCRIPTION IFIX)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE UNICITY-OF-0)) (10 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 4 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 3 (:REWRITE IFIX-INTEGERP)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (SIGNED-BYTE-P-OF-TRUNCATE (216 119 (:REWRITE DEFAULT-<-1)) (212 7 (:REWRITE TRUNCATE-TYPE . 2)) (161 11 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (123 123 (:META CANCEL_PLUS-LESSP-CORRECT)) (121 14 (:DEFINITION ABS)) (119 119 (:REWRITE DEFAULT-<-2)) (110 110 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (107 7 (:REWRITE TRUNCATE-=-X/Y . 2)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 4)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 3)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 2)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 1)) (68 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 11 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (56 17 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (44 44 (:REWRITE POWER2-INTEGER)) (34 10 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 6 (:LINEAR TRUNCATE-TYPE . 3)) (30 6 (:LINEAR TRUNCATE-TYPE . 4)) (22 11 (:REWRITE USB-TIGHTEN)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:TYPE-PRESCRIPTION ABS)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (11 11 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (11 11 (:REWRITE DEFAULT-UNARY-MINUS)) (10 7 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR TRUNCATE-TYPE . 1)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:LINEAR X*Y>1-POSITIVE))) (BITP-RANGE) (LOGCAR-OF-LOGBIT (25 5 (:REWRITE LOGCAR-EVENP)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (10 5 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-SHIFT-HACK (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (461 244 (:REWRITE DEFAULT-*-2)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (308 164 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (284 244 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (164 164 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 55 (:REWRITE POWER2-INTEGER)) (49 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (HACKZ (24 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (16 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR X*Y>1-POSITIVE)) (9 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (HACKZZ (13 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (6 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE RTL-A-MILLION)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (NO-INTEGERPS-BETWEEN-0-AND-1) (NO-INTEGERPS-BETWEEN-0-AND-MINUS-1) (INTEGERP-OF-UNARY-/-WHEN-INTEGER-P (25 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE NO-INTEGERPS-BETWEEN-0-AND-1)) (14 2 (:REWRITE NORMALIZE-<-MINUS-/)) (14 2 (:REWRITE EQUAL-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 9 (:REWRITE DEFAULT-<-2)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT))) (ARITHHACK2 (34 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (FLOOR-OF-ONE-MORE-CASE-1 (1385 77 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (1111 21 (:REWRITE 0-<-*)) (935 93 (:REWRITE INTEGERP-+-MINUS-*-4)) (864 41 (:REWRITE FLOOR-TYPE-4 . 2)) (766 191 (:REWRITE EQUAL-1-HACK)) (726 270 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (691 41 (:REWRITE FLOOR-TYPE-3 . 3)) (656 656 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (656 656 (:REWRITE EXPT-COMPARE)) (575 575 (:REWRITE DEFAULT-<-2)) (575 575 (:REWRITE DEFAULT-<-1)) (542 20 (:REWRITE CANCEL-FLOOR-+-BASIC)) (524 471 (:META CANCEL_PLUS-EQUAL-CORRECT)) (471 471 (:META CANCEL_TIMES-EQUAL-CORRECT)) (470 470 (:REWRITE EXPT-COMPARE-EQUAL)) (464 40 (:REWRITE FLOOR-=-X/Y . 2)) (454 404 (:REWRITE DEFAULT-*-2)) (452 41 (:REWRITE FLOOR-SIMPLE-CASES)) (432 14 (:REWRITE CANCEL-MOD-+-BASIC)) (404 404 (:REWRITE DEFAULT-*-1)) (392 41 (:REWRITE RTL1)) (392 41 (:REWRITE FLOOR-DETERMINED-1)) (384 64 (:LINEAR X*Y>1-POSITIVE)) (383 41 (:REWRITE FLOOR-TYPE-3 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (308 66 (:REWRITE <-*-/-LEFT)) (296 14 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (291 21 (:DEFINITION IFF)) (268 268 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (243 135 (:REWRITE DEFAULT-UNARY-/)) (193 11 (:LINEAR FLOOR-TYPE-2 . 2)) (190 31 (:REWRITE <-*-/-RIGHT)) (176 11 (:LINEAR FLOOR-TYPE-1 . 2)) (148 43 (:REWRITE RTL-A-MILLION)) (145 145 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (139 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (119 11 (:LINEAR FLOOR-TYPE-2 . 1)) (114 114 (:REWRITE POWER2-INTEGER)) (113 41 (:REWRITE FLOOR-TYPE-4 . 3)) (109 74 (:REWRITE DEFAULT-+-2)) (106 2 (:REWRITE FLOOR-=-X/Y . 4)) (102 39 (:REWRITE MY-EQUAL-/)) (85 32 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (74 74 (:REWRITE DEFAULT-+-1)) (60 3 (:LINEAR MOD-TYPE . 2)) (48 48 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE NORMALIZE-EQUAL-0)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:REWRITE FOLD-CONSTS-IN-*)) (29 11 (:LINEAR FLOOR-TYPE-1 . 1)) (24 1 (:REWRITE EQUAL-MINUS-MINUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 21 (:REWRITE TIMES-ZERO)) (21 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (17 3 (:LINEAR MOD-TYPE . 3)) (16 4 (:DEFINITION ZEROP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (12 12 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (FLOOR-OF-ONE-MORE-CASE-2 (6450 33 (:REWRITE FLOOR-OF-ONE-MORE-CASE-1)) (2266 105 (:REWRITE CANCEL-MOD-+-BASIC)) (1598 758 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1532 1532 (:REWRITE DEFAULT-*-2)) (1532 1532 (:REWRITE DEFAULT-*-1)) (1440 400 (:REWRITE EQUAL-1-HACK)) (1432 52 (:REWRITE MOD-=-0 . 2)) (975 36 (:REWRITE FLOOR-=-X/Y . 3)) (900 900 (:REWRITE EXPT-COMPARE)) (873 109 (:REWRITE INTEGERP-+-MINUS-*-4)) (726 726 (:REWRITE DEFAULT-<-2)) (726 726 (:REWRITE DEFAULT-<-1)) (716 36 (:REWRITE FLOOR-=-X/Y . 2)) (702 702 (:META CANCEL_TIMES-EQUAL-CORRECT)) (698 698 (:REWRITE EXPT-COMPARE-EQUAL)) (593 24 (:LINEAR MOD-TYPE . 2)) (552 48 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (529 519 (:REWRITE DEFAULT-+-2)) (526 379 (:REWRITE DEFAULT-UNARY-/)) (519 519 (:REWRITE DEFAULT-+-1)) (500 6 (:REWRITE CANCEL-MOD-+-3)) (377 125 (:REWRITE RTL-A-MILLION)) (341 39 (:REWRITE RTL1)) (341 39 (:REWRITE FLOOR-DETERMINED-1)) (338 52 (:REWRITE INTEGERP-+-MINUS-*-2)) (329 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (312 312 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (222 36 (:REWRITE FLOOR-TYPE-3 . 2)) (177 177 (:REWRITE POWER2-INTEGER)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (168 52 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (157 24 (:LINEAR MOD-TYPE . 3)) (134 134 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (124 124 (:REWRITE FOLD-CONSTS-IN-*)) (120 36 (:REWRITE FLOOR-TYPE-3 . 3)) (112 28 (:DEFINITION ZEROP)) (108 36 (:REWRITE FLOOR-TYPE-4 . 2)) (104 17 (:LINEAR X*Y>1-POSITIVE)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (90 3 (:REWRITE FLOOR-=-X/Y . 4)) (84 84 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (84 16 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (84 16 (:REWRITE INTEGERP-PROD-3)) (79 13 (:LINEAR FLOOR-TYPE-2 . 1)) (70 28 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (56 56 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (53 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 52 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 48 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (44 44 (:REWRITE FOLD-CONSTS-IN-+)) (44 32 (:REWRITE /-CANCELLATION-ON-RIGHT)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (36 36 (:REWRITE FLOOR-TYPE-4 . 3)) (34 13 (:LINEAR FLOOR-TYPE-2 . 2)) (31 13 (:LINEAR FLOOR-TYPE-1 . 2)) (24 24 (:LINEAR MOD-TYPE . 1)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:LINEAR FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (FLOOR-OF-ONE-MORE (821 31 (:REWRITE FLOOR-=-X/Y . 3)) (731 43 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (642 64 (:REWRITE INTEGERP-+-MINUS-*-4)) (534 194 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (505 120 (:REWRITE EQUAL-1-HACK)) (382 16 (:REWRITE CANCEL-MOD-+-BASIC)) (337 337 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (337 337 (:REWRITE EXPT-COMPARE)) (337 337 (:REWRITE DEFAULT-<-2)) (337 337 (:REWRITE DEFAULT-<-1)) (337 337 (:META CANCEL_PLUS-LESSP-CORRECT)) (252 31 (:REWRITE FLOOR-=-X/Y . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (235 31 (:REWRITE RTL1)) (235 31 (:REWRITE FLOOR-SIMPLE-CASES)) (235 31 (:REWRITE FLOOR-DETERMINED-1)) (229 229 (:REWRITE DEFAULT-*-2)) (229 229 (:REWRITE DEFAULT-*-1)) (227 31 (:REWRITE FLOOR-TYPE-3 . 3)) (216 216 (:REWRITE EXPT-COMPARE-EQUAL)) (216 216 (:META CANCEL_TIMES-EQUAL-CORRECT)) (216 216 (:META CANCEL_PLUS-EQUAL-CORRECT)) (205 31 (:REWRITE FLOOR-TYPE-3 . 2)) (199 97 (:REWRITE DEFAULT-UNARY-/)) (199 31 (:REWRITE FLOOR-TYPE-4 . 2)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (120 1 (:REWRITE FLOOR-=-X/Y . 4)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (84 12 (:LINEAR FLOOR-TYPE-2 . 1)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 15 (:REWRITE RTL-A-MILLION)) (77 42 (:REWRITE DEFAULT-+-2)) (72 72 (:REWRITE POWER2-INTEGER)) (54 12 (:LINEAR FLOOR-TYPE-2 . 2)) (48 12 (:LINEAR FLOOR-TYPE-1 . 2)) (45 45 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (42 42 (:REWRITE DEFAULT-+-1)) (40 10 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (40 5 (:LINEAR MOD-TYPE . 3)) (35 5 (:LINEAR MOD-TYPE . 2)) (34 34 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (33 2 (:REWRITE CANCEL-FLOOR-+-BASIC)) (32 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (31 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-TYPE-4 . 3)) (24 6 (:DEFINITION ZEROP)) (23 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 12 (:LINEAR FLOOR-TYPE-1 . 1)) (8 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 8 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-HELPER-1 (994 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (915 391 (:REWRITE DEFAULT-+-2)) (790 391 (:REWRITE DEFAULT-+-1)) (657 70 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (576 262 (:REWRITE DEFAULT-*-1)) (552 262 (:REWRITE DEFAULT-*-2)) (486 6 (:REWRITE MOD-=-0 . 2)) (484 484 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (350 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (277 93 (:REWRITE EXPO-OF-NOT-RATIONALP)) (242 242 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (212 26 (:REWRITE INTEGERP-+-MINUS-*-1)) (196 10 (:REWRITE INTEGERP-+-MINUS-*-3)) (175 35 (:REWRITE DEFAULT-UNARY-/)) (166 2 (:LINEAR MOD-TYPE . 2)) (149 149 (:META CANCEL_TIMES-EQUAL-CORRECT)) (112 74 (:REWRITE DEFAULT-<-1)) (108 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (100 74 (:REWRITE DEFAULT-<-2)) (93 93 (:REWRITE EXPO-MINUS-ERIC)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (80 28 (:REWRITE DEFAULT-UNARY-MINUS)) (63 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (59 59 (:REWRITE POWER2-INTEGER)) (58 58 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (48 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (40 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (32 2 (:REWRITE RTL-A-MILLION)) (27 7 (:REWRITE SUM-POWER-OF-TWO)) (21 3 (:LINEAR EXPT->-1)) (18 6 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (18 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (15 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE FOLD-CONSTS-IN-*)) (6 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:LINEAR MOD-TYPE . 3)) (6 2 (:LINEAR MOD-TYPE . 1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ONE-TWO-MULTIPLES-FIT (40 10 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (34 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (32 7 (:REWRITE EQUAL-1-HACK)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 5 (:REWRITE DEFAULT-UNARY-/)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (MOD-HELPER-2 (748 748 (:REWRITE DEFAULT-+-2)) (748 748 (:REWRITE DEFAULT-+-1)) (738 738 (:REWRITE DEFAULT-*-2)) (738 738 (:REWRITE DEFAULT-*-1)) (516 516 (:REWRITE EXPT-COMPARE)) (446 306 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (360 360 (:REWRITE DEFAULT-<-2)) (360 360 (:REWRITE DEFAULT-<-1)) (260 15 (:REWRITE MOD-=-0 . 2)) (200 200 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (187 187 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (158 58 (:REWRITE EQUAL-1-HACK)) (153 153 (:REWRITE DEFAULT-UNARY-/)) (146 146 (:META CANCEL_TIMES-EQUAL-CORRECT)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (134 134 (:REWRITE EXPT-COMPARE-EQUAL)) (126 21 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (111 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 34 (:REWRITE INTEGERP-+-MINUS-*-4)) (100 100 (:REWRITE FOLD-CONSTS-IN-*)) (84 84 (:REWRITE POWER2-INTEGER)) (62 27 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 27 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (21 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (20 20 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (20 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE FOLD-CONSTS-IN-+)) (15 15 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (14 14 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (12 12 (:REWRITE SUM-POWER-OF-TWO)) (12 12 (:REWRITE EQUAL-CONSTANT-+)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (8 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (6 1 (:LINEAR X*Y>1-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-MORE (1768 180 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1125 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (1032 12 (:REWRITE FLOOR-=-X/Y . 3)) (859 44 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (591 22 (:REWRITE INTEGERP-+-MINUS-*-2)) (564 8 (:REWRITE MOD-=-0 . 2)) (522 6 (:LINEAR MOD-TYPE . 2)) (450 90 (:REWRITE DEFAULT-UNARY-/)) (405 135 (:REWRITE EXPO-OF-NOT-RATIONALP)) (336 116 (:REWRITE DEFAULT-*-2)) (285 161 (:REWRITE DEFAULT-<-2)) (280 12 (:REWRITE RTL1)) (280 12 (:REWRITE FLOOR-SIMPLE-CASES)) (280 12 (:REWRITE FLOOR-DETERMINED-1)) (274 274 (:META CANCEL_TIMES-EQUAL-CORRECT)) (274 274 (:META CANCEL_PLUS-EQUAL-CORRECT)) (264 12 (:REWRITE FLOOR-=-X/Y . 2)) (256 12 (:REWRITE FLOOR-TYPE-3 . 2)) (172 57 (:REWRITE DEFAULT-+-2)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (165 165 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (161 161 (:REWRITE DEFAULT-<-1)) (156 52 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (135 135 (:REWRITE EXPO-MINUS-ERIC)) (128 116 (:REWRITE DEFAULT-*-1)) (123 57 (:REWRITE DEFAULT-+-1)) (122 122 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (120 10 (:REWRITE RTL-A-MILLION)) (102 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (96 12 (:REWRITE FLOOR-TYPE-3 . 3)) (94 94 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (90 30 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (87 87 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (86 2 (:REWRITE CANCEL-MOD-+-BASIC)) (85 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (84 12 (:REWRITE FLOOR-TYPE-4 . 2)) (79 79 (:REWRITE POWER2-INTEGER)) (68 19 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (61 61 (:LINEAR EXPT-LESS-THAN-1-HACK)) (47 47 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (30 30 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (22 22 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (22 22 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (19 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (18 6 (:LINEAR MOD-TYPE . 3)) (18 6 (:LINEAR MOD-TYPE . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-TYPE-4 . 3)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGBIT-OF-ONE-MORE (85 5 (:REWRITE LOGHEAD-IDENTITY)) (40 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (24 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:REWRITE DEFAULT-<-2)) (20 20 (:REWRITE DEFAULT-<-1)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (19 19 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE DEFAULT-+-2)) (7 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (OTHER-WAY (957 956 (:REWRITE DEFAULT-*-2)) (956 956 (:REWRITE DEFAULT-*-1)) (681 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (589 587 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (587 587 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (489 489 (:REWRITE EXPT-COMPARE)) (468 27 (:REWRITE RTL1)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (343 343 (:REWRITE DEFAULT-+-2)) (343 343 (:REWRITE DEFAULT-+-1)) (260 260 (:REWRITE DEFAULT-<-2)) (260 260 (:REWRITE DEFAULT-<-1)) (161 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (122 122 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (108 27 (:REWRITE FLOOR-DETERMINED-1)) (105 15 (:REWRITE ERIC700)) (104 8 (:LINEAR MOD-TYPE . 2)) (98 98 (:REWRITE POWER2-INTEGER)) (78 78 (:REWRITE INTEGERP-+-MINUS-*-4)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (61 22 (:REWRITE FLOOR-TYPE-3 . 3)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 22 (:REWRITE FLOOR-TYPE-4 . 3)) (55 22 (:REWRITE FLOOR-TYPE-4 . 2)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (34 33 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (33 33 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:META CANCEL_TIMES-EQUAL-CORRECT)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (26 26 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (21 21 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE HACKYY)) (17 1 (:REWRITE ODDP-+)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE ODDP-OF-*))) (FLOOR-LINEAR-1 (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 10 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE COMMUTATIVITY-OF-*)) (18 2 (:REWRITE FLOOR-=-X/Y . 3)) (18 2 (:REWRITE FLOOR-=-X/Y . 2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (16 2 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE DEFAULT-<-1)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 3)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (12 2 (:REWRITE RTL1)) (12 2 (:REWRITE FLOOR-SIMPLE-CASES)) (12 2 (:REWRITE FLOOR-DETERMINED-1)) (10 10 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 1 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (2 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE DEFAULT-+-1))) (FLOOR-WHEN-<-2 (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (23 12 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (19 19 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (19 19 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 2 (:LINEAR FLOOR-TYPE-2 . 2)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (8 2 (:LINEAR FLOOR-TYPE-1 . 2)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:LINEAR FLOOR-TYPE-1 . 1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (ONE-WAY (3276 30 (:REWRITE RTL)) (1008 990 (:REWRITE DEFAULT-*-2)) (990 990 (:REWRITE DEFAULT-*-1)) (878 29 (:REWRITE RTL1)) (557 555 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (555 555 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (546 546 (:REWRITE EXPT-COMPARE)) (365 365 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (311 311 (:REWRITE DEFAULT-<-2)) (311 311 (:REWRITE DEFAULT-<-1)) (303 303 (:REWRITE DEFAULT-+-2)) (303 303 (:REWRITE DEFAULT-+-1)) (289 44 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (223 29 (:REWRITE FLOOR-SIMPLE-CASES)) (208 16 (:LINEAR MOD-TYPE . 2)) (159 159 (:REWRITE POWER2-INTEGER)) (149 149 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (138 138 (:REWRITE INTEGERP-+-MINUS-*-4)) (110 29 (:REWRITE FLOOR-DETERMINED-1)) (99 99 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (63 24 (:REWRITE FLOOR-TYPE-3 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 2)) (56 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 51 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (51 51 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (38 38 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (20 20 (:REWRITE FOLD-CONSTS-IN-+)) (20 20 (:REWRITE EXPT-COMPARE-EQUAL)) (18 3 (:REWRITE HACKYY)) (16 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (16 16 (:LINEAR MOD-TYPE . 3)) (16 16 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-SPLIT-X-REWRITE) (LOGHEAD-SPLIT-Y-REWRITE (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGTAIL-EQUAL-MINUS-ONE-REWRITE (105 1 (:REWRITE FLOOR-=-X/Y . 3)) (68 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (42 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (41 1 (:REWRITE FLOOR-TYPE-1)) (39 39 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (39 39 (:REWRITE EXPT-COMPARE)) (39 39 (:META CANCEL_PLUS-LESSP-CORRECT)) (39 29 (:REWRITE DEFAULT-<-1)) (37 29 (:REWRITE DEFAULT-<-2)) (35 5 (:LINEAR EXPT->-1)) (30 1 (:REWRITE RTL1)) (30 1 (:REWRITE FLOOR-SIMPLE-CASES)) (30 1 (:REWRITE FLOOR-DETERMINED-1)) (28 8 (:REWRITE EXPT-COMPARE-EQUAL)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE DEFAULT-+-1)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE DEFAULT-*-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (<-OF-ASH (82 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (49 1 (:REWRITE FLOOR-WHEN-<-2)) (33 1 (:LINEAR X*Y>1-POSITIVE)) (25 12 (:REWRITE EXPT-COMPARE)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 4 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT->-1)) (18 8 (:REWRITE DEFAULT-*-2)) (15 9 (:REWRITE DEFAULT-<-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 9 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE POWER2-INTEGER)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-SHIFT (3500 130 (:LINEAR X*Y>1-POSITIVE)) (2958 122 (:REWRITE ARITHHACK2)) (2805 34 (:REWRITE <-*-0)) (2679 34 (:REWRITE 0-<-*)) (1879 16 (:REWRITE FLOOR-TYPE-4 . 2)) (1851 16 (:REWRITE FLOOR-TYPE-4 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 2)) (1662 68 (:DEFINITION IFF)) (1053 857 (:REWRITE DEFAULT-<-2)) (1033 1007 (:REWRITE EXPT-COMPARE)) (1029 857 (:REWRITE DEFAULT-<-1)) (1007 1007 (:META CANCEL_PLUS-LESSP-CORRECT)) (1005 1005 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (817 16 (:REWRITE FLOOR-WHEN-<-2)) (812 16 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (663 16 (:REWRITE RTL1)) (663 16 (:REWRITE FLOOR-SIMPLE-CASES)) (663 16 (:REWRITE FLOOR-DETERMINED-1)) (640 64 (:REWRITE NORMALIZE-<-MINUS-/)) (621 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (570 16 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (538 538 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (497 497 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (460 351 (:REWRITE EXPT-COMPARE-EQUAL)) (360 16 (:REWRITE FLOOR-=-X/Y . 3)) (360 16 (:REWRITE FLOOR-=-X/Y . 2)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (326 128 (:REWRITE MY-EQUAL-/)) (310 4 (:LINEAR FLOOR-TYPE-2 . 2)) (310 4 (:LINEAR FLOOR-TYPE-2 . 1)) (300 4 (:LINEAR FLOOR-TYPE-1 . 2)) (300 4 (:LINEAR FLOOR-TYPE-1 . 1)) (286 88 (:REWRITE <-*-/-LEFT-COMMUTED)) (236 98 (:REWRITE DEFAULT-*-2)) (230 32 (:REWRITE <-*-/-RIGHT-COMMUTED)) (200 98 (:REWRITE DEFAULT-*-1)) (168 19 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (146 18 (:REWRITE EQUAL-1-HACK)) (133 133 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 12 (:REWRITE DEFAULT-UNARY-/)) (68 12 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 4 (:REWRITE <-*-/-RIGHT)) (49 3 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (49 3 (:REWRITE INTEGERP-PROD-3)) (46 7 (:LINEAR EXPT->-1)) (45 23 (:REWRITE DEFAULT-+-2)) (42 1 (:REWRITE NORMALIZE-EQUAL-0)) (37 37 (:REWRITE FOLD-CONSTS-IN-*)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (29 14 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE DEFAULT-+-1)) (18 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE EXPO-SHIFT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (7 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 1 (:REWRITE EQUAL-MINUS-MINUS)) (5 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGTAIL-SHIFT-CONSTANT-VERSION (104 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (97 97 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 2 (:REWRITE LOGTAIL-IDENTITY)) (64 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (33 20 (:REWRITE DEFAULT-<-2)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (17 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (16 2 (:LINEAR LOGTAIL-LEQ)) (14 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE DEFAULT-+-1)) (12 2 (:LINEAR EXPT->-1)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 4 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:REWRITE EXPO-MINUS-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (DIVIDES) (DIVIDES-HACK (14 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 8 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE DEFAULT-*-1)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 3 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 1 (:REWRITE INTEGERP-UNARY-)) (3 3 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (DIVIDES-HACK2 (4 3 (:REWRITE DEFAULT-*-2)) (4 3 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-OF-SUM (60 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE DEFAULT-UNARY-/)) (18 3 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 6 (:REWRITE DEFAULT-*-2)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 6 (:REWRITE DEFAULT-*-1)) (8 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1))) (DIVIDES-OF-SUM-2 (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 12 (:REWRITE POWER2-INTEGER)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2B (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 11 (:REWRITE POWER2-INTEGER)) (10 4 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2C (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:REWRITE POWER2-INTEGER)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 8 (:REWRITE DEFAULT-+-1)) (11 8 (:REWRITE DEFAULT-*-2)) (10 8 (:REWRITE DEFAULT-+-2)) (10 8 (:REWRITE DEFAULT-*-1)) (10 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-UNARY-MINUS (22 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (8 2 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE POWER2-INTEGER)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (5 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (2 1 (:DEFINITION NOT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (DIVIDES-OF-TIMES-1 (40 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 2 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (8 6 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-TIMES-2) (INTEGERP-SQUEEZE-HACK (3 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK (96 3 (:REWRITE EQUAL-1-HACK)) (84 6 (:LINEAR X*Y>1-POSITIVE)) (78 6 (:REWRITE ARITHHACK2)) (26 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-*-2)) (11 11 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 1 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (INTEGERP-SQUEEZE-HACK-2 (4 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK-3 (15 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (11 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 1 (:REWRITE ARITHHACK2)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (DIVIDES-SQUEEZE-HACK-2 (178 12 (:LINEAR X*Y>1-POSITIVE)) (166 12 (:REWRITE ARITHHACK2)) (109 5 (:REWRITE EQUAL-1-HACK)) (101 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:REWRITE DEFAULT-<-2)) (54 54 (:REWRITE DEFAULT-<-1)) (50 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE EXPT-COMPARE-EQUAL)) (21 21 (:META CANCEL_TIMES-EQUAL-CORRECT)) (21 21 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:REWRITE DEFAULT-*-2)) (18 18 (:REWRITE DEFAULT-*-1)) (12 3 (:REWRITE DEFAULT-UNARY-/)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-LEFT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE (5570 770 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (5427 5427 (:REWRITE EXPT-COMPARE)) (4950 770 (:REWRITE DIVIDES-SQUEEZE-HACK)) (4857 4028 (:REWRITE DEFAULT-+-2)) (4570 4028 (:REWRITE DEFAULT-+-1)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4135 3897 (:REWRITE DEFAULT-<-1)) (3961 3897 (:REWRITE DEFAULT-<-2)) (3323 3095 (:REWRITE DEFAULT-*-2)) (3125 3095 (:REWRITE DEFAULT-*-1)) (2898 124 (:REWRITE INTEGERP-+-MINUS-*-2)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (1833 1833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1509 1509 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1196 236 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (752 44 (:REWRITE DIVIDES-OF-TIMES-2)) (658 658 (:META CANCEL_TIMES-EQUAL-CORRECT)) (628 52 (:REWRITE SUM-POWER-OF-TWO)) (594 594 (:REWRITE EXPT-COMPARE-EQUAL)) (488 68 (:REWRITE DIVIDES-OF-SUM)) (409 409 (:REWRITE POWER2-INTEGER)) (365 364 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (364 364 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (315 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (274 274 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (212 200 (:REWRITE DEFAULT-UNARY-MINUS)) (144 16 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (140 140 (:REWRITE FOLD-CONSTS-IN-+)) (139 124 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (128 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (124 52 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (64 32 (:REWRITE USB-TIGHTEN)) (52 52 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (52 52 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (45 45 (:LINEAR MOD-TYPE . 3)) (45 45 (:LINEAR MOD-TYPE . 1)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 32 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (26 26 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE EQUAL-CONSTANT-+)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (74 8 (:REWRITE DIVIDES-HACK2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (66 5 (:REWRITE MOD-=-0 . 2)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (25 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (22 22 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (22 22 (:REWRITE EXPT-COMPARE)) (22 22 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 8 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (21 3 (:REWRITE INTEGERP-UNARY-)) (18 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK)) (16 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (13 2 (:REWRITE <-+-NEGATIVE-0-1)) (12 4 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (9 1 (:REWRITE DISTRIBUTIVITY-ALT)) (8 8 (:TYPE-PRESCRIPTION DIVIDES)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (134 57 (:REWRITE DEFAULT-+-1)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (118 57 (:REWRITE DEFAULT-+-2)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (102 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (155 60 (:REWRITE DEFAULT-+-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (121 60 (:REWRITE DEFAULT-+-2)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (96 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-16-32 (40 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (40 5 (:REWRITE MOD-=-0 . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (27 23 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 23 (:REWRITE DEFAULT-<-1)) (23 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (21 7 (:REWRITE COMMUTATIVITY-OF-*)) (16 2 (:LINEAR MOD-TYPE . 2)) (14 14 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ASH1-IS-MULT2 (300 11 (:REWRITE FLOOR-WHEN-<-2)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (198 18 (:LINEAR X*Y>1-POSITIVE)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (68 8 (:DEFINITION IFF)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (63 45 (:REWRITE DEFAULT-<-2)) (55 45 (:REWRITE DEFAULT-<-1)) (48 8 (:DEFINITION NOT)) (24 16 (:REWRITE DEFAULT-*-2)) (24 8 (:REWRITE UNICITY-OF-1)) (21 11 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 16 (:REWRITE DEFAULT-*-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 4 (:REWRITE DEFAULT-+-2)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE POWER2-INTEGER)) (3 2 (:REWRITE IFIX-INTEGERP))) (ASH-IS-MULT2 (385 13 (:REWRITE FLOOR-WHEN-<-2)) (222 22 (:LINEAR X*Y>1-POSITIVE)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (74 56 (:REWRITE DEFAULT-<-2)) (74 56 (:REWRITE DEFAULT-<-1)) (68 8 (:DEFINITION IFF)) (56 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 2 (:REWRITE ZIP-OPEN)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (40 18 (:REWRITE DEFAULT-*-2)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 13 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (27 1 (:REWRITE <-*-Y-X-Y)) (25 18 (:REWRITE DEFAULT-*-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 16 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (ASH-OPEN (1454 22 (:LINEAR X*Y>1-POSITIVE)) (419 12 (:REWRITE FLOOR-WHEN-<-2)) (338 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (251 243 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (172 4 (:REWRITE <-*-0)) (172 4 (:REWRITE 0-<-*)) (160 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (148 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (146 2 (:LINEAR FLOOR-TYPE-2 . 2)) (146 2 (:LINEAR FLOOR-TYPE-2 . 1)) (140 2 (:LINEAR FLOOR-TYPE-1 . 2)) (140 2 (:LINEAR FLOOR-TYPE-1 . 1)) (122 2 (:LINEAR FLOOR-LINEAR-1)) (100 55 (:REWRITE DEFAULT-<-1)) (91 55 (:REWRITE DEFAULT-<-2)) (76 76 (:REWRITE EXPT-COMPARE)) (76 76 (:META CANCEL_PLUS-LESSP-CORRECT)) (68 8 (:DEFINITION IFF)) (64 18 (:REWRITE DEFAULT-*-2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (57 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 2 (:REWRITE ZIP-OPEN)) (48 8 (:REWRITE UNICITY-OF-1)) (37 18 (:REWRITE DEFAULT-*-1)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 16 (:REWRITE DEFAULT-+-2)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (SHIFT-IS-MULT2 (82 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (76 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 4 (:REWRITE MOD-=-0 . 2)) (50 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 2 (:REWRITE 0-<-*)) (31 23 (:REWRITE DEFAULT-<-2)) (31 23 (:REWRITE DEFAULT-<-1)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 2 (:LINEAR MOD-TYPE . 2)) (22 16 (:REWRITE DEFAULT-*-2)) (22 16 (:REWRITE DEFAULT-*-1)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (10 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (10 1 (:REWRITE FLOOR-WHEN-<-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP))) (SHIFT-BOUNDS (56 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (52 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 2 (:REWRITE 0-<-*)) (26 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (26 2 (:REWRITE MOD-=-0 . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (18 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 1 (:LINEAR MOD-TYPE . 2)) (11 8 (:REWRITE DEFAULT-*-2)) (11 8 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 4 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 1 (:REWRITE FLOOR-WHEN-<-2)) (4 4 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT (152 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (72 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 27 (:REWRITE EXPT-COMPARE)) (40 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT->-1)) (32 19 (:REWRITE DEFAULT-<-2)) (28 28 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 19 (:REWRITE DEFAULT-<-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE EXPO-EXPT2)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (EXTEND-< (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LINEAR-REWRITE (56 56 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGBITP-TOP-BIT-WHEN-SIGNED-BYTE-P (775 365 (:REWRITE DEFAULT-*-2)) (707 365 (:REWRITE DEFAULT-*-1)) (504 58 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (454 5 (:REWRITE RTL1)) (436 166 (:REWRITE DEFAULT-+-2)) (410 410 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (271 5 (:REWRITE FLOOR-=-X/Y . 3)) (252 62 (:REWRITE EXPT-COMPARE-EQUAL)) (207 193 (:REWRITE EXPT-COMPARE)) (206 166 (:REWRITE DEFAULT-+-1)) (205 205 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (200 200 (:REWRITE USB-LINEAR-REWRITE)) (192 192 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (179 129 (:REWRITE DEFAULT-<-1)) (169 129 (:REWRITE DEFAULT-<-2)) (160 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (145 29 (:REWRITE DEFAULT-UNARY-/)) (133 4 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (95 95 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (82 9 (:LINEAR EXPT->-1)) (68 5 (:REWRITE FLOOR-SIMPLE-CASES)) (68 5 (:REWRITE FLOOR-DETERMINED-1)) (68 5 (:REWRITE FLOOR-=-X/Y . 2)) (64 64 (:META CANCEL_TIMES-EQUAL-CORRECT)) (62 62 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (60 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 15 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (43 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (40 40 (:TYPE-PRESCRIPTION POWER2P)) (40 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (29 5 (:REWRITE FLOOR-TYPE-3 . 3)) (29 5 (:REWRITE FLOOR-TYPE-3 . 2)) (26 5 (:REWRITE FLOOR-TYPE-4 . 3)) (26 5 (:REWRITE FLOOR-TYPE-4 . 2)) (25 1 (:LINEAR X*Y>1-POSITIVE)) (22 22 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE POWER2P-EXPT2-I)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE EXPO-EXPT2)) (20 2 (:REWRITE EVENP-COLLAPSE)) (20 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (19 19 (:REWRITE FOLD-CONSTS-IN-*)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 2 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (10 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-2 (72 9 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (12 11 (:META META-RULE-ERIC)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE DEFAULT-<-1)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGORC1-OF-ZERO-TWO (80 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (63 6 (:REWRITE LOGIOR-AS-B-IOR)) (15 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE USB-TIGHTEN)) (9 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (9 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 2 (:REWRITE LOGNOT-ZIP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN))) (LOGORC1-OF-ZERO-ONE) (LOGEQV-OF-ZERO-ONE (80 4 (:LINEAR LOGEQV-BOUND)) (46 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (5 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE LOGNOT-ZIP)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (1 1 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEQV-COMMUTATIVE (76 4 (:LINEAR LOGEQV-BOUND)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION LOGORC1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2 (6250 11 (:DEFINITION BINARY-LOGAND)) (6215 65 (:LINEAR X*Y>1-POSITIVE)) (5180 11 (:REWRITE <-OF-LOGTAIL)) (2666 123 (:REWRITE FLOOR-WHEN-<-2)) (1911 49 (:REWRITE INTEGERP-+-MINUS-*-1)) (1592 36 (:REWRITE LOGTAIL-IDENTITY)) (1285 147 (:REWRITE <-*-/-LEFT-COMMUTED)) (1104 1104 (:REWRITE USB-LINEAR-REWRITE)) (1104 1104 (:META CANCEL_PLUS-LESSP-CORRECT)) (1096 1096 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1096 1096 (:REWRITE EXPT-COMPARE)) (903 854 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (876 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (870 40 (:REWRITE EQUAL-1-HACK)) (746 611 (:REWRITE DEFAULT-<-1)) (735 35 (:REWRITE EQUAL-MINUS-MINUS)) (715 5 (:REWRITE LOGCDR-*-1/2-EXPT)) (704 50 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (685 611 (:REWRITE DEFAULT-<-2)) (647 20 (:REWRITE ZIP-OPEN)) (617 196 (:REWRITE EXPT-COMPARE-EQUAL)) (615 92 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (593 593 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (568 344 (:REWRITE DEFAULT-*-2)) (566 156 (:REWRITE FOLD-CONSTS-IN-*)) (552 127 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (548 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (533 73 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (500 12 (:REWRITE 0-<-*)) (498 8 (:REWRITE LOGTAIL-LESSP)) (476 12 (:REWRITE <-*-0)) (444 24 (:REWRITE NORMALIZE-EQUAL-0)) (424 6 (:LINEAR FLOOR-TYPE-2 . 2)) (414 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (406 6 (:LINEAR FLOOR-TYPE-2 . 1)) (406 6 (:LINEAR FLOOR-TYPE-1 . 2)) (397 344 (:REWRITE DEFAULT-*-1)) (388 6 (:LINEAR FLOOR-TYPE-1 . 1)) (386 27 (:LINEAR LOGTAIL-LEQ)) (384 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (380 20 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (351 18 (:REWRITE FLOOR-TYPE-3 . 3)) (347 170 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (340 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (333 264 (:REWRITE DEFAULT-+-2)) (330 26 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (324 18 (:REWRITE FLOOR-TYPE-3 . 2)) (318 6 (:LINEAR FLOOR-LINEAR-1)) (317 36 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (306 18 (:REWRITE FLOOR-TYPE-4 . 2)) (293 264 (:REWRITE DEFAULT-+-1)) (288 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (279 18 (:REWRITE RTL1)) (279 18 (:REWRITE FLOOR-TYPE-4 . 3)) (279 18 (:REWRITE FLOOR-SIMPLE-CASES)) (279 18 (:REWRITE FLOOR-DETERMINED-1)) (240 200 (:META CANCEL_TIMES-EQUAL-CORRECT)) (237 79 (:REWRITE EXPO-OF-NOT-RATIONALP)) (234 32 (:LINEAR EXPT->-1)) (230 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (225 18 (:REWRITE FLOOR-=-X/Y . 3)) (225 18 (:REWRITE FLOOR-=-X/Y . 2)) (224 112 (:REWRITE USB-TIGHTEN)) (216 24 (:DEFINITION IFF)) (196 196 (:META CANCEL_PLUS-EQUAL-CORRECT)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (176 29 (:REWRITE COMMUTATIVITY-OF-+)) (170 170 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (150 150 (:REWRITE INTEGERP-+-MINUS-*-4)) (140 28 (:REWRITE SUM-POWER-OF-TWO)) (140 20 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (136 136 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (126 18 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (112 112 (:TYPE-PRESCRIPTION LOGBITP)) (112 112 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (108 18 (:REWRITE DISTRIBUTIVITY-ALT)) (100 5 (:REWRITE LOGTAIL-SHIFT-CONSTANT-VERSION)) (97 11 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (96 32 (:REWRITE FOLD-CONSTS-IN-+)) (94 92 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (92 80 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (90 46 (:REWRITE DEFAULT-UNARY-MINUS)) (90 18 (:REWRITE CANCEL-FLOOR-+-BASIC)) (82 82 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (79 79 (:REWRITE EXPO-MINUS-ERIC)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-2)) (72 54 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (72 4 (:REWRITE EQUAL-CONSTANT-+)) (70 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (68 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (64 64 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 10 (:REWRITE DISTRIBUTIVITY)) (60 30 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (52 52 (:TYPE-PRESCRIPTION LOGMASKP)) (34 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (32 32 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 28 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (27 27 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (24 4 (:REWRITE EVENP-+-ALT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (20 20 (:REWRITE FLOOR-UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (13 13 (:REWRITE EVENP-*)) (11 11 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (8 8 (:REWRITE MY-EQUAL-/)) (4 4 (:REWRITE EVENP-+)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION (397 9 (:REWRITE EXPO-COMPARISON-REWRITE-TO-BOUND-2)) (122 2 (:REWRITE LOGTAIL-IDENTITY)) (115 2 (:REWRITE ASH-0)) (108 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (107 2 (:REWRITE ZIP-OPEN)) (104 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (104 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (104 2 (:REWRITE ASH-AS-LOGTAIL)) (89 89 (:REWRITE USB-LINEAR-REWRITE)) (89 89 (:REWRITE EXPT-COMPARE)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (74 74 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (51 2 (:REWRITE LOGTAIL-EQUAL-0)) (50 1 (:LINEAR EXPT->-1)) (48 44 (:REWRITE DEFAULT-<-1)) (44 44 (:REWRITE DEFAULT-<-2)) (44 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (36 4 (:LINEAR LOGTAIL-LEQ)) (34 32 (:REWRITE DEFAULT-+-2)) (32 32 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 18 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (9 3 (:REWRITE EXPT-EXPO-WHEN-POWER2P)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:LINEAR EXPO-LOWER-POS)) (1 1 (:LINEAR EXPO-LOWER-BOUND-2))) (DIVIDE-BOTH-SIDES-HACK) (CANCEL-NEGATED-CASE (51 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (25 1 (:REWRITE <-*-0)) (15 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 7 (:REWRITE DEFAULT-*-1)) (8 1 (:DEFINITION IFF)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:REWRITE DEFAULT-*-2)) (7 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGEQV-NEG (123 7 (:REWRITE LOGIOR-AS-B-IOR)) (60 3 (:REWRITE USBP-OVER-LOGAND)) (29 29 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (28 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (24 12 (:REWRITE USB-TIGHTEN)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (22 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (14 14 (:TYPE-PRESCRIPTION LOGMASKP)) (13 7 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 7 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (11 7 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE LOGNOT-ZIP)) (5 5 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-OF-LOGNOT (65 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (21 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (18 13 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (LOGBIT-SUBST-SIMPLER (108 6 (:REWRITE LOGHEAD-IDENTITY)) (54 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (23 23 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 23 (:REWRITE EXPT-COMPARE)) (23 23 (:META CANCEL_PLUS-LESSP-CORRECT)) (21 19 (:REWRITE DEFAULT-<-1)) (20 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE USB-TIGHTEN)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGBIT-OF-LOGCAR (136 30 (:REWRITE LOGCAR-EVENP)) (62 25 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 52 (:REWRITE POWER2-INTEGER)) (44 44 (:TYPE-PRESCRIPTION EVENP)) (34 4 (:REWRITE EQUAL-1-HACK)) (19 11 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 5 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1))) (LOGHEAD-WHEN-MOSTLY-0 (499 499 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 10 (:REWRITE LOGHEAD-IDENTITY)) (97 97 (:REWRITE USB-LINEAR-REWRITE)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (92 92 (:REWRITE EXPT-COMPARE)) (90 81 (:REWRITE DEFAULT-<-2)) (88 81 (:REWRITE DEFAULT-<-1)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (74 4 (:REWRITE ASH-0)) (72 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (63 7 (:LINEAR LOGHEAD-LEQ)) (58 4 (:REWRITE ZIP-OPEN)) (50 50 (:REWRITE DEFAULT-+-2)) (50 50 (:REWRITE DEFAULT-+-1)) (49 4 (:REWRITE ASH-AS-LOGTAIL)) (48 48 (:REWRITE LOGHEAD-SUBST2)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:META META-RULE-ERIC)) (45 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (40 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE POWER2-INTEGER)) (35 4 (:REWRITE ASH-GOES-TO-0)) (30 15 (:REWRITE USB-TIGHTEN)) (24 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 22 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 3 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (16 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-SIMPLER-2 (658 42 (:REWRITE LOGHEAD-IDENTITY)) (528 528 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (299 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (298 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (127 127 (:REWRITE USB-LINEAR-REWRITE)) (125 14 (:LINEAR LOGHEAD-LEQ)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (102 89 (:REWRITE DEFAULT-<-1)) (91 89 (:REWRITE DEFAULT-<-2)) (84 42 (:REWRITE USB-TIGHTEN)) (60 60 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (57 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (54 54 (:META META-RULE-ERIC)) (54 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (49 49 (:REWRITE POWER2-INTEGER)) (48 44 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (44 44 (:REWRITE LOGHEAD-SUBST)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (38 3 (:REWRITE ASH-0)) (30 30 (:REWRITE DEFAULT-+-2)) (30 30 (:REWRITE DEFAULT-+-1)) (29 2 (:REWRITE ZIP-OPEN)) (27 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (27 3 (:REWRITE ASH-AS-LOGTAIL)) (26 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 3 (:REWRITE ASH-GOES-TO-0)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL (417 417 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (223 12 (:REWRITE LOGHEAD-IDENTITY)) (196 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (127 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (110 110 (:REWRITE USB-LINEAR-REWRITE)) (107 11 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (103 103 (:REWRITE EXPT-COMPARE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (70 8 (:LINEAR LOGHEAD-LEQ)) (69 3 (:REWRITE ASH-0)) (63 57 (:REWRITE DEFAULT-<-1)) (57 57 (:REWRITE DEFAULT-<-2)) (57 3 (:REWRITE ZIP-OPEN)) (54 3 (:REWRITE ASH-GOES-TO-0)) (51 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (51 3 (:REWRITE ASH-AS-LOGTAIL)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (38 38 (:REWRITE DEFAULT-+-2)) (38 38 (:REWRITE DEFAULT-+-1)) (34 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (32 5 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (30 15 (:REWRITE USB-TIGHTEN)) (28 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 25 (:META META-RULE-ERIC)) (21 21 (:REWRITE LOGHEAD-SUBST)) (19 19 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-LOGHEAD-DROP (127 8 (:REWRITE LOGHEAD-IDENTITY)) (64 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (63 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (33 27 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE USB-LINEAR-REWRITE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 27 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT->-1)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 7 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-EQUAL-LOGAPP-SAME-REWRITE (57 5 (:REWRITE LOGHEAD-IDENTITY)) (52 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 2 (:REWRITE EQUAL-1-HACK)) (15 14 (:REWRITE DEFAULT-<-2)) (15 14 (:REWRITE DEFAULT-<-1)) (10 5 (:REWRITE USB-TIGHTEN)) (9 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-LOGHEAD-ONE-SHORTER-REWRITE (154 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (87 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (52 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (43 43 (:REWRITE USB-LINEAR-REWRITE)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 23 (:REWRITE DEFAULT-<-2)) (23 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (14 7 (:REWRITE USB-TIGHTEN)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 2 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS (204 11 (:REWRITE LOGHEAD-IDENTITY)) (196 196 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 86 (:REWRITE USB-LINEAR-REWRITE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 85 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (85 85 (:REWRITE EXPT-COMPARE)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (49 46 (:REWRITE DEFAULT-<-2)) (48 46 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (39 39 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 16 (:REWRITE USB-TIGHTEN)) (30 27 (:REWRITE DEFAULT-+-2)) (27 27 (:REWRITE DEFAULT-+-1)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT (204 11 (:REWRITE LOGHEAD-IDENTITY)) (199 199 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 47 (:REWRITE DEFAULT-<-2)) (49 47 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (40 40 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 28 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE USB-TIGHTEN)) (28 28 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT (204 9 (:REWRITE LOGHEAD-IDENTITY)) (140 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (91 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR LOGHEAD-LEQ)) (22 11 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 12 (:REWRITE DEFAULT-+-2)) (13 12 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-SUBST (18 1 (:REWRITE LOGHEAD-IDENTITY)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-SUBST (36 2 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:META META-RULE-ERIC))) (LOGBITP-SUBST-2 (91 6 (:REWRITE LOGHEAD-IDENTITY)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 17 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-EQUAL-MIN-VALUE-HACK (64 8 (:LINEAR LOGHEAD-LEQ)) (60 6 (:REWRITE LOGHEAD-IDENTITY)) (51 51 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE USB-TIGHTEN)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:META META-RULE-ERIC)) (14 9 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE LOGHEAD-SUBST-2)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 7 (:REWRITE LOGBIT-SUBST)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR))) (LOGHEAD-SPLIT-GEN (618 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (251 35 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (242 1 (:REWRITE ASH-0)) (238 1 (:REWRITE ZIP-OPEN)) (208 8 (:REWRITE LOGTAIL-IDENTITY)) (199 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (112 112 (:REWRITE USB-LINEAR-REWRITE)) (112 112 (:REWRITE EXPT-COMPARE)) (112 112 (:META CANCEL_PLUS-LESSP-CORRECT)) (110 110 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (108 100 (:REWRITE DEFAULT-<-1)) (104 8 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (100 100 (:REWRITE DEFAULT-<-2)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (80 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (72 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (70 35 (:REWRITE USB-TIGHTEN)) (70 8 (:LINEAR LOGHEAD-LEQ)) (67 67 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 8 (:LINEAR EXPT->-1)) (44 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (35 35 (:TYPE-PRESCRIPTION LOGBITP)) (35 35 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 1 (:REWRITE LOGTAIL-EQUAL-0)) (25 25 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (25 25 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE LOGHEAD-SUBST)) (25 25 (:META META-RULE-ERIC)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (ASH-EQUAL-EXPT-REWRITE (35 1 (:REWRITE FLOOR-WHEN-<-2)) (17 4 (:REWRITE EXPT-COMPARE)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:LINEAR EXPT->-1)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-EXPT-REWRITE (573 573 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (324 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (261 11 (:REWRITE LOGHEAD-IDENTITY)) (183 183 (:REWRITE USB-LINEAR-REWRITE)) (175 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (167 167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (120 8 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (107 107 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (97 89 (:REWRITE DEFAULT-<-1)) (89 89 (:REWRITE DEFAULT-<-2)) (86 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (80 80 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 6 (:REWRITE LOGTAIL-IDENTITY)) (63 1 (:REWRITE FLOOR-WHEN-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (52 6 (:LINEAR LOGHEAD-LEQ)) (47 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (44 22 (:REWRITE USB-TIGHTEN)) (42 41 (:REWRITE DEFAULT-+-1)) (41 41 (:REWRITE DEFAULT-+-2)) (40 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 1 (:LINEAR X*Y>1-POSITIVE)) (30 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (29 29 (:META META-RULE-ERIC)) (28 28 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE POWER2-INTEGER)) (24 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE ASH-0)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 8 (:REWRITE LOGBIT-SUBST)) (20 1 (:REWRITE ZIP-OPEN)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 4 (:REWRITE LOGBITP-SUBST)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGBIT-SUBST-SIMPLER)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE DEFAULT-*-1)) (5 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-GOES-TO-0))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-N-MINUS-1 (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN (82 5 (:REWRITE LOGHEAD-IDENTITY)) (71 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (39 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (37 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (35 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 18 (:REWRITE DEFAULT-<-1)) (25 22 (:REWRITE DEFAULT-+-2)) (25 22 (:REWRITE DEFAULT-+-1)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 3 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 9 (:REWRITE USB-TIGHTEN)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 3 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION (70 70 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (20 2 (:REWRITE LOGHEAD-IDENTITY)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-BYTE-P-PLUS-LIMIT (307 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (87 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (74 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (63 49 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (62 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 4 (:LINEAR EXPT->-1)) (40 26 (:REWRITE DEFAULT-<-2)) (38 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 26 (:REWRITE DEFAULT-<-1)) (23 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (17 6 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:REWRITE POWER2-INTEGER)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE DEFAULT-+-1)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 1 (:DEFINITION FIX))) (PLUS-OF-LOGAPP-SUCK-IN-GEN2 (94 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 16 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (26 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (20 16 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST)) (7 7 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (7 7 (:REWRITE LOGHEAD-+-REDUCE)) (7 7 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUCK-IN-ONE-PLUS (345 21 (:REWRITE LOGHEAD-IDENTITY)) (108 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (85 59 (:REWRITE DEFAULT-<-2)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 56 (:REWRITE POWER2-INTEGER)) (56 8 (:LINEAR EXPT->-1)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (35 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 10 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (8 8 (:REWRITE LOGHEAD-OF-ONE-MORE-THAN-X)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPO-MINUS-ERIC))) (LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT (74 74 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 5 (:REWRITE LOGHEAD-IDENTITY)) (35 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 13 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE DEFAULT-+-2)) (7 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-NORMALIZE-CONSTANT-ARG (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 11 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-IDENTITY)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-SUBST-IN-FIRST-ARG (65 5 (:REWRITE LOGHEAD-IDENTITY)) (42 42 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (30 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 14 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 14 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE POWER2-INTEGER)) (9 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 1 (:REWRITE LOGAPP-LOGHEAD-DROP)) (7 6 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ODD-<-EVEN-TIGHTEN (16 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGAPP-DOES-NOTHING-REWRITE (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (11 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGTAIL-IDENTITY)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 3 (:REWRITE USB-TIGHTEN)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGAPP-OF-LOGHEAD (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 3 (:REWRITE LOGHEAD-IDENTITY)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 13 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-DOES-NOTHING-REWRITE (112 1 (:REWRITE FLOOR-=-X/Y . 3)) (49 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (46 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (43 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (29 9 (:REWRITE EXPT-COMPARE-EQUAL)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (20 14 (:REWRITE DEFAULT-<-2)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE DEFAULT-<-1)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-OF-ONE-MORE))) (LOGBIT-OF-USB-1 (44 11 (:REWRITE LOGCAR-EVENP)) (27 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (24 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (18 9 (:REWRITE USB-TIGHTEN)) (15 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (11 1 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-CONSTANT-FALSE-FROM-USB (70 70 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR EXPT->-1)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 3 (:REWRITE DEFAULT-<-2)) (4 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS))) (LOGHEAD-CANCEL-CONSTANTS-HACK (6648 6648 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6546 427 (:REWRITE LOGHEAD-IDENTITY)) (3190 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2863 407 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1275 856 (:REWRITE DEFAULT-<-2)) (998 856 (:REWRITE DEFAULT-<-1)) (881 881 (:REWRITE USB-LINEAR-REWRITE)) (874 874 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (874 874 (:REWRITE EXPT-COMPARE)) (856 107 (:LINEAR LOGHEAD-LEQ)) (814 814 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (814 407 (:REWRITE USB-TIGHTEN)) (781 781 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (767 767 (:REWRITE POWER2-INTEGER)) (734 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (658 658 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (643 248 (:REWRITE DEFAULT-+-2)) (622 442 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (572 400 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (563 248 (:REWRITE DEFAULT-+-1)) (472 442 (:REWRITE LOGHEAD-SUBST)) (442 442 (:REWRITE LOGHEAD-SUBST2)) (442 442 (:META META-RULE-ERIC)) (427 427 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (407 407 (:TYPE-PRESCRIPTION LOGBITP)) (407 407 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (389 389 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (372 200 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (311 23 (:REWRITE LOGHEAD-<)) (234 26 (:LINEAR EXPT->-1)) (208 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (154 28 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (115 5 (:REWRITE LOGHEAD-<=)) (89 51 (:REWRITE DEFAULT-UNARY-MINUS)) (84 84 (:REWRITE FOLD-CONSTS-IN-+)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 34 (:REWRITE EXPT-COMPARE-EQUAL)) (34 34 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (34 34 (:META CANCEL_TIMES-EQUAL-CORRECT)) (34 34 (:META CANCEL_PLUS-EQUAL-CORRECT)) (28 28 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 14 (:REWRITE SUM-POWER-OF-TWO)) (14 14 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (LOGBIT-TOO-BIG (44 44 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 5 (:REWRITE DEFAULT-<-2)) (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-TO-ASH-1-REWRITE (39 4 (:REWRITE ASH-0)) (26 4 (:REWRITE ZIP-OPEN)) (16 7 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (14 2 (:REWRITE EQUAL-1-HACK)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (10 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-CONSTANT))) (LOGHEAD-OF-LOGEXT-HACK-1 (8001 48 (:REWRITE LOGHEAD-IDENTITY)) (7243 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (6880 12 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (2294 192 (:REWRITE <-+-CONSTANT-CONSTANT)) (2186 11 (:REWRITE LOGHEAD-COMPARE-HACK)) (1821 690 (:REWRITE POWER2-INTEGER)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1447 366 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1403 48 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1172 1068 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1081 625 (:REWRITE EXPT-COMPARE)) (1005 193 (:REWRITE INTEGERP-+-MINUS-*-2)) (954 66 (:LINEAR EXPT->-1)) (888 66 (:LINEAR EXPT-LESS-THAN-1-HACK)) (836 532 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (625 625 (:REWRITE USB-LINEAR-REWRITE)) (625 625 (:META CANCEL_PLUS-LESSP-CORRECT)) (621 72 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (601 601 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (597 144 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (564 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN)) (518 8 (:LINEAR LOGHEAD-LEQ)) (480 16 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (476 16 (:LINEAR LOGEXT-BOUNDS-2)) (469 411 (:REWRITE DEFAULT-<-2)) (467 411 (:REWRITE DEFAULT-<-1)) (456 88 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (456 16 (:LINEAR LOGEXT-BOUNDS)) (440 4 (:REWRITE LOGHEAD-EQUAL-EXPT-REWRITE)) (395 28 (:REWRITE LOGEXT-IDENTITY)) (374 75 (:REWRITE EXPO-EXPT2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (314 314 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (311 175 (:REWRITE DEFAULT-+-2)) (265 69 (:META META-RULE-ERIC)) (257 75 (:REWRITE EXPO-OF-NOT-RATIONALP)) (217 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (200 100 (:REWRITE USB-TIGHTEN)) (193 193 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (193 175 (:REWRITE DEFAULT-+-1)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (188 188 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (161 17 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (149 149 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (134 134 (:TYPE-PRESCRIPTION LOGBITP)) (132 132 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (128 4 (:REWRITE <-+-NEGATIVE-0-1)) (111 43 (:REWRITE DEFAULT-UNARY-MINUS)) (100 100 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (99 99 (:TYPE-PRESCRIPTION POWER2P)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (94 94 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (88 88 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (86 69 (:REWRITE LOGHEAD-SUBST)) (86 43 (:DEFINITION FIX)) (83 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (76 17 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (75 75 (:REWRITE POWER2P-EXPT2-I)) (75 75 (:REWRITE EXPO-MINUS-ERIC)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 69 (:REWRITE LOGHEAD-SUBST2)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 8 (:LINEAR LOGEXT-BOUND-UPPER)) (57 47 (:META CANCEL_PLUS-EQUAL-CORRECT)) (56 56 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (56 56 (:REWRITE EXPONENTS-ADD)) (56 17 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (47 47 (:META CANCEL_TIMES-EQUAL-CORRECT)) (44 44 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 44 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (44 44 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (38 38 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (37 37 (:REWRITE EXPT-COMPARE-EQUAL)) (37 15 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (17 17 (:REWRITE LOGBITP-TOO-BIG)) (17 17 (:REWRITE LOGBITP-SUBST-2)) (17 17 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 4 (:REWRITE SIGNED-BYTE-P-OF-LOGEXT)) (8 4 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-1-ALT (3233 40 (:REWRITE LOGHEAD-IDENTITY)) (2475 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2182 7 (:REWRITE LOGHEAD-COMPARE-HACK)) (1944 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (1405 370 (:REWRITE POWER2-INTEGER)) (1395 40 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (979 166 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (862 76 (:REWRITE <-+-CONSTANT-CONSTANT)) (861 93 (:REWRITE INTEGERP-+-MINUS-*-2)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (548 8 (:LINEAR LOGHEAD-LEQ)) (516 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (513 361 (:REWRITE EXPT-COMPARE)) (436 404 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (436 332 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (361 361 (:REWRITE USB-LINEAR-REWRITE)) (361 361 (:META CANCEL_PLUS-LESSP-CORRECT)) (354 26 (:LINEAR EXPT->-1)) (353 353 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (328 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (325 275 (:REWRITE DEFAULT-<-2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (307 275 (:REWRITE DEFAULT-<-1)) (257 61 (:META META-RULE-ERIC)) (240 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (235 12 (:REWRITE LOGEXT-IDENTITY)) (234 234 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (213 123 (:REWRITE DEFAULT-+-2)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (194 55 (:REWRITE EXPO-EXPT2)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (177 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (177 55 (:REWRITE EXPO-OF-NOT-RATIONALP)) (177 13 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (176 88 (:REWRITE USB-TIGHTEN)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (173 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (172 172 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (162 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (137 123 (:REWRITE DEFAULT-+-1)) (125 125 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (124 124 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (114 114 (:TYPE-PRESCRIPTION LOGBITP)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (93 93 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (93 13 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (78 61 (:REWRITE LOGHEAD-SUBST)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (70 35 (:DEFINITION FIX)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (68 13 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 61 (:REWRITE LOGHEAD-SUBST2)) (63 63 (:TYPE-PRESCRIPTION POWER2P)) (55 55 (:REWRITE POWER2P-EXPT2-I)) (55 55 (:REWRITE EXPO-MINUS-ERIC)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (52 13 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (47 27 (:REWRITE DEFAULT-UNARY-MINUS)) (45 35 (:META CANCEL_PLUS-EQUAL-CORRECT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 35 (:META CANCEL_TIMES-EQUAL-CORRECT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (32 4 (:LINEAR LOGEXT-BOUND-UPPER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (24 24 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 24 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 24 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (23 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (21 7 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (19 12 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (13 13 (:REWRITE LOGBITP-TOO-BIG)) (13 13 (:REWRITE LOGBITP-SUBST-2)) (13 13 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (12 12 (:REWRITE EXPONENTS-ADD)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-2 (961 22 (:REWRITE LOGHEAD-IDENTITY)) (537 22 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (475 43 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (320 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (192 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (184 8 (:LINEAR LOGHEAD-LEQ)) (160 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (153 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (149 149 (:REWRITE POWER2-INTEGER)) (146 114 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (109 68 (:REWRITE DEFAULT-+-2)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 83 (:REWRITE DEFAULT-<-2)) (102 102 (:REWRITE USB-LINEAR-REWRITE)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (102 102 (:META CANCEL_PLUS-LESSP-CORRECT)) (99 83 (:REWRITE DEFAULT-<-1)) (86 86 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (86 86 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (86 43 (:REWRITE USB-TIGHTEN)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (56 8 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (47 47 (:TYPE-PRESCRIPTION LOGBITP)) (43 43 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (36 4 (:LINEAR EXPT->-1)) (32 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (26 26 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (26 26 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST)) (24 24 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (24 24 (:REWRITE LOGHEAD-SUBST2)) (24 24 (:REWRITE LOGHEAD-SUBST)) (24 24 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (24 24 (:REWRITE LOGHEAD-+-REDUCE)) (24 24 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (24 24 (:META META-RULE-ERIC)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (22 22 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-UNARY-MINUS)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-LOGEXT-HACK-3 (641 16 (:REWRITE LOGHEAD-IDENTITY)) (363 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (317 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (172 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (132 7 (:LINEAR LOGHEAD-LEQ)) (111 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (105 105 (:REWRITE POWER2-INTEGER)) (96 65 (:REWRITE DEFAULT-+-2)) (88 67 (:REWRITE DEFAULT-<-2)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 80 (:REWRITE USB-LINEAR-REWRITE)) (80 80 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (75 67 (:REWRITE DEFAULT-<-1)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 58 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (58 29 (:REWRITE USB-TIGHTEN)) (49 49 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (49 7 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (45 28 (:REWRITE INTEGERP-+-MINUS-*-2)) (39 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 4 (:LINEAR EXPT->-1)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (24 24 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (24 24 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUBST2)) (22 22 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 22 (:META META-RULE-ERIC)) (21 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-+-CANCEL-BETTER-ALT-1 (159 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (111 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-+-2)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGHEAD-OF-LOGEXT-HACK-4 (1700 21 (:REWRITE LOGHEAD-IDENTITY)) (1324 24 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (969 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (450 43 (:REWRITE <-+-CONSTANT-CONSTANT)) (432 98 (:REWRITE INTEGERP-+-MINUS-*-2)) (325 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (310 262 (:REWRITE POWER2-INTEGER)) (303 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (210 134 (:REWRITE EXPT-COMPARE)) (168 12 (:LINEAR EXPT->-1)) (160 149 (:REWRITE DEFAULT-+-1)) (156 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (152 4 (:LINEAR LOGHEAD-LEQ)) (139 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (134 134 (:REWRITE USB-LINEAR-REWRITE)) (134 134 (:META CANCEL_PLUS-LESSP-CORRECT)) (130 130 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (128 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (122 122 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (122 8 (:REWRITE LOGBITP-+-SIMPLE)) (120 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (113 91 (:REWRITE DEFAULT-<-2)) (110 58 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (109 91 (:REWRITE DEFAULT-<-1)) (98 98 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (82 41 (:REWRITE USB-TIGHTEN)) (80 80 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (80 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (78 78 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 62 (:REWRITE FOLD-CONSTS-IN-+)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE EXPO-EXPT2)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (49 49 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (48 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (41 41 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (36 8 (:REWRITE LOGBITP-+-USB-V4)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 8 (:REWRITE LOGBITP-+-USB-V1)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (26 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (26 4 (:REWRITE LOGBITP-+-USB-V3)) (26 4 (:REWRITE LOGBITP-+-USB-V2)) (26 4 (:REWRITE LOGBITP-+-SIMPLE2)) (24 24 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (24 24 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (24 24 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 23 (:META META-RULE-ERIC)) (24 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (23 23 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (23 23 (:REWRITE LOGHEAD-SUBST2)) (23 23 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 12 (:REWRITE DEFAULT-UNARY-MINUS)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (15 15 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (15 15 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (15 15 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (10 10 (:TYPE-PRESCRIPTION POWER2P)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1))) (LOGHEAD-OF-LOGEXT-HACK-5 (791 25 (:REWRITE LOGHEAD-IDENTITY)) (704 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (397 34 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (337 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (317 53 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (295 172 (:REWRITE DEFAULT-+-2)) (294 24 (:REWRITE LOGBITP-+-SIMPLE)) (267 78 (:REWRITE INTEGERP-+-MINUS-*-2)) (196 196 (:REWRITE POWER2-INTEGER)) (168 12 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (132 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (130 118 (:REWRITE FOLD-CONSTS-IN-+)) (120 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (116 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 106 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (106 53 (:REWRITE USB-TIGHTEN)) (92 4 (:LINEAR LOGHEAD-LEQ)) (84 12 (:REWRITE SIGNED-BYTE-P-+)) (78 78 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 77 (:TYPE-PRESCRIPTION LOGBITP)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (66 52 (:REWRITE DEFAULT-<-2)) (66 24 (:REWRITE LOGBITP-+-USB-V4)) (64 64 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 52 (:REWRITE DEFAULT-<-1)) (60 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (57 24 (:REWRITE LOGBITP-+-USB-V1)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 53 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (45 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (45 12 (:REWRITE LOGBITP-+-USB-V3)) (45 12 (:REWRITE LOGBITP-+-USB-V2)) (45 12 (:REWRITE LOGBITP-+-SIMPLE2)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (39 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (34 34 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (34 34 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (28 28 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGHEAD-SUBST2)) (27 27 (:REWRITE LOGHEAD-SUBST)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 27 (:META META-RULE-ERIC)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST)) (26 26 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (26 26 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (26 26 (:REWRITE LOGHEAD-+-REDUCE)) (26 26 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 11 (:REWRITE DEFAULT-*-2)) (14 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (INTEGERP-<-HACK (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-HACK-MORE (6 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE RATIONALP-*)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-16-HACK (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (11 3 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (11 1 (:REWRITE MOD-=-0 . 2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK)) (9 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-OF-ONE-MORE (8535 89 (:REWRITE FLOOR-=-X/Y . 3)) (6148 918 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (5095 2153 (:REWRITE DEFAULT-*-2)) (4702 7 (:REWRITE FLOOR-=-X/Y . 4)) (4568 144 (:REWRITE RTL1)) (3871 205 (:REWRITE INTEGERP-+-MINUS-*-4)) (3599 2153 (:REWRITE DEFAULT-*-1)) (3497 144 (:REWRITE FLOOR-DETERMINED-1)) (3290 89 (:REWRITE FLOOR-=-X/Y . 2)) (2803 1128 (:REWRITE DEFAULT-+-2)) (2591 1665 (:REWRITE DEFAULT-<-2)) (2247 459 (:REWRITE DEFAULT-UNARY-/)) (2214 91 (:REWRITE INTEGERP-+-MINUS-*-2)) (2185 132 (:LINEAR X*Y>1-POSITIVE)) (2146 2146 (:REWRITE USB-LINEAR-REWRITE)) (1949 1128 (:REWRITE DEFAULT-+-1)) (1830 1665 (:REWRITE DEFAULT-<-1)) (1551 549 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1310 1310 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1218 1218 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1214 115 (:REWRITE FLOOR-TYPE-3 . 3)) (1146 10 (:LINEAR MOD-TYPE . 2)) (1092 115 (:REWRITE FLOOR-TYPE-4 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (893 54 (:DEFINITION NATP)) (888 54 (:REWRITE NATP-RW)) (871 115 (:REWRITE FLOOR-TYPE-4 . 3)) (655 655 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (604 604 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (549 549 (:REWRITE EXPO-MINUS-ERIC)) (467 161 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (457 165 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (396 22 (:LINEAR FLOOR-TYPE-2 . 1)) (394 103 (:REWRITE RTL-A-MILLION)) (386 22 (:LINEAR FLOOR-TYPE-1 . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (356 22 (:LINEAR FLOOR-TYPE-2 . 2)) (350 350 (:REWRITE POWER2-INTEGER)) (340 340 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (298 22 (:LINEAR FLOOR-TYPE-1 . 1)) (222 82 (:REWRITE DEFAULT-UNARY-MINUS)) (220 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (198 165 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (181 45 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (175 19 (:REWRITE INTEGERP-+-MINUS-*-1)) (170 170 (:LINEAR EXPT-LESS-THAN-1-HACK)) (147 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 48 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (133 7 (:REWRITE INTEGERP-+-MINUS-*-3)) (127 127 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (120 40 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (118 91 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (107 13 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (90 86 (:REWRITE FOLD-CONSTS-IN-*)) (79 79 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION NATP)) (50 48 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (50 22 (:REWRITE SUM-POWER-OF-TWO)) (48 3 (:REWRITE <-*-RIGHT-CANCEL)) (41 4 (:REWRITE FLOOR-WHEN-<-2)) (41 1 (:REWRITE EVENP-COLLECT-1)) (40 5 (:REWRITE MOD-HELPER-1)) (30 10 (:LINEAR MOD-TYPE . 3)) (30 10 (:LINEAR MOD-TYPE . 1)) (30 1 (:REWRITE EVENP-+-ALT)) (26 6 (:REWRITE EVENP-COLLAPSE)) (24 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE EQUAL-CONSTANT-+)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (9 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (9 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (7 7 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (7 7 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-LOGBIT-REASSEMBLE (49 5 (:REWRITE LOGHEAD-IDENTITY)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (13 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (13 1 (:REWRITE ASH-0)) (12 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 10 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE DEFAULT-<-2)) (9 1 (:REWRITE ZIP-OPEN)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE LOGBIT-TOO-BIG)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT32HACK (94 5 (:REWRITE LOGEXT-IDENTITY)) (89 6 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (32 19 (:REWRITE DEFAULT-<-2)) (28 4 (:REWRITE EVENP-*)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (27 27 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 9 (:REWRITE DEFAULT-+-2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-2 (585 16 (:REWRITE LOGBITP-+-SIMPLE)) (567 12 (:REWRITE LOGBITP-+-USB-V4)) (527 23 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (508 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (422 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (392 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (192 8 (:REWRITE LOGEXT-IDENTITY)) (182 10 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (130 2 (:REWRITE 0-<-*)) (128 2 (:REWRITE <-*-0)) (97 6 (:REWRITE EVENP-+-ALT)) (88 2 (:REWRITE EQUAL-LOGEXT-0)) (86 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (76 76 (:TYPE-PRESCRIPTION LOGBITP)) (75 16 (:REWRITE LOGBITP-+-USB-V1)) (64 32 (:REWRITE USB-TIGHTEN)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (59 8 (:REWRITE SIGNED-BYTE-P-+)) (56 39 (:REWRITE DEFAULT-<-2)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (53 6 (:REWRITE EVENP-)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (48 4 (:DEFINITION IFF)) (46 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 6 (:REWRITE EVENP-*)) (43 39 (:REWRITE DEFAULT-<-1)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (40 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (40 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 22 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (37 6 (:REWRITE LOGBITP-+-USB-V3)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 8 (:REWRITE LOGBITP-+-USB-V2)) (35 8 (:REWRITE LOGBITP-+-SIMPLE2)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE POWER2-INTEGER)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 27 (:META CANCEL_TIMES-EQUAL-CORRECT)) (27 27 (:META CANCEL_PLUS-EQUAL-CORRECT)) (27 18 (:REWRITE DEFAULT-+-2)) (24 22 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (23 23 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:REWRITE LOGBITP-SUBST-2)) (22 22 (:REWRITE LOGBITP-SUBST)) (22 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE DEFAULT-+-1)) (16 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-UNARY-MINUS)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST-2)) (7 5 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE DEFAULT-*-1)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT32HACK-3 (260 6 (:REWRITE LOGHEAD-IDENTITY)) (258 40 (:REWRITE LOGCAR-EVENP)) (229 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (188 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (148 12 (:REWRITE EVENP-+-ALT)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (126 4 (:LINEAR LOGEXT-BOUND-UPPER)) (110 8 (:REWRITE LOGBITP-+-SIMPLE)) (110 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (108 108 (:TYPE-PRESCRIPTION EVENP)) (106 5 (:REWRITE LOGEXT-IDENTITY)) (79 67 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (68 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 37 (:REWRITE DEFAULT-<-2)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE SIGNED-BYTE-P-+)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (44 39 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (44 37 (:REWRITE DEFAULT-<-1)) (33 32 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (31 8 (:REWRITE EVENP-)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 22 (:REWRITE DEFAULT-+-2)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (26 13 (:REWRITE USB-TIGHTEN)) (25 25 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 22 (:REWRITE DEFAULT-+-1)) (23 8 (:REWRITE LOGBITP-+-USB-V4)) (23 8 (:REWRITE LOGBITP-+-USB-V1)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 4 (:REWRITE LOGBITP-+-USB-V3)) (19 4 (:REWRITE LOGBITP-+-USB-V2)) (19 4 (:REWRITE LOGBITP-+-SIMPLE2)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 18 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE POWER2-INTEGER)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (14 14 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (14 14 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 7 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:META META-RULE-ERIC)) (6 5 (:REWRITE EVENP-OF-LOGEXT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-4 (296 20 (:REWRITE EVENP-+-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (87 10 (:REWRITE EVENP-)) (72 10 (:REWRITE EVENP-*)) (70 64 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 14 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-6 (224 6 (:LINEAR LOGEXT-BOUND-UPPER)) (166 2 (:REWRITE LOGHEAD-IDENTITY)) (142 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (117 5 (:REWRITE LOGEXT-IDENTITY)) (112 2 (:REWRITE <-+-NEGATIVE-0-1)) (108 12 (:LINEAR LOGEXT-BOUNDS-2)) (108 12 (:LINEAR LOGEXT-BOUNDS)) (103 24 (:REWRITE LOGCAR-EVENP)) (69 40 (:REWRITE DEFAULT-<-2)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (44 44 (:REWRITE USB-LINEAR-REWRITE)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (43 40 (:REWRITE DEFAULT-<-1)) (42 42 (:TYPE-PRESCRIPTION EVENP)) (35 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 2 (:REWRITE EVENP-+-ALT)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 28 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 2 (:REWRITE SIGNED-BYTE-P-+)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (22 19 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (17 4 (:REWRITE EVENP-)) (17 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE DEFAULT-+-2)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 3 (:REWRITE EVENP-OF-LOGEXT)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-7 (94 5 (:REWRITE LOGEXT-IDENTITY)) (43 2 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 21 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:REWRITE EVENP-*)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-*-2)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-*-1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-5 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 19 (:REWRITE DEFAULT-+-2)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 19 (:REWRITE DEFAULT-+-1)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-8 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 18 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGEXT-CASE (372 6 (:LINEAR LOGTAIL-LEQ)) (306 4 (:REWRITE LOGTAIL-LESSP)) (296 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (292 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (172 1 (:REWRITE ASH-0)) (168 1 (:REWRITE ZIP-OPEN)) (160 20 (:LINEAR LOGEXT-BOUNDS-2)) (160 20 (:LINEAR LOGEXT-BOUNDS)) (134 106 (:REWRITE DEFAULT-<-1)) (114 114 (:REWRITE USB-LINEAR-REWRITE)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (114 114 (:REWRITE EXPT-COMPARE)) (114 114 (:META CANCEL_PLUS-LESSP-CORRECT)) (112 106 (:REWRITE DEFAULT-<-2)) (90 10 (:LINEAR LOGEXT-BOUND-UPPER)) (80 10 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (52 2 (:REWRITE LOGTAIL-IDENTITY)) (42 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (35 35 (:REWRITE POWER2-INTEGER)) (35 1 (:REWRITE LOGTAIL-EQUAL-0)) (28 28 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 5 (:REWRITE USBP-LOGEXT-NARROWER)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (12 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGHEAD-CASE (662 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (274 1 (:REWRITE ASH-0)) (270 1 (:REWRITE ZIP-OPEN)) (255 38 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (210 8 (:REWRITE LOGTAIL-IDENTITY)) (156 134 (:REWRITE DEFAULT-<-1)) (149 134 (:REWRITE DEFAULT-<-2)) (144 144 (:REWRITE USB-LINEAR-REWRITE)) (144 144 (:REWRITE EXPT-COMPARE)) (144 144 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 12 (:LINEAR LOGHEAD-LEQ)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (82 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (82 10 (:LINEAR EXPT->-1)) (78 78 (:REWRITE POWER2-INTEGER)) (76 38 (:REWRITE USB-TIGHTEN)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (41 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (41 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (41 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (38 38 (:REWRITE LOGHEAD-SUBST2)) (38 38 (:META META-RULE-ERIC)) (36 1 (:REWRITE LOGTAIL-EQUAL-0)) (34 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 32 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (23 21 (:REWRITE DEFAULT-+-2)) (21 21 (:REWRITE DEFAULT-+-1)) (21 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGHEAD-SUM-WEIRD (561 16 (:REWRITE LOGHEAD-IDENTITY)) (279 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (262 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (207 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (144 4 (:LINEAR LOGHEAD-LEQ)) (115 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (84 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (80 8 (:REWRITE LOGBITP-+-SIMPLE)) (67 53 (:REWRITE DEFAULT-<-2)) (63 63 (:REWRITE USB-LINEAR-REWRITE)) (63 63 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE EXPT-COMPARE)) (63 63 (:META CANCEL_PLUS-LESSP-CORRECT)) (61 53 (:REWRITE DEFAULT-<-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 50 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (36 23 (:REWRITE DEFAULT-+-2)) (34 34 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (34 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 23 (:REWRITE DEFAULT-+-1)) (27 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE LOGBITP-+-USB-V4)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 8 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V3)) (15 4 (:REWRITE LOGBITP-+-USB-V2)) (15 4 (:REWRITE LOGBITP-+-SIMPLE2)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:DEFINITION FIX)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-CHOP-HACK-1 (234 4 (:REWRITE LOGHEAD-IDENTITY)) (180 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (146 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (66 66 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (66 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (31 4 (:REWRITE LOGBITP-+-SIMPLE)) (30 23 (:REWRITE DEFAULT-<-1)) (30 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 23 (:REWRITE DEFAULT-<-2)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 8 (:REWRITE USB-TIGHTEN)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (15 12 (:REWRITE DEFAULT-+-2)) (15 1 (:LINEAR EXPT->-1)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 12 (:REWRITE DEFAULT-+-1)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (HACK-BLAH (566 4 (:LINEAR LOGHEAD-LEQ)) (508 4 (:REWRITE <-*-0)) (232 14 (:REWRITE LOGHEAD-IDENTITY)) (182 4 (:DEFINITION IFF)) (104 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (96 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (94 82 (:REWRITE DEFAULT-<-2)) (87 87 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (87 87 (:META CANCEL_PLUS-LESSP-CORRECT)) (84 82 (:REWRITE DEFAULT-<-1)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (36 36 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (24 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (23 23 (:REWRITE POWER2-INTEGER)) (22 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (21 19 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGBITP)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (19 19 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 4 (:REWRITE EQUAL-LOGEXT-0)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (17 17 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 6 (:REWRITE DEFAULT-*-1)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 4 (:REWRITE DEFAULT-+-2)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGAPP-HACK-3 (284 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (202 10 (:REWRITE LOGHEAD-IDENTITY)) (145 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (129 12 (:REWRITE LOGBITP-+-SIMPLE)) (86 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (82 82 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (61 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (59 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (38 38 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (38 27 (:REWRITE DEFAULT-+-2)) (38 19 (:REWRITE USB-TIGHTEN)) (34 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 27 (:REWRITE DEFAULT-+-1)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (29 29 (:REWRITE USB-LINEAR-REWRITE)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (29 29 (:REWRITE EXPT-COMPARE)) (29 29 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (27 12 (:REWRITE LOGBITP-+-USB-V4)) (27 12 (:REWRITE LOGBITP-+-USB-V1)) (24 24 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (22 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (21 21 (:REWRITE DEFAULT-<-2)) (21 21 (:REWRITE DEFAULT-<-1)) (21 6 (:REWRITE LOGBITP-+-USB-V3)) (21 6 (:REWRITE LOGBITP-+-USB-V2)) (21 6 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 12 (:REWRITE FOLD-CONSTS-IN-+)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 6 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:META META-RULE-ERIC)) (12 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-HACK-4 (348 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (192 10 (:REWRITE LOGHEAD-IDENTITY)) (189 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (178 16 (:REWRITE LOGBITP-+-SIMPLE)) (112 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 86 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (76 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE SIGNED-BYTE-P-+)) (37 37 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 27 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE LOGBITP-+-USB-V4)) (31 16 (:REWRITE LOGBITP-+-USB-V1)) (27 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 27 (:REWRITE DEFAULT-+-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (23 8 (:REWRITE LOGBITP-+-USB-V3)) (23 8 (:REWRITE LOGBITP-+-USB-V2)) (23 8 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 13 (:REWRITE FOLD-CONSTS-IN-+)) (18 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:META META-RULE-ERIC)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGHEAD-HACK-BLAH (704 11 (:REWRITE LOGHEAD-IDENTITY)) (440 7 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (286 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (174 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (84 4 (:LINEAR LOGHEAD-LEQ)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (72 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (70 7 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 56 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (56 56 (:REWRITE USB-LINEAR-REWRITE)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (56 56 (:META CANCEL_PLUS-LESSP-CORRECT)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 44 (:REWRITE DEFAULT-<-1)) (48 24 (:REWRITE USB-TIGHTEN)) (45 44 (:REWRITE DEFAULT-<-2)) (38 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 2 (:REWRITE <-+-NEGATIVE-0-1)) (24 24 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 18 (:REWRITE DEFAULT-+-2)) (19 18 (:REWRITE DEFAULT-+-1)) (19 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 7 (:REWRITE DEFAULT-UNARY-MINUS)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE LOGHEAD-<=)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (7 7 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE UNICITY-OF-0))) (LOGHEAD-CANCEL-SIGH (205 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (65 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (19 18 (:REWRITE DEFAULT-+-2)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (18 18 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT-SUBST2 (180 18 (:REWRITE LOGEXT-IDENTITY)) (111 8 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (49 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 36 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (29 29 (:REWRITE POWER2-INTEGER)) (28 22 (:REWRITE DEFAULT-<-1)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:META META-RULE-ERIC)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGEXT-SUBST2-ALT (171 18 (:REWRITE LOGEXT-IDENTITY)) (100 6 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (34 34 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (28 22 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE USB-LINEAR-REWRITE)) (25 25 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:REWRITE EXPT-COMPARE)) (25 25 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (17 17 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (17 17 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER (1693 98 (:REWRITE LOGHEAD-IDENTITY)) (898 130 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (863 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (549 53 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (513 513 (:REWRITE USB-LINEAR-REWRITE)) (506 148 (:REWRITE USB-TIGHTEN)) (481 481 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (481 481 (:REWRITE EXPT-COMPARE)) (441 441 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (299 271 (:REWRITE DEFAULT-<-1)) (272 271 (:REWRITE DEFAULT-<-2)) (206 14 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (188 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (185 185 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (171 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (147 147 (:REWRITE POWER2-INTEGER)) (137 137 (:META META-RULE-ERIC)) (133 120 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (131 130 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (130 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (130 130 (:REWRITE DEFAULT-+-2)) (130 130 (:REWRITE DEFAULT-+-1)) (121 121 (:REWRITE LOGHEAD-SUBST)) (105 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (105 9 (:REWRITE ASH-AS-LOGTAIL)) (91 53 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (89 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (73 73 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (73 60 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (63 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (54 54 (:REWRITE LOGBITP-TOO-BIG)) (51 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (50 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (43 41 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (42 18 (:REWRITE LOGBIT-TOO-BIG)) (36 18 (:REWRITE LOGBIT-SUBST-SIMPLER)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 28 (:REWRITE EXPT-COMPARE-EQUAL)) (27 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (22 14 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (20 2 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (19 3 (:REWRITE COMMUTATIVITY-2-OF-+)) (18 18 (:REWRITE LOGBIT-SUBST)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 4 (:REWRITE COMMUTATIVITY-OF-+)) (15 15 (:REWRITE LOGHEAD-COMPARE-HACK)) (15 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 9 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (9 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 9 (:REWRITE ASH-0)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (5 5 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE INVERSE-OF-+)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION POWER2P))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT) (SHOW-BITS-AUX (33 4 (:REWRITE FLOOR-WHEN-<-2)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE DEFAULT-<-2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (7 1 (:REWRITE <-*-/-LEFT-COMMUTED)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE INTEGERP==>DENOMINATOR=1)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE DEFAULT-DENOMINATOR))) (SHOW-BITS) (LOGAPP-RECOLLAPSE (526 24 (:REWRITE LOGHEAD-IDENTITY)) (286 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (273 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (133 105 (:REWRITE EXPT-COMPARE)) (113 9 (:LINEAR LOGHEAD-LEQ)) (107 97 (:REWRITE DEFAULT-<-2)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (105 97 (:REWRITE DEFAULT-<-1)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (98 6 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (85 9 (:LINEAR EXPT->-1)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 33 (:REWRITE USB-TIGHTEN)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 2 (:REWRITE LOGTAIL-IDENTITY)) (34 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (29 29 (:REWRITE POWER2-INTEGER)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (29 29 (:REWRITE LOGHEAD-SUBST2)) (29 29 (:REWRITE LOGHEAD-SUBST)) (29 29 (:META META-RULE-ERIC)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (23 23 (:REWRITE <-+-CONSTANT-CONSTANT)) (23 15 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE ASH-0)) (22 22 (:REWRITE DEFAULT-+-2)) (22 22 (:REWRITE DEFAULT-+-1)) (19 1 (:REWRITE ZIP-OPEN)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 1 (:REWRITE NORMALIZE-EQUAL-0)) (16 16 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (15 2 (:REWRITE LOGTAIL-LESSP)) (12 4 (:REWRITE DEFAULT-*-2)) (12 1 (:REWRITE EQUAL-MINUS-MINUS)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 1 (:REWRITE ASH-GOES-TO-0)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE EQUAL-LOGHEAD-ASH-POS)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-NEG-LOGHEAD)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE TIMES-ZERO)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (DUMB) (MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:LINEAR X*Y>1-POSITIVE))) (MULTIPLY-BY-POSITIVE-INTEGER-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (TINY-ADDEND-DOESNT-MATTER-WHEN-COMPARING-INTEGERS (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (NON-MULTIPLE-ADDEND-DOESNT-MATTER-WHEN-COMPARING-MULTIPLES (206 6 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (82 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (79 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (78 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (78 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (48 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 6 (:LINEAR X*Y>1-POSITIVE)) (42 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (37 7 (:REWRITE EQUAL-1-HACK)) (34 34 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE DEFAULT-<-1)) (32 32 (:REWRITE DEFAULT-*-2)) (32 32 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE DEFAULT-UNARY-/)) (11 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED (84 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 50 (:REWRITE DEFAULT-<-2)) (76 50 (:REWRITE DEFAULT-<-1)) (62 22 (:REWRITE DEFAULT-*-2)) (58 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (56 7 (:LINEAR EXPT->-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (28 22 (:REWRITE DEFAULT-*-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (13 5 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED-NEG (52 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 32 (:REWRITE DEFAULT-<-1)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 32 (:REWRITE DEFAULT-<-2)) (38 14 (:REWRITE DEFAULT-+-2)) (35 13 (:REWRITE DEFAULT-*-2)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (28 14 (:REWRITE DEFAULT-+-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 26 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE DEFAULT-UNARY-MINUS)) (19 13 (:REWRITE DEFAULT-*-1)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 2 (:REWRITE EXPT-COMPARE-EQUAL)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (ARITHHACK3 (19 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-*)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-NUMERATOR))) (ARITHHACK4 (84 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (48 48 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (21 7 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT->-1)) (15 5 (:REWRITE DEFAULT-*-2)) (13 7 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 5 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-FW (804 2 (:REWRITE SIGNED-BYTE-P-+)) (217 20 (:LINEAR EXPT->-1)) (198 11 (:REWRITE LOGHEAD-IDENTITY)) (193 116 (:REWRITE EXPT-COMPARE)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (172 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (144 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (128 30 (:REWRITE <-+-CONSTANT-CONSTANT)) (125 79 (:REWRITE DEFAULT-<-1)) (116 116 (:REWRITE USB-LINEAR-REWRITE)) (116 116 (:META CANCEL_PLUS-LESSP-CORRECT)) (113 113 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (106 79 (:REWRITE DEFAULT-<-2)) (99 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (77 38 (:REWRITE DEFAULT-+-2)) (76 55 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (70 2 (:REWRITE LOGHEAD-<)) (70 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (56 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (55 38 (:REWRITE DEFAULT-+-1)) (51 20 (:REWRITE DEFAULT-*-2)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (45 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (41 5 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 4 (:LINEAR LOGHEAD-LEQ)) (34 14 (:REWRITE DEFAULT-UNARY-MINUS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (26 13 (:REWRITE USB-TIGHTEN)) (24 20 (:REWRITE DEFAULT-*-1)) (22 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE POWER2-INTEGER)) (17 10 (:REWRITE EXPONENTS-ADD)) (15 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 3 (:REWRITE EXPT-COMPARE-EQUAL)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:TYPE-PRESCRIPTION POWER2P)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE POWER2P-EXPT2-I)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 3 (:REWRITE POWER2P-INVERSE)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-BK (730 2 (:REWRITE SIGNED-BYTE-P-+)) (358 150 (:REWRITE EXPT-COMPARE)) (204 150 (:REWRITE USB-LINEAR-REWRITE)) (180 10 (:REWRITE LOGHEAD-IDENTITY)) (162 138 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 98 (:REWRITE DEFAULT-<-1)) (150 150 (:META CANCEL_PLUS-LESSP-CORRECT)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (132 98 (:REWRITE DEFAULT-<-2)) (131 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (124 68 (:REWRITE DEFAULT-+-2)) (114 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (109 77 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (101 6 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (99 68 (:REWRITE DEFAULT-+-1)) (94 37 (:REWRITE DEFAULT-*-2)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (59 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (59 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (56 22 (:REWRITE DEFAULT-UNARY-MINUS)) (56 2 (:REWRITE LOGHEAD-<)) (53 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 37 (:REWRITE DEFAULT-*-1)) (49 21 (:REWRITE EXPONENTS-ADD)) (49 4 (:REWRITE EXPO-SHIFT-CONSTANT)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (39 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (27 3 (:LINEAR LOGHEAD-LEQ)) (26 18 (:REWRITE FOLD-CONSTS-IN-+)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (24 12 (:REWRITE USB-TIGHTEN)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (17 17 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (SIGNED-BYTE-P-OF-LOGAPP (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (126 42 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (126 6 (:LINEAR EXPT->-1)) (78 24 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 47 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE LOGHEAD-IDENTITY)) (62 62 (:REWRITE USB-LINEAR-REWRITE)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (59 29 (:REWRITE DEFAULT-+-2)) (53 47 (:REWRITE DEFAULT-<-2)) (42 42 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (29 29 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 9 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE IFIX-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC))) (LOGEXT-SUBST-WITH-LOGHEAD (191 20 (:REWRITE LOGEXT-IDENTITY)) (90 5 (:REWRITE LOGHEAD-IDENTITY)) (66 66 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 20 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 31 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (31 31 (:REWRITE LOGEXT-SUBST2-ALT)) (31 31 (:REWRITE LOGEXT-SUBST2)) (31 31 (:REWRITE DEFAULT-<-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (19 19 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (19 19 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (19 19 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-EQUAL-TO-DIVIDES (738 2 (:REWRITE CANCEL-MOD-+-BASIC)) (720 6 (:REWRITE DIVIDES-HACK2)) (264 3 (:LINEAR MOD-TYPE . 2)) (244 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (236 1 (:REWRITE INTEGERP-UNARY-)) (147 6 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (131 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (126 3 (:LINEAR MOD-TYPE . 4)) (119 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (118 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (84 7 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (52 52 (:REWRITE USB-LINEAR-REWRITE)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:REWRITE DEFAULT-<-2)) (48 48 (:REWRITE DEFAULT-<-1)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 20 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (20 20 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (20 4 (:REWRITE COMMUTATIVITY-OF-+)) (16 8 (:REWRITE USB-TIGHTEN)) (15 5 (:REWRITE COMMUTATIVITY-OF-*)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE UNICITY-OF-0)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:LINEAR MOD-TYPE . 3)) (3 3 (:LINEAR MOD-TYPE . 1)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE LOGHEAD-SUBST-WEIRD)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION))) (LOGHEAD-EQUAL-TO-DIVIDES2 (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (10 1 (:REWRITE LOGHEAD-IDENTITY)) (9 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (9 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGHEAD8-PLUS-TIMES-256 (116 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (99 6 (:REWRITE LOGHEAD-IDENTITY)) (48 2 (:REWRITE LOGBITP-+-SIMPLE)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 12 (:REWRITE USB-TIGHTEN)) (21 2 (:REWRITE LOGBITP-+-USB-V4)) (17 2 (:LINEAR LOGHEAD-LEQ)) (15 2 (:REWRITE LOGBITP-+-USB-V1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE LOGBITP-SUBST-2)) (9 9 (:REWRITE LOGBITP-SUBST)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGBITP-+-USB-V3)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGBITP-+-USB-V2)) (7 1 (:REWRITE LOGBITP-+-SIMPLE2)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 1 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LEMMA (10 5 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-SIZE-MINUS-ONE (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGEXT-OF-2-TO-THE-SIZE-MINUS-ONE (98 98 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (25 25 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 6 (:REWRITE DEFAULT-+-2)) (9 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MINUS-OF-LOGEXT (1304 28 (:REWRITE LOGEXT-IDENTITY)) (550 132 (:REWRITE EXPT-COMPARE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (177 177 (:REWRITE USB-LINEAR-REWRITE)) (177 177 (:META CANCEL_PLUS-LESSP-CORRECT)) (159 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (154 9 (:REWRITE LOGHEAD-IDENTITY)) (121 9 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (121 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (121 9 (:REWRITE ASH-AS-LOGTAIL)) (110 11 (:REWRITE LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P)) (104 104 (:REWRITE DEFAULT-+-2)) (104 104 (:REWRITE DEFAULT-+-1)) (103 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (94 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 30 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (80 62 (:REWRITE DEFAULT-<-1)) (76 76 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (73 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (69 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 44 (:REWRITE EXPO-EXPT2)) (62 62 (:REWRITE DEFAULT-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (55 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (52 15 (:REWRITE USB-TIGHTEN)) (51 9 (:REWRITE LOGBIT-SUBST)) (47 47 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (47 47 (:REWRITE EXPONENTS-ADD)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 5 (:LINEAR LOGHEAD-LEQ)) (44 44 (:TYPE-PRESCRIPTION POWER2P)) (44 44 (:REWRITE POWER2P-EXPT2-I)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 38 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 13 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE POWER2-INTEGER)) (40 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (38 38 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (38 38 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (30 30 (:REWRITE LOGEXT-SUBST2-ALT)) (30 30 (:REWRITE LOGEXT-SUBST2)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (29 1 (:REWRITE EQUAL-LOGEXT---LOGEXT)) (23 20 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (23 5 (:REWRITE LOGBITP-SUBST)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (17 11 (:REWRITE SBP-LOGHEAD)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 9 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBIT-TOO-BIG)) (9 9 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:META META-RULE-ERIC)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (5 5 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN))) (LOGNOT-OF-LOGEXT) (LOGAPP-OF-SUM-OF-LOGHEAD-ONE (54 5 (:REWRITE LOGHEAD-IDENTITY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 7 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (8 7 (:REWRITE DEFAULT-+-2)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGAPP-OF-SUM-OF-LOGHEAD-TWO (92 4 (:LINEAR LOGAPP-LINEAR)) (88 8 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (32 16 (:REWRITE USB-TIGHTEN)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 9 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-OF-LOGEXT (542 6 (:LINEAR LOGEXT-BOUND-UPPER)) (342 27 (:REWRITE LOGEXT-IDENTITY)) (108 108 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (99 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (92 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (72 48 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 9 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (60 4 (:LINEAR EXPT->-1)) (58 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 27 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (45 45 (:REWRITE USB-LINEAR-REWRITE)) (45 45 (:REWRITE EXPT-COMPARE)) (45 45 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 34 (:REWRITE DEFAULT-<-1)) (36 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 34 (:REWRITE DEFAULT-<-2)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE DEFAULT-+-2)) (28 28 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (27 27 (:REWRITE LOGEXT-SUBST2-ALT)) (27 27 (:REWRITE LOGEXT-SUBST2)) (27 27 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-SPLIT-WHEN-USB-ONE-LONGER (266 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (253 69 (:REWRITE EXPT-COMPARE)) (133 5 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (119 5 (:LINEAR X*Y>1-POSITIVE)) (94 6 (:REWRITE POWER2-INTEGER)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 24 (:REWRITE EXPO-OF-NOT-RATIONALP)) (58 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (57 57 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 5 (:LINEAR EXPT->-1)) (50 49 (:REWRITE DEFAULT-<-2)) (49 49 (:REWRITE DEFAULT-<-1)) (47 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (35 35 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE POWER2P-EXPT2-I)) (24 24 (:REWRITE EXPO-MINUS-ERIC)) (24 24 (:REWRITE EXPO-EXPT2)) (24 1 (:REWRITE EQUAL-1-HACK)) (23 10 (:REWRITE DEFAULT-+-2)) (23 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (20 10 (:REWRITE USB-TIGHTEN)) (16 10 (:REWRITE DEFAULT-+-1)) (16 4 (:REWRITE LOGBIT-TOO-BIG)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (13 5 (:REWRITE DEFAULT-*-1)) (11 5 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (EQUALITY-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (<-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (22 22 (:REWRITE USB-LINEAR-REWRITE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-HACK-YUCK (104 3 (:LINEAR LOGHEAD-LEQ)) (82 10 (:REWRITE LOGHEAD-IDENTITY)) (25 21 (:META META-RULE-ERIC)) (23 23 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (12 1 (:REWRITE MY-LOGAPP-<-0)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (10 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 1 (:REWRITE LOGAPP-<)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:DEFINITION IFIX))) (LOGAPP-HACK-YUCK2 (118 118 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (33 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (20 5 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (9 8 (:META META-RULE-ERIC)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE DEFAULT-+-1)) (6 3 (:DEFINITION FIX)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-SUBST-IN-FIRST-ARG-2 (119 8 (:REWRITE LOGHEAD-IDENTITY)) (73 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (52 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (32 32 (:REWRITE POWER2-INTEGER)) (32 24 (:REWRITE DEFAULT-<-1)) (30 24 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 5 (:REWRITE DEFAULT-+-2)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-0-HACK (170 11 (:REWRITE LOGHEAD-IDENTITY)) (39 3 (:LINEAR LOGHEAD-LEQ)) (34 17 (:REWRITE USB-TIGHTEN)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 3 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 1 (:REWRITE UNICITY-OF-0)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-EQUAL-LOGHEAD-LONGER (1746 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1174 62 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (1151 431 (:REWRITE EXPT-COMPARE)) (1147 90 (:REWRITE LOGHEAD-IDENTITY)) (953 7 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (878 174 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (532 55 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (445 431 (:REWRITE USB-LINEAR-REWRITE)) (431 431 (:META CANCEL_PLUS-LESSP-CORRECT)) (392 367 (:REWRITE DEFAULT-<-1)) (388 388 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (378 367 (:REWRITE DEFAULT-<-2)) (359 359 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (348 174 (:REWRITE USB-TIGHTEN)) (286 174 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (260 260 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (237 94 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (225 7 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (216 72 (:REWRITE EXPO-OF-NOT-RATIONALP)) (209 209 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (201 197 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (194 23 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (181 174 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (180 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (174 174 (:TYPE-PRESCRIPTION LOGBITP)) (168 168 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 144 (:REWRITE POWER2-INTEGER)) (126 14 (:LINEAR LOGHEAD-LEQ)) (121 121 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (121 121 (:REWRITE LOGHEAD-SUBST2)) (121 121 (:REWRITE LOGHEAD-SUBST)) (121 121 (:REWRITE DEFAULT-+-2)) (121 121 (:REWRITE DEFAULT-+-1)) (121 121 (:META META-RULE-ERIC)) (96 49 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (87 87 (:REWRITE EXPT-COMPARE-EQUAL)) (84 84 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (79 79 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE POWER2P-EXPT2-I)) (72 72 (:REWRITE EXPO-MINUS-ERIC)) (72 72 (:REWRITE EXPO-EXPT2)) (63 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 7 (:REWRITE LOGHEAD-<)) (55 55 (:REWRITE EQUAL-CONSTANT-+)) (55 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (36 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (36 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 32 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (28 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE LOGHEAD-COMPARE-HACK)) (21 21 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (21 21 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (21 21 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (20 20 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (14 14 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (14 14 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 7 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT-SPLIT-GEN (274 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (270 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (262 4 (:REWRITE LOGTAIL-LESSP)) (248 4 (:LINEAR LOGTAIL-LEQ)) (128 16 (:LINEAR LOGEXT-BOUNDS-2)) (128 16 (:LINEAR LOGEXT-BOUNDS)) (78 62 (:REWRITE DEFAULT-<-1)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE DEFAULT-<-2)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 31 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-IDENTITY)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 3 (:REWRITE LOGEXT-IDENTITY)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE USBP-LOGEXT-NARROWER)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-SUBST2-ALT)) (3 3 (:REWRITE LOGEXT-SUBST2)) (3 3 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGTAIL-LOGEXT-EQUAL-0-REWRITE (93 3 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 2 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (39 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (35 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (25 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (22 2 (:REWRITE LOGEXT-IDENTITY)) (19 2 (:REWRITE LOGTAIL-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (17 13 (:REWRITE DEFAULT-<-2)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-1)) (11 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (10 9 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE SIGNED-BYTE-P-OF-LOGTAIL)) (4 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGEXT-SUBST2-ALT)) (2 2 (:REWRITE LOGEXT-SUBST2)) (2 2 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (1 1 (:REWRITE USBP-LOGEXT-NARROWER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-EQUAL-LOGEXT-LONGER (808 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (477 54 (:REWRITE LOGEXT-IDENTITY)) (424 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (356 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (307 6 (:LINEAR LOGHEAD-LEQ)) (187 187 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (181 19 (:REWRITE LOGHEAD-IDENTITY)) (171 171 (:REWRITE USB-LINEAR-REWRITE)) (171 171 (:REWRITE EXPT-COMPARE)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (168 42 (:REWRITE USBP-LOGEXT-NARROWER)) (167 167 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (163 163 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (144 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 72 (:REWRITE USB-TIGHTEN)) (144 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (143 130 (:REWRITE DEFAULT-<-1)) (136 72 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE DEFAULT-<-2)) (117 13 (:LINEAR EXPT-LESS-THAN-1-HACK)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE POWER2-INTEGER)) (88 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (86 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:TYPE-PRESCRIPTION LOGBITP)) (75 75 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (73 72 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (72 72 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (72 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (68 68 (:REWRITE DEFAULT-+-2)) (68 68 (:REWRITE DEFAULT-+-1)) (64 16 (:REWRITE DEFAULT-UNARY-MINUS)) (56 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (56 56 (:REWRITE LOGEXT-SUBST2-ALT)) (56 56 (:REWRITE LOGEXT-SUBST2)) (56 56 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (52 52 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (52 52 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (52 52 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 5 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (36 19 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (34 25 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (32 32 (:REWRITE EXPONENTS-ADD)) (29 5 (:REWRITE LOGTAIL-LOGEXT-EQUAL-0-REWRITE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (24 3 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 19 (:META META-RULE-ERIC)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (17 17 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 8 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (EXPT-WEAKLY-MONOTONIC-LINEAR (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 8 (:REWRITE DEFAULT-<-2)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE IFIX-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (PROD-NON-NEGATIVE-LINEAR) (PROD-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 1 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (PROD-LINEAR-ALT (14 2 (:LINEAR X*Y>1-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (4 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-OF-LOGAPP-2-GEN (718 14 (:REWRITE LOGHEAD-IDENTITY)) (319 141 (:REWRITE USB-LINEAR-REWRITE)) (265 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (200 130 (:REWRITE DEFAULT-<-2)) (171 21 (:LINEAR EXPT->-1)) (170 130 (:REWRITE DEFAULT-<-1)) (163 6 (:REWRITE LOGHEAD-<)) (143 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (141 141 (:META CANCEL_PLUS-LESSP-CORRECT)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 80 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 52 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (50 50 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (49 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 42 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (42 42 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (42 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 10 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE POWER2-INTEGER)) (35 21 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 17 (:REWRITE USB-TIGHTEN)) (34 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (17 17 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (10 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 3 (:REWRITE DEFAULT-*-2)) (8 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-*-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT))) (LOGTAIL-OF-SUM-OF-ASH (56 4 (:LINEAR LOGTAIL-LEQ)) (28 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (20 20 (:TYPE-PRESCRIPTION ASH)) (19 14 (:REWRITE DEFAULT-<-1)) (17 2 (:LINEAR EXPT->-1)) (16 14 (:REWRITE DEFAULT-<-2)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUM-OF-ASH-ALT (30 30 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (28 2 (:LINEAR LOGTAIL-LEQ)) (13 9 (:REWRITE DEFAULT-<-1)) (13 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (12 12 (:TYPE-PRESCRIPTION ASH)) (12 9 (:REWRITE DEFAULT-<-2)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR EXPT->-1)) (9 1 (:DEFINITION NATP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE ASH-0)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE NATP-RW)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION NATP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-GOES-TO-0))) (LOGTAIL-OF-SUB1-OF-ASH (94 2 (:LINEAR LOGTAIL-LEQ)) (72 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (18 2 (:REWRITE ASH-BOUND2)) (18 2 (:REWRITE ASH-BOUND1A)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 10 (:REWRITE DEFAULT-<-1)) (12 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (12 1 (:REWRITE LOGTAIL-OF-SUM-OF-ASH)) (12 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (10 10 (:REWRITE DEFAULT-<-2)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 7 (:REWRITE DEFAULT-+-2)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 2 (:REWRITE ASH-BOUND4)) (6 2 (:REWRITE ASH-BOUND3A)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 1 (:REWRITE ASH-0)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUB1-OF-LOGAPP (128 2 (:LINEAR LOGTAIL-LEQ)) (64 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (44 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (42 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (18 2 (:REWRITE LOGAPP-<)) (16 16 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 8 (:LINEAR LOGAPP-LINEAR)) (10 5 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST))) (LOGHEAD-IDENTITY-2 (95 95 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (70 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (27 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (21 13 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE POWER2-INTEGER)) (16 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (8 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY (46 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (27 11 (:REWRITE USB-LINEAR-REWRITE)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY-ALT (12 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (USB-OF-SUM-WITH-TWO-OTHER-ADDENDS-HACK (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (26 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (24 15 (:REWRITE DEFAULT-<-2)) (24 2 (:LINEAR EXPT->-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 15 (:REWRITE DEFAULT-<-1)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-OF-PROD-LEMMA-ALT-GEN (2748 32 (:LINEAR LOGHEAD-LEQ)) (1612 19 (:REWRITE <-*-0)) (880 52 (:REWRITE LOGHEAD-IDENTITY)) (429 63 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (368 368 (:REWRITE USB-LINEAR-REWRITE)) (368 368 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (368 368 (:REWRITE EXPT-COMPARE)) (368 368 (:META CANCEL_PLUS-LESSP-CORRECT)) (351 343 (:REWRITE DEFAULT-<-1)) (349 343 (:REWRITE DEFAULT-<-2)) (330 19 (:DEFINITION IFF)) (280 280 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (162 19 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (162 19 (:LINEAR PROD-LINEAR)) (162 19 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (161 19 (:LINEAR PROD-LINEAR-ALT)) (161 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 19 (:LINEAR X*Y>1-POSITIVE)) (143 19 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (126 63 (:REWRITE USB-TIGHTEN)) (119 119 (:META META-RULE-ERIC)) (106 106 (:REWRITE LOGHEAD-SUBST)) (105 105 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (101 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (88 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (85 85 (:REWRITE EXPT-COMPARE-EQUAL)) (83 9 (:REWRITE LOGHEAD-<=)) (82 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (79 79 (:TYPE-PRESCRIPTION LOGBITP)) (79 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (76 76 (:TYPE-PRESCRIPTION IFIX)) (74 11 (:LINEAR EXPT->-1)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (53 47 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (50 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (45 45 (:REWRITE POWER2-INTEGER)) (44 36 (:REWRITE DEFAULT-*-2)) (37 36 (:REWRITE DEFAULT-*-1)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (30 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 2 (:REWRITE NORMALIZE-EQUAL-0)) (26 26 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-+-1)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (18 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-TIMES-16-OF-LOGAPP (268 6 (:REWRITE 0-<-*)) (235 7 (:REWRITE LOGHEAD-IDENTITY)) (183 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (124 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (119 3 (:LINEAR LOGHEAD-LEQ)) (88 5 (:REWRITE NORMALIZE-EQUAL-0)) (57 57 (:REWRITE USB-LINEAR-REWRITE)) (57 57 (:REWRITE EXPT-COMPARE)) (57 57 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 5 (:REWRITE EQUAL-MINUS-MINUS)) (48 6 (:REWRITE <-Y-*-Y-X)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (33 28 (:REWRITE DEFAULT-<-1)) (33 6 (:LINEAR LOGAPP-LINEAR)) (28 28 (:REWRITE DEFAULT-<-2)) (28 10 (:REWRITE EQUAL-1-HACK)) (27 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 25 (:META CANCEL_TIMES-EQUAL-CORRECT)) (25 25 (:META CANCEL_PLUS-EQUAL-CORRECT)) (25 5 (:REWRITE SUM-POWER-OF-TWO)) (24 3 (:REWRITE <-*-Y-X-Y)) (24 2 (:REWRITE MY-LOGAPP-<-0)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 1 (:REWRITE <-*-0)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE USB-TIGHTEN)) (18 3 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:META META-RULE-ERIC)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (8 8 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 6 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (7 7 (:DEFINITION IFF)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-<)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:DEFINITION IFIX)) (1 1 (:REWRITE ZP-OPEN))) (LOGHEAD-OF-MINUS-COMPARE-WHEN-USB (231 231 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (29 15 (:REWRITE DEFAULT-<-1)) (21 15 (:REWRITE DEFAULT-<-2)) (20 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 6 (:REWRITE DEFAULT-+-2)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 6 (:REWRITE DEFAULT-+-1)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:META META-RULE-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGBIT-TOO-BIG-NO-FREE-VARS (111 1 (:REWRITE FLOOR-=-X/Y . 3)) (90 11 (:LINEAR EXPT->-1)) (87 32 (:REWRITE EXPT-COMPARE)) (85 1 (:REWRITE FLOOR-TYPE-3 . 2)) (51 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (48 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (45 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (43 30 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE RTL1)) (34 1 (:REWRITE FLOOR-DETERMINED-1)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 30 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (25 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (22 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 6 (:REWRITE DEFAULT-*-2)) (15 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 1 (:REWRITE LOGBIT-TOO-BIG)) (12 12 (:REWRITE POWER2-INTEGER)) (12 1 (:REWRITE LOGBITP-TOO-BIG)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 6 (:REWRITE EXPO-EXPT2)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 2 (:DEFINITION IFIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE POWER2P-SHIFT-2)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION IFIX)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT (1127 71 (:REWRITE LOGHEAD-IDENTITY)) (570 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (472 4 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (261 127 (:REWRITE DEFAULT-+-2)) (231 139 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (227 127 (:REWRITE DEFAULT-+-1)) (179 179 (:REWRITE POWER2-INTEGER)) (167 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 116 (:REWRITE DEFAULT-<-2)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (143 143 (:REWRITE EXPT-COMPARE)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (139 139 (:META META-RULE-ERIC)) (139 127 (:REWRITE LOGHEAD-SUBST)) (139 17 (:LINEAR EXPT->-1)) (135 116 (:REWRITE DEFAULT-<-1)) (127 127 (:REWRITE LOGHEAD-SUBST2)) (119 82 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (116 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (86 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (84 42 (:REWRITE USB-TIGHTEN)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (79 17 (:REWRITE EXPT-COMPARE-EQUAL)) (77 71 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (76 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (72 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (69 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (66 66 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (64 24 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (62 2 (:REWRITE LOGHEAD-<)) (57 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (56 2 (:REWRITE <-OF-LOGHEADS-REWRITE)) (53 53 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 42 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 21 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (34 34 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (34 34 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (32 32 (:REWRITE FOLD-CONSTS-IN-+)) (28 22 (:REWRITE DEFAULT-UNARY-MINUS)) (23 23 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 4 (:REWRITE EXPO-EXPT2)) (21 21 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (19 19 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 12 (:REWRITE INTEGERP-+-MINUS-*-2)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 12 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (8 4 (:DEFINITION FIX)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD))) (LOGHEAD-OF-1 (125 8 (:REWRITE LOGHEAD-IDENTITY)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 27 (:REWRITE DEFAULT-<-2)) (31 27 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE USB-LINEAR-REWRITE)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (27 27 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE POWER2-INTEGER)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT-NON-SPLITTING (185 15 (:REWRITE LOGHEAD-IDENTITY)) (105 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 3 (:LINEAR LOGHEAD-LEQ)) (48 34 (:REWRITE DEFAULT-<-2)) (47 24 (:REWRITE DEFAULT-+-2)) (46 24 (:REWRITE DEFAULT-+-1)) (44 34 (:REWRITE DEFAULT-<-1)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE POWER2-INTEGER)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (25 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (22 22 (:META META-RULE-ERIC)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE ZP-OPEN)) (6 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT (54 3 (:REWRITE LOGHEAD-IDENTITY)) (49 49 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (30 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC))) (LOGHEAD-SUM-SUBST-HELPER-BETTER (519 16 (:REWRITE LOGHEAD-IDENTITY)) (263 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (232 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (172 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (74 53 (:REWRITE DEFAULT-<-2)) (68 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (57 53 (:REWRITE DEFAULT-<-1)) (53 53 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 6 (:LINEAR LOGHEAD-LEQ)) (46 46 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (46 23 (:REWRITE USB-TIGHTEN)) (43 43 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (43 43 (:REWRITE POWER2-INTEGER)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR EXPT->-1)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE DEFAULT-+-2)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 3 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 3 (:DEFINITION FIX)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-ONE-MORE-WRAPS-AROUND (327 24 (:REWRITE LOGHEAD-IDENTITY)) (119 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 52 (:REWRITE USB-LINEAR-REWRITE)) (79 9 (:LINEAR LOGHEAD-LEQ)) (78 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (71 50 (:REWRITE DEFAULT-<-1)) (60 50 (:REWRITE DEFAULT-<-2)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (49 23 (:REWRITE DEFAULT-+-2)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (46 46 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE USB-TIGHTEN)) (42 23 (:REWRITE DEFAULT-+-1)) (39 9 (:REWRITE EXPT-COMPARE-EQUAL)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (32 32 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 2 (:REWRITE LOGHEAD-<)) (13 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 4 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE ZP-OPEN)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGHEAD-IDENTITY-2-ALT (89 1 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 9 (:REWRITE USB-TIGHTEN)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-SUM-SPLIT-INTO-2-CASES-FORCED (502 36 (:REWRITE LOGHEAD-IDENTITY)) (297 297 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (198 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (116 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (67 42 (:REWRITE DEFAULT-<-2)) (61 32 (:REWRITE DEFAULT-+-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (59 32 (:REWRITE DEFAULT-+-2)) (50 42 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE USB-LINEAR-REWRITE)) (47 47 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE EXPT-COMPARE)) (47 47 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (41 41 (:REWRITE LOGHEAD-SUBST2)) (41 41 (:REWRITE LOGHEAD-SUBST)) (39 1 (:REWRITE LOGHEAD-<)) (38 38 (:REWRITE POWER2-INTEGER)) (38 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR LOGHEAD-LEQ)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST)) (5 5 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (5 5 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE LOGHEAD-+-REDUCE)) (5 5 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE DEFAULT-*-1))) (LOGHEAD-EQUALITY-IMPOSSIBLE (300 6 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (157 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (96 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 67 (:REWRITE DEFAULT-+-2)) (67 67 (:REWRITE DEFAULT-+-1)) (66 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (42 42 (:REWRITE LOGHEAD-SUBST2)) (42 42 (:REWRITE LOGHEAD-SUBST)) (42 42 (:META META-RULE-ERIC)) (37 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE USB-TIGHTEN)) (13 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST-WEIRD)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+))) (NOT-UNSIGNED-BYTE-P-WHEN-J-IS-NEGATIVE (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE (151 151 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 4 (:REWRITE LOGHEAD-IDENTITY)) (69 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE USB-TIGHTEN)) (15 1 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 2 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (12 4 (:REWRITE COMMUTATIVITY-OF-+)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (7 1 (:REWRITE LOGHEAD-<)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:META META-RULE-ERIC)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBIT-TOO-BIG)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DUMB)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (103 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (31 31 (:REWRITE USB-LINEAR-REWRITE)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 31 (:META CANCEL_PLUS-LESSP-CORRECT)) (29 3 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (22 1 (:REWRITE LOGHEAD-<)) (20 17 (:REWRITE DEFAULT-<-2)) (18 6 (:REWRITE FOLD-CONSTS-IN-+)) (17 17 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 5 (:REWRITE COMMUTATIVITY-OF-+)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE (340 340 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (265 17 (:REWRITE LOGHEAD-IDENTITY)) (206 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (129 129 (:REWRITE POWER2-INTEGER)) (123 4 (:REWRITE LOGHEAD-<)) (118 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (108 46 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (102 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (97 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (78 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (73 45 (:REWRITE DEFAULT-<-2)) (72 72 (:REWRITE USB-LINEAR-REWRITE)) (72 72 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (72 72 (:REWRITE EXPT-COMPARE)) (72 72 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (70 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (69 25 (:REWRITE USB-TIGHTEN)) (61 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (49 45 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 23 (:REWRITE INTEGERP-+-MINUS-*-2)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (23 23 (:REWRITE FIX-DOES-NOTHING)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 18 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-SUBST2)) (17 17 (:REWRITE LOGHEAD-SUBST)) (17 17 (:META META-RULE-ERIC)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-REASSEMBLE (37 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (29 3 (:REWRITE LOGTAIL-IDENTITY)) (22 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (12 6 (:REWRITE USB-TIGHTEN)) (11 8 (:REWRITE DEFAULT-<-2)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE DEFAULT-<-1)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-PLUS-LOGTAIL-REASSEMBLE (142 8 (:REWRITE LOGTAIL-LESSP)) (98 2 (:LINEAR PROD-LINEAR)) (78 50 (:REWRITE EXPT-COMPARE)) (74 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (72 8 (:LINEAR LOGTAIL-LEQ)) (68 2 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (64 4 (:REWRITE LOGHEAD-IDENTITY)) (64 2 (:LINEAR PROD-LINEAR-ALT)) (58 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 37 (:REWRITE DEFAULT-<-1)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (48 48 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 37 (:REWRITE DEFAULT-<-2)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 2 (:REWRITE LOGTAIL-IDENTITY)) (27 10 (:REWRITE USB-TIGHTEN)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 5 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 5 (:REWRITE DEFAULT-*-1)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 6 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE UNICITY-OF-1)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE TIMES-ZERO)) (6 2 (:REWRITE FIX-DOES-NOTHING)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (X-EQUAL-SUM-OF-LOGHEAD-CANCEL (216 12 (:REWRITE LOGHEAD-IDENTITY)) (204 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (196 28 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (189 12 (:REWRITE LOGTAIL-LESSP)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (172 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (151 109 (:REWRITE EXPT-COMPARE)) (138 3 (:LINEAR PROD-LINEAR)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (109 109 (:REWRITE USB-LINEAR-REWRITE)) (109 109 (:META CANCEL_PLUS-LESSP-CORRECT)) (108 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 3 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (96 12 (:LINEAR LOGTAIL-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (93 3 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (92 86 (:REWRITE DEFAULT-<-2)) (87 3 (:LINEAR PROD-LINEAR-ALT)) (86 86 (:REWRITE DEFAULT-<-1)) (84 28 (:REWRITE USB-TIGHTEN)) (75 3 (:LINEAR X*Y>1-POSITIVE)) (64 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (48 4 (:REWRITE LOGTAIL-IDENTITY)) (44 44 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (36 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (32 4 (:LINEAR EXPT->-1)) (28 28 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 16 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE DEFAULT-+-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 7 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 3 (:REWRITE UNICITY-OF-1)) (9 9 (:REWRITE TIMES-ZERO)) (9 3 (:REWRITE FIX-DOES-NOTHING)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 3 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SIGNED-BYTE-P-OF-X-MINUS-2-TO-THEN-MINUS-ONE-WHEN-USB (115 1 (:REWRITE SIGNED-BYTE-P-+)) (58 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (39 39 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE EXPT-COMPARE)) (20 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (19 11 (:REWRITE DEFAULT-<-2)) (17 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-*-2)) (13 9 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE DEFAULT-+-1)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (1 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE-CONSTANT-VERSION (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (HALF-CANCEL) (LOGEXT-PLUS-EXPT2N-REWRITE (504 6 (:REWRITE LOGHEAD-IDENTITY)) (393 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (329 59 (:REWRITE EXPT-COMPARE)) (167 79 (:REWRITE USB-LINEAR-REWRITE)) (123 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (95 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (79 79 (:META CANCEL_PLUS-LESSP-CORRECT)) (60 25 (:REWRITE DEFAULT-*-2)) (57 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (54 54 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (53 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 23 (:REWRITE DEFAULT-+-2)) (36 27 (:REWRITE DEFAULT-<-2)) (36 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (30 23 (:REWRITE DEFAULT-+-1)) (29 25 (:REWRITE DEFAULT-*-1)) (28 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 27 (:REWRITE DEFAULT-<-1)) (22 11 (:REWRITE USB-TIGHTEN)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 2 (:REWRITE LOGBITP-TOO-BIG)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 4 (:REWRITE IFIX-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:META META-RULE-ERIC)) (6 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE LOGBITP-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-PLUS-EXPT2N-REWRITE-CONSTANT-VERSION (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-EQUAL-REWRITE (488 34 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (482 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (438 8 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (371 16 (:REWRITE LOGHEAD-IDENTITY)) (371 8 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (258 6 (:LINEAR LOGHEAD-LEQ)) (239 15 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (237 39 (:REWRITE USB-TIGHTEN)) (208 208 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (205 86 (:REWRITE EXPT-COMPARE)) (201 19 (:REWRITE LOGBITP-SUBST-2)) (166 21 (:REWRITE <-+-CONSTANT-CONSTANT)) (90 26 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (78 78 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (77 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (77 2 (:REWRITE LOGBITP-LOGEXT)) (73 73 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (68 68 (:TYPE-PRESCRIPTION LOGBITP)) (63 56 (:REWRITE DEFAULT-<-1)) (56 56 (:REWRITE DEFAULT-<-2)) (49 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (38 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (35 35 (:REWRITE DEFAULT-+-2)) (35 35 (:REWRITE DEFAULT-+-1)) (34 34 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (33 33 (:REWRITE POWER2-INTEGER)) (30 15 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 2 (:REWRITE USBP-LOGEXT-NARROWER)) (27 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGEXT-BOUND-UPPER)) (26 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (25 25 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (23 16 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (21 14 (:REWRITE EXPO-EXPT2)) (18 18 (:META META-RULE-ERIC)) (17 17 (:REWRITE LOGBITP-SUBST)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGEXT-SUBST2)) (16 9 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (14 14 (:REWRITE POWER2P-EXPT2-I)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (10 10 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE DUMB))) (UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 4 (:REWRITE DEFAULT-<-1)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (5 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MOVE-NEGATED-TERM-HACK (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 3 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGIOR-HACK (4 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE LOGIOR-AS-B-IOR)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST))) (LOGBITP-BOUND (86 1 (:REWRITE FLOOR-=-X/Y . 3)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (30 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (25 13 (:REWRITE DEFAULT-<-2)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-SIMPLE-CASES)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (17 1 (:REWRITE FLOOR-TYPE-3 . 2)) (15 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (ASH-EQUAL-REWRITE (530 10 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (461 9 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (450 9 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (318 180 (:REWRITE USB-LINEAR-REWRITE)) (243 3 (:REWRITE ASH-BOUND4)) (237 3 (:REWRITE ASH-BOUND3A)) (215 177 (:REWRITE EXPT-COMPARE)) (182 142 (:REWRITE DEFAULT-<-1)) (180 180 (:META CANCEL_PLUS-LESSP-CORRECT)) (170 170 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (166 142 (:REWRITE DEFAULT-<-2)) (155 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (147 137 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (118 10 (:REWRITE LOGBITP-SUBST)) (108 10 (:LINEAR EXPT->-1)) (83 28 (:REWRITE USB-TIGHTEN)) (74 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 6 (:LINEAR PROD-LINEAR-ALT)) (62 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (54 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (54 6 (:REWRITE ASH-AS-LOGTAIL)) (54 6 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (54 6 (:LINEAR PROD-LINEAR)) (54 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (54 3 (:REWRITE LOGTAIL-IDENTITY)) (50 4 (:REWRITE ASH-0)) (49 47 (:REWRITE DEFAULT-+-2)) (48 6 (:LINEAR X*Y>1-POSITIVE)) (48 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (47 47 (:REWRITE DEFAULT-+-1)) (45 45 (:TYPE-PRESCRIPTION LOGBITP)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (37 4 (:REWRITE ZIP-OPEN)) (36 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 2 (:REWRITE LOGBITP-ASH)) (29 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (27 3 (:REWRITE ASH-BOUND2)) (27 3 (:REWRITE ASH-BOUND1A)) (24 24 (:REWRITE POWER2-INTEGER)) (23 4 (:REWRITE UNSIGNED-BYTE-P-ASH)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 5 (:REWRITE <=-0-ASH)) (20 4 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (19 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 6 (:REWRITE DEFAULT-*-2)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 5 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGBITP-SUBST-2)) (9 6 (:REWRITE DEFAULT-*-1)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META META-RULE-ERIC)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE <-*-0)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (6 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (ASSOCIATIVITY-OF-LOGAPP-BETTER-BACK (126 126 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (114 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (110 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (47 47 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (46 4 (:REWRITE MY-LOGAPP-<-0)) (25 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (24 16 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE POWER2-INTEGER)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE DEFAULT-<-2)) (13 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE LOGAPP-<)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (7 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE <-+-NEGATIVE-0-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (EXPT-EXECUTE (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (EXPT-EXECUTE-REWRITE (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGAPP-EQUAL-CONSTANT (132 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (128 8 (:REWRITE LOGHEAD-IDENTITY)) (102 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (72 4 (:REWRITE LOGTAIL-IDENTITY)) (60 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (56 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 22 (:REWRITE USB-TIGHTEN)) (42 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 33 (:REWRITE DEFAULT-<-2)) (38 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (34 33 (:REWRITE DEFAULT-<-1)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 33 (:REWRITE POWER2-INTEGER)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (19 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 14 (:REWRITE DEFAULT-+-2)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:REWRITE DEFAULT-+-1)) (12 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 2 (:REWRITE ASH-0)) (8 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:DEFINITION FIX)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-COMPARE-TO-MAX) (LOGHEAD-EQUAL-MAX-PLUS-SOMETHING-ELSE (60 6 (:REWRITE LOGHEAD-IDENTITY)) (20 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:TYPE-PRESCRIPTION LOGBITP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (5 3 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE USB-LINEAR-REWRITE)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGHEAD-PLUS-EXPT-AS-THIRD-ADDEND (1072 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (848 194 (:REWRITE POWER2-INTEGER)) (790 104 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (700 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (624 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (622 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (464 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (432 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (424 32 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (400 8 (:REWRITE LOGHEAD-IDENTITY)) (350 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (220 16 (:REWRITE LOGBITP-+-SIMPLE)) (204 28 (:REWRITE <-+-CONSTANT-CONSTANT)) (148 148 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (142 142 (:REWRITE USB-LINEAR-REWRITE)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (142 142 (:REWRITE EXPT-COMPARE)) (142 142 (:META CANCEL_PLUS-LESSP-CORRECT)) (137 118 (:REWRITE DEFAULT-<-2)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (128 128 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (125 118 (:REWRITE DEFAULT-<-1)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 58 (:REWRITE FIX-DOES-NOTHING)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (90 30 (:REWRITE EXPO-OF-NOT-RATIONALP)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 40 (:DEFINITION FIX)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 4 (:LINEAR LOGHEAD-LEQ)) (68 32 (:REWRITE USB-TIGHTEN)) (64 64 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (62 34 (:REWRITE DEFAULT-+-2)) (60 30 (:REWRITE EXPO-EXPT2)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (51 51 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (40 40 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 30 (:TYPE-PRESCRIPTION POWER2P)) (30 30 (:REWRITE POWER2P-EXPT2-I)) (30 30 (:REWRITE EXPO-MINUS-ERIC)) (27 3 (:LINEAR EXPT->-1)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG))) (LOGHEAD-OF-DIFFERENCE (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (242 161 (:REWRITE DEFAULT-+-2)) (204 161 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (174 18 (:LINEAR LOGHEAD-LEQ)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (108 86 (:REWRITE DEFAULT-<-1)) (107 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (LOGHEAD-OF-DIFFERENCE-ALT (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (255 170 (:REWRITE DEFAULT-+-2)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (223 170 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (168 18 (:LINEAR LOGHEAD-LEQ)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (141 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (108 86 (:REWRITE DEFAULT-<-1)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (49 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (HACK<) (LOGAPP-LOGHEAD-HACK-16-31 (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (48 4 (:LINEAR LOGAPP-LINEAR)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (10 6 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 3 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (9 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (8 1 (:REWRITE HACK<)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEADS-OF-SUM-ALMOST-EQUAL (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 15 (:REWRITE DEFAULT-+-2)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEADS-OF-SUM-ALMOST-EQUAL-ALT (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (20 14 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-SUM-OF-LOGAPP (726 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (616 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (545 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (504 13 (:REWRITE LOGHEAD-IDENTITY)) (482 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (256 80 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (224 34 (:REWRITE <-+-CONSTANT-CONSTANT)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (148 148 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (121 121 (:REWRITE POWER2-INTEGER)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE USB-LINEAR-REWRITE)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (99 99 (:META CANCEL_PLUS-LESSP-CORRECT)) (97 73 (:REWRITE DEFAULT-<-2)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (88 88 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 42 (:REWRITE USB-TIGHTEN)) (84 84 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (82 73 (:REWRITE DEFAULT-<-1)) (80 40 (:DEFINITION FIX)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (58 58 (:TYPE-PRESCRIPTION LOGBITP)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 34 (:REWRITE DEFAULT-+-2)) (48 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 40 (:REWRITE FIX-DOES-NOTHING)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (28 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (22 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE LOGHEAD-LOGAPP-2)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGHEAD-OF-SUM-OF-LOGAPP-1 (780 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (773 19 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (670 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (589 11 (:REWRITE LOGHEAD-IDENTITY)) (524 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (479 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (312 96 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (232 42 (:REWRITE <-+-CONSTANT-CONSTANT)) (212 212 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (145 145 (:REWRITE POWER2-INTEGER)) (136 8 (:REWRITE USB-OF-LOGAPP-2-GEN)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (106 106 (:META CANCEL_PLUS-LESSP-CORRECT)) (104 80 (:REWRITE DEFAULT-<-2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (104 8 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (102 8 (:REWRITE LOGBITP-+-USB-V2)) (100 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (96 80 (:REWRITE DEFAULT-<-1)) (96 48 (:DEFINITION FIX)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 39 (:REWRITE USB-TIGHTEN)) (78 78 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (60 48 (:REWRITE INTEGERP-+-MINUS-*-2)) (60 48 (:REWRITE FIX-DOES-NOTHING)) (58 8 (:REWRITE LOGBITP-+-USB-V4)) (57 36 (:REWRITE DEFAULT-+-2)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 55 (:TYPE-PRESCRIPTION LOGBITP)) (48 48 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (39 39 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (39 36 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (23 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (20 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (19 19 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGAPP-OF-ASH (569 5 (:REWRITE LOGAPP-<)) (352 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (314 2 (:REWRITE LOGBITP-LOGAPP-BETTER)) (164 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (162 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (156 112 (:REWRITE DEFAULT-<-1)) (154 84 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (145 145 (:REWRITE EXPT-COMPARE)) (145 145 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (119 112 (:REWRITE DEFAULT-<-2)) (81 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (81 9 (:REWRITE ASH-AS-LOGTAIL)) (79 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (79 9 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (70 9 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (64 8 (:LINEAR EXPT->-1)) (62 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (57 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (56 56 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (50 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (48 1 (:LINEAR LOGHEAD-LEQ)) (46 23 (:REWRITE USB-TIGHTEN)) (44 28 (:REWRITE DEFAULT-+-2)) (43 43 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 9 (:REWRITE ASH-0)) (30 28 (:REWRITE DEFAULT-+-1)) (29 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 2 (:REWRITE LOGBITP-ASH)) (28 1 (:REWRITE LOGHEAD-IDENTITY)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 2 (:REWRITE <-0-+-NEGATIVE-1)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 6 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (20 2 (:REWRITE UNSIGNED-BYTE-P-ASH)) (18 18 (:TYPE-PRESCRIPTION ZIP)) (18 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 15 (:META META-RULE-ERIC)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE HACK<)) (11 11 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (11 11 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE ZIP-OPEN)) (9 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 6 (:REWRITE USB-OF-LOGAPP-2-GEN)) (8 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 1 (:REWRITE LOGHEAD-LOGAPP-BETTER)) (8 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (EQUAL-LOGAPP-WITH-LOGTAIL-OF-SELF-REWRITE (121 13 (:REWRITE LOGHEAD-IDENTITY)) (46 46 (:TYPE-PRESCRIPTION LOGBITP)) (46 23 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 1 (:REWRITE ASH-0)) (37 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 4 (:LINEAR LOGHEAD-LEQ)) (34 1 (:REWRITE ZIP-OPEN)) (30 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (30 3 (:REWRITE LOGTAIL-IDENTITY)) (28 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 9 (:REWRITE HACK<)) (23 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (18 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (17 17 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR LOGTAIL-LEQ)) (15 15 (:REWRITE POWER2-INTEGER)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (11 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE DEFAULT-<-1)) (9 1 (:REWRITE LOGTAIL-EQUAL-0)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGAPP-EQUAL-LOGAPP-REWRITE-SPECIAL (78 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (56 4 (:REWRITE LOGHEAD-IDENTITY)) (46 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (26 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 3 (:REWRITE HACK<)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 11 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LARGER-LOGHEAD-ISNT-LESS (879 24 (:REWRITE LOGTAIL-IDENTITY)) (818 96 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (715 360 (:REWRITE EXPT-COMPARE)) (632 94 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (622 12 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (615 37 (:REWRITE LOGHEAD-IDENTITY)) (614 360 (:REWRITE USB-LINEAR-REWRITE)) (605 12 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (499 25 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (476 6 (:LINEAR X*Y>1-POSITIVE)) (448 24 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (447 24 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (395 299 (:REWRITE DEFAULT-<-2)) (390 299 (:REWRITE DEFAULT-<-1)) (360 360 (:META CANCEL_PLUS-LESSP-CORRECT)) (348 326 (:REWRITE POWER2-INTEGER)) (335 335 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (329 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (312 24 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (287 287 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (273 108 (:REWRITE USB-TIGHTEN)) (216 20 (:REWRITE LOGHEAD-<)) (176 176 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (171 171 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (148 148 (:TYPE-PRESCRIPTION LOGBITP)) (147 114 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (145 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (118 107 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (110 16 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (108 12 (:LINEAR LOGHEAD-LEQ)) (105 35 (:REWRITE EXPO-OF-NOT-RATIONALP)) (99 4 (:REWRITE LOGHEAD-<=)) (97 96 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (94 94 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (93 76 (:REWRITE DEFAULT-+-2)) (90 57 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (83 76 (:REWRITE DEFAULT-+-1)) (79 20 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (70 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (67 37 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (59 24 (:REWRITE DEFAULT-*-2)) (57 56 (:META META-RULE-ERIC)) (56 56 (:REWRITE LOGHEAD-SUBST2)) (56 24 (:REWRITE LOGBITP-SUBST)) (54 24 (:REWRITE DEFAULT-*-1)) (53 24 (:REWRITE MOVE-NEGATED-TERM-HACK)) (51 35 (:REWRITE EXPO-EXPT2)) (49 49 (:REWRITE EXPT-COMPARE-EQUAL)) (49 49 (:META CANCEL_TIMES-EQUAL-CORRECT)) (49 49 (:META CANCEL_PLUS-EQUAL-CORRECT)) (49 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (45 37 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (40 8 (:REWRITE LOGCAR-EVENP)) (39 12 (:DEFINITION QUOTEP)) (39 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION POWER2P)) (35 35 (:REWRITE POWER2P-EXPT2-I)) (35 35 (:REWRITE EXPO-MINUS-ERIC)) (33 1 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (32 8 (:REWRITE LOGCAR-0-REWRITE)) (28 10 (:REWRITE HACK<)) (26 26 (:REWRITE EQUAL-CONSTANT-+)) (24 24 (:TYPE-PRESCRIPTION EVENP)) (24 24 (:REWRITE LOGBITP-SUBST-2)) (24 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION QUOTEP)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 10 (:REWRITE <-OF-LOGTAIL)) (18 9 (:DEFINITION FIX)) (17 9 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (16 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 9 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 4 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (3 3 (:REWRITE DEFAULT-CAR)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGAPP-<-NO-SAME-X (71 71 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (71 71 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (51 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 3 (:REWRITE HACK<)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE USB-OF-LOGAPP-2-GEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:META META-RULE-ERIC)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)))
78932
(SBP-LOGHEAD-HELPER (128 4 (:REWRITE LOGHEAD-IDENTITY)) (100 4 (:DEFINITION UNSIGNED-BYTE-P)) (76 4 (:DEFINITION INTEGER-RANGE-P)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 14 (:REWRITE DEFAULT-<-2)) (16 14 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR LOGHEAD-LEQ)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:META META-RULE-ERIC)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (SBP-LOGHEAD (39 31 (:REWRITE DEFAULT-<-2)) (39 3 (:REWRITE LOGHEAD-IDENTITY)) (36 31 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE TOP-BIT-MEANS-<)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (25 25 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (18 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE SBP-LOGHEAD-HELPER)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:TYPE-PRESCRIPTION LOGHEAD-TYPE))) (LOGCAR-LOGXOR (7052 3 (:DEFINITION LOGIOR*)) (7037 8 (:REWRITE LOGCDR-LOGAND)) (6849 14 (:DEFINITION LOGAND*)) (6448 28 (:REWRITE LOGCDR-LOGNOT)) (6065 199 (:DEFINITION UNSIGNED-BYTE-P*)) (5123 276 (:REWRITE LOGCAR-IDENTITY)) (5062 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (5003 68 (:REWRITE LOGNOT-ZIP)) (4994 12 (:DEFINITION LOGMASKP*)) (4868 34 (:DEFINITION LOGNOT*)) (4769 32 (:REWRITE ZIP-OPEN)) (3818 138 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (3697 188 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3117 184 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (1842 1842 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (1678 126 (:REWRITE EQUAL-BIT-1)) (1673 414 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1630 6 (:REWRITE LOGIOR-AS-B-IOR)) (1502 62 (:REWRITE B-NOT-OPEN-1)) (1013 276 (:REWRITE LOGCAR-EVENP)) (752 2 (:REWRITE LOGCDR-LOGXOR)) (608 10 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (601 601 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (546 546 (:TYPE-PRESCRIPTION EVENP)) (520 118 (:REWRITE EQUAL-1-HACK)) (480 276 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (470 294 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (416 108 (:REWRITE LOGCAR-0-REWRITE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (366 289 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (349 349 (:REWRITE TOP-BIT-MEANS-<)) (333 333 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (325 304 (:REWRITE DEFAULT-<-1)) (304 304 (:REWRITE DEFAULT-<-2)) (258 258 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (224 18 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (203 14 (:REWRITE LOGNOT-NEG)) (191 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (171 29 (:REWRITE LOGCDR-<-0)) (147 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (132 132 (:TYPE-PRESCRIPTION LOGNOT)) (101 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (88 2 (:REWRITE LOGIOR-=-0)) (76 76 (:TYPE-PRESCRIPTION LOGMASKP)) (76 76 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (70 70 (:TYPE-PRESCRIPTION ZIP)) (55 28 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (55 28 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (54 2 (:REWRITE LOGAND-NEG)) (52 12 (:REWRITE EQUAL-0-LOGAND-BIT)) (40 40 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE)) (20 4 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGXOR)) (18 18 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (18 10 (:REWRITE IFIX-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EQUAL-LOGAND---EXPT-0-REWRITE)) (10 2 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (8 8 (:TYPE-PRESCRIPTION BINARY-LOGIOR)) (6 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-B-NOT)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGCAR)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (LOGXOR-LOGNOT-ONE (141 10 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (41 41 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 10 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 10 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-LOGNOT-TWO (117 9 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (16 9 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (15 9 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-NEG (116 8 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (50 6 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (27 15 (:REWRITE LOGAND-WITH-MASK-ERIC)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (21 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (17 17 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 8 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP))) (INTEGERP-LOGAND) (INTEGERP-LOGXOR) (INTEGERP-LOGIOR) (INTEGERP-LOGEXT) (RATIONALP-LOGAND) (RATIONALP-LOGXOR) (RATIONALP-LOGIOR) (RATIONALP-LOGEXT) (LOGBITP-TOO-BIG (91 91 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (27 17 (:REWRITE DEFAULT-<-2)) (24 17 (:REWRITE DEFAULT-<-1)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 3 (:LINEAR EXPT->-1)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 1 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (USBP-LOGEXT-NARROWER (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE TOP-BIT-MEANS-<)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META META-RULE-ERIC))) (PERHAPS-<=-1-IS-USB1? (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE DEFAULT-<-1))) (SIGNED-BYTE-P-OF-LOGEXT (186 6 (:REWRITE LOGEXT-IDENTITY)) (158 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (138 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:LINEAR LOGCAR-RANGE-LINEAR)) (72 9 (:REWRITE LOGCAR-IDENTITY)) (45 9 (:REWRITE LOGCAR-EVENP)) (40 40 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (22 17 (:REWRITE DEFAULT-<-2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (21 21 (:TYPE-PRESCRIPTION EVENP)) (21 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 17 (:REWRITE DEFAULT-<-1)) (18 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 3 (:REWRITE LOGCAR-0-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR LOGEXT-BOUNDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGXOR-CANCEL2 (24 17 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (21 17 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 4 (:REWRITE IFIX-INTEGERP))) (SBP32-NEGATION (80 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (51 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (44 1 (:REWRITE SIGNED-BYTE-P--2)) (29 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE SBP-BOUND-1)) (5 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-LOGEXT-BETTER (85 85 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 4 (:REWRITE LOGEXT-IDENTITY)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (10 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (8 4 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-+-EXPT (21595 114 (:REWRITE LOGEXT-IDENTITY)) (18961 206 (:DEFINITION SIGNED-BYTE-P*)) (17578 405 (:DEFINITION UNSIGNED-BYTE-P*)) (17372 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (12767 644 (:REWRITE LOGCAR-IDENTITY)) (10740 1038 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10229 327 (:REWRITE EQUAL-BIT-1)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (6422 308 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (5783 195 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5554 358 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4845 81 (:REWRITE NORMALIZE-EQUAL-0)) (3257 88 (:REWRITE SIGNED-BYTE-P-+)) (2444 47 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1578 1061 (:REWRITE DEFAULT-<-1)) (1481 316 (:REWRITE EQUAL-1-HACK)) (1354 1354 (:REWRITE TOP-BIT-MEANS-<)) (1352 364 (:REWRITE <-+-CONSTANT-CONSTANT)) (1261 848 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1233 1233 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1215 1066 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1061 1061 (:REWRITE DEFAULT-<-2)) (1044 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (933 722 (:REWRITE DEFAULT-+-2)) (925 925 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (784 722 (:REWRITE DEFAULT-+-1)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (730 557 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (626 626 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (626 626 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (479 358 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (416 283 (:LINEAR EXPT-LESS-THAN-1-HACK)) (408 408 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (382 123 (:REWRITE DEFAULT-UNARY-MINUS)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (238 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (155 17 (:REWRITE LOGCONS-<-0)) (149 149 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (77 11 (:REWRITE LOGCDR-+2)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 12 (:REWRITE LOGCDR-<-0)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (42 42 (:TYPE-PRESCRIPTION BITP)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (22 22 (:REWRITE SBP-BOUND-1)) (22 22 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (22 11 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (22 11 (:REWRITE UNSIGNED-BYTE-P-LOGCDR-BRIDGE5)) (22 11 (:REWRITE UNSIGNED-BYTE-P-1+)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT (26036 114 (:REWRITE LOGEXT-IDENTITY)) (20875 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (20663 489 (:DEFINITION UNSIGNED-BYTE-P*)) (20553 210 (:DEFINITION SIGNED-BYTE-P*)) (13627 644 (:REWRITE LOGCAR-IDENTITY)) (11585 1195 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10269 331 (:REWRITE EQUAL-BIT-1)) (7201 207 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (7044 132 (:REWRITE ARITH-MOVE-NEGATED-TERM)) (6434 320 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3545 88 (:REWRITE SIGNED-BYTE-P-+)) (3499 84 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (2466 58 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1745 1199 (:REWRITE DEFAULT-+-2)) (1616 1199 (:REWRITE DEFAULT-+-1)) (1603 932 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1552 307 (:REWRITE <-+-CONSTANT-CONSTANT)) (1523 1330 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1514 327 (:REWRITE EQUAL-1-HACK)) (1485 179 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1406 1406 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1332 1332 (:REWRITE TOP-BIT-MEANS-<)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1201 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1199 1199 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1195 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1041 951 (:REWRITE DEFAULT-<-2)) (974 951 (:REWRITE DEFAULT-<-1)) (906 689 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (877 877 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (828 28 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (634 634 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (634 634 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (550 377 (:LINEAR EXPT-LESS-THAN-1-HACK)) (500 15 (:REWRITE NORMALIZE-EQUAL-0)) (416 416 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (322 179 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (265 87 (:REWRITE DEFAULT-UNARY-MINUS)) (252 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (193 193 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (176 88 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (144 8 (:REWRITE SIGNED-BYTE-P--2)) (131 13 (:REWRITE LOGCONS-<-0)) (112 8 (:REWRITE EQUAL-MINUS-MINUS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (66 66 (:TYPE-PRESCRIPTION BITP)) (66 6 (:REWRITE <-+-NEGATIVE-0-1)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (40 4 (:REWRITE LOGCDR-EXPT)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (34 17 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (24 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE EXPT-2-EQUAL-1-REWRITE)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 4 (:DEFINITION =)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT-ALT (261 257 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (204 10 (:REWRITE LOGEXT-IDENTITY)) (84 4 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (60 6 (:REWRITE SIGNED-BYTE-P-+)) (48 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 10 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 19 (:REWRITE DEFAULT-+-2)) (22 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 19 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 5 (:REWRITE DEFAULT-UNARY-MINUS)) (14 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE TOP-BIT-MEANS-<)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 2 (:REWRITE SIGNED-BYTE-P--2)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-TO-SIGNED) (SIGNED-TO-UNSIGNED) (LOGHEAD--OF--LOGEXT-WHEN-UNSIGNED-BYTE-P (504 2 (:LINEAR LOGHEAD-LEQ)) (438 4 (:LINEAR LOGEXT-BOUNDS)) (310 5 (:REWRITE LOGEXT-IDENTITY)) (269 5 (:DEFINITION SIGNED-BYTE-P)) (104 104 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (80 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (72 8 (:LINEAR EXPT->-1)) (69 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (65 49 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (45 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 25 (:REWRITE DEFAULT-<-2)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 7 (:REWRITE DEFAULT-UNARY-MINUS)) (27 25 (:REWRITE DEFAULT-<-1)) (21 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (17 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE))) (LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P (450 10 (:REWRITE LOGHEAD-IDENTITY)) (410 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (256 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (228 228 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (212 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (106 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (98 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 53 (:REWRITE DEFAULT-<-2)) (70 70 (:REWRITE TOP-BIT-MEANS-<)) (60 53 (:REWRITE DEFAULT-<-1)) (58 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (44 44 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (40 10 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 5 (:LINEAR EXPT->-1)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (30 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 4 (:REWRITE LOGHEAD-<)) (24 4 (:LINEAR LOGHEAD-LEQ)) (20 14 (:REWRITE DEFAULT-+-2)) (20 14 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE SBP-LOGHEAD)) (14 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (11 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (11 2 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE FIX-DOES-NOTHING)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE SBP-BOUND-1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT))) (LOGHEAD-EQUAL-REWRITE (288 288 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (260 5 (:REWRITE LOGHEAD-IDENTITY)) (234 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (68 3 (:LINEAR LOGHEAD-LEQ)) (54 39 (:REWRITE DEFAULT-<-2)) (50 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (49 49 (:REWRITE TOP-BIT-MEANS-<)) (49 49 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (49 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (45 39 (:REWRITE DEFAULT-<-1)) (44 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (32 24 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (29 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (14 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1))) (LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE (329 5 (:REWRITE LOGHEAD-IDENTITY)) (299 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (246 246 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (94 70 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (76 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (48 29 (:REWRITE DEFAULT-<-2)) (46 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (40 4 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 29 (:REWRITE DEFAULT-<-1)) (38 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (38 3 (:LINEAR LOGHEAD-LEQ)) (36 6 (:LINEAR EXPT->-1)) (34 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (27 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE RATIONALP-+)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE (113 4 (:REWRITE SBP-BOUND)) (48 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 19 (:REWRITE DEFAULT-<-1)) (31 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (31 19 (:REWRITE DEFAULT-<-2)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (24 24 (:REWRITE TOP-BIT-MEANS-<)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (21 2 (:LINEAR EXPT->-1)) (20 13 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:DEFINITION FIX)) (12 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO (175 5 (:REWRITE SBP-BOUND)) (64 28 (:REWRITE DEFAULT-<-1)) (59 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (55 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 21 (:REWRITE DEFAULT-+-2)) (45 28 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 21 (:REWRITE DEFAULT-+-1)) (31 3 (:LINEAR EXPT->-1)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (10 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (7 7 (:REWRITE SBP-BOUND-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE RATIONALP-+)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE (263 247 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (198 4 (:REWRITE SBP-BOUND)) (93 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (68 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (61 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE DEFAULT-<-1)) (41 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (41 4 (:LINEAR EXPT->-1)) (39 27 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (37 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 23 (:REWRITE DEFAULT-<-2)) (33 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (32 32 (:REWRITE TOP-BIT-MEANS-<)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 13 (:REWRITE DEFAULT-+-1)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR (357 357 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (49 24 (:REWRITE DEFAULT-<-1)) (47 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 24 (:REWRITE DEFAULT-<-2)) (31 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE TOP-BIT-MEANS-<)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (21 13 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 1 (:REWRITE SBP-BOUND)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SB-FREE-BACKCHAIN (140 4 (:REWRITE SBP-BOUND)) (24 12 (:REWRITE DEFAULT-+-2)) (21 12 (:REWRITE DEFAULT-+-1)) (19 8 (:REWRITE DEFAULT-<-1)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 8 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (SB-FREE-BACKCHAIN1 (200 4 (:REWRITE SBP-BOUND)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (33 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (30 18 (:REWRITE DEFAULT-+-2)) (27 18 (:REWRITE DEFAULT-+-1)) (22 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 8 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE DEFAULT-<-2)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (11 11 (:REWRITE EXPONENTS-ADD)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (UNSIGNED-BYTE-P-LOGAPP-BETTER (181 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (146 9 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (101 101 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (95 70 (:REWRITE DEFAULT-<-1)) (86 86 (:REWRITE TOP-BIT-MEANS-<)) (86 86 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 70 (:REWRITE DEFAULT-<-2)) (79 67 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (78 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (51 6 (:LINEAR EXPT->-1)) (44 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (44 3 (:REWRITE SBP-BOUND)) (43 37 (:REWRITE DEFAULT-+-2)) (40 40 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (39 37 (:REWRITE DEFAULT-+-1)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (17 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 1 (:REWRITE LOGHEAD-IDENTITY)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 3 (:REWRITE ASH-0)) (12 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 4 (:REWRITE IFIX-INTEGERP)) (6 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (ASH-<=-TO-SBP (197 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (172 2 (:REWRITE <-*-/-LEFT)) (135 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (100 2 (:REWRITE EXPONENTS-ADD)) (88 2 (:REWRITE EXPT-MINUS)) (70 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 3 (:LINEAR X*Y>1-POSITIVE)) (56 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (42 23 (:REWRITE DEFAULT-<-2)) (36 36 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 3 (:LINEAR EXPT->-1)) (30 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 1 (:REWRITE ASH-BOUND3)) (25 23 (:REWRITE DEFAULT-<-1)) (25 7 (:REWRITE DEFAULT-*-2)) (22 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (19 7 (:REWRITE DEFAULT-*-1)) (18 2 (:REWRITE COMMUTATIVITY-OF-*)) (17 1 (:REWRITE EQUAL-1-HACK)) (16 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 3 (:REWRITE ASH-0)) (12 1 (:REWRITE INTEGERP-EXPT)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (11 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE <-1-EXPT)) (8 1 (:REWRITE EQUAL-BIT-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 1 (:REWRITE ASH-BOUND4A)) (6 1 (:REWRITE ASH-BOUND2A)) (6 1 (:REWRITE ASH-BOUND1)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 1 (:REWRITE DEFAULT-NUMERATOR))) (LOGEXT-BOUNDS-2 (518 8 (:REWRITE LOGEXT-IDENTITY)) (159 159 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 4 (:REWRITE SBP-BOUND)) (136 8 (:LINEAR LOGCAR-RANGE-LINEAR)) (110 10 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (98 3 (:LINEAR LOGEXT-BOUNDS)) (96 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 10 (:REWRITE LOGCAR-IDENTITY)) (60 6 (:LINEAR EXPT->-1)) (52 48 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 10 (:REWRITE LOGCAR-EVENP)) (34 34 (:REWRITE TOP-BIT-MEANS-<)) (34 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (33 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 18 (:REWRITE DEFAULT-<-1)) (29 17 (:REWRITE DEFAULT-+-1)) (26 18 (:REWRITE DEFAULT-<-2)) (25 17 (:REWRITE DEFAULT-+-2)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (22 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (20 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (12 2 (:REWRITE COMMUTATIVITY-OF-+)) (10 10 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 10 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE RATIONALP-+))) (BITP-SIGNED-BYTE-P-32 (8 1 (:REWRITE EQUAL-BIT-1)) (2 2 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (NEGATIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 2 (:LINEAR MOD-TYPE . 2)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (40 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (26 18 (:REWRITE DEFAULT-<-2)) (26 18 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (18 18 (:REWRITE TOP-BIT-MEANS-<)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (POSITIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (50 2 (:LINEAR MOD-TYPE . 2)) (45 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (41 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (28 20 (:REWRITE DEFAULT-<-2)) (28 20 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (20 20 (:REWRITE TOP-BIT-MEANS-<)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-NON-ZERO-TYPE (28 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 4 (:LINEAR LOGHEAD-BOUND)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (10 4 (:LINEAR LOGHEAD-LEQ)) (5 1 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-OF-LOGCAR (272 12 (:REWRITE LOGCAR-IDENTITY)) (56 12 (:REWRITE LOGCAR-EVENP)) (38 34 (:REWRITE DEFAULT-<-1)) (37 34 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE EXPT-COMPARE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 1 (:REWRITE EQUAL-BIT-1)) (23 15 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (21 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE EQUAL-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (SIGNED-BYTE-P-OF-LOGCAR (109 7 (:REWRITE MOD-=-0 . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (63 28 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (62 35 (:REWRITE DEFAULT-<-1)) (44 35 (:REWRITE DEFAULT-<-2)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 39 (:REWRITE EXPT-COMPARE)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (37 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE DEFAULT-*-2)) (25 25 (:REWRITE DEFAULT-*-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 7 (:REWRITE FOLD-CONSTS-IN-*)) (18 1 (:LINEAR MOD-TYPE . 2)) (16 16 (:REWRITE INTEGERP-+-MINUS-*-4)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 1 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE DEFAULT-+-2)) (9 2 (:REWRITE EQUAL-1-HACK)) (7 7 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE DEFAULT-+-1)) (6 2 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGBITP-TEST-OF-TOP-BIT (765 363 (:REWRITE DEFAULT-*-2)) (705 363 (:REWRITE DEFAULT-*-1)) (510 50 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (493 5 (:REWRITE RTL1)) (456 182 (:REWRITE DEFAULT-+-2)) (418 418 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (358 31 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (302 38 (:REWRITE POWER2-INTEGER)) (283 5 (:REWRITE FLOOR-=-X/Y . 3)) (267 8 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (252 240 (:REWRITE EXPT-COMPARE)) (239 239 (:REWRITE TOP-BIT-MEANS-<)) (239 239 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (222 182 (:REWRITE DEFAULT-+-1)) (213 159 (:REWRITE DEFAULT-<-1)) (213 61 (:REWRITE EXPT-COMPARE-EQUAL)) (209 209 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (195 159 (:REWRITE DEFAULT-<-2)) (187 19 (:REWRITE INTEGERP-+-MINUS-*-4)) (147 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (125 25 (:REWRITE DEFAULT-UNARY-/)) (104 1 (:REWRITE EVENP-COLLECT-1)) (93 15 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (92 7 (:REWRITE EVENP-COLLAPSE)) (87 3 (:REWRITE EVENP-*)) (85 1 (:REWRITE EVENP-+)) (83 5 (:REWRITE FLOOR-=-X/Y . 2)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (65 5 (:REWRITE FLOOR-DETERMINED-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (63 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (61 5 (:REWRITE FLOOR-SIMPLE-CASES)) (58 8 (:LINEAR EXPT->-1)) (57 19 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (55 55 (:TYPE-PRESCRIPTION POWER2P)) (53 2 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 9 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (34 34 (:REWRITE POWER2P-EXPT2-I)) (32 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (27 27 (:REWRITE EXPO-EXPT2)) (23 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 5 (:REWRITE FLOOR-TYPE-3 . 3)) (23 5 (:REWRITE FLOOR-TYPE-3 . 2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:REWRITE FOLD-CONSTS-IN-*)) (21 1 (:LINEAR X*Y>1-POSITIVE)) (20 5 (:REWRITE FLOOR-TYPE-4 . 3)) (20 5 (:REWRITE FLOOR-TYPE-4 . 2)) (20 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (18 18 (:REWRITE SBP-BOUND-1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 7 (:REWRITE POWER2P-INVERSE)) (14 1 (:REWRITE EVENP-+-ALT)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (13 1 (:REWRITE SBP-BOUND)) (12 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 1 (:REWRITE DISTRIBUTIVITY)) (10 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 1 (:REWRITE POWER2P-SHIFT-2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-PROD-3)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGBITP-TEST-OF-TOP-BIT-ALT (297 5 (:REWRITE RTL1)) (194 3 (:REWRITE FLOOR-=-X/Y . 3)) (93 17 (:REWRITE POWER2-INTEGER)) (91 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (69 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (62 46 (:REWRITE DEFAULT-<-2)) (58 8 (:LINEAR EXPT->-1)) (56 56 (:REWRITE TOP-BIT-MEANS-<)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (55 3 (:REWRITE FLOOR-=-X/Y . 2)) (54 46 (:REWRITE DEFAULT-<-1)) (53 5 (:REWRITE FLOOR-DETERMINED-1)) (47 14 (:REWRITE DEFAULT-*-2)) (45 15 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (37 37 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (35 9 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (25 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 7 (:REWRITE EXPT-COMPARE-EQUAL)) (20 12 (:REWRITE DEFAULT-+-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (18 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 3 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-*-1)) (14 12 (:REWRITE DEFAULT-+-1)) (13 3 (:REWRITE FLOOR-TYPE-3 . 3)) (13 1 (:REWRITE SBP-BOUND)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE EVENP-COLLAPSE)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE SBP-BOUND-1)) (8 3 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (7 5 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (4 2 (:REWRITE POWER2P-INVERSE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGHEAD-LOGCDR (58 3 (:REWRITE LOGHEAD-IDENTITY)) (44 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (18 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (7 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 5 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE DEFAULT-<-1)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-+-LOGHEAD-SIMPLE (140 3 (:REWRITE LOGBITP-+-TOO-BIG)) (48 6 (:REWRITE LOGHEAD-IDENTITY)) (41 2 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (29 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 6 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE DEFAULT-+-1)) (6 6 (:META META-RULE-ERIC)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (95 95 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (79 41 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (44 44 (:REWRITE TOP-BIT-MEANS-<)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (41 41 (:REWRITE POWER2-INTEGER)) (41 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (34 28 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (115 115 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 39 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (47 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 43 (:REWRITE TOP-BIT-MEANS-<)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (39 39 (:REWRITE POWER2-INTEGER)) (39 27 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (33 27 (:REWRITE DEFAULT-<-1)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (*ARK*-LOGAND-B-AND (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-IOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-XOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (22 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE B-NOT-OPEN-1)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (6 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (*ARK*-LOGAND-LOGCAR (132 20 (:REWRITE LOGCAR-IDENTITY)) (100 20 (:REWRITE LOGCAR-EVENP)) (52 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (48 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (35 35 (:REWRITE POWER2-INTEGER)) (35 35 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 32 (:TYPE-PRESCRIPTION EVENP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (LOGXOR-1 (11 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (5 1 (:REWRITE LOGAND---EXPT-REWRITE)) (4 4 (:TYPE-PRESCRIPTION LOGNOT)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 1 (:REWRITE LOGNOT-ZIP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE B-NOT-OPEN-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 1 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (IFIX-LOGXOR (4 2 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-REWRITE)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (EQUAL-LOGCAR-1 (38 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 4 (:REWRITE LOGCAR-IDENTITY)) (19 4 (:REWRITE LOGCAR-EVENP)) (11 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 4 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGCAR-OF-B-XOR (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 3 (:REWRITE LOGCAR-EVENP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (6 4 (:REWRITE B-NOT-OPEN-1)) (6 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION BITP-OF-B-IOR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION))) (LOGCAR-OF-B-AND (32 4 (:REWRITE EQUAL-BIT-1)) (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 3 (:REWRITE LOGCAR-EVENP)) (12 4 (:REWRITE EQUAL-1-HACK)) (12 4 (:REWRITE BFIX-BITP)) (10 3 (:REWRITE LOGCAR-IDENTITY)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:TYPE-PRESCRIPTION BITP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEXT-BOUND-2 (103 7 (:REWRITE LOGEXT-IDENTITY)) (52 2 (:LINEAR LOGEXT-BOUNDS)) (48 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 12 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE EXPT-COMPARE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-BOUND-REWRITE-1) (LOGEXT-BOUND-REWRITE-2) (LOGEXT-BOUND-UPPER (111 111 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (13 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE EXPONENTS-ADD)) (8 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-LOGHEAD-BETTER (811 35 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (451 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (286 41 (:REWRITE LOGCAR-IDENTITY)) (188 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 114 (:REWRITE EXPT-COMPARE)) (164 15 (:REWRITE LOGHEAD-IDENTITY)) (136 100 (:REWRITE DEFAULT-<-2)) (125 125 (:REWRITE POWER2-INTEGER)) (125 125 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (116 100 (:REWRITE DEFAULT-<-1)) (113 43 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (110 110 (:REWRITE TOP-BIT-MEANS-<)) (97 97 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (90 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (85 85 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (77 77 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (72 35 (:REWRITE LOGBITP-TOO-BIG)) (72 4 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (64 64 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (37 3 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (36 9 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (36 4 (:LINEAR LOGHEAD-LEQ)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 3 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (27 27 (:REWRITE EXPT-COMPARE-EQUAL)) (27 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (26 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 10 (:REWRITE IFIX-INTEGERP)) (21 21 (:REWRITE LOGHEAD-SUBST2)) (21 21 (:REWRITE LOGHEAD-SUBST)) (21 21 (:META META-RULE-ERIC)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (11 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 5 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE POWER2P-EXPT2-I)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1))) (LOGBIT-LOGHEAD-BETTER (548 6 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (504 14 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (486 16 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (469 75 (:REWRITE EXPT-COMPARE-EQUAL)) (392 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (352 80 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (195 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (183 183 (:REWRITE EXPT-COMPARE)) (182 182 (:REWRITE TOP-BIT-MEANS-<)) (167 150 (:REWRITE DEFAULT-<-2)) (154 150 (:REWRITE DEFAULT-<-1)) (137 18 (:REWRITE LOGCAR-IDENTITY)) (126 21 (:REWRITE EQUAL-BIT-1)) (126 14 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (125 8 (:LINEAR LOGHEAD-LEQ)) (117 3 (:REWRITE LOGHEAD-OF-MINUS)) (116 17 (:REWRITE <-+-CONSTANT-CONSTANT)) (112 112 (:REWRITE POWER2-INTEGER)) (112 112 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (112 14 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (107 18 (:REWRITE LOGCAR-EVENP)) (101 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (95 95 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (93 21 (:REWRITE EQUAL-1-HACK)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (79 55 (:REWRITE DEFAULT-+-2)) (71 71 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 55 (:REWRITE DEFAULT-+-1)) (66 21 (:REWRITE EXPO-OF-NOT-RATIONALP)) (66 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (65 18 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (57 3 (:REWRITE LOGBITP-+-TOO-BIG)) (55 55 (:REWRITE LOGHEAD-SUBST2)) (55 55 (:REWRITE LOGHEAD-SUBST)) (55 55 (:META META-RULE-ERIC)) (54 3 (:REWRITE <-*-0)) (52 49 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 28 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (27 27 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 21 (:REWRITE EXPO-EXPT2)) (24 3 (:REWRITE NORMALIZE-EQUAL-0)) (21 21 (:REWRITE POWER2P-EXPT2-I)) (21 21 (:REWRITE EXPO-MINUS-ERIC)) (21 3 (:DEFINITION IFF)) (19 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD-SIMPLE)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD)) (18 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-1+)) (13 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (9 5 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 1 (:REWRITE LOGCONS-<-0)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT))) (LOGCAR-LOGAPP-BETTER (230 34 (:REWRITE LOGCAR-IDENTITY)) (210 35 (:REWRITE LOGCAR-EVENP)) (120 34 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (114 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (96 56 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (56 56 (:REWRITE POWER2-INTEGER)) (56 5 (:REWRITE B-NOT-OPEN-1)) (36 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (34 1 (:REWRITE EVENP-+-ALT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:TYPE-PRESCRIPTION NFIX)) (20 20 (:TYPE-PRESCRIPTION IFIX)) (15 1 (:REWRITE LOGHEAD-IDENTITY)) (14 1 (:REWRITE EVENP-*)) (12 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE EVENP-OF-LOGHEAD)) (6 2 (:REWRITE IFIX-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-LOGAPP-BETTER (1177 220 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (910 126 (:REWRITE LOGCAR-IDENTITY)) (468 32 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (416 416 (:REWRITE TOP-BIT-MEANS-<)) (416 416 (:REWRITE EXPT-COMPARE)) (404 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (362 319 (:REWRITE DEFAULT-<-2)) (360 319 (:REWRITE DEFAULT-<-1)) (287 257 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (260 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (257 257 (:REWRITE POWER2-INTEGER)) (228 220 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (220 220 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (208 112 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 174 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (155 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z)) (154 154 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (132 124 (:REWRITE DEFAULT-+-2)) (128 124 (:REWRITE DEFAULT-+-1)) (121 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (107 107 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (102 102 (:REWRITE LOGBITP-TOO-BIG)) (98 2 (:REWRITE SBP-BOUND)) (87 9 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (73 73 (:REWRITE EXPT-COMPARE-EQUAL)) (73 14 (:REWRITE INTEGERP-UNARY-)) (70 7 (:REWRITE LOGHEAD-IDENTITY)) (66 10 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (61 3 (:DEFINITION MAX)) (58 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (54 18 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (38 36 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (36 36 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (35 19 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (34 31 (:REWRITE DEFAULT-UNARY-MINUS)) (34 6 (:LINEAR EXPT->-1)) (32 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (30 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (24 12 (:DEFINITION FIX)) (22 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 14 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (18 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (16 4 (:REWRITE ASH-0)) (16 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 2 (:REWRITE <-0-+-NEGATIVE-1)) (16 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (13 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE RATIONALP-UNARY--)) (10 5 (:REWRITE RATIONALP-+)) (10 2 (:REWRITE FOLD-CONSTS-IN-+)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-ZERO)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0))) (LOGEXT-OF-LOGEXT-SAME (1020 973 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (646 304 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (498 10 (:REWRITE LOGHEAD-IDENTITY)) (394 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (344 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (336 75 (:REWRITE INTEGERP-+-MINUS-*-2)) (304 304 (:REWRITE POWER2-INTEGER)) (264 132 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (261 12 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (175 175 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (141 141 (:REWRITE TOP-BIT-MEANS-<)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (141 141 (:REWRITE EXPT-COMPARE)) (136 71 (:REWRITE FIX-DOES-NOTHING)) (136 31 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (129 86 (:REWRITE DEFAULT-<-1)) (127 127 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (126 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (120 9 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (115 86 (:REWRITE DEFAULT-<-2)) (108 12 (:LINEAR LOGHEAD-LEQ)) (107 75 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (99 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (94 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (92 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 56 (:REWRITE RATIONALP-+)) (82 6 (:LINEAR EXPT->-1)) (78 3 (:REWRITE NORMALIZE-EQUAL-0)) (68 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (64 37 (:REWRITE DEFAULT-+-2)) (64 8 (:REWRITE LOGCAR-IDENTITY)) (56 8 (:REWRITE INTEGERP-UNARY-)) (52 50 (:META META-RULE-ERIC)) (51 3 (:REWRITE EQUAL-MINUS-MINUS)) (50 37 (:REWRITE DEFAULT-+-1)) (49 49 (:REWRITE LOGHEAD-SUBST2)) (45 8 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 8 (:REWRITE INTEGERP-+-MINUS-*-1)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (26 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (25 8 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (24 3 (:REWRITE EQUAL-BIT-1)) (23 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 4 (:REWRITE RATIONALP-UNARY--)) (14 1 (:REWRITE IFIX-INTEGERP)) (14 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (12 12 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (11 6 (:REWRITE DEFAULT-UNARY-MINUS)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 3 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-1+)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (LOGEXT-+-LOGEXT-BETTER-ALT (165 6 (:LINEAR LOGEXT-BOUND-UPPER)) (107 8 (:REWRITE LOGEXT-IDENTITY)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (60 33 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 33 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE TOP-BIT-MEANS-<)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (28 18 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE POWER2-INTEGER)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (16 10 (:REWRITE DEFAULT-+-2)) (15 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE DEFAULT-+-1)) (9 9 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (9 9 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 6 (:REWRITE FIX-DOES-NOTHING)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE LOGEXT-+-CANCEL)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-OF-PRODUCT-WITH-2 (974 69 (:REWRITE POWER2-INTEGER)) (743 4 (:REWRITE FLOOR-=-X/Y . 3)) (712 46 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (524 14 (:REWRITE <-*-/-LEFT)) (504 9 (:REWRITE <-*-Y-X-Y)) (424 13 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (410 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (300 6 (:REWRITE 0-<-*)) (280 4 (:REWRITE RTL1)) (280 4 (:REWRITE FLOOR-SIMPLE-CASES)) (280 4 (:REWRITE FLOOR-DETERMINED-1)) (261 6 (:REWRITE <-*-0)) (249 5 (:REWRITE EVENP-COLLAPSE)) (243 4 (:REWRITE FLOOR-TYPE-3 . 3)) (236 27 (:REWRITE INTEGERP-+-MINUS-*-4)) (232 4 (:REWRITE FLOOR-TYPE-4 . 2)) (222 37 (:LINEAR X*Y>1-POSITIVE)) (219 4 (:REWRITE FLOOR-TYPE-3 . 2)) (217 4 (:REWRITE FLOOR-TYPE-4 . 3)) (215 215 (:REWRITE TOP-BIT-MEANS-<)) (215 215 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (215 215 (:REWRITE EXPT-COMPARE)) (207 11 (:REWRITE EXPO-SHIFT-CONSTANT)) (198 21 (:REWRITE EXPO-/-POWER2P-ALT)) (196 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (185 14 (:REWRITE <-*-/-RIGHT)) (184 63 (:REWRITE EXPT-COMPARE-EQUAL)) (179 79 (:REWRITE DEFAULT-*-2)) (177 4 (:REWRITE EVENP-*)) (160 124 (:REWRITE DEFAULT-<-2)) (148 14 (:REWRITE NORMALIZE-EQUAL-0)) (136 18 (:LINEAR EXPT->-1)) (134 13 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (129 12 (:DEFINITION IFF)) (126 124 (:REWRITE DEFAULT-<-1)) (126 13 (:REWRITE INTEGERP-PROD-3)) (112 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (111 21 (:REWRITE COMMUTATIVITY-OF-+)) (102 7 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 4 (:REWRITE FLOOR-=-X/Y . 2)) (97 79 (:REWRITE DEFAULT-*-1)) (91 29 (:REWRITE EXPO-OF-NOT-RATIONALP)) (87 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (77 29 (:REWRITE FOLD-CONSTS-IN-*)) (67 67 (:TYPE-PRESCRIPTION POWER2P)) (62 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 56 (:REWRITE DEFAULT-+-2)) (59 56 (:REWRITE DEFAULT-+-1)) (53 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 50 (:REWRITE POWER2P-EXPT2-I)) (45 21 (:REWRITE UNICITY-OF-0)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (42 21 (:REWRITE POWER2P-INVERSE)) (40 11 (:REWRITE POWER2P-SHIFT-2)) (33 29 (:REWRITE EXPO-EXPT2)) (32 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (31 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (29 29 (:REWRITE EXPO-MINUS-ERIC)) (26 23 (:REWRITE DEFAULT-UNARY-MINUS)) (24 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 4 (:REWRITE DEFAULT-UNARY-/)) (20 15 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (17 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE TIMES-ZERO)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 13 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 8 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-+)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGBITP-OF-PRODUCT-WITH-1/2 (1584 78 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1522 12 (:REWRITE FLOOR-=-X/Y . 3)) (1184 104 (:REWRITE POWER2-INTEGER)) (993 40 (:REWRITE <-*-/-LEFT)) (401 12 (:REWRITE RTL1)) (401 12 (:REWRITE FLOOR-SIMPLE-CASES)) (401 12 (:REWRITE FLOOR-DETERMINED-1)) (399 8 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (383 61 (:REWRITE INTEGERP-+-MINUS-*-4)) (371 56 (:LINEAR X*Y>1-POSITIVE)) (351 131 (:REWRITE DEFAULT-*-2)) (330 8 (:REWRITE EVENP-*)) (320 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (300 8 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (279 279 (:REWRITE TOP-BIT-MEANS-<)) (279 279 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (279 279 (:REWRITE EXPT-COMPARE)) (265 12 (:REWRITE FLOOR-TYPE-3 . 3)) (265 12 (:REWRITE FLOOR-TYPE-3 . 2)) (253 196 (:REWRITE DEFAULT-<-2)) (249 12 (:REWRITE FLOOR-TYPE-4 . 3)) (249 12 (:REWRITE FLOOR-TYPE-4 . 2)) (234 26 (:REWRITE EXPO-/-POWER2P-ALT)) (230 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (210 30 (:LINEAR EXPT->-1)) (210 16 (:REWRITE <-*-/-RIGHT)) (203 196 (:REWRITE DEFAULT-<-1)) (202 12 (:REWRITE FLOOR-=-X/Y . 2)) (187 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (166 131 (:REWRITE DEFAULT-*-1)) (130 26 (:REWRITE COMMUTATIVITY-OF-+)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (104 104 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (100 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (96 32 (:REWRITE EXPO-OF-NOT-RATIONALP)) (82 61 (:REWRITE DEFAULT-+-2)) (80 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (69 69 (:TYPE-PRESCRIPTION POWER2P)) (66 33 (:REWRITE FOLD-CONSTS-IN-*)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 30 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (61 61 (:REWRITE DEFAULT-+-1)) (61 13 (:REWRITE EXPT-COMPARE-EQUAL)) (60 60 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (58 58 (:REWRITE POWER2P-EXPT2-I)) (52 26 (:REWRITE UNICITY-OF-0)) (52 26 (:REWRITE POWER2P-INVERSE)) (40 8 (:REWRITE DEFAULT-UNARY-/)) (36 30 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (32 32 (:REWRITE EXPO-MINUS-ERIC)) (32 32 (:REWRITE EXPO-EXPT2)) (30 30 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE DEFAULT-UNARY-MINUS)) (20 5 (:REWRITE POWER2P-SHIFT-2)) (18 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE SBP-BOUND-1)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-PROD-3)) (6 6 (:REWRITE ODDP-OF-*)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (5 5 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE ODDP-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGBITP-OF-*-EXPT-2-SPECIAL (309 24 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (158 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (95 18 (:REWRITE LOGCAR-IDENTITY)) (76 28 (:REWRITE DEFAULT-*-2)) (68 21 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (62 46 (:REWRITE DEFAULT-<-2)) (57 57 (:REWRITE TOP-BIT-MEANS-<)) (57 57 (:REWRITE EXPT-COMPARE)) (56 56 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (54 46 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE POWER2-INTEGER)) (42 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (42 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 28 (:REWRITE DEFAULT-*-1)) (37 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 36 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 24 (:REWRITE LOGBITP-TOO-BIG)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (18 18 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE ZIP-OPEN))) (LOGBITP-OF-*-EXPT-2-SPECIAL-CONST (96 7 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (51 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 9 (:REWRITE LOGCAR-IDENTITY)) (19 15 (:REWRITE DEFAULT-<-2)) (17 15 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 8 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (9 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC))) (THE-CHECK-NOOP) (LOGAND-BOUND (74 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (43 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGNOT-BOUND (16 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 3 (:REWRITE LOGNOT-ZIP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (5 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 3 (:REWRITE ZIP-OPEN)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGEQV-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGIOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (5 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGXOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGXOR-BIT-BOUND (4 4 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGIOR-BOUND1) (LOGAND-BOUND-REWRITE-1 (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-BOUND-REWRITE-2 (3 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (ASH--15-HACK (17 1 (:REWRITE ASH-BOUND4)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:REWRITE ASH-BOUND2)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 1 (:REWRITE ASH-0)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0))) (ASH--8-HACK (17 1 (:REWRITE ASH-BOUND4)) (17 1 (:REWRITE ASH-BOUND3)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (6 1 (:REWRITE ASH-BOUND2)) (6 1 (:REWRITE ASH-BOUND1)) (6 1 (:REWRITE <-*-/-RIGHT-COMMUTED)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 1 (:REWRITE ASH-BOUND2A)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-BOUND4A))) (LOGIOR-BOUND-REWRITE-7 (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (*ARK*-+* (2116 1460 (:REWRITE DEFAULT-+-2)) (1790 1460 (:REWRITE DEFAULT-+-1)) (1459 1071 (:REWRITE DEFAULT-*-2)) (1071 1071 (:REWRITE DEFAULT-*-1)) (934 788 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (780 780 (:REWRITE EXPT-COMPARE-EQUAL)) (680 105 (:REWRITE EQUAL-1-HACK)) (552 398 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (443 279 (:REWRITE SUM-POWER-OF-TWO)) (435 58 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (174 29 (:REWRITE <-+-CONSTANT-CONSTANT)) (169 169 (:REWRITE POWER2-INTEGER)) (123 41 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (96 32 (:REWRITE BFIX-BITP)) (92 92 (:TYPE-PRESCRIPTION BITP)) (89 89 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (89 89 (:REWRITE EXPT-COMPARE)) (78 14 (:REWRITE EQUAL-LOGCONS)) (75 66 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE DEFAULT-UNARY-MINUS)) (41 41 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (41 41 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (31 31 (:REWRITE DEFAULT-<-2)) (31 31 (:REWRITE DEFAULT-<-1)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:TYPE-PRESCRIPTION LOGCDR-LOGCDR-INDUCTION))) (*ARK*-SIGNED-BYTE-P-+-BRIDGE (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (*ARK*-SIGNED-BYTE-P-31-23-BRIDGE (4 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (SIGNED-BYTE-P-32-BRIDGE (8 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (SIGNED-BYTE-P-32-BRIDGE2 (44 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (25 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 2 (:REWRITE ERIC9)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-32-+-BRIDGE (17 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (6 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-+--EXPT-17-BRIDGE (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-LOGHEAD-7-65535 (26 2 (:REWRITE MOD-=-0 . 2)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (13 1 (:LINEAR MOD-TYPE . 2)) (12 8 (:REWRITE DEFAULT-<-2)) (12 8 (:REWRITE DEFAULT-<-1)) (12 3 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (9 6 (:REWRITE DEFAULT-*-2)) (9 6 (:REWRITE DEFAULT-*-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-31-LOGCDR-BRIDGE (187 14 (:REWRITE MOD-=-0 . 2)) (185 15 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (169 98 (:REWRITE DEFAULT-*-2)) (167 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (158 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (121 98 (:REWRITE DEFAULT-*-1)) (104 74 (:REWRITE DEFAULT-<-2)) (104 74 (:REWRITE DEFAULT-<-1)) (90 90 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (90 90 (:REWRITE EXPT-COMPARE)) (90 50 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (88 87 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (78 6 (:LINEAR MOD-TYPE . 2)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 50 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 40 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (35 17 (:REWRITE DEFAULT-+-2)) (33 33 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 15 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (24 2 (:LINEAR FLOOR-TYPE-2 . 2)) (24 2 (:LINEAR FLOOR-TYPE-2 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (22 14 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 2 (:LINEAR FLOOR-TYPE-1 . 2)) (22 2 (:LINEAR FLOOR-TYPE-1 . 1)) (17 17 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (10 2 (:REWRITE CANCEL-MOD-+-BASIC)) (6 6 (:LINEAR MOD-TYPE . 3)) (6 6 (:LINEAR MOD-TYPE . 1)) (6 1 (:REWRITE DISTRIBUTIVITY-ALT)) (6 1 (:DEFINITION IFIX)) (4 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (*ARK*-LOGAND-BIT-CONSTANT (714 7 (:DEFINITION BINARY-LOGAND)) (252 14 (:REWRITE FLOOR-BY-TWICE-HACK)) (182 14 (:REWRITE FLOOR-OF-SHIFT-RIGHT-2)) (126 21 (:REWRITE COMMUTATIVITY-OF-+)) (84 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 56 (:REWRITE DEFAULT-+-2)) (77 56 (:REWRITE DEFAULT-+-1)) (70 63 (:REWRITE DEFAULT-*-2)) (70 14 (:REWRITE FOLD-CONSTS-IN-*)) (63 63 (:REWRITE DEFAULT-*-1)) (56 56 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (42 28 (:REWRITE FIX-DOES-NOTHING)) (42 14 (:REWRITE UNICITY-OF-0)) (42 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (36 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (36 9 (:REWRITE LOGCAR-EVENP)) (32 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (28 28 (:TYPE-PRESCRIPTION LOGMASKP)) (28 28 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (28 14 (:REWRITE UNICITY-OF-1)) (17 9 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE POWER2-INTEGER)) (14 14 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION IFIX)) (7 7 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGIOR-LOGXOR (123 16 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (30 16 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (27 16 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (16 16 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGNOT-ZIP)) (12 8 (:REWRITE LOGAND-WITH-MASK-ERIC)) (12 8 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION LOGNOT)) (8 8 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGIOR-LOGIOR-CONST)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE ZIP-OPEN))) (LOGXOR-LOGIOR (153 23 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (76 8 (:REWRITE LOGNOT-ZIP)) (63 2 (:REWRITE ZIP-OPEN)) (49 30 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (48 30 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (46 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (42 30 (:REWRITE LOGAND-WITH-MASK-ERIC)) (40 23 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (40 23 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (23 23 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE LOGIOR-LOGIOR-CONST)) (5 1 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGIOR-=-0)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE EQUAL-LOGIOR-CONST-CONST))) (*ARK*-FOLD-IN-TWO-CROCK (137 43 (:REWRITE DEFAULT-*-2)) (84 84 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (64 7 (:REWRITE ZIP-OPEN)) (60 12 (:LINEAR X*Y>1-POSITIVE)) (43 43 (:REWRITE DEFAULT-*-1)) (43 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (34 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (33 27 (:REWRITE DEFAULT-+-1)) (33 3 (:REWRITE NORMALIZE-EQUAL-0)) (32 32 (:REWRITE EXPT-COMPARE)) (27 27 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-<-2)) (26 26 (:REWRITE DEFAULT-<-1)) (24 3 (:REWRITE EQUAL-MINUS-MINUS)) (16 4 (:REWRITE SUM-POWER-OF-TWO)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:REWRITE EXPT-2-CRUNCHER)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EXPO-MINUS-ERIC))) (*ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE (56 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (17 1 (:REWRITE EQUAL-1-HACK)) (15 2 (:REWRITE POWER2-INTEGER)) (5 3 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (*ARK*-ASH-POS-LOGHEAD-CHEATER (4324 55 (:REWRITE LOGHEAD-IDENTITY)) (4167 125 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (2807 51 (:DEFINITION UNSIGNED-BYTE-P*)) (746 719 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (676 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (618 618 (:REWRITE EXPT-COMPARE)) (553 553 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (512 153 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (374 374 (:REWRITE DEFAULT-<-2)) (374 374 (:REWRITE DEFAULT-<-1)) (351 17 (:REWRITE ZIP-OPEN)) (331 21 (:REWRITE ASH-0)) (297 27 (:REWRITE NORMALIZE-EQUAL-0)) (288 12 (:DEFINITION EXPT)) (278 278 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (244 244 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (239 223 (:REWRITE DEFAULT-+-2)) (226 223 (:REWRITE DEFAULT-+-1)) (216 27 (:REWRITE EQUAL-MINUS-MINUS)) (179 179 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (174 151 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (153 153 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (135 27 (:REWRITE SUM-POWER-OF-TWO)) (135 27 (:REWRITE EQUAL-1-HACK)) (119 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (119 64 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (115 115 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (113 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (99 99 (:REWRITE EXPT-COMPARE-EQUAL)) (66 6 (:LINEAR LOGHEAD-LEQ)) (64 64 (:META META-RULE-ERIC)) (64 25 (:REWRITE ASH-GOES-TO-0)) (63 40 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 38 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (60 45 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (60 27 (:REWRITE DEFAULT-*-2)) (50 25 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (48 33 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (46 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (44 26 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (39 12 (:REWRITE COMMUTATIVITY-OF-+)) (35 25 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (32 32 (:REWRITE LOGHEAD-SUBST)) (27 27 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (27 27 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE DEFAULT-*-1)) (27 9 (:REWRITE EXPT-2-CRUNCHER)) (23 23 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (21 3 (:REWRITE LOGCDR-<-0)) (13 13 (:TYPE-PRESCRIPTION ZIP)) (9 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (*ARK*-ASH-POS-LOGHEAD-CHEATER2 (8591 131 (:REWRITE LOGHEAD-IDENTITY)) (8032 237 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5344 109 (:DEFINITION UNSIGNED-BYTE-P*)) (1448 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1258 1258 (:REWRITE EXPT-COMPARE)) (1104 299 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1095 1095 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (774 766 (:REWRITE DEFAULT-<-2)) (766 766 (:REWRITE DEFAULT-<-1)) (644 90 (:REWRITE EQUAL-1-HACK)) (638 557 (:REWRITE DEFAULT-+-2)) (565 557 (:REWRITE DEFAULT-+-1)) (536 536 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (526 74 (:REWRITE ASH-0)) (472 472 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (448 12 (:REWRITE ZIP-OPEN)) (373 77 (:REWRITE SUM-POWER-OF-TWO)) (363 88 (:REWRITE LOGCAR-EVENP)) (340 293 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (299 299 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (271 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (260 260 (:REWRITE EXPT-COMPARE-EQUAL)) (257 140 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (239 239 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 150 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (192 129 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (184 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (156 78 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (148 79 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (140 140 (:META META-RULE-ERIC)) (140 12 (:LINEAR LOGHEAD-LEQ)) (135 88 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (129 82 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (115 78 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (99 46 (:REWRITE DEFAULT-*-2)) (90 82 (:REWRITE DEFAULT-UNARY-MINUS)) (78 78 (:REWRITE ASH-GOES-TO-0)) (74 74 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (70 70 (:REWRITE LOGHEAD-SUBST2)) (70 70 (:REWRITE LOGHEAD-SUBST)) (61 61 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (49 7 (:REWRITE LOGCDR-<-0)) (46 46 (:REWRITE DEFAULT-*-1)) (21 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 18 (:REWRITE POWER2-INTEGER)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (ASH-LOGXOR (504 4 (:REWRITE ASH-0)) (496 4 (:REWRITE ZIP-OPEN)) (204 8 (:LINEAR LOGAND-BOUND)) (160 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (136 8 (:LINEAR LOGNOT-BOUND)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (68 4 (:REWRITE SIGNED-BYTE-P-LOGOPS)) (59 4 (:REWRITE LOGIOR-AS-B-IOR)) (52 4 (:REWRITE LOGNOT-NEG)) (32 4 (:REWRITE EQUAL-0-LOGAND-BIT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE EXPT-COMPARE)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 16 (:REWRITE DEFAULT-<-2)) (17 16 (:REWRITE DEFAULT-<-1)) (16 16 (:TYPE-PRESCRIPTION LOGNOT)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 4 (:REWRITE ASH-AS-LOGTAIL)) (11 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (10 4 (:REWRITE LOGNOT-ZIP)) (8 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE))) (ASH-LOGAND-NEG (184 8 (:LINEAR LOGAND-BOUND)) (136 8 (:REWRITE SIGNED-BYTE-P-ASH)) (58 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (58 8 (:REWRITE LOGTAIL-IDENTITY)) (56 8 (:REWRITE <=-0-ASH)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (36 36 (:REWRITE EXPT-COMPARE)) (31 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (28 28 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (19 9 (:REWRITE LOGAND-WITH-MASK-ERIC)) (17 17 (:REWRITE DEFAULT-UNARY-MINUS)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (13 9 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (13 9 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:TYPE-PRESCRIPTION LOGMASKP)) (10 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (8 8 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:TYPE-PRESCRIPTION ADD1-INDUCTION)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (ASH-LEAVES-ONE-BIT-LEFT-HELPER (431 4 (:REWRITE LOGTAIL-IDENTITY)) (325 11 (:DEFINITION EXPT)) (158 154 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 4 (:REWRITE ZIP-OPEN)) (71 62 (:REWRITE DEFAULT-<-2)) (64 62 (:REWRITE DEFAULT-<-1)) (63 59 (:REWRITE DEFAULT-+-1)) (59 59 (:REWRITE DEFAULT-+-2)) (55 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 31 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 4 (:REWRITE NORMALIZE-EQUAL-0)) (42 12 (:REWRITE COMMUTATIVITY-OF-+)) (32 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 4 (:REWRITE EQUAL-MINUS-MINUS)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (26 26 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (25 5 (:REWRITE EQUAL-1-HACK)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 6 (:REWRITE LOGBITP-TOO-BIG)) (21 7 (:REWRITE EXPT-2-CRUNCHER)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 4 (:REWRITE SUM-POWER-OF-TWO)) (19 5 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPONENTS-ADD)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ZP-OPEN))) (ASH-LEAVES-ONE-BIT-LEFT (302 2 (:REWRITE LOGTAIL-IDENTITY)) (235 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (189 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (87 31 (:REWRITE EXPT-COMPARE)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (78 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 4 (:REWRITE POWER2-INTEGER)) (51 3 (:REWRITE EQUAL-1-HACK)) (40 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (38 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 19 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 7 (:REWRITE EXPO-OF-NOT-RATIONALP)) (19 19 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (16 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE UNICITY-OF-0)) (12 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 9 (:REWRITE POWER2P-EXPT2-I)) (9 7 (:REWRITE EXPO-EXPT2)) (9 3 (:REWRITE DEFAULT-NUMERATOR)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE INVERSE-OF-+)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (ASH-NEG-LOGHEAD (839 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (432 130 (:REWRITE EXPT-COMPARE)) (315 7 (:REWRITE EXPT-MINUS)) (252 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (234 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (157 10 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (144 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (142 13 (:REWRITE LOGHEAD-IDENTITY)) (123 123 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE DEFAULT-+-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (85 5 (:REWRITE EQUAL-1-HACK)) (67 57 (:REWRITE DEFAULT-<-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (61 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (59 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (57 57 (:REWRITE DEFAULT-<-2)) (57 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 9 (:REWRITE POWER2-INTEGER)) (41 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (38 2 (:REWRITE EXPO-SHIFT-CONSTANT)) (36 4 (:LINEAR LOGHEAD-LEQ)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 7 (:REWRITE DEFAULT-UNARY-/)) (33 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE DEFAULT-UNARY-MINUS)) (27 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE POWER2P-EXPT2-I)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 19 (:REWRITE EXPO-EXPT2)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (19 11 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:META META-RULE-ERIC)) (18 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 5 (:REWRITE DEFAULT-NUMERATOR)) (14 7 (:REWRITE POWER2P-INVERSE)) (13 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 2 (:REWRITE POWER2P-SHIFT-2)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE LOGCDR-<-0)) (6 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE EXPONENTS-ADD)) (3 3 (:TYPE-PRESCRIPTION ADD1-SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE ZP-OPEN))) (SIGNED-BYTE-P-OF-LOGTAIL (342 132 (:REWRITE EXPT-COMPARE)) (256 8 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (255 8 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (245 8 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (159 91 (:REWRITE DEFAULT-<-2)) (152 23 (:LINEAR EXPT->-1)) (139 53 (:REWRITE DEFAULT-*-2)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (104 47 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (102 91 (:REWRITE DEFAULT-<-1)) (93 53 (:REWRITE DEFAULT-*-1)) (87 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (70 5 (:REWRITE LOGTAIL-IDENTITY)) (60 51 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (60 24 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 1 (:REWRITE INTEGERP-UNARY-)) (35 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 8 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE FOLD-CONSTS-IN-*)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL))) (USBP-OVER-LOGAND (242 4 (:LINEAR LOGAND-BOUND)) (118 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (116 44 (:REWRITE EXPT-COMPARE)) (98 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (93 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (42 30 (:REWRITE DEFAULT-<-2)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 30 (:REWRITE DEFAULT-<-1)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 3 (:LINEAR EXPT->-1)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:TYPE-PRESCRIPTION POWER2P)) (12 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPO-EXPT2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 2 (:REWRITE LOGAND-NEG)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-OF-LOGEXT (761 6 (:LINEAR LOGHEAD-LEQ)) (727 28 (:REWRITE LOGEXT-IDENTITY)) (640 23 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (363 21 (:REWRITE LOGHEAD-IDENTITY)) (315 70 (:REWRITE LOGCAR-EVENP)) (306 34 (:LINEAR LOGCAR-RANGE-LINEAR)) (247 10 (:LINEAR LOGEXT-BOUNDS-2)) (236 236 (:REWRITE POWER2-INTEGER)) (184 10 (:LINEAR LOGEXT-BOUNDS)) (163 5 (:LINEAR LOGEXT-BOUND-UPPER)) (156 156 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (150 87 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (150 26 (:REWRITE LOGCAR-0-REWRITE)) (147 147 (:TYPE-PRESCRIPTION EVENP)) (140 91 (:REWRITE DEFAULT-<-2)) (128 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 91 (:REWRITE DEFAULT-<-1)) (94 94 (:REWRITE EXPT-COMPARE)) (94 15 (:REWRITE USBP-LOGEXT-NARROWER)) (91 91 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (78 78 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (63 5 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (59 59 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 56 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (54 3 (:REWRITE LOGBITP-LOGCAR)) (48 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (40 40 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (37 34 (:REWRITE LOGHEAD-SUBST2)) (34 34 (:REWRITE LOGHEAD-SUBST)) (34 34 (:META META-RULE-ERIC)) (31 31 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (21 3 (:LINEAR EXPT->-1)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-OF-1 (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 7 (:REWRITE DEFAULT-<-1)) (9 9 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-<-2)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE POWER2-INTEGER)) (4 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X (56 1 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (49 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (45 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (33 28 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (24 4 (:LINEAR EXPT->-1)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 20 (:REWRITE POWER2-INTEGER)) (17 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 4 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGIOR-UNSIGNED-BYTE-P-16-ONE (10 1 (:REWRITE LOGIOR-AS-B-IOR)) (6 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION))) (LOGIOR-UNSIGNED-BYTE-P-16-TWO (30 3 (:REWRITE LOGIOR-AS-B-IOR)) (12 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-MINUS (3500 158 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1543 236 (:REWRITE EXPT-COMPARE-EQUAL)) (1073 133 (:LINEAR EXPT->-1)) (1000 21 (:REWRITE RTL1)) (1000 21 (:REWRITE FLOOR-SIMPLE-CASES)) (1000 21 (:REWRITE FLOOR-DETERMINED-1)) (876 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (812 266 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (630 477 (:REWRITE DEFAULT-<-2)) (624 124 (:REWRITE POWER2-INTEGER)) (567 567 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (567 567 (:REWRITE EXPT-COMPARE)) (553 79 (:REWRITE DEFAULT-UNARY-/)) (537 498 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (477 477 (:REWRITE DEFAULT-<-1)) (462 124 (:REWRITE DEFAULT-+-2)) (440 139 (:REWRITE DEFAULT-UNARY-MINUS)) (408 135 (:REWRITE DEFAULT-*-2)) (366 102 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (346 7 (:REWRITE ODDP-OF-*)) (326 8 (:REWRITE FLOOR-=-X/Y . 2)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (292 73 (:REWRITE EXPO-OF-NOT-RATIONALP)) (288 249 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (280 56 (:REWRITE EQUAL-1-HACK)) (258 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (244 61 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (229 124 (:REWRITE DEFAULT-+-1)) (216 54 (:REWRITE EXPT-2-CRUNCHER)) (211 211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 51 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (200 200 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 133 (:LINEAR EXPT-LESS-THAN-1-HACK)) (164 12 (:REWRITE EXPO-/-POWER2P-ALT)) (153 153 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (146 146 (:TYPE-PRESCRIPTION POWER2P)) (146 73 (:REWRITE EXPO-EXPT2)) (135 135 (:REWRITE DEFAULT-*-1)) (130 10 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 102 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (91 13 (:REWRITE FLOOR-TYPE-3 . 3)) (91 13 (:REWRITE FLOOR-TYPE-3 . 2)) (88 25 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (85 85 (:REWRITE POWER2P-EXPT2-I)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (82 25 (:LINEAR MOD-TYPE . 3)) (82 25 (:LINEAR MOD-TYPE . 1)) (78 13 (:REWRITE FLOOR-TYPE-4 . 3)) (78 13 (:REWRITE FLOOR-TYPE-4 . 2)) (73 73 (:REWRITE EXPO-MINUS-ERIC)) (56 56 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (26 26 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (26 26 (:REWRITE EXPONENTS-ADD)) (26 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (25 25 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (24 12 (:REWRITE POWER2P-INVERSE)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (PLUS-OF-LOGAPP-SUCK-IN (92 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (81 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (64 30 (:REWRITE DEFAULT-+-2)) (42 30 (:REWRITE DEFAULT-+-1)) (34 29 (:REWRITE DEFAULT-<-2)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 29 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 2 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 5 (:LINEAR EXPT->-1)) (19 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 3 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (PLUS-OF-LOGAPP-SUCK-IN-ALT (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (PLUS-MINUS-HALF-COLLECT) (LOGHEAD-OF-PROD-OF-LOGEXT-HELPER (52714 108 (:REWRITE <-*-0)) (52714 108 (:REWRITE 0-<-*)) (43020 216 (:DEFINITION IFF)) (20420 387 (:REWRITE FLOOR-=-X/Y . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 2)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 3)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 2)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (11778 1198 (:REWRITE INTEGERP-+-MINUS-*-4)) (10073 2195 (:REWRITE DEFAULT-*-2)) (9895 1462 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9752 174 (:LINEAR MOD-TYPE . 2)) (7135 387 (:REWRITE FLOOR-=-X/Y . 2)) (6437 3307 (:REWRITE DEFAULT-<-2)) (6174 190 (:REWRITE MOD-=-0 . 2)) (5628 389 (:REWRITE RTL1)) (5628 389 (:REWRITE FLOOR-DETERMINED-1)) (4699 4699 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4699 4699 (:REWRITE EXPT-COMPARE)) (4580 67 (:REWRITE NORMALIZE-EQUAL-0)) (4312 3307 (:REWRITE DEFAULT-<-1)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4015 365 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3625 725 (:REWRITE DEFAULT-UNARY-/)) (3469 1106 (:REWRITE EXPT-COMPARE-EQUAL)) (3294 366 (:REWRITE EXPO-/-POWER2P-ALT)) (3110 2195 (:REWRITE DEFAULT-*-1)) (2304 2304 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2211 2211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2154 718 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1998 30 (:REWRITE INTEGERP-+-MINUS-*-2)) (1977 659 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1688 67 (:REWRITE EQUAL-MINUS-MINUS)) (1545 309 (:LINEAR X*Y>1-POSITIVE)) (1495 60 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1488 24 (:REWRITE MOD-=-0 . 1)) (1458 810 (:REWRITE DEFAULT-+-2)) (1438 126 (:REWRITE INTEGERP-PROD-3)) (1426 126 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (1347 67 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1275 1275 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1244 4 (:REWRITE CANCEL-FLOOR-+-BASIC)) (1050 1050 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1032 718 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1024 64 (:REWRITE <-0-+-NEGATIVE-1)) (993 471 (:REWRITE DEFAULT-UNARY-MINUS)) (957 286 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (837 810 (:REWRITE DEFAULT-+-1)) (732 366 (:REWRITE UNICITY-OF-0)) (732 366 (:REWRITE POWER2P-INVERSE)) (659 659 (:REWRITE EXPO-MINUS-ERIC)) (573 191 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (570 190 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (552 24 (:REWRITE MOD-TYPE)) (540 174 (:LINEAR MOD-TYPE . 3)) (538 174 (:LINEAR MOD-TYPE . 1)) (533 529 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (320 64 (:REWRITE SUM-POWER-OF-TWO)) (316 191 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (256 256 (:LINEAR EXPT-LESS-THAN-1-HACK)) (224 112 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (192 6 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (182 90 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (182 90 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (112 112 (:TYPE-PRESCRIPTION EVENP)) (64 64 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (32 32 (:TYPE-PRESCRIPTION IFF)) (30 30 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 2 (:REWRITE INTEGERP-UNARY-)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT))) (LOGHEAD-OF-PROD-OF-LOGEXT (466 4 (:LINEAR LOGHEAD-LEQ)) (414 4 (:REWRITE <-*-0)) (168 12 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:DEFINITION IFF)) (122 84 (:REWRITE DEFAULT-<-2)) (92 84 (:REWRITE DEFAULT-<-1)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (88 4 (:REWRITE LOGEXT-IDENTITY)) (84 12 (:LINEAR LOGEXT-BOUNDS-2)) (84 12 (:LINEAR LOGEXT-BOUNDS)) (72 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 68 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (54 54 (:REWRITE POWER2-INTEGER)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (46 46 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (38 38 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (32 32 (:TYPE-PRESCRIPTION IFIX)) (32 8 (:REWRITE LOGCAR-EVENP)) (24 24 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (22 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 10 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (14 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR EXPT->-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (10 10 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT (60 60 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 3 (:REWRITE LOGTAIL-IDENTITY)) (42 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (39 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE EXPT-COMPARE)) (24 3 (:REWRITE LOGHEAD-IDENTITY)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SPLIT (153 11 (:REWRITE LOGHEAD-IDENTITY)) (140 140 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 28 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE DEFAULT-<-2)) (26 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 13 (:META META-RULE-ERIC)) (13 13 (:REWRITE POWER2-INTEGER)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-EQUAL-LOGAPP-REWRITE-HELPER (291 23 (:REWRITE LOGHEAD-IDENTITY)) (137 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (100 91 (:REWRITE DEFAULT-<-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (91 91 (:REWRITE DEFAULT-<-2)) (79 10 (:LINEAR LOGHEAD-LEQ)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (57 57 (:REWRITE POWER2-INTEGER)) (52 51 (:META META-RULE-ERIC)) (41 41 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (36 6 (:REWRITE ASH-AS-LOGTAIL)) (30 5 (:LINEAR EXPT->-1)) (25 10 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (12 3 (:REWRITE ASH-0)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 5 (:REWRITE IFIX-INTEGERP)) (8 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE CANCEL-EQUAL-+-*))) (LOGAPP-EQUAL-LOGAPP-REWRITE (574 49 (:REWRITE LOGHEAD-IDENTITY)) (304 304 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (280 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (255 45 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (186 143 (:REWRITE DEFAULT-<-1)) (167 143 (:REWRITE DEFAULT-<-2)) (145 145 (:REWRITE POWER2-INTEGER)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (143 143 (:REWRITE EXPT-COMPARE)) (109 109 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (94 49 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (93 12 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (81 12 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (74 74 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (67 67 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (56 7 (:LINEAR LOGHEAD-LEQ)) (53 53 (:META META-RULE-ERIC)) (49 49 (:REWRITE LOGHEAD-SUBST)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 15 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (27 4 (:LINEAR EXPT->-1)) (22 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGAPP-EQUAL-LOGAPP-REWRITE-NO-SPLIT (44 44 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 44 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (44 4 (:REWRITE LOGHEAD-IDENTITY)) (16 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-SPLIT-SPECIAL (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-SPLIT (235 17 (:REWRITE LOGHEAD-IDENTITY)) (201 201 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (134 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (72 72 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (53 48 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (30 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (20 19 (:META META-RULE-ERIC)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (15 15 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-TWO-LOGEXTS-REWRITE-HELPER (1446 1446 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1241 78 (:REWRITE LOGHEAD-IDENTITY)) (856 102 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (476 476 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (476 476 (:REWRITE EXPT-COMPARE)) (456 17 (:LINEAR LOGHEAD-LEQ)) (325 35 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (270 255 (:REWRITE DEFAULT-<-1)) (266 266 (:REWRITE POWER2-INTEGER)) (265 255 (:REWRITE DEFAULT-<-2)) (200 102 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (179 94 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (149 149 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (133 129 (:REWRITE DEFAULT-+-1)) (133 123 (:META META-RULE-ERIC)) (133 78 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (129 129 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE LOGHEAD-SPLIT-SPECIAL)) (113 113 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (104 104 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (84 6 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (83 10 (:LINEAR EXPT->-1)) (71 71 (:REWRITE EXPT-COMPARE-EQUAL)) (70 70 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (60 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 4 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (50 4 (:REWRITE ASH-AS-LOGTAIL)) (40 20 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (40 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 35 (:REWRITE LOGBITP-TOO-BIG)) (26 14 (:REWRITE FOLD-CONSTS-IN-+)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 10 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (12 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 8 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RIGHT-CANCELLATION-FOR-+)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE ASH-0)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (EQUAL-OF-TWO-LOGEXTS-REWRITE (468 38 (:REWRITE LOGEXT-IDENTITY)) (220 52 (:REWRITE LOGCAR-EVENP)) (154 6 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (142 142 (:REWRITE POWER2-INTEGER)) (105 14 (:REWRITE LOGHEAD-IDENTITY)) (96 96 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (96 12 (:LINEAR LOGEXT-BOUND-UPPER)) (94 52 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (90 90 (:TYPE-PRESCRIPTION EVENP)) (90 48 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (88 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (76 38 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 66 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (56 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (51 35 (:REWRITE DEFAULT-<-1)) (50 35 (:REWRITE DEFAULT-<-2)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE EXPT-COMPARE)) (36 6 (:REWRITE LOGCAR-0-REWRITE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 31 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (30 30 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (30 30 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (30 30 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:META META-RULE-ERIC)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGEXT-OF-PRODUCT-OF-LOGEXT (2889 28 (:REWRITE FLOOR-=-X/Y . 3)) (1826 142 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1752 48 (:REWRITE <-*-0)) (1752 48 (:REWRITE 0-<-*)) (1680 96 (:DEFINITION IFF)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (1371 34 (:REWRITE FLOOR-SIMPLE-CASES)) (1363 34 (:REWRITE RTL1)) (1363 34 (:REWRITE FLOOR-DETERMINED-1)) (1336 76 (:REWRITE INTEGERP-+-MINUS-*-4)) (1263 988 (:REWRITE DEFAULT-<-2)) (1258 46 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (1253 294 (:REWRITE DEFAULT-*-2)) (1211 988 (:REWRITE DEFAULT-<-1)) (1189 1189 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1189 1189 (:REWRITE EXPT-COMPARE)) (861 28 (:REWRITE FLOOR-=-X/Y . 2)) (822 215 (:REWRITE DEFAULT-+-2)) (795 159 (:LINEAR X*Y>1-POSITIVE)) (770 462 (:REWRITE EXPT-COMPARE-EQUAL)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (707 71 (:REWRITE DEFAULT-UNARY-/)) (703 294 (:REWRITE DEFAULT-*-1)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (599 28 (:REWRITE FLOOR-TYPE-3 . 3)) (599 28 (:REWRITE FLOOR-TYPE-3 . 2)) (590 29 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (590 29 (:REWRITE INTEGERP-PROD-3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 2)) (556 556 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (532 38 (:REWRITE EXPO-/-POWER2P-ALT)) (450 215 (:REWRITE DEFAULT-+-1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (394 98 (:REWRITE DEFAULT-UNARY-MINUS)) (385 326 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (364 44 (:LINEAR EXPT->-1)) (303 21 (:REWRITE EQUAL-1-HACK)) (288 72 (:REWRITE EXPT-2-CRUNCHER)) (260 65 (:REWRITE EXPO-OF-NOT-RATIONALP)) (256 88 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (250 19 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (238 238 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (222 163 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (211 58 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (197 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (168 14 (:REWRITE NORMALIZE-EQUAL-0)) (162 6 (:DEFINITION ZEROP)) (156 54 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (147 43 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (136 43 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (136 34 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (131 54 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (118 44 (:LINEAR EXPT-LESS-THAN-1-HACK)) (112 14 (:REWRITE EQUAL-MINUS-MINUS)) (90 90 (:REWRITE FOLD-CONSTS-IN-*)) (80 38 (:REWRITE UNICITY-OF-0)) (76 38 (:REWRITE POWER2P-INVERSE)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 69 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (65 65 (:REWRITE EXPO-MINUS-ERIC)) (56 4 (:REWRITE ASSOCIATIVITY-OF-*)) (40 7 (:REWRITE DEFAULT-NUMERATOR)) (38 19 (:REWRITE INTEGERP-+-MINUS-*-2)) (31 31 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (31 31 (:REWRITE EXPONENTS-ADD)) (19 19 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (14 14 (:REWRITE FOLD-CONSTS-IN-+)) (14 14 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (7 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (7 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-PRODUCT-OF-LOGEXT-ALT (346 8 (:LINEAR LOGEXT-BOUND-UPPER)) (240 2 (:REWRITE <-*-0)) (112 16 (:LINEAR LOGEXT-BOUNDS-2)) (112 16 (:LINEAR LOGEXT-BOUNDS)) (90 2 (:LINEAR X*Y>1-POSITIVE)) (86 51 (:REWRITE DEFAULT-<-2)) (53 53 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 53 (:REWRITE EXPT-COMPARE)) (51 51 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 2 (:DEFINITION IFF)) (33 33 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 3 (:REWRITE LOGEXT-IDENTITY)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (ASH-OF-LOGTAIL-DOES-NOTHING-REWRITE (1858 115 (:LINEAR X*Y>1-POSITIVE)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (901 13 (:LINEAR FLOOR-TYPE-2 . 1)) (897 13 (:LINEAR FLOOR-TYPE-2 . 2)) (894 26 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (886 13 (:LINEAR FLOOR-TYPE-1 . 2)) (886 13 (:LINEAR FLOOR-TYPE-1 . 1)) (705 45 (:REWRITE RATIONALP-*)) (558 326 (:REWRITE DEFAULT-<-1)) (558 12 (:REWRITE RTL1)) (539 326 (:REWRITE DEFAULT-<-2)) (530 35 (:REWRITE <-*-0)) (470 32 (:REWRITE 0-<-*)) (466 30 (:REWRITE <-*-/-LEFT)) (453 138 (:REWRITE POWER2-INTEGER)) (440 109 (:REWRITE DEFAULT-*-2)) (440 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (432 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (404 26 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (389 12 (:REWRITE FLOOR-SIMPLE-CASES)) (374 12 (:REWRITE FLOOR-TYPE-3 . 2)) (361 12 (:REWRITE FLOOR-DETERMINED-1)) (359 12 (:REWRITE FLOOR-TYPE-4 . 3)) (351 76 (:LINEAR EXPT->-1)) (338 12 (:REWRITE FLOOR-TYPE-4 . 2)) (329 12 (:REWRITE FLOOR-TYPE-3 . 3)) (288 12 (:REWRITE FLOOR-=-X/Y . 3)) (273 109 (:REWRITE DEFAULT-*-1)) (254 12 (:REWRITE FLOOR-=-X/Y . 2)) (243 81 (:REWRITE EXPO-OF-NOT-RATIONALP)) (184 152 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (177 177 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (166 52 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 76 (:LINEAR EXPT-LESS-THAN-1-HACK)) (145 57 (:REWRITE EXPT-COMPARE-EQUAL)) (100 100 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (100 12 (:REWRITE <-*-/-RIGHT)) (96 1 (:REWRITE MOD-=-0 . 2)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (81 81 (:REWRITE EXPO-MINUS-ERIC)) (81 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (67 1 (:REWRITE FLOOR-=-X/Y . 4)) (65 13 (:REWRITE DEFAULT-UNARY-/)) (55 11 (:DEFINITION IFF)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (33 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (31 31 (:REWRITE FOLD-CONSTS-IN-*)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (17 1 (:REWRITE EVENP-COLLAPSE)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (15 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (11 11 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:TYPE-PRESCRIPTION EVENP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ASH (943 14 (:REWRITE FLOOR-SIMPLE-CASES)) (927 56 (:LINEAR X*Y>1-POSITIVE)) (811 334 (:REWRITE EXPT-COMPARE)) (499 14 (:REWRITE RTL1)) (499 14 (:REWRITE FLOOR-DETERMINED-1)) (357 251 (:REWRITE DEFAULT-<-1)) (356 251 (:REWRITE DEFAULT-<-2)) (323 5 (:REWRITE FLOOR-=-X/Y . 3)) (310 10 (:REWRITE 0-<-*)) (305 10 (:REWRITE <-*-0)) (296 38 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (291 291 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (273 115 (:REWRITE DEFAULT-*-2)) (262 6 (:LINEAR FLOOR-TYPE-2 . 2)) (254 6 (:LINEAR FLOOR-TYPE-2 . 1)) (252 30 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (252 30 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (252 6 (:LINEAR FLOOR-TYPE-1 . 1)) (248 6 (:LINEAR FLOOR-TYPE-1 . 2)) (235 36 (:LINEAR EXPT->-1)) (205 20 (:DEFINITION IFF)) (193 115 (:REWRITE DEFAULT-*-1)) (153 51 (:REWRITE EXPO-OF-NOT-RATIONALP)) (150 150 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (150 39 (:REWRITE POWER2-INTEGER)) (135 5 (:REWRITE FLOOR-=-X/Y . 2)) (125 1 (:REWRITE FLOOR-=-X/Y . 4)) (123 5 (:REWRITE FLOOR-TYPE-3 . 3)) (121 5 (:REWRITE FLOOR-TYPE-3 . 2)) (119 7 (:REWRITE COMMUTATIVITY-2-OF-*)) (117 5 (:REWRITE FLOOR-TYPE-4 . 3)) (116 5 (:REWRITE FLOOR-TYPE-4 . 2)) (104 64 (:REWRITE EXPT-COMPARE-EQUAL)) (102 102 (:TYPE-PRESCRIPTION POWER2P)) (83 19 (:REWRITE DEFAULT-UNARY-/)) (78 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (75 33 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 72 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 51 (:REWRITE EXPO-EXPT2)) (57 33 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (54 54 (:REWRITE POWER2P-EXPT2-I)) (51 51 (:REWRITE EXPO-MINUS-ERIC)) (46 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (46 2 (:REWRITE INTEGERP-PROD-3)) (44 4 (:REWRITE EQUAL-1-HACK)) (42 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 3 (:REWRITE <-*-RIGHT-CANCEL)) (32 16 (:REWRITE DEFAULT-+-2)) (31 13 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (24 4 (:REWRITE /-CANCELLATION-ON-RIGHT)) (22 22 (:REWRITE FOLD-CONSTS-IN-*)) (22 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (22 2 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 16 (:REWRITE DEFAULT-+-1)) (15 3 (:REWRITE COMMUTATIVITY-OF-+)) (13 13 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE UNICITY-OF-0)) (6 3 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (B-NOT-EQUAL-0-REWRITE (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE EQUAL-1-HACK)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER))) (B-NOT-EQUAL-1-REWRITE (10 3 (:REWRITE EQUAL-1-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (UNSIGNED-BYTE-P-1-CHOICES) (LOGEXT-OF-PROD-OF-LOGHEAD (468 26 (:REWRITE LOGEXT-IDENTITY)) (276 4 (:LINEAR LOGEXT-BOUND-UPPER)) (250 28 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (224 4 (:REWRITE <-*-0)) (60 4 (:DEFINITION IFF)) (56 56 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (51 26 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (42 6 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:TYPE-PRESCRIPTION IFIX)) (36 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (28 28 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (25 23 (:REWRITE DEFAULT-<-2)) (24 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (17 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (17 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (17 1 (:LINEAR LOGHEAD-BOUND)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 2 (:REWRITE LOGHEAD-<=)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE LOGHEAD-NON-ZERO-TYPE)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK))) (ASH-LOGEXT (43467 47 (:REWRITE ASH-0)) (43357 22 (:REWRITE ZIP-OPEN)) (16868 164 (:DEFINITION LOGEXT*-BETTER)) (15577 328 (:REWRITE LOGEXT-IDENTITY)) (14339 19 (:REWRITE EQUAL-LOGEXT-0)) (9000 344 (:DEFINITION SIGNED-BYTE-P*)) (8244 164 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (8019 114 (:REWRITE LOGHEAD-IDENTITY)) (6777 57 (:DEFINITION LOGHEAD*-BETTER)) (5381 19 (:LINEAR LOGHEAD-UPPER-BOUND)) (4699 1545 (:REWRITE <-+-CONSTANT-CONSTANT)) (4668 114 (:DEFINITION UNSIGNED-BYTE-P*)) (4386 57 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (3821 19 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (3516 228 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2752 344 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2169 2169 (:REWRITE EXPT-COMPARE)) (2167 2167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2068 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (1960 280 (:REWRITE <-0-+-NEGATIVE-1)) (1758 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1743 1431 (:REWRITE DEFAULT-<-2)) (1647 1431 (:REWRITE DEFAULT-<-1)) (1636 164 (:REWRITE EQUAL-1-HACK)) (1591 1591 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1586 194 (:REWRITE EXPONENTS-ADD)) (1540 385 (:REWRITE LOGCAR-EVENP)) (1454 883 (:REWRITE DEFAULT-+-2)) (1198 1070 (:REWRITE EXPT-COMPARE-EQUAL)) (934 934 (:TYPE-PRESCRIPTION EVENP)) (883 883 (:REWRITE DEFAULT-+-1)) (856 566 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (852 852 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (852 852 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (816 136 (:REWRITE SUM-POWER-OF-TWO)) (784 16 (:REWRITE EXPT-MINUS)) (742 19 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (713 713 (:REWRITE FOLD-CONSTS-IN-+)) (688 688 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (679 679 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (650 650 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (640 32 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (637 331 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (619 619 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (595 75 (:LINEAR EXPT-LESS-THAN-1-HACK)) (570 570 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (549 549 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (492 328 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (393 89 (:REWRITE DEFAULT-UNARY-MINUS)) (385 385 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (357 150 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (328 164 (:REWRITE LOGCAR-0-REWRITE)) (300 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (292 40 (:LINEAR LOGEXT-BOUND-UPPER)) (285 285 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (272 272 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (267 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (256 16 (:REWRITE COMMUTATIVITY-2-OF-*)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (228 228 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (221 221 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (179 47 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (179 47 (:REWRITE ASH-AS-LOGTAIL)) (171 114 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (164 164 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (162 162 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (152 152 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (144 48 (:REWRITE DEFAULT-*-2)) (144 48 (:REWRITE DEFAULT-*-1)) (136 136 (:REWRITE EQUAL-CONSTANT-+)) (133 19 (:LINEAR LOGHEAD-LEQ)) (128 16 (:REWRITE /-CANCELLATION-ON-LEFT)) (114 114 (:META META-RULE-ERIC)) (112 16 (:REWRITE COMMUTATIVITY-OF-*)) (89 47 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (80 16 (:REWRITE DEFAULT-UNARY-/)) (69 47 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (69 47 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (57 57 (:REWRITE LOGHEAD-SUBST2)) (57 57 (:REWRITE LOGHEAD-SUBST)) (48 48 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (48 16 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (48 16 (:REWRITE EXPO-OF-NOT-RATIONALP)) (47 47 (:REWRITE ASH-GOES-TO-0)) (32 32 (:TYPE-PRESCRIPTION POWER2P)) (32 32 (:REWRITE FOLD-CONSTS-IN-*)) (25 25 (:TYPE-PRESCRIPTION ZIP)) (16 16 (:REWRITE POWER2P-EXPT2-I)) (16 16 (:REWRITE EXPO-MINUS-ERIC)) (16 16 (:REWRITE EXPO-EXPT2)) (14 2 (:REWRITE <=-0-ASH)) (3 3 (:REWRITE POWER2-INTEGER))) (ASH-PLUS-CONSTANT-SUCK-IN (34 34 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (34 34 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (14 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (12 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (7 5 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (7 1 (:REWRITE ASH-AS-LOGTAIL)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:LINEAR EXPT->-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (<-OF-LOGTAIL (1666 22 (:REWRITE FLOOR-=-X/Y . 3)) (880 40 (:REWRITE INTEGERP-+-MINUS-*-4)) (806 66 (:REWRITE POWER2-INTEGER)) (752 100 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (490 22 (:REWRITE RTL1)) (490 22 (:REWRITE FLOOR-SIMPLE-CASES)) (490 22 (:REWRITE FLOOR-DETERMINED-1)) (442 22 (:REWRITE FLOOR-=-X/Y . 2)) (419 271 (:REWRITE DEFAULT-<-2)) (409 123 (:REWRITE DEFAULT-*-2)) (347 299 (:REWRITE EXPT-COMPARE)) (312 52 (:LINEAR EXPT->-1)) (295 295 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (280 20 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (273 271 (:REWRITE DEFAULT-<-1)) (250 50 (:REWRITE DEFAULT-UNARY-/)) (207 47 (:REWRITE EXPT-COMPARE-EQUAL)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (180 20 (:REWRITE EXPO-/-POWER2P-ALT)) (144 144 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (144 16 (:LINEAR X*Y>1-POSITIVE)) (142 22 (:REWRITE FLOOR-TYPE-3 . 3)) (142 22 (:REWRITE FLOOR-TYPE-3 . 2)) (139 123 (:REWRITE DEFAULT-*-1)) (136 2 (:REWRITE FLOOR-=-X/Y . 4)) (132 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (122 22 (:REWRITE FLOOR-TYPE-4 . 3)) (122 22 (:REWRITE FLOOR-TYPE-4 . 2)) (104 104 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (100 20 (:REWRITE COMMUTATIVITY-OF-+)) (92 48 (:REWRITE DEFAULT-+-2)) (88 88 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (66 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (64 64 (:REWRITE POWER2P-EXPT2-I)) (64 2 (:REWRITE EQUAL-*-/-2)) (60 20 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (56 48 (:REWRITE DEFAULT-+-1)) (52 52 (:LINEAR EXPT-LESS-THAN-1-HACK)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 44 (:REWRITE EXPO-EXPT2)) (40 20 (:REWRITE UNICITY-OF-0)) (40 20 (:REWRITE POWER2P-INVERSE)) (28 4 (:LINEAR FLOOR-TYPE-2 . 2)) (28 4 (:LINEAR FLOOR-TYPE-2 . 1)) (24 4 (:LINEAR FLOOR-TYPE-1 . 2)) (24 4 (:LINEAR FLOOR-TYPE-1 . 1)) (22 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 22 (:REWRITE FIX-DOES-NOTHING)) (20 20 (:REWRITE DEFAULT-UNARY-MINUS)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-< (5114 164 (:REWRITE INTEGERP-+-MINUS-*-4)) (4742 342 (:REWRITE POWER2-INTEGER)) (4409 414 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (3826 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3445 1450 (:REWRITE DEFAULT-*-2)) (3376 358 (:LINEAR X*Y>1-POSITIVE)) (3025 40 (:REWRITE FLOOR-=-X/Y . 3)) (2883 2275 (:REWRITE EXPT-COMPARE)) (2791 1450 (:REWRITE DEFAULT-*-1)) (2650 98 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2522 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (2498 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (2119 1645 (:REWRITE DEFAULT-<-1)) (2100 1645 (:REWRITE DEFAULT-<-2)) (1621 763 (:REWRITE DEFAULT-+-2)) (1442 206 (:LINEAR EXPT->-1)) (1388 1388 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1264 254 (:REWRITE EXPT-COMPARE-EQUAL)) (1065 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1035 207 (:REWRITE DEFAULT-UNARY-/)) (990 110 (:REWRITE EXPO-/-POWER2P-ALT)) (956 956 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (948 14 (:LINEAR MOD-TYPE . 2)) (922 763 (:REWRITE DEFAULT-+-1)) (887 40 (:REWRITE RTL1)) (887 40 (:REWRITE FLOOR-SIMPLE-CASES)) (887 40 (:REWRITE FLOOR-DETERMINED-1)) (777 259 (:REWRITE EXPO-OF-NOT-RATIONALP)) (733 40 (:REWRITE FLOOR-=-X/Y . 2)) (704 704 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (694 694 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (514 514 (:TYPE-PRESCRIPTION POWER2P)) (412 412 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (369 369 (:REWRITE POWER2P-EXPT2-I)) (303 101 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (275 107 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (271 40 (:REWRITE FLOOR-TYPE-3 . 3)) (271 40 (:REWRITE FLOOR-TYPE-3 . 2)) (259 259 (:REWRITE EXPO-MINUS-ERIC)) (259 259 (:REWRITE EXPO-EXPT2)) (259 163 (:REWRITE DEFAULT-UNARY-MINUS)) (258 258 (:META CANCEL_TIMES-EQUAL-CORRECT)) (238 40 (:REWRITE FLOOR-TYPE-4 . 3)) (238 40 (:REWRITE FLOOR-TYPE-4 . 2)) (220 110 (:REWRITE POWER2P-INVERSE)) (206 206 (:LINEAR EXPT-LESS-THAN-1-HACK)) (142 142 (:REWRITE FOLD-CONSTS-IN-*)) (140 2 (:REWRITE FLOOR-=-X/Y . 4)) (135 55 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (113 107 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (108 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (83 83 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (72 2 (:REWRITE EQUAL-*-/-2)) (55 55 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (54 6 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 6 (:LINEAR FLOOR-TYPE-2 . 2)) (48 6 (:LINEAR FLOOR-TYPE-2 . 1)) (42 6 (:LINEAR FLOOR-TYPE-1 . 2)) (42 6 (:LINEAR FLOOR-TYPE-1 . 1)) (30 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (30 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (14 14 (:LINEAR MOD-TYPE . 3)) (14 14 (:LINEAR MOD-TYPE . 1)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGAPP-<= (335 335 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (220 2 (:REWRITE LOGHEAD-<=)) (218 4 (:REWRITE LOGHEAD-<)) (164 8 (:REWRITE LOGTAIL-IDENTITY)) (159 12 (:REWRITE LOGHEAD-IDENTITY)) (152 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (131 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (117 97 (:REWRITE DEFAULT-<-2)) (113 97 (:REWRITE DEFAULT-<-1)) (111 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (105 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (97 97 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (97 97 (:REWRITE EXPT-COMPARE)) (97 97 (:META CANCEL_PLUS-LESSP-CORRECT)) (82 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (64 8 (:LINEAR LOGTAIL-LEQ)) (57 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (48 6 (:REWRITE LOGTAIL-LESSP)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:REWRITE <-OF-LOGTAIL)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 4 (:LINEAR EXPT->-1)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (ASH-LOGCDR-1-BETTER (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (14 12 (:REWRITE DEFAULT-*-2)) (13 12 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 1 (:DEFINITION IFIX)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGCDR-LOGAPP (144 9 (:REWRITE LOGHEAD-IDENTITY)) (92 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (68 68 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (68 68 (:REWRITE EXPT-COMPARE)) (68 68 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 64 (:REWRITE POWER2-INTEGER)) (62 50 (:REWRITE DEFAULT-<-1)) (62 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 50 (:REWRITE DEFAULT-<-2)) (48 48 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 28 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 2 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE ASH-0)) (9 1 (:REWRITE LOGCDR-<-0)) (8 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 6 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE ZIP-OPEN)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKYY (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (USB-TIGHTEN (638 2 (:REWRITE FLOOR-=-X/Y . 3)) (340 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (280 21 (:REWRITE POWER2-INTEGER)) (132 4 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (107 11 (:REWRITE EXPT-COMPARE-EQUAL)) (97 4 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (88 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (85 35 (:REWRITE DEFAULT-*-2)) (85 2 (:REWRITE FLOOR-=-X/Y . 2)) (83 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (82 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (73 2 (:REWRITE FLOOR-TYPE-3 . 2)) (72 4 (:REWRITE INTEGERP-PROD-3)) (64 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (64 38 (:REWRITE DEFAULT-<-2)) (64 2 (:REWRITE RTL1)) (64 2 (:REWRITE FLOOR-DETERMINED-1)) (60 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (59 59 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (59 59 (:REWRITE EXPT-COMPARE)) (59 59 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (50 4 (:REWRITE COMMUTATIVITY-2-OF-*)) (41 41 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 35 (:REWRITE DEFAULT-*-1)) (38 38 (:REWRITE DEFAULT-<-1)) (38 35 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 27 (:TYPE-PRESCRIPTION POWER2P)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE POWER2P-EXPT2-I)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 5 (:REWRITE POWER2P-SHIFT-2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:REWRITE EXPO-EXPT2)) (12 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (4 4 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 1 (:REWRITE IFIX-INTEGERP))) (LOGHEAD-WHEN-KNOW-TOP-BIT (134 134 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (48 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (19 17 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (16 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE USB-TIGHTEN)) (11 10 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-TWO (123 123 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 18 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (15 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 10 (:META META-RULE-ERIC)) (11 7 (:REWRITE USB-TIGHTEN)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE POWER2-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-THREE (217 217 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (197 13 (:REWRITE LOGHEAD-IDENTITY)) (135 3 (:LINEAR LOGHEAD-LEQ)) (125 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (121 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (81 81 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (81 81 (:REWRITE EXPT-COMPARE)) (79 79 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 42 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE DEFAULT-<-2)) (26 20 (:META META-RULE-ERIC)) (26 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 8 (:REWRITE FOLD-CONSTS-IN-+)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (17 17 (:REWRITE DEFAULT-+-2)) (17 17 (:REWRITE DEFAULT-+-1)) (16 16 (:REWRITE POWER2-INTEGER)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (LOGTAIL-LEAVES-SINGLE-BIT (172 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (90 54 (:REWRITE DEFAULT-<-2)) (84 4 (:REWRITE FLOOR-=-X/Y . 3)) (82 54 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE RTL1)) (72 4 (:REWRITE FLOOR-DETERMINED-1)) (64 4 (:REWRITE FLOOR-=-X/Y . 2)) (58 58 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (58 58 (:REWRITE EXPT-COMPARE)) (58 58 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 12 (:REWRITE DEFAULT-UNARY-/)) (54 26 (:REWRITE DEFAULT-*-2)) (52 4 (:REWRITE FLOOR-TYPE-3 . 3)) (52 4 (:REWRITE FLOOR-TYPE-3 . 2)) (48 4 (:REWRITE FLOOR-TYPE-4 . 3)) (48 4 (:REWRITE FLOOR-TYPE-4 . 2)) (48 4 (:REWRITE EQUAL-1-HACK)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 26 (:REWRITE DEFAULT-*-1)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 2 (:LINEAR FLOOR-TYPE-2 . 2)) (26 2 (:LINEAR FLOOR-TYPE-2 . 1)) (24 2 (:LINEAR FLOOR-TYPE-1 . 2)) (24 2 (:LINEAR FLOOR-TYPE-1 . 1)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (22 2 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 8 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (10 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 3 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (ASH-SUCK-IN-SPECIAL (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (88 8 (:LINEAR X*Y>1-POSITIVE)) (88 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (68 8 (:DEFINITION IFF)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 24 (:REWRITE DEFAULT-<-2)) (32 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (24 24 (:REWRITE DEFAULT-<-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 15 (:REWRITE DEFAULT-*-2)) (19 15 (:REWRITE DEFAULT-*-1)) (18 10 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 8 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE POWER2-INTEGER))) (UNSIGNED-BYTE-P-OF-ONE-MORE-THAN-X (55 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (38 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (35 5 (:LINEAR EXPT->-1)) (30 20 (:REWRITE DEFAULT-<-2)) (27 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE DEFAULT-<-1)) (17 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 6 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2))) (LOGTAIL-SHIFT-16 (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (449 233 (:REWRITE DEFAULT-*-2)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (305 161 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (273 233 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (161 161 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (49 49 (:REWRITE POWER2-INTEGER)) (48 48 (:REWRITE INTEGERP-+-MINUS-*-4)) (36 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1))) (EVENP-OF-MOD (28 1 (:REWRITE MOD-=-0 . 2)) (21 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 8 (:REWRITE DEFAULT-*-1)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 12 (:REWRITE DEFAULT-<-2)) (13 12 (:REWRITE DEFAULT-<-1)) (13 8 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE POWER2-INTEGER)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:REWRITE RTL1)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (8 1 (:REWRITE FLOOR-SIMPLE-CASES)) (8 1 (:REWRITE FLOOR-DETERMINED-1)) (8 1 (:REWRITE FLOOR-=-X/Y . 3)) (8 1 (:REWRITE FLOOR-=-X/Y . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (6 1 (:REWRITE DEFAULT-UNARY-MINUS)) (6 1 (:REWRITE DEFAULT-+-2)) (5 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:DEFINITION ZEROP)) (2 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (LOGTAIL-OF-ONE-MORE-WHEN-EVEN (713 713 (:REWRITE EXPT-COMPARE)) (654 59 (:REWRITE FLOOR-TYPE-3 . 3)) (654 59 (:REWRITE FLOOR-TYPE-3 . 2)) (578 59 (:REWRITE FLOOR-TYPE-4 . 3)) (578 59 (:REWRITE FLOOR-TYPE-4 . 2)) (564 524 (:REWRITE DEFAULT-<-2)) (547 507 (:REWRITE DEFAULT-*-1)) (502 59 (:REWRITE RTL1)) (502 59 (:REWRITE FLOOR-DETERMINED-1)) (482 50 (:REWRITE FLOOR-=-X/Y . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (297 297 (:REWRITE DEFAULT-+-1)) (196 196 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (163 163 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (141 13 (:LINEAR FLOOR-TYPE-2 . 2)) (141 13 (:LINEAR FLOOR-TYPE-2 . 1)) (135 34 (:REWRITE CANCEL-FLOOR-+-BASIC)) (125 13 (:LINEAR FLOOR-TYPE-1 . 2)) (125 13 (:LINEAR FLOOR-TYPE-1 . 1)) (116 8 (:REWRITE FLOOR-=-X/Y . 4)) (105 105 (:REWRITE POWER2-INTEGER)) (79 63 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-4)) (63 63 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (43 43 (:REWRITE EXPT-COMPARE-EQUAL)) (42 42 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (33 1 (:REWRITE EQUAL-*-/-1)) (26 10 (:REWRITE SUM-POWER-OF-TWO)) (23 20 (:REWRITE INTEGERP-+-MINUS-*-2)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (20 20 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (17 17 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (15 2 (:REWRITE IFIX-INTEGERP)) (12 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (7 7 (:REWRITE MY-EQUAL-/)) (7 2 (:LINEAR X*Y>1-POSITIVE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1))) (SUM-WITH-SHIFT-BECOMES-LOGAPP (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 3 (:REWRITE DEFAULT-*-2)) (7 1 (:LINEAR EXPT->-1)) (6 2 (:REWRITE DEFAULT-+-2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 3 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SUM-WITH-SHIFT-BECOMES-LOGAPP-CONSTANT-VERSION (396 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (303 303 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (273 2 (:REWRITE LOGTAIL-IDENTITY)) (254 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 34 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (100 40 (:REWRITE EXPT-COMPARE)) (71 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (71 3 (:LINEAR EXPT->-1)) (60 30 (:REWRITE DEFAULT-<-2)) (50 50 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 30 (:REWRITE DEFAULT-<-1)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (38 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (36 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (32 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (22 11 (:REWRITE USB-TIGHTEN)) (22 1 (:REWRITE NATP-RW)) (22 1 (:REWRITE LOGHEAD-CANCEL-LEMMA-ALT)) (20 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (17 7 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (14 4 (:REWRITE EXPO-EXPT2)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 1 (:LINEAR EXPO-LOWER-BOUND)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:LINEAR EXPO-LOWER-POS)) (7 1 (:LINEAR EXPO-LOWER-BOUND-2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:DEFINITION ABS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE EXPO-OF-INTEGER)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-PLUS-ASH (4879 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (4860 72 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (4859 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4585 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (4565 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3602 117 (:LINEAR X*Y>1-POSITIVE)) (3564 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (2886 74 (:REWRITE 0-<-*)) (2812 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (2775 74 (:REWRITE <-*-0)) (2484 1326 (:REWRITE EXPT-COMPARE)) (2399 123 (:REWRITE INTEGERP-+-MINUS-*-4)) (2250 276 (:REWRITE POWER2-INTEGER)) (2105 22 (:REWRITE MOD-=-0 . 2)) (1739 148 (:DEFINITION IFF)) (1432 36 (:LINEAR FLOOR-TYPE-2 . 2)) (1416 10 (:LINEAR MOD-TYPE . 2)) (1414 979 (:REWRITE DEFAULT-<-1)) (1404 36 (:LINEAR FLOOR-TYPE-2 . 1)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 2)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 1)) (1326 1326 (:META CANCEL_PLUS-LESSP-CORRECT)) (1241 1241 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1178 17 (:REWRITE FLOOR-TYPE-3 . 3)) (1164 979 (:REWRITE DEFAULT-<-2)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 3)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 2)) (1127 17 (:REWRITE FLOOR-TYPE-3 . 2)) (1031 94 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1027 375 (:REWRITE DEFAULT-*-2)) (833 833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (781 104 (:LINEAR EXPT->-1)) (732 375 (:REWRITE DEFAULT-*-1)) (687 26 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (683 683 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (621 351 (:REWRITE EXPT-COMPARE-EQUAL)) (600 40 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (566 17 (:REWRITE RTL1)) (566 17 (:REWRITE FLOOR-SIMPLE-CASES)) (566 17 (:REWRITE FLOOR-DETERMINED-1)) (507 169 (:REWRITE EXPO-OF-NOT-RATIONALP)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (475 104 (:LINEAR EXPT-LESS-THAN-1-HACK)) (459 169 (:REWRITE DEFAULT-+-2)) (442 13 (:REWRITE DISTRIBUTIVITY-ALT)) (438 146 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (391 17 (:REWRITE FLOOR-=-X/Y . 3)) (391 17 (:REWRITE FLOOR-=-X/Y . 2)) (360 40 (:REWRITE EXPO-/-POWER2P-ALT)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (325 325 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (321 321 (:TYPE-PRESCRIPTION POWER2P)) (297 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (239 169 (:REWRITE EXPO-EXPT2)) (235 47 (:REWRITE DEFAULT-UNARY-/)) (209 209 (:REWRITE POWER2P-EXPT2-I)) (208 208 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (195 169 (:REWRITE DEFAULT-+-1)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (171 171 (:REWRITE FOLD-CONSTS-IN-*)) (169 169 (:REWRITE EXPO-MINUS-ERIC)) (146 146 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (116 36 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (106 106 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 23 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (81 27 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (80 40 (:REWRITE POWER2P-INVERSE)) (74 74 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (69 23 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (66 22 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (50 10 (:LINEAR MOD-TYPE . 3)) (48 10 (:LINEAR MOD-TYPE . 1)) (40 40 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (19 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 13 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (10 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-LINEAR (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 60 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (34 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (28 2 (:LINEAR LOGTAIL-LEQ)) (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 1 (:REWRITE LOGTAIL-IDENTITY)) (20 10 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (12 6 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 8 (:REWRITE DEFAULT-+-1)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE DEFAULT-+-2)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (3 3 (:REWRITE ASH-AS-LOGTAIL)) (3 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (3 3 (:META META-RULE-ERIC)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-OF-ONE-LESS-THAN-X (271 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (107 1 (:REWRITE EQUAL-MINUS-MINUS)) (82 6 (:LINEAR EXPT->-1)) (77 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (60 22 (:REWRITE POWER2-INTEGER)) (60 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (42 26 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE EXPT-COMPARE)) (41 41 (:META CANCEL_PLUS-LESSP-CORRECT)) (37 26 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE SIGNED-BYTE-P-+)) (32 10 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 6 (:REWRITE EXPT-COMPARE-EQUAL)) (29 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (22 2 (:REWRITE EXPO-EXPT2)) (19 13 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 6 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 1 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (1 1 (:TYPE-PRESCRIPTION EVENP))) (LOGBITP-OF-ONE-LESS-CASE-1 (197 4 (:REWRITE RTL1)) (104 1 (:REWRITE MOD-=-0 . 2)) (98 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (75 4 (:REWRITE FLOOR-DETERMINED-1)) (56 8 (:LINEAR EXPT->-1)) (52 37 (:REWRITE DEFAULT-<-2)) (49 49 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 3 (:REWRITE ODDP-OF-*)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 37 (:REWRITE DEFAULT-<-1)) (36 12 (:REWRITE DEFAULT-*-2)) (30 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (30 6 (:REWRITE DEFAULT-UNARY-/)) (28 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (24 2 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE DEFAULT-+-1)) (13 1 (:LINEAR MOD-TYPE . 4)) (13 1 (:LINEAR MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (12 12 (:REWRITE DEFAULT-*-1)) (12 1 (:LINEAR MOD-TYPE . 2)) (12 1 (:LINEAR MOD-TYPE . 1)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (FLOOR-OF-MINUS-1-CASE-1 (1225 1212 (:REWRITE DEFAULT-*-2)) (1212 1212 (:REWRITE DEFAULT-*-1)) (1175 44 (:REWRITE FLOOR-=-X/Y . 3)) (1100 430 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (956 956 (:REWRITE EXPT-COMPARE)) (923 44 (:REWRITE FLOOR-=-X/Y . 2)) (852 49 (:REWRITE RTL1)) (813 58 (:REWRITE CANCEL-FLOOR-+-BASIC)) (758 659 (:REWRITE DEFAULT-<-1)) (659 659 (:REWRITE DEFAULT-<-2)) (572 572 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (537 44 (:REWRITE FLOOR-TYPE-3 . 3)) (523 49 (:REWRITE FLOOR-SIMPLE-CASES)) (523 49 (:REWRITE FLOOR-DETERMINED-1)) (522 44 (:REWRITE FLOOR-TYPE-3 . 2)) (498 447 (:REWRITE DEFAULT-+-2)) (474 44 (:REWRITE FLOOR-TYPE-4 . 2)) (447 447 (:REWRITE DEFAULT-+-1)) (434 70 (:LINEAR X*Y>1-POSITIVE)) (424 44 (:REWRITE FLOOR-TYPE-4 . 3)) (402 67 (:REWRITE EQUAL-1-HACK)) (317 215 (:REWRITE DEFAULT-UNARY-/)) (312 312 (:REWRITE POWER2-INTEGER)) (264 264 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (234 234 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (216 72 (:REWRITE INTEGERP-UNARY-)) (194 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (174 6 (:REWRITE FLOOR-=-X/Y . 4)) (170 11 (:LINEAR FLOOR-TYPE-2 . 2)) (170 11 (:LINEAR FLOOR-TYPE-2 . 1)) (151 151 (:META CANCEL_TIMES-EQUAL-CORRECT)) (151 11 (:LINEAR FLOOR-TYPE-1 . 2)) (151 11 (:LINEAR FLOOR-TYPE-1 . 1)) (145 145 (:REWRITE EXPT-COMPARE-EQUAL)) (123 123 (:REWRITE DEFAULT-UNARY-MINUS)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (96 72 (:REWRITE INTEGERP-+-MINUS-*-1)) (92 92 (:REWRITE FOLD-CONSTS-IN-*)) (84 49 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (69 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (67 67 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (56 56 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (49 49 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (36 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 1 (:REWRITE EVENP-COLLECT-1)) (32 20 (:REWRITE /-CANCELLATION-ON-RIGHT)) (30 30 (:REWRITE FOLD-CONSTS-IN-+)) (25 1 (:REWRITE EVENP-+-ALT)) (17 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (16 12 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (16 12 (:REWRITE INTEGERP-PROD-3)) (15 3 (:REWRITE EVENP-COLLAPSE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT))) (LOGBITP-OF-ONE-LESS-CASE-2 (104 1 (:REWRITE MOD-=-0 . 2)) (90 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (65 2 (:REWRITE FLOOR-=-X/Y . 2)) (49 9 (:REWRITE POWER2-INTEGER)) (48 4 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 33 (:REWRITE DEFAULT-<-2)) (39 33 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (36 36 (:REWRITE EXPT-COMPARE)) (36 36 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 5 (:LINEAR EXPT->-1)) (31 2 (:REWRITE RTL1)) (31 2 (:REWRITE FLOOR-SIMPLE-CASES)) (31 2 (:REWRITE FLOOR-DETERMINED-1)) (27 7 (:REWRITE EXPT-COMPARE-EQUAL)) (26 2 (:LINEAR MOD-TYPE . 4)) (26 2 (:LINEAR MOD-TYPE . 3)) (24 2 (:LINEAR MOD-TYPE . 2)) (24 2 (:LINEAR MOD-TYPE . 1)) (21 7 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 2 (:REWRITE FLOOR-TYPE-3 . 3)) (9 2 (:REWRITE FLOOR-TYPE-3 . 2)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (8 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (8 2 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-=-X/Y . 3)) (2 1 (:REWRITE UNICITY-OF-0)) (2 1 (:REWRITE POWER2P-INVERSE)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-LESS (495 44 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (466 11 (:REWRITE RTL1)) (230 5 (:REWRITE ODDP-OF-*)) (216 11 (:REWRITE FLOOR-DETERMINED-1)) (203 29 (:LINEAR EXPT->-1)) (188 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (184 4 (:REWRITE FLOOR-=-X/Y . 2)) (146 62 (:REWRITE DEFAULT-*-2)) (142 106 (:REWRITE DEFAULT-<-2)) (141 3 (:REWRITE INTEGERP-UNARY-)) (139 139 (:META CANCEL_PLUS-LESSP-CORRECT)) (134 24 (:REWRITE EXPT-COMPARE-EQUAL)) (117 106 (:REWRITE DEFAULT-<-1)) (117 97 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (110 22 (:REWRITE DEFAULT-UNARY-/)) (108 36 (:REWRITE EXPO-OF-NOT-RATIONALP)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 62 (:REWRITE DEFAULT-*-1)) (68 68 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 2 (:REWRITE DISTRIBUTIVITY-ALT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (61 23 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (58 58 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 48 (:REWRITE DEFAULT-+-2)) (52 48 (:REWRITE DEFAULT-+-1)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (40 5 (:REWRITE FLOOR-TYPE-3 . 3)) (40 5 (:REWRITE FLOOR-TYPE-3 . 2)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:REWRITE EXPO-MINUS-ERIC)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (35 5 (:REWRITE FLOOR-TYPE-4 . 3)) (35 5 (:REWRITE FLOOR-TYPE-4 . 2)) (34 2 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (30 23 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 20 (:REWRITE DEFAULT-UNARY-MINUS)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (24 24 (:META CANCEL_PLUS-EQUAL-CORRECT)) (22 1 (:REWRITE MOD-=-0 . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ONE-LESS-THAN-X (1976 48 (:REWRITE RTL1)) (1223 140 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (851 48 (:REWRITE FLOOR-DETERMINED-1)) (652 20 (:REWRITE FLOOR-=-X/Y . 2)) (634 226 (:REWRITE DEFAULT-*-2)) (489 301 (:REWRITE DEFAULT-<-2)) (412 412 (:META CANCEL_PLUS-LESSP-CORRECT)) (406 58 (:LINEAR EXPT->-1)) (375 65 (:REWRITE EXPT-COMPARE-EQUAL)) (350 70 (:REWRITE DEFAULT-UNARY-/)) (333 301 (:REWRITE DEFAULT-<-1)) (302 226 (:REWRITE DEFAULT-*-1)) (276 92 (:REWRITE EXPO-OF-NOT-RATIONALP)) (261 93 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (212 58 (:REWRITE <-+-CONSTANT-CONSTANT)) (184 114 (:REWRITE DEFAULT-+-2)) (168 21 (:REWRITE FLOOR-TYPE-3 . 3)) (168 21 (:REWRITE FLOOR-TYPE-3 . 2)) (166 166 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (152 114 (:REWRITE DEFAULT-+-1)) (147 21 (:REWRITE FLOOR-TYPE-4 . 3)) (147 21 (:REWRITE FLOOR-TYPE-4 . 2)) (142 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (141 3 (:REWRITE INTEGERP-UNARY-)) (129 1 (:REWRITE FLOOR-=-X/Y . 4)) (116 116 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (112 93 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (106 8 (:LINEAR FLOOR-TYPE-2 . 2)) (106 8 (:LINEAR FLOOR-TYPE-2 . 1)) (102 4 (:LINEAR X*Y>1-POSITIVE)) (93 31 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (92 92 (:REWRITE EXPO-MINUS-ERIC)) (92 8 (:LINEAR FLOOR-TYPE-1 . 2)) (92 8 (:LINEAR FLOOR-TYPE-1 . 1)) (91 91 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (73 41 (:REWRITE DEFAULT-UNARY-MINUS)) (65 65 (:META CANCEL_TIMES-EQUAL-CORRECT)) (65 65 (:META CANCEL_PLUS-EQUAL-CORRECT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (58 58 (:LINEAR EXPT-LESS-THAN-1-HACK)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (22 1 (:REWRITE MOD-=-0 . 2)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-ONE-LESS-THAN-X (337 20 (:DEFINITION UNSIGNED-BYTE-P)) (329 17 (:REWRITE LOGHEAD-IDENTITY)) (277 20 (:DEFINITION INTEGER-RANGE-P)) (226 226 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (136 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (100 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (82 2 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (53 47 (:REWRITE DEFAULT-<-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (47 47 (:REWRITE DEFAULT-<-2)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:META META-RULE-ERIC)) (35 23 (:REWRITE DEFAULT-+-2)) (34 1 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (33 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 3 (:LINEAR LOGHEAD-LEQ)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 23 (:REWRITE DEFAULT-+-1)) (22 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 3 (:REWRITE LOGHEAD-<)) (10 10 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (7 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGAPP-<))) (EQUAL-+-HACK-GEN (42 40 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 5 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:REWRITE DEFAULT-+-2)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE))) (EQUAL-CONSTANT-+-BLAH (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE SUM-POWER-OF-TWO)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKY) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT (453 14 (:REWRITE LOGHEAD-IDENTITY)) (243 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (224 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (59 46 (:REWRITE DEFAULT-<-2)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (55 55 (:REWRITE EXPT-COMPARE)) (55 55 (:META CANCEL_PLUS-LESSP-CORRECT)) (52 46 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (29 29 (:REWRITE POWER2-INTEGER)) (27 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (26 16 (:REWRITE DEFAULT-+-2)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (23 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE LOGEXT-IDENTITY)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE DEFAULT-+-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 15 (:META META-RULE-ERIC)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE DEFAULT-*-1)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT-BLAH (360 8 (:REWRITE LOGHEAD-IDENTITY)) (216 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (184 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (72 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (60 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (46 36 (:REWRITE DEFAULT-<-2)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 36 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1))) (REMOVEME4 (524 16 (:REWRITE LOGHEAD-IDENTITY)) (257 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (237 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (158 4 (:LINEAR LOGHEAD-LEQ)) (109 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 3 (:REWRITE LOGEXT-IDENTITY)) (77 55 (:REWRITE DEFAULT-<-2)) (68 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (67 55 (:REWRITE DEFAULT-<-1)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (66 42 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (54 27 (:REWRITE USB-TIGHTEN)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 48 (:REWRITE POWER2-INTEGER)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 8 (:REWRITE LOGCAR-EVENP)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (31 18 (:REWRITE DEFAULT-+-2)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 18 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (REMOVEME7 (556 14 (:REWRITE LOGHEAD-IDENTITY)) (244 10 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (234 31 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (176 4 (:LINEAR LOGHEAD-LEQ)) (108 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (101 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (91 10 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 49 (:REWRITE DEFAULT-<-2)) (63 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (62 31 (:REWRITE USB-TIGHTEN)) (51 49 (:REWRITE DEFAULT-<-1)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 8 (:LINEAR X*Y>1-POSITIVE)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 21 (:REWRITE DEFAULT-+-2)) (35 18 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (33 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE POWER2-INTEGER)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (31 31 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 21 (:REWRITE DEFAULT-+-1)) (28 4 (:REWRITE COMMUTATIVITY-OF-+)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:TYPE-PRESCRIPTION IFIX)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE UNICITY-OF-0)) (10 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 4 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 3 (:REWRITE IFIX-INTEGERP)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (SIGNED-BYTE-P-OF-TRUNCATE (216 119 (:REWRITE DEFAULT-<-1)) (212 7 (:REWRITE TRUNCATE-TYPE . 2)) (161 11 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (123 123 (:META CANCEL_PLUS-LESSP-CORRECT)) (121 14 (:DEFINITION ABS)) (119 119 (:REWRITE DEFAULT-<-2)) (110 110 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (107 7 (:REWRITE TRUNCATE-=-X/Y . 2)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 4)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 3)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 2)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 1)) (68 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 11 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (56 17 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (44 44 (:REWRITE POWER2-INTEGER)) (34 10 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 6 (:LINEAR TRUNCATE-TYPE . 3)) (30 6 (:LINEAR TRUNCATE-TYPE . 4)) (22 11 (:REWRITE USB-TIGHTEN)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:TYPE-PRESCRIPTION ABS)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (11 11 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (11 11 (:REWRITE DEFAULT-UNARY-MINUS)) (10 7 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR TRUNCATE-TYPE . 1)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:LINEAR X*Y>1-POSITIVE))) (BITP-RANGE) (LOGCAR-OF-LOGBIT (25 5 (:REWRITE LOGCAR-EVENP)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (10 5 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-SHIFT-HACK (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (461 244 (:REWRITE DEFAULT-*-2)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (308 164 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (284 244 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (164 164 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 55 (:REWRITE POWER2-INTEGER)) (49 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (HACKZ (24 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (16 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR X*Y>1-POSITIVE)) (9 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (HACKZZ (13 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (6 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE RTL-A-MILLION)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (NO-INTEGERPS-BETWEEN-0-AND-1) (NO-INTEGERPS-BETWEEN-0-AND-MINUS-1) (INTEGERP-OF-UNARY-/-WHEN-INTEGER-P (25 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE NO-INTEGERPS-BETWEEN-0-AND-1)) (14 2 (:REWRITE NORMALIZE-<-MINUS-/)) (14 2 (:REWRITE EQUAL-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 9 (:REWRITE DEFAULT-<-2)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT))) (ARITHHACK2 (34 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (FLOOR-OF-ONE-MORE-CASE-1 (1385 77 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (1111 21 (:REWRITE 0-<-*)) (935 93 (:REWRITE INTEGERP-+-MINUS-*-4)) (864 41 (:REWRITE FLOOR-TYPE-4 . 2)) (766 191 (:REWRITE EQUAL-1-HACK)) (726 270 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (691 41 (:REWRITE FLOOR-TYPE-3 . 3)) (656 656 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (656 656 (:REWRITE EXPT-COMPARE)) (575 575 (:REWRITE DEFAULT-<-2)) (575 575 (:REWRITE DEFAULT-<-1)) (542 20 (:REWRITE CANCEL-FLOOR-+-BASIC)) (524 471 (:META CANCEL_PLUS-EQUAL-CORRECT)) (471 471 (:META CANCEL_TIMES-EQUAL-CORRECT)) (470 470 (:REWRITE EXPT-COMPARE-EQUAL)) (464 40 (:REWRITE FLOOR-=-X/Y . 2)) (454 404 (:REWRITE DEFAULT-*-2)) (452 41 (:REWRITE FLOOR-SIMPLE-CASES)) (432 14 (:REWRITE CANCEL-MOD-+-BASIC)) (404 404 (:REWRITE DEFAULT-*-1)) (392 41 (:REWRITE RTL1)) (392 41 (:REWRITE FLOOR-DETERMINED-1)) (384 64 (:LINEAR X*Y>1-POSITIVE)) (383 41 (:REWRITE FLOOR-TYPE-3 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (308 66 (:REWRITE <-*-/-LEFT)) (296 14 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (291 21 (:DEFINITION IFF)) (268 268 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (243 135 (:REWRITE DEFAULT-UNARY-/)) (193 11 (:LINEAR FLOOR-TYPE-2 . 2)) (190 31 (:REWRITE <-*-/-RIGHT)) (176 11 (:LINEAR FLOOR-TYPE-1 . 2)) (148 43 (:REWRITE RTL-A-MILLION)) (145 145 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (139 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (119 11 (:LINEAR FLOOR-TYPE-2 . 1)) (114 114 (:REWRITE POWER2-INTEGER)) (113 41 (:REWRITE FLOOR-TYPE-4 . 3)) (109 74 (:REWRITE DEFAULT-+-2)) (106 2 (:REWRITE FLOOR-=-X/Y . 4)) (102 39 (:REWRITE MY-EQUAL-/)) (85 32 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (74 74 (:REWRITE DEFAULT-+-1)) (60 3 (:LINEAR MOD-TYPE . 2)) (48 48 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE NORMALIZE-EQUAL-0)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:REWRITE FOLD-CONSTS-IN-*)) (29 11 (:LINEAR FLOOR-TYPE-1 . 1)) (24 1 (:REWRITE EQUAL-MINUS-MINUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 21 (:REWRITE TIMES-ZERO)) (21 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (17 3 (:LINEAR MOD-TYPE . 3)) (16 4 (:DEFINITION ZEROP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (12 12 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (FLOOR-OF-ONE-MORE-CASE-2 (6450 33 (:REWRITE FLOOR-OF-ONE-MORE-CASE-1)) (2266 105 (:REWRITE CANCEL-MOD-+-BASIC)) (1598 758 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1532 1532 (:REWRITE DEFAULT-*-2)) (1532 1532 (:REWRITE DEFAULT-*-1)) (1440 400 (:REWRITE EQUAL-1-HACK)) (1432 52 (:REWRITE MOD-=-0 . 2)) (975 36 (:REWRITE FLOOR-=-X/Y . 3)) (900 900 (:REWRITE EXPT-COMPARE)) (873 109 (:REWRITE INTEGERP-+-MINUS-*-4)) (726 726 (:REWRITE DEFAULT-<-2)) (726 726 (:REWRITE DEFAULT-<-1)) (716 36 (:REWRITE FLOOR-=-X/Y . 2)) (702 702 (:META CANCEL_TIMES-EQUAL-CORRECT)) (698 698 (:REWRITE EXPT-COMPARE-EQUAL)) (593 24 (:LINEAR MOD-TYPE . 2)) (552 48 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (529 519 (:REWRITE DEFAULT-+-2)) (526 379 (:REWRITE DEFAULT-UNARY-/)) (519 519 (:REWRITE DEFAULT-+-1)) (500 6 (:REWRITE CANCEL-MOD-+-3)) (377 125 (:REWRITE RTL-A-MILLION)) (341 39 (:REWRITE RTL1)) (341 39 (:REWRITE FLOOR-DETERMINED-1)) (338 52 (:REWRITE INTEGERP-+-MINUS-*-2)) (329 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (312 312 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (222 36 (:REWRITE FLOOR-TYPE-3 . 2)) (177 177 (:REWRITE POWER2-INTEGER)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (168 52 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (157 24 (:LINEAR MOD-TYPE . 3)) (134 134 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (124 124 (:REWRITE FOLD-CONSTS-IN-*)) (120 36 (:REWRITE FLOOR-TYPE-3 . 3)) (112 28 (:DEFINITION ZEROP)) (108 36 (:REWRITE FLOOR-TYPE-4 . 2)) (104 17 (:LINEAR X*Y>1-POSITIVE)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (90 3 (:REWRITE FLOOR-=-X/Y . 4)) (84 84 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (84 16 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (84 16 (:REWRITE INTEGERP-PROD-3)) (79 13 (:LINEAR FLOOR-TYPE-2 . 1)) (70 28 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (56 56 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (53 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 52 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 48 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (44 44 (:REWRITE FOLD-CONSTS-IN-+)) (44 32 (:REWRITE /-CANCELLATION-ON-RIGHT)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (36 36 (:REWRITE FLOOR-TYPE-4 . 3)) (34 13 (:LINEAR FLOOR-TYPE-2 . 2)) (31 13 (:LINEAR FLOOR-TYPE-1 . 2)) (24 24 (:LINEAR MOD-TYPE . 1)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:LINEAR FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (FLOOR-OF-ONE-MORE (821 31 (:REWRITE FLOOR-=-X/Y . 3)) (731 43 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (642 64 (:REWRITE INTEGERP-+-MINUS-*-4)) (534 194 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (505 120 (:REWRITE EQUAL-1-HACK)) (382 16 (:REWRITE CANCEL-MOD-+-BASIC)) (337 337 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (337 337 (:REWRITE EXPT-COMPARE)) (337 337 (:REWRITE DEFAULT-<-2)) (337 337 (:REWRITE DEFAULT-<-1)) (337 337 (:META CANCEL_PLUS-LESSP-CORRECT)) (252 31 (:REWRITE FLOOR-=-X/Y . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (235 31 (:REWRITE RTL1)) (235 31 (:REWRITE FLOOR-SIMPLE-CASES)) (235 31 (:REWRITE FLOOR-DETERMINED-1)) (229 229 (:REWRITE DEFAULT-*-2)) (229 229 (:REWRITE DEFAULT-*-1)) (227 31 (:REWRITE FLOOR-TYPE-3 . 3)) (216 216 (:REWRITE EXPT-COMPARE-EQUAL)) (216 216 (:META CANCEL_TIMES-EQUAL-CORRECT)) (216 216 (:META CANCEL_PLUS-EQUAL-CORRECT)) (205 31 (:REWRITE FLOOR-TYPE-3 . 2)) (199 97 (:REWRITE DEFAULT-UNARY-/)) (199 31 (:REWRITE FLOOR-TYPE-4 . 2)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (120 1 (:REWRITE FLOOR-=-X/Y . 4)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (84 12 (:LINEAR FLOOR-TYPE-2 . 1)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 15 (:REWRITE RTL-A-MILLION)) (77 42 (:REWRITE DEFAULT-+-2)) (72 72 (:REWRITE POWER2-INTEGER)) (54 12 (:LINEAR FLOOR-TYPE-2 . 2)) (48 12 (:LINEAR FLOOR-TYPE-1 . 2)) (45 45 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (42 42 (:REWRITE DEFAULT-+-1)) (40 10 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (40 5 (:LINEAR MOD-TYPE . 3)) (35 5 (:LINEAR MOD-TYPE . 2)) (34 34 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (33 2 (:REWRITE CANCEL-FLOOR-+-BASIC)) (32 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (31 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-TYPE-4 . 3)) (24 6 (:DEFINITION ZEROP)) (23 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 12 (:LINEAR FLOOR-TYPE-1 . 1)) (8 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 8 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-HELPER-1 (994 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (915 391 (:REWRITE DEFAULT-+-2)) (790 391 (:REWRITE DEFAULT-+-1)) (657 70 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (576 262 (:REWRITE DEFAULT-*-1)) (552 262 (:REWRITE DEFAULT-*-2)) (486 6 (:REWRITE MOD-=-0 . 2)) (484 484 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (350 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (277 93 (:REWRITE EXPO-OF-NOT-RATIONALP)) (242 242 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (212 26 (:REWRITE INTEGERP-+-MINUS-*-1)) (196 10 (:REWRITE INTEGERP-+-MINUS-*-3)) (175 35 (:REWRITE DEFAULT-UNARY-/)) (166 2 (:LINEAR MOD-TYPE . 2)) (149 149 (:META CANCEL_TIMES-EQUAL-CORRECT)) (112 74 (:REWRITE DEFAULT-<-1)) (108 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (100 74 (:REWRITE DEFAULT-<-2)) (93 93 (:REWRITE EXPO-MINUS-ERIC)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (80 28 (:REWRITE DEFAULT-UNARY-MINUS)) (63 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (59 59 (:REWRITE POWER2-INTEGER)) (58 58 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (48 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (40 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (32 2 (:REWRITE RTL-A-MILLION)) (27 7 (:REWRITE SUM-POWER-OF-TWO)) (21 3 (:LINEAR EXPT->-1)) (18 6 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (18 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (15 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE FOLD-CONSTS-IN-*)) (6 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:LINEAR MOD-TYPE . 3)) (6 2 (:LINEAR MOD-TYPE . 1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ONE-TWO-MULTIPLES-FIT (40 10 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (34 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (32 7 (:REWRITE EQUAL-1-HACK)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 5 (:REWRITE DEFAULT-UNARY-/)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (MOD-HELPER-2 (748 748 (:REWRITE DEFAULT-+-2)) (748 748 (:REWRITE DEFAULT-+-1)) (738 738 (:REWRITE DEFAULT-*-2)) (738 738 (:REWRITE DEFAULT-*-1)) (516 516 (:REWRITE EXPT-COMPARE)) (446 306 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (360 360 (:REWRITE DEFAULT-<-2)) (360 360 (:REWRITE DEFAULT-<-1)) (260 15 (:REWRITE MOD-=-0 . 2)) (200 200 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (187 187 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (158 58 (:REWRITE EQUAL-1-HACK)) (153 153 (:REWRITE DEFAULT-UNARY-/)) (146 146 (:META CANCEL_TIMES-EQUAL-CORRECT)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (134 134 (:REWRITE EXPT-COMPARE-EQUAL)) (126 21 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (111 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 34 (:REWRITE INTEGERP-+-MINUS-*-4)) (100 100 (:REWRITE FOLD-CONSTS-IN-*)) (84 84 (:REWRITE POWER2-INTEGER)) (62 27 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 27 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (21 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (20 20 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (20 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE FOLD-CONSTS-IN-+)) (15 15 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (14 14 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (12 12 (:REWRITE SUM-POWER-OF-TWO)) (12 12 (:REWRITE EQUAL-CONSTANT-+)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (8 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (6 1 (:LINEAR X*Y>1-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-MORE (1768 180 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1125 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (1032 12 (:REWRITE FLOOR-=-X/Y . 3)) (859 44 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (591 22 (:REWRITE INTEGERP-+-MINUS-*-2)) (564 8 (:REWRITE MOD-=-0 . 2)) (522 6 (:LINEAR MOD-TYPE . 2)) (450 90 (:REWRITE DEFAULT-UNARY-/)) (405 135 (:REWRITE EXPO-OF-NOT-RATIONALP)) (336 116 (:REWRITE DEFAULT-*-2)) (285 161 (:REWRITE DEFAULT-<-2)) (280 12 (:REWRITE RTL1)) (280 12 (:REWRITE FLOOR-SIMPLE-CASES)) (280 12 (:REWRITE FLOOR-DETERMINED-1)) (274 274 (:META CANCEL_TIMES-EQUAL-CORRECT)) (274 274 (:META CANCEL_PLUS-EQUAL-CORRECT)) (264 12 (:REWRITE FLOOR-=-X/Y . 2)) (256 12 (:REWRITE FLOOR-TYPE-3 . 2)) (172 57 (:REWRITE DEFAULT-+-2)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (165 165 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (161 161 (:REWRITE DEFAULT-<-1)) (156 52 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (135 135 (:REWRITE EXPO-MINUS-ERIC)) (128 116 (:REWRITE DEFAULT-*-1)) (123 57 (:REWRITE DEFAULT-+-1)) (122 122 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (120 10 (:REWRITE RTL-A-MILLION)) (102 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (96 12 (:REWRITE FLOOR-TYPE-3 . 3)) (94 94 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (90 30 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (87 87 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (86 2 (:REWRITE CANCEL-MOD-+-BASIC)) (85 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (84 12 (:REWRITE FLOOR-TYPE-4 . 2)) (79 79 (:REWRITE POWER2-INTEGER)) (68 19 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (61 61 (:LINEAR EXPT-LESS-THAN-1-HACK)) (47 47 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (30 30 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (22 22 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (22 22 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (19 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (18 6 (:LINEAR MOD-TYPE . 3)) (18 6 (:LINEAR MOD-TYPE . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-TYPE-4 . 3)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGBIT-OF-ONE-MORE (85 5 (:REWRITE LOGHEAD-IDENTITY)) (40 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (24 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:REWRITE DEFAULT-<-2)) (20 20 (:REWRITE DEFAULT-<-1)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (19 19 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE DEFAULT-+-2)) (7 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (OTHER-WAY (957 956 (:REWRITE DEFAULT-*-2)) (956 956 (:REWRITE DEFAULT-*-1)) (681 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (589 587 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (587 587 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (489 489 (:REWRITE EXPT-COMPARE)) (468 27 (:REWRITE RTL1)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (343 343 (:REWRITE DEFAULT-+-2)) (343 343 (:REWRITE DEFAULT-+-1)) (260 260 (:REWRITE DEFAULT-<-2)) (260 260 (:REWRITE DEFAULT-<-1)) (161 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (122 122 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (108 27 (:REWRITE FLOOR-DETERMINED-1)) (105 15 (:REWRITE ERIC700)) (104 8 (:LINEAR MOD-TYPE . 2)) (98 98 (:REWRITE POWER2-INTEGER)) (78 78 (:REWRITE INTEGERP-+-MINUS-*-4)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (61 22 (:REWRITE FLOOR-TYPE-3 . 3)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 22 (:REWRITE FLOOR-TYPE-4 . 3)) (55 22 (:REWRITE FLOOR-TYPE-4 . 2)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (34 33 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (33 33 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:META CANCEL_TIMES-EQUAL-CORRECT)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (26 26 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (21 21 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE HACKYY)) (17 1 (:REWRITE ODDP-+)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE ODDP-OF-*))) (FLOOR-LINEAR-1 (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 10 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE COMMUTATIVITY-OF-*)) (18 2 (:REWRITE FLOOR-=-X/Y . 3)) (18 2 (:REWRITE FLOOR-=-X/Y . 2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (16 2 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE DEFAULT-<-1)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 3)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (12 2 (:REWRITE RTL1)) (12 2 (:REWRITE FLOOR-SIMPLE-CASES)) (12 2 (:REWRITE FLOOR-DETERMINED-1)) (10 10 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 1 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (2 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE DEFAULT-+-1))) (FLOOR-WHEN-<-2 (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (23 12 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (19 19 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (19 19 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 2 (:LINEAR FLOOR-TYPE-2 . 2)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (8 2 (:LINEAR FLOOR-TYPE-1 . 2)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:LINEAR FLOOR-TYPE-1 . 1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (ONE-WAY (3276 30 (:REWRITE RTL)) (1008 990 (:REWRITE DEFAULT-*-2)) (990 990 (:REWRITE DEFAULT-*-1)) (878 29 (:REWRITE RTL1)) (557 555 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (555 555 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (546 546 (:REWRITE EXPT-COMPARE)) (365 365 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (311 311 (:REWRITE DEFAULT-<-2)) (311 311 (:REWRITE DEFAULT-<-1)) (303 303 (:REWRITE DEFAULT-+-2)) (303 303 (:REWRITE DEFAULT-+-1)) (289 44 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (223 29 (:REWRITE FLOOR-SIMPLE-CASES)) (208 16 (:LINEAR MOD-TYPE . 2)) (159 159 (:REWRITE POWER2-INTEGER)) (149 149 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (138 138 (:REWRITE INTEGERP-+-MINUS-*-4)) (110 29 (:REWRITE FLOOR-DETERMINED-1)) (99 99 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (63 24 (:REWRITE FLOOR-TYPE-3 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 2)) (56 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 51 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (51 51 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (38 38 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (20 20 (:REWRITE FOLD-CONSTS-IN-+)) (20 20 (:REWRITE EXPT-COMPARE-EQUAL)) (18 3 (:REWRITE HACKYY)) (16 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (16 16 (:LINEAR MOD-TYPE . 3)) (16 16 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-SPLIT-X-REWRITE) (LOGHEAD-SPLIT-Y-REWRITE (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGTAIL-EQUAL-MINUS-ONE-REWRITE (105 1 (:REWRITE FLOOR-=-X/Y . 3)) (68 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (42 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (41 1 (:REWRITE FLOOR-TYPE-1)) (39 39 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (39 39 (:REWRITE EXPT-COMPARE)) (39 39 (:META CANCEL_PLUS-LESSP-CORRECT)) (39 29 (:REWRITE DEFAULT-<-1)) (37 29 (:REWRITE DEFAULT-<-2)) (35 5 (:LINEAR EXPT->-1)) (30 1 (:REWRITE RTL1)) (30 1 (:REWRITE FLOOR-SIMPLE-CASES)) (30 1 (:REWRITE FLOOR-DETERMINED-1)) (28 8 (:REWRITE EXPT-COMPARE-EQUAL)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE DEFAULT-+-1)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE DEFAULT-*-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (<-OF-ASH (82 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (49 1 (:REWRITE FLOOR-WHEN-<-2)) (33 1 (:LINEAR X*Y>1-POSITIVE)) (25 12 (:REWRITE EXPT-COMPARE)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 4 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT->-1)) (18 8 (:REWRITE DEFAULT-*-2)) (15 9 (:REWRITE DEFAULT-<-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 9 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE POWER2-INTEGER)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-SHIFT (3500 130 (:LINEAR X*Y>1-POSITIVE)) (2958 122 (:REWRITE ARITHHACK2)) (2805 34 (:REWRITE <-*-0)) (2679 34 (:REWRITE 0-<-*)) (1879 16 (:REWRITE FLOOR-TYPE-4 . 2)) (1851 16 (:REWRITE FLOOR-TYPE-4 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 2)) (1662 68 (:DEFINITION IFF)) (1053 857 (:REWRITE DEFAULT-<-2)) (1033 1007 (:REWRITE EXPT-COMPARE)) (1029 857 (:REWRITE DEFAULT-<-1)) (1007 1007 (:META CANCEL_PLUS-LESSP-CORRECT)) (1005 1005 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (817 16 (:REWRITE FLOOR-WHEN-<-2)) (812 16 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (663 16 (:REWRITE RTL1)) (663 16 (:REWRITE FLOOR-SIMPLE-CASES)) (663 16 (:REWRITE FLOOR-DETERMINED-1)) (640 64 (:REWRITE NORMALIZE-<-MINUS-/)) (621 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (570 16 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (538 538 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (497 497 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (460 351 (:REWRITE EXPT-COMPARE-EQUAL)) (360 16 (:REWRITE FLOOR-=-X/Y . 3)) (360 16 (:REWRITE FLOOR-=-X/Y . 2)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (326 128 (:REWRITE MY-EQUAL-/)) (310 4 (:LINEAR FLOOR-TYPE-2 . 2)) (310 4 (:LINEAR FLOOR-TYPE-2 . 1)) (300 4 (:LINEAR FLOOR-TYPE-1 . 2)) (300 4 (:LINEAR FLOOR-TYPE-1 . 1)) (286 88 (:REWRITE <-*-/-LEFT-COMMUTED)) (236 98 (:REWRITE DEFAULT-*-2)) (230 32 (:REWRITE <-*-/-RIGHT-COMMUTED)) (200 98 (:REWRITE DEFAULT-*-1)) (168 19 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (146 18 (:REWRITE EQUAL-1-HACK)) (133 133 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 12 (:REWRITE DEFAULT-UNARY-/)) (68 12 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 4 (:REWRITE <-*-/-RIGHT)) (49 3 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (49 3 (:REWRITE INTEGERP-PROD-3)) (46 7 (:LINEAR EXPT->-1)) (45 23 (:REWRITE DEFAULT-+-2)) (42 1 (:REWRITE NORMALIZE-EQUAL-0)) (37 37 (:REWRITE FOLD-CONSTS-IN-*)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (29 14 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE DEFAULT-+-1)) (18 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE EXPO-SHIFT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (7 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 1 (:REWRITE EQUAL-MINUS-MINUS)) (5 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGTAIL-SHIFT-CONSTANT-VERSION (104 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (97 97 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 2 (:REWRITE LOGTAIL-IDENTITY)) (64 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (33 20 (:REWRITE DEFAULT-<-2)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (17 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (16 2 (:LINEAR LOGTAIL-LEQ)) (14 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE DEFAULT-+-1)) (12 2 (:LINEAR EXPT->-1)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 4 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:REWRITE EXPO-MINUS-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (DIVIDES) (DIVIDES-HACK (14 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 8 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE DEFAULT-*-1)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 3 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 1 (:REWRITE INTEGERP-UNARY-)) (3 3 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (DIVIDES-HACK2 (4 3 (:REWRITE DEFAULT-*-2)) (4 3 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-OF-SUM (60 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE DEFAULT-UNARY-/)) (18 3 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 6 (:REWRITE DEFAULT-*-2)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 6 (:REWRITE DEFAULT-*-1)) (8 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1))) (DIVIDES-OF-SUM-2 (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 12 (:REWRITE POWER2-INTEGER)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2B (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 11 (:REWRITE POWER2-INTEGER)) (10 4 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2C (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:REWRITE POWER2-INTEGER)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 8 (:REWRITE DEFAULT-+-1)) (11 8 (:REWRITE DEFAULT-*-2)) (10 8 (:REWRITE DEFAULT-+-2)) (10 8 (:REWRITE DEFAULT-*-1)) (10 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-UNARY-MINUS (22 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (8 2 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE POWER2-INTEGER)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (5 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (2 1 (:DEFINITION NOT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (DIVIDES-OF-TIMES-1 (40 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 2 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (8 6 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-TIMES-2) (INTEGERP-SQUEEZE-HACK (3 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK (96 3 (:REWRITE EQUAL-1-HACK)) (84 6 (:LINEAR X*Y>1-POSITIVE)) (78 6 (:REWRITE ARITHHACK2)) (26 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-*-2)) (11 11 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 1 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (INTEGERP-SQUEEZE-HACK-2 (4 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK-3 (15 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (11 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 1 (:REWRITE ARITHHACK2)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (DIVIDES-SQUEEZE-HACK-2 (178 12 (:LINEAR X*Y>1-POSITIVE)) (166 12 (:REWRITE ARITHHACK2)) (109 5 (:REWRITE EQUAL-1-HACK)) (101 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:REWRITE DEFAULT-<-2)) (54 54 (:REWRITE DEFAULT-<-1)) (50 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE EXPT-COMPARE-EQUAL)) (21 21 (:META CANCEL_TIMES-EQUAL-CORRECT)) (21 21 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:REWRITE DEFAULT-*-2)) (18 18 (:REWRITE DEFAULT-*-1)) (12 3 (:REWRITE DEFAULT-UNARY-/)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-LEFT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE (5570 770 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (5427 5427 (:REWRITE EXPT-COMPARE)) (4950 770 (:REWRITE DIVIDES-SQUEEZE-HACK)) (4857 4028 (:REWRITE DEFAULT-+-2)) (4570 4028 (:REWRITE DEFAULT-+-1)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4135 3897 (:REWRITE DEFAULT-<-1)) (3961 3897 (:REWRITE DEFAULT-<-2)) (3323 3095 (:REWRITE DEFAULT-*-2)) (3125 3095 (:REWRITE DEFAULT-*-1)) (2898 124 (:REWRITE INTEGERP-+-MINUS-*-2)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (1833 1833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1509 1509 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1196 236 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (752 44 (:REWRITE DIVIDES-OF-TIMES-2)) (658 658 (:META CANCEL_TIMES-EQUAL-CORRECT)) (628 52 (:REWRITE SUM-POWER-OF-TWO)) (594 594 (:REWRITE EXPT-COMPARE-EQUAL)) (488 68 (:REWRITE DIVIDES-OF-SUM)) (409 409 (:REWRITE POWER2-INTEGER)) (365 364 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (364 364 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (315 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (274 274 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (212 200 (:REWRITE DEFAULT-UNARY-MINUS)) (144 16 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (140 140 (:REWRITE FOLD-CONSTS-IN-+)) (139 124 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (128 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (124 52 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (64 32 (:REWRITE USB-TIGHTEN)) (52 52 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (52 52 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (45 45 (:LINEAR MOD-TYPE . 3)) (45 45 (:LINEAR MOD-TYPE . 1)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 32 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (26 26 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE EQUAL-CONSTANT-+)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (74 8 (:REWRITE DIVIDES-HACK2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (66 5 (:REWRITE MOD-=-0 . 2)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (25 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (22 22 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (22 22 (:REWRITE EXPT-COMPARE)) (22 22 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 8 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (21 3 (:REWRITE INTEGERP-UNARY-)) (18 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK)) (16 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (13 2 (:REWRITE <-+-NEGATIVE-0-1)) (12 4 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (9 1 (:REWRITE DISTRIBUTIVITY-ALT)) (8 8 (:TYPE-PRESCRIPTION DIVIDES)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (134 57 (:REWRITE DEFAULT-+-1)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (118 57 (:REWRITE DEFAULT-+-2)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (102 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (155 60 (:REWRITE DEFAULT-+-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (121 60 (:REWRITE DEFAULT-+-2)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (96 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-16-32 (40 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (40 5 (:REWRITE MOD-=-0 . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (27 23 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 23 (:REWRITE DEFAULT-<-1)) (23 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (21 7 (:REWRITE COMMUTATIVITY-OF-*)) (16 2 (:LINEAR MOD-TYPE . 2)) (14 14 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ASH1-IS-MULT2 (300 11 (:REWRITE FLOOR-WHEN-<-2)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (198 18 (:LINEAR X*Y>1-POSITIVE)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (68 8 (:DEFINITION IFF)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (63 45 (:REWRITE DEFAULT-<-2)) (55 45 (:REWRITE DEFAULT-<-1)) (48 8 (:DEFINITION NOT)) (24 16 (:REWRITE DEFAULT-*-2)) (24 8 (:REWRITE UNICITY-OF-1)) (21 11 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 16 (:REWRITE DEFAULT-*-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 4 (:REWRITE DEFAULT-+-2)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE POWER2-INTEGER)) (3 2 (:REWRITE IFIX-INTEGERP))) (ASH-IS-MULT2 (385 13 (:REWRITE FLOOR-WHEN-<-2)) (222 22 (:LINEAR X*Y>1-POSITIVE)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (74 56 (:REWRITE DEFAULT-<-2)) (74 56 (:REWRITE DEFAULT-<-1)) (68 8 (:DEFINITION IFF)) (56 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 2 (:REWRITE ZIP-OPEN)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (40 18 (:REWRITE DEFAULT-*-2)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 13 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (27 1 (:REWRITE <-*-Y-X-Y)) (25 18 (:REWRITE DEFAULT-*-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 16 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (ASH-OPEN (1454 22 (:LINEAR X*Y>1-POSITIVE)) (419 12 (:REWRITE FLOOR-WHEN-<-2)) (338 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (251 243 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (172 4 (:REWRITE <-*-0)) (172 4 (:REWRITE 0-<-*)) (160 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (148 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (146 2 (:LINEAR FLOOR-TYPE-2 . 2)) (146 2 (:LINEAR FLOOR-TYPE-2 . 1)) (140 2 (:LINEAR FLOOR-TYPE-1 . 2)) (140 2 (:LINEAR FLOOR-TYPE-1 . 1)) (122 2 (:LINEAR FLOOR-LINEAR-1)) (100 55 (:REWRITE DEFAULT-<-1)) (91 55 (:REWRITE DEFAULT-<-2)) (76 76 (:REWRITE EXPT-COMPARE)) (76 76 (:META CANCEL_PLUS-LESSP-CORRECT)) (68 8 (:DEFINITION IFF)) (64 18 (:REWRITE DEFAULT-*-2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (57 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 2 (:REWRITE ZIP-OPEN)) (48 8 (:REWRITE UNICITY-OF-1)) (37 18 (:REWRITE DEFAULT-*-1)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 16 (:REWRITE DEFAULT-+-2)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (SHIFT-IS-MULT2 (82 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (76 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 4 (:REWRITE MOD-=-0 . 2)) (50 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 2 (:REWRITE 0-<-*)) (31 23 (:REWRITE DEFAULT-<-2)) (31 23 (:REWRITE DEFAULT-<-1)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 2 (:LINEAR MOD-TYPE . 2)) (22 16 (:REWRITE DEFAULT-*-2)) (22 16 (:REWRITE DEFAULT-*-1)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (10 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (10 1 (:REWRITE FLOOR-WHEN-<-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP))) (SHIFT-BOUNDS (56 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (52 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 2 (:REWRITE 0-<-*)) (26 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (26 2 (:REWRITE MOD-=-0 . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (18 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 1 (:LINEAR MOD-TYPE . 2)) (11 8 (:REWRITE DEFAULT-*-2)) (11 8 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 4 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 1 (:REWRITE FLOOR-WHEN-<-2)) (4 4 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT (152 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (72 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 27 (:REWRITE EXPT-COMPARE)) (40 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT->-1)) (32 19 (:REWRITE DEFAULT-<-2)) (28 28 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 19 (:REWRITE DEFAULT-<-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE EXPO-EXPT2)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (EXTEND-< (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LINEAR-REWRITE (56 56 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGBITP-TOP-BIT-WHEN-SIGNED-BYTE-P (775 365 (:REWRITE DEFAULT-*-2)) (707 365 (:REWRITE DEFAULT-*-1)) (504 58 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (454 5 (:REWRITE RTL1)) (436 166 (:REWRITE DEFAULT-+-2)) (410 410 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (271 5 (:REWRITE FLOOR-=-X/Y . 3)) (252 62 (:REWRITE EXPT-COMPARE-EQUAL)) (207 193 (:REWRITE EXPT-COMPARE)) (206 166 (:REWRITE DEFAULT-+-1)) (205 205 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (200 200 (:REWRITE USB-LINEAR-REWRITE)) (192 192 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (179 129 (:REWRITE DEFAULT-<-1)) (169 129 (:REWRITE DEFAULT-<-2)) (160 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (145 29 (:REWRITE DEFAULT-UNARY-/)) (133 4 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (95 95 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (82 9 (:LINEAR EXPT->-1)) (68 5 (:REWRITE FLOOR-SIMPLE-CASES)) (68 5 (:REWRITE FLOOR-DETERMINED-1)) (68 5 (:REWRITE FLOOR-=-X/Y . 2)) (64 64 (:META CANCEL_TIMES-EQUAL-CORRECT)) (62 62 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (60 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 15 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (43 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (40 40 (:TYPE-PRESCRIPTION POWER2P)) (40 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (29 5 (:REWRITE FLOOR-TYPE-3 . 3)) (29 5 (:REWRITE FLOOR-TYPE-3 . 2)) (26 5 (:REWRITE FLOOR-TYPE-4 . 3)) (26 5 (:REWRITE FLOOR-TYPE-4 . 2)) (25 1 (:LINEAR X*Y>1-POSITIVE)) (22 22 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE POWER2P-EXPT2-I)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE EXPO-EXPT2)) (20 2 (:REWRITE EVENP-COLLAPSE)) (20 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (19 19 (:REWRITE FOLD-CONSTS-IN-*)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 2 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (10 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-2 (72 9 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (12 11 (:META META-RULE-ERIC)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE DEFAULT-<-1)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGORC1-OF-ZERO-TWO (80 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (63 6 (:REWRITE LOGIOR-AS-B-IOR)) (15 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE USB-TIGHTEN)) (9 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (9 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 2 (:REWRITE LOGNOT-ZIP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN))) (LOGORC1-OF-ZERO-ONE) (LOGEQV-OF-ZERO-ONE (80 4 (:LINEAR LOGEQV-BOUND)) (46 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (5 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE LOGNOT-ZIP)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (1 1 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEQV-COMMUTATIVE (76 4 (:LINEAR LOGEQV-BOUND)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION LOGORC1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2 (6250 11 (:DEFINITION BINARY-LOGAND)) (6215 65 (:LINEAR X*Y>1-POSITIVE)) (5180 11 (:REWRITE <-OF-LOGTAIL)) (2666 123 (:REWRITE FLOOR-WHEN-<-2)) (1911 49 (:REWRITE INTEGERP-+-MINUS-*-1)) (1592 36 (:REWRITE LOGTAIL-IDENTITY)) (1285 147 (:REWRITE <-*-/-LEFT-COMMUTED)) (1104 1104 (:REWRITE USB-LINEAR-REWRITE)) (1104 1104 (:META CANCEL_PLUS-LESSP-CORRECT)) (1096 1096 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1096 1096 (:REWRITE EXPT-COMPARE)) (903 854 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (876 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (870 40 (:REWRITE EQUAL-1-HACK)) (746 611 (:REWRITE DEFAULT-<-1)) (735 35 (:REWRITE EQUAL-MINUS-MINUS)) (715 5 (:REWRITE LOGCDR-*-1/2-EXPT)) (704 50 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (685 611 (:REWRITE DEFAULT-<-2)) (647 20 (:REWRITE ZIP-OPEN)) (617 196 (:REWRITE EXPT-COMPARE-EQUAL)) (615 92 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (593 593 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (568 344 (:REWRITE DEFAULT-*-2)) (566 156 (:REWRITE FOLD-CONSTS-IN-*)) (552 127 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (548 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (533 73 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (500 12 (:REWRITE 0-<-*)) (498 8 (:REWRITE LOGTAIL-LESSP)) (476 12 (:REWRITE <-*-0)) (444 24 (:REWRITE NORMALIZE-EQUAL-0)) (424 6 (:LINEAR FLOOR-TYPE-2 . 2)) (414 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (406 6 (:LINEAR FLOOR-TYPE-2 . 1)) (406 6 (:LINEAR FLOOR-TYPE-1 . 2)) (397 344 (:REWRITE DEFAULT-*-1)) (388 6 (:LINEAR FLOOR-TYPE-1 . 1)) (386 27 (:LINEAR LOGTAIL-LEQ)) (384 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (380 20 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (351 18 (:REWRITE FLOOR-TYPE-3 . 3)) (347 170 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (340 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (333 264 (:REWRITE DEFAULT-+-2)) (330 26 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (324 18 (:REWRITE FLOOR-TYPE-3 . 2)) (318 6 (:LINEAR FLOOR-LINEAR-1)) (317 36 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (306 18 (:REWRITE FLOOR-TYPE-4 . 2)) (293 264 (:REWRITE DEFAULT-+-1)) (288 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (279 18 (:REWRITE RTL1)) (279 18 (:REWRITE FLOOR-TYPE-4 . 3)) (279 18 (:REWRITE FLOOR-SIMPLE-CASES)) (279 18 (:REWRITE FLOOR-DETERMINED-1)) (240 200 (:META CANCEL_TIMES-EQUAL-CORRECT)) (237 79 (:REWRITE EXPO-OF-NOT-RATIONALP)) (234 32 (:LINEAR EXPT->-1)) (230 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (225 18 (:REWRITE FLOOR-=-X/Y . 3)) (225 18 (:REWRITE FLOOR-=-X/Y . 2)) (224 112 (:REWRITE USB-TIGHTEN)) (216 24 (:DEFINITION IFF)) (196 196 (:META CANCEL_PLUS-EQUAL-CORRECT)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (176 29 (:REWRITE COMMUTATIVITY-OF-+)) (170 170 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (150 150 (:REWRITE INTEGERP-+-MINUS-*-4)) (140 28 (:REWRITE SUM-POWER-OF-TWO)) (140 20 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (136 136 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (126 18 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (112 112 (:TYPE-PRESCRIPTION LOGBITP)) (112 112 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (108 18 (:REWRITE DISTRIBUTIVITY-ALT)) (100 5 (:REWRITE LOGTAIL-SHIFT-CONSTANT-VERSION)) (97 11 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (96 32 (:REWRITE FOLD-CONSTS-IN-+)) (94 92 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (92 80 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (90 46 (:REWRITE DEFAULT-UNARY-MINUS)) (90 18 (:REWRITE CANCEL-FLOOR-+-BASIC)) (82 82 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (79 79 (:REWRITE EXPO-MINUS-ERIC)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-2)) (72 54 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (72 4 (:REWRITE EQUAL-CONSTANT-+)) (70 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (68 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (64 64 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 10 (:REWRITE DISTRIBUTIVITY)) (60 30 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (52 52 (:TYPE-PRESCRIPTION LOGMASKP)) (34 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (32 32 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 28 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (27 27 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (24 4 (:REWRITE EVENP-+-ALT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (20 20 (:REWRITE FLOOR-UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (13 13 (:REWRITE EVENP-*)) (11 11 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (8 8 (:REWRITE MY-EQUAL-/)) (4 4 (:REWRITE EVENP-+)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION (397 9 (:REWRITE EXPO-COMPARISON-REWRITE-TO-BOUND-2)) (122 2 (:REWRITE LOGTAIL-IDENTITY)) (115 2 (:REWRITE ASH-0)) (108 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (107 2 (:REWRITE ZIP-OPEN)) (104 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (104 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (104 2 (:REWRITE ASH-AS-LOGTAIL)) (89 89 (:REWRITE USB-LINEAR-REWRITE)) (89 89 (:REWRITE EXPT-COMPARE)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (74 74 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (51 2 (:REWRITE LOGTAIL-EQUAL-0)) (50 1 (:LINEAR EXPT->-1)) (48 44 (:REWRITE DEFAULT-<-1)) (44 44 (:REWRITE DEFAULT-<-2)) (44 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (36 4 (:LINEAR LOGTAIL-LEQ)) (34 32 (:REWRITE DEFAULT-+-2)) (32 32 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 18 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (9 3 (:REWRITE EXPT-EXPO-WHEN-POWER2P)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:LINEAR EXPO-LOWER-POS)) (1 1 (:LINEAR EXPO-LOWER-BOUND-2))) (DIVIDE-BOTH-SIDES-HACK) (CANCEL-NEGATED-CASE (51 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (25 1 (:REWRITE <-*-0)) (15 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 7 (:REWRITE DEFAULT-*-1)) (8 1 (:DEFINITION IFF)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:REWRITE DEFAULT-*-2)) (7 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGEQV-NEG (123 7 (:REWRITE LOGIOR-AS-B-IOR)) (60 3 (:REWRITE USBP-OVER-LOGAND)) (29 29 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (28 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (24 12 (:REWRITE USB-TIGHTEN)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (22 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (14 14 (:TYPE-PRESCRIPTION LOGMASKP)) (13 7 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 7 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (11 7 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE LOGNOT-ZIP)) (5 5 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-OF-LOGNOT (65 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (21 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (18 13 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (LOGBIT-SUBST-SIMPLER (108 6 (:REWRITE LOGHEAD-IDENTITY)) (54 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (23 23 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 23 (:REWRITE EXPT-COMPARE)) (23 23 (:META CANCEL_PLUS-LESSP-CORRECT)) (21 19 (:REWRITE DEFAULT-<-1)) (20 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE USB-TIGHTEN)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGBIT-OF-LOGCAR (136 30 (:REWRITE LOGCAR-EVENP)) (62 25 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 52 (:REWRITE POWER2-INTEGER)) (44 44 (:TYPE-PRESCRIPTION EVENP)) (34 4 (:REWRITE EQUAL-1-HACK)) (19 11 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 5 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1))) (LOGHEAD-WHEN-MOSTLY-0 (499 499 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 10 (:REWRITE LOGHEAD-IDENTITY)) (97 97 (:REWRITE USB-LINEAR-REWRITE)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (92 92 (:REWRITE EXPT-COMPARE)) (90 81 (:REWRITE DEFAULT-<-2)) (88 81 (:REWRITE DEFAULT-<-1)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (74 4 (:REWRITE ASH-0)) (72 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (63 7 (:LINEAR LOGHEAD-LEQ)) (58 4 (:REWRITE ZIP-OPEN)) (50 50 (:REWRITE DEFAULT-+-2)) (50 50 (:REWRITE DEFAULT-+-1)) (49 4 (:REWRITE ASH-AS-LOGTAIL)) (48 48 (:REWRITE LOGHEAD-SUBST2)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:META META-RULE-ERIC)) (45 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (40 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE POWER2-INTEGER)) (35 4 (:REWRITE ASH-GOES-TO-0)) (30 15 (:REWRITE USB-TIGHTEN)) (24 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 22 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 3 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (16 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-SIMPLER-2 (658 42 (:REWRITE LOGHEAD-IDENTITY)) (528 528 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (299 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (298 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (127 127 (:REWRITE USB-LINEAR-REWRITE)) (125 14 (:LINEAR LOGHEAD-LEQ)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (102 89 (:REWRITE DEFAULT-<-1)) (91 89 (:REWRITE DEFAULT-<-2)) (84 42 (:REWRITE USB-TIGHTEN)) (60 60 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (57 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (54 54 (:META META-RULE-ERIC)) (54 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (49 49 (:REWRITE POWER2-INTEGER)) (48 44 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (44 44 (:REWRITE LOGHEAD-SUBST)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (38 3 (:REWRITE ASH-0)) (30 30 (:REWRITE DEFAULT-+-2)) (30 30 (:REWRITE DEFAULT-+-1)) (29 2 (:REWRITE ZIP-OPEN)) (27 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (27 3 (:REWRITE ASH-AS-LOGTAIL)) (26 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 3 (:REWRITE ASH-GOES-TO-0)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL (417 417 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (223 12 (:REWRITE LOGHEAD-IDENTITY)) (196 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (127 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (110 110 (:REWRITE USB-LINEAR-REWRITE)) (107 11 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (103 103 (:REWRITE EXPT-COMPARE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (70 8 (:LINEAR LOGHEAD-LEQ)) (69 3 (:REWRITE ASH-0)) (63 57 (:REWRITE DEFAULT-<-1)) (57 57 (:REWRITE DEFAULT-<-2)) (57 3 (:REWRITE ZIP-OPEN)) (54 3 (:REWRITE ASH-GOES-TO-0)) (51 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (51 3 (:REWRITE ASH-AS-LOGTAIL)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (38 38 (:REWRITE DEFAULT-+-2)) (38 38 (:REWRITE DEFAULT-+-1)) (34 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (32 5 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (30 15 (:REWRITE USB-TIGHTEN)) (28 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 25 (:META META-RULE-ERIC)) (21 21 (:REWRITE LOGHEAD-SUBST)) (19 19 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-LOGHEAD-DROP (127 8 (:REWRITE LOGHEAD-IDENTITY)) (64 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (63 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (33 27 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE USB-LINEAR-REWRITE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 27 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT->-1)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 7 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-EQUAL-LOGAPP-SAME-REWRITE (57 5 (:REWRITE LOGHEAD-IDENTITY)) (52 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 2 (:REWRITE EQUAL-1-HACK)) (15 14 (:REWRITE DEFAULT-<-2)) (15 14 (:REWRITE DEFAULT-<-1)) (10 5 (:REWRITE USB-TIGHTEN)) (9 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-LOGHEAD-ONE-SHORTER-REWRITE (154 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (87 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (52 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (43 43 (:REWRITE USB-LINEAR-REWRITE)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 23 (:REWRITE DEFAULT-<-2)) (23 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (14 7 (:REWRITE USB-TIGHTEN)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 2 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS (204 11 (:REWRITE LOGHEAD-IDENTITY)) (196 196 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 86 (:REWRITE USB-LINEAR-REWRITE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 85 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (85 85 (:REWRITE EXPT-COMPARE)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (49 46 (:REWRITE DEFAULT-<-2)) (48 46 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (39 39 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 16 (:REWRITE USB-TIGHTEN)) (30 27 (:REWRITE DEFAULT-+-2)) (27 27 (:REWRITE DEFAULT-+-1)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT (204 11 (:REWRITE LOGHEAD-IDENTITY)) (199 199 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 47 (:REWRITE DEFAULT-<-2)) (49 47 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (40 40 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 28 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE USB-TIGHTEN)) (28 28 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT (204 9 (:REWRITE LOGHEAD-IDENTITY)) (140 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (91 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR LOGHEAD-LEQ)) (22 11 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 12 (:REWRITE DEFAULT-+-2)) (13 12 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-SUBST (18 1 (:REWRITE LOGHEAD-IDENTITY)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-SUBST (36 2 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:META META-RULE-ERIC))) (LOGBITP-SUBST-2 (91 6 (:REWRITE LOGHEAD-IDENTITY)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 17 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-EQUAL-MIN-VALUE-HACK (64 8 (:LINEAR LOGHEAD-LEQ)) (60 6 (:REWRITE LOGHEAD-IDENTITY)) (51 51 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE USB-TIGHTEN)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:META META-RULE-ERIC)) (14 9 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE LOGHEAD-SUBST-2)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 7 (:REWRITE LOGBIT-SUBST)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR))) (LOGHEAD-SPLIT-GEN (618 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (251 35 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (242 1 (:REWRITE ASH-0)) (238 1 (:REWRITE ZIP-OPEN)) (208 8 (:REWRITE LOGTAIL-IDENTITY)) (199 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (112 112 (:REWRITE USB-LINEAR-REWRITE)) (112 112 (:REWRITE EXPT-COMPARE)) (112 112 (:META CANCEL_PLUS-LESSP-CORRECT)) (110 110 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (108 100 (:REWRITE DEFAULT-<-1)) (104 8 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (100 100 (:REWRITE DEFAULT-<-2)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (80 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (72 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (70 35 (:REWRITE USB-TIGHTEN)) (70 8 (:LINEAR LOGHEAD-LEQ)) (67 67 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 8 (:LINEAR EXPT->-1)) (44 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (35 35 (:TYPE-PRESCRIPTION LOGBITP)) (35 35 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 1 (:REWRITE LOGTAIL-EQUAL-0)) (25 25 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (25 25 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE LOGHEAD-SUBST)) (25 25 (:META META-RULE-ERIC)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (ASH-EQUAL-EXPT-REWRITE (35 1 (:REWRITE FLOOR-WHEN-<-2)) (17 4 (:REWRITE EXPT-COMPARE)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:LINEAR EXPT->-1)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-EXPT-REWRITE (573 573 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (324 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (261 11 (:REWRITE LOGHEAD-IDENTITY)) (183 183 (:REWRITE USB-LINEAR-REWRITE)) (175 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (167 167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (120 8 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (107 107 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (97 89 (:REWRITE DEFAULT-<-1)) (89 89 (:REWRITE DEFAULT-<-2)) (86 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (80 80 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 6 (:REWRITE LOGTAIL-IDENTITY)) (63 1 (:REWRITE FLOOR-WHEN-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (52 6 (:LINEAR LOGHEAD-LEQ)) (47 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (44 22 (:REWRITE USB-TIGHTEN)) (42 41 (:REWRITE DEFAULT-+-1)) (41 41 (:REWRITE DEFAULT-+-2)) (40 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 1 (:LINEAR X*Y>1-POSITIVE)) (30 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (29 29 (:META META-RULE-ERIC)) (28 28 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE POWER2-INTEGER)) (24 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE ASH-0)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 8 (:REWRITE LOGBIT-SUBST)) (20 1 (:REWRITE ZIP-OPEN)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 4 (:REWRITE LOGBITP-SUBST)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGBIT-SUBST-SIMPLER)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE DEFAULT-*-1)) (5 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-GOES-TO-0))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-N-MINUS-1 (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN (82 5 (:REWRITE LOGHEAD-IDENTITY)) (71 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (39 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (37 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (35 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 18 (:REWRITE DEFAULT-<-1)) (25 22 (:REWRITE DEFAULT-+-2)) (25 22 (:REWRITE DEFAULT-+-1)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 3 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 9 (:REWRITE USB-TIGHTEN)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 3 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION (70 70 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (20 2 (:REWRITE LOGHEAD-IDENTITY)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-BYTE-P-PLUS-LIMIT (307 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (87 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (74 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (63 49 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (62 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 4 (:LINEAR EXPT->-1)) (40 26 (:REWRITE DEFAULT-<-2)) (38 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 26 (:REWRITE DEFAULT-<-1)) (23 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (17 6 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:REWRITE POWER2-INTEGER)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE DEFAULT-+-1)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 1 (:DEFINITION FIX))) (PLUS-OF-LOGAPP-SUCK-IN-GEN2 (94 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 16 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (26 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (20 16 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST)) (7 7 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (7 7 (:REWRITE LOGHEAD-+-REDUCE)) (7 7 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUCK-IN-ONE-PLUS (345 21 (:REWRITE LOGHEAD-IDENTITY)) (108 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (85 59 (:REWRITE DEFAULT-<-2)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 56 (:REWRITE POWER2-INTEGER)) (56 8 (:LINEAR EXPT->-1)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (35 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 10 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (8 8 (:REWRITE LOGHEAD-OF-ONE-MORE-THAN-X)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPO-MINUS-ERIC))) (LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT (74 74 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 5 (:REWRITE LOGHEAD-IDENTITY)) (35 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 13 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE DEFAULT-+-2)) (7 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-NORMALIZE-CONSTANT-ARG (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 11 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-IDENTITY)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-SUBST-IN-FIRST-ARG (65 5 (:REWRITE LOGHEAD-IDENTITY)) (42 42 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (30 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 14 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 14 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE POWER2-INTEGER)) (9 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 1 (:REWRITE LOGAPP-LOGHEAD-DROP)) (7 6 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ODD-<-EVEN-TIGHTEN (16 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGAPP-DOES-NOTHING-REWRITE (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (11 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGTAIL-IDENTITY)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 3 (:REWRITE USB-TIGHTEN)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGAPP-OF-LOGHEAD (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 3 (:REWRITE LOGHEAD-IDENTITY)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 13 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-DOES-NOTHING-REWRITE (112 1 (:REWRITE FLOOR-=-X/Y . 3)) (49 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (46 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (43 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (29 9 (:REWRITE EXPT-COMPARE-EQUAL)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (20 14 (:REWRITE DEFAULT-<-2)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE DEFAULT-<-1)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-OF-ONE-MORE))) (LOGBIT-OF-USB-1 (44 11 (:REWRITE LOGCAR-EVENP)) (27 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (24 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (18 9 (:REWRITE USB-TIGHTEN)) (15 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (11 1 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-CONSTANT-FALSE-FROM-USB (70 70 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR EXPT->-1)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 3 (:REWRITE DEFAULT-<-2)) (4 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS))) (LOGHEAD-CANCEL-CONSTANTS-HACK (6648 6648 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6546 427 (:REWRITE LOGHEAD-IDENTITY)) (3190 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2863 407 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1275 856 (:REWRITE DEFAULT-<-2)) (998 856 (:REWRITE DEFAULT-<-1)) (881 881 (:REWRITE USB-LINEAR-REWRITE)) (874 874 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (874 874 (:REWRITE EXPT-COMPARE)) (856 107 (:LINEAR LOGHEAD-LEQ)) (814 814 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (814 407 (:REWRITE USB-TIGHTEN)) (781 781 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (767 767 (:REWRITE POWER2-INTEGER)) (734 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (658 658 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (643 248 (:REWRITE DEFAULT-+-2)) (622 442 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (572 400 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (563 248 (:REWRITE DEFAULT-+-1)) (472 442 (:REWRITE LOGHEAD-SUBST)) (442 442 (:REWRITE LOGHEAD-SUBST2)) (442 442 (:META META-RULE-ERIC)) (427 427 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (407 407 (:TYPE-PRESCRIPTION LOGBITP)) (407 407 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (389 389 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (372 200 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (311 23 (:REWRITE LOGHEAD-<)) (234 26 (:LINEAR EXPT->-1)) (208 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (154 28 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (115 5 (:REWRITE LOGHEAD-<=)) (89 51 (:REWRITE DEFAULT-UNARY-MINUS)) (84 84 (:REWRITE FOLD-CONSTS-IN-+)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 34 (:REWRITE EXPT-COMPARE-EQUAL)) (34 34 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (34 34 (:META CANCEL_TIMES-EQUAL-CORRECT)) (34 34 (:META CANCEL_PLUS-EQUAL-CORRECT)) (28 28 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 14 (:REWRITE SUM-POWER-OF-TWO)) (14 14 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (LOGBIT-TOO-BIG (44 44 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 5 (:REWRITE DEFAULT-<-2)) (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-TO-ASH-1-REWRITE (39 4 (:REWRITE ASH-0)) (26 4 (:REWRITE ZIP-OPEN)) (16 7 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (14 2 (:REWRITE EQUAL-1-HACK)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (10 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-CONSTANT))) (LOGHEAD-OF-LOGEXT-HACK-1 (8001 48 (:REWRITE LOGHEAD-IDENTITY)) (7243 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (6880 12 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (2294 192 (:REWRITE <-+-CONSTANT-CONSTANT)) (2186 11 (:REWRITE LOGHEAD-COMPARE-HACK)) (1821 690 (:REWRITE POWER2-INTEGER)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1447 366 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1403 48 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1172 1068 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1081 625 (:REWRITE EXPT-COMPARE)) (1005 193 (:REWRITE INTEGERP-+-MINUS-*-2)) (954 66 (:LINEAR EXPT->-1)) (888 66 (:LINEAR EXPT-LESS-THAN-1-HACK)) (836 532 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (625 625 (:REWRITE USB-LINEAR-REWRITE)) (625 625 (:META CANCEL_PLUS-LESSP-CORRECT)) (621 72 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (601 601 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (597 144 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (564 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN)) (518 8 (:LINEAR LOGHEAD-LEQ)) (480 16 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (476 16 (:LINEAR LOGEXT-BOUNDS-2)) (469 411 (:REWRITE DEFAULT-<-2)) (467 411 (:REWRITE DEFAULT-<-1)) (456 88 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (456 16 (:LINEAR LOGEXT-BOUNDS)) (440 4 (:REWRITE LOGHEAD-EQUAL-EXPT-REWRITE)) (395 28 (:REWRITE LOGEXT-IDENTITY)) (374 75 (:REWRITE EXPO-EXPT2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (314 314 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (311 175 (:REWRITE DEFAULT-+-2)) (265 69 (:META META-RULE-ERIC)) (257 75 (:REWRITE EXPO-OF-NOT-RATIONALP)) (217 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (200 100 (:REWRITE USB-TIGHTEN)) (193 193 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (193 175 (:REWRITE DEFAULT-+-1)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (188 188 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (161 17 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (149 149 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (134 134 (:TYPE-PRESCRIPTION LOGBITP)) (132 132 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (128 4 (:REWRITE <-+-NEGATIVE-0-1)) (111 43 (:REWRITE DEFAULT-UNARY-MINUS)) (100 100 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (99 99 (:TYPE-PRESCRIPTION POWER2P)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (94 94 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (88 88 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (86 69 (:REWRITE LOGHEAD-SUBST)) (86 43 (:DEFINITION FIX)) (83 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (76 17 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (75 75 (:REWRITE POWER2P-EXPT2-I)) (75 75 (:REWRITE EXPO-MINUS-ERIC)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 69 (:REWRITE LOGHEAD-SUBST2)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 8 (:LINEAR LOGEXT-BOUND-UPPER)) (57 47 (:META CANCEL_PLUS-EQUAL-CORRECT)) (56 56 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (56 56 (:REWRITE EXPONENTS-ADD)) (56 17 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (47 47 (:META CANCEL_TIMES-EQUAL-CORRECT)) (44 44 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 44 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (44 44 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (38 38 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (37 37 (:REWRITE EXPT-COMPARE-EQUAL)) (37 15 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (17 17 (:REWRITE LOGBITP-TOO-BIG)) (17 17 (:REWRITE LOGBITP-SUBST-2)) (17 17 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 4 (:REWRITE SIGNED-BYTE-P-OF-LOGEXT)) (8 4 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-1-ALT (3233 40 (:REWRITE LOGHEAD-IDENTITY)) (2475 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2182 7 (:REWRITE LOGHEAD-COMPARE-HACK)) (1944 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (1405 370 (:REWRITE POWER2-INTEGER)) (1395 40 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (979 166 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (862 76 (:REWRITE <-+-CONSTANT-CONSTANT)) (861 93 (:REWRITE INTEGERP-+-MINUS-*-2)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (548 8 (:LINEAR LOGHEAD-LEQ)) (516 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (513 361 (:REWRITE EXPT-COMPARE)) (436 404 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (436 332 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (361 361 (:REWRITE USB-LINEAR-REWRITE)) (361 361 (:META CANCEL_PLUS-LESSP-CORRECT)) (354 26 (:LINEAR EXPT->-1)) (353 353 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (328 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (325 275 (:REWRITE DEFAULT-<-2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (307 275 (:REWRITE DEFAULT-<-1)) (257 61 (:META META-RULE-ERIC)) (240 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (235 12 (:REWRITE LOGEXT-IDENTITY)) (234 234 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (213 123 (:REWRITE DEFAULT-+-2)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (194 55 (:REWRITE EXPO-EXPT2)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (177 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (177 55 (:REWRITE EXPO-OF-NOT-RATIONALP)) (177 13 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (176 88 (:REWRITE USB-TIGHTEN)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (173 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (172 172 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (162 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (137 123 (:REWRITE DEFAULT-+-1)) (125 125 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (124 124 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (114 114 (:TYPE-PRESCRIPTION LOGBITP)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (93 93 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (93 13 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (78 61 (:REWRITE LOGHEAD-SUBST)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (70 35 (:DEFINITION FIX)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (68 13 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 61 (:REWRITE LOGHEAD-SUBST2)) (63 63 (:TYPE-PRESCRIPTION POWER2P)) (55 55 (:REWRITE POWER2P-EXPT2-I)) (55 55 (:REWRITE EXPO-MINUS-ERIC)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (52 13 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (47 27 (:REWRITE DEFAULT-UNARY-MINUS)) (45 35 (:META CANCEL_PLUS-EQUAL-CORRECT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 35 (:META CANCEL_TIMES-EQUAL-CORRECT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (32 4 (:LINEAR LOGEXT-BOUND-UPPER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (24 24 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 24 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 24 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (23 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (21 7 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (19 12 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (13 13 (:REWRITE LOGBITP-TOO-BIG)) (13 13 (:REWRITE LOGBITP-SUBST-2)) (13 13 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (12 12 (:REWRITE EXPONENTS-ADD)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-2 (961 22 (:REWRITE LOGHEAD-IDENTITY)) (537 22 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (475 43 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (320 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (192 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (184 8 (:LINEAR LOGHEAD-LEQ)) (160 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (153 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (149 149 (:REWRITE POWER2-INTEGER)) (146 114 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (109 68 (:REWRITE DEFAULT-+-2)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 83 (:REWRITE DEFAULT-<-2)) (102 102 (:REWRITE USB-LINEAR-REWRITE)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (102 102 (:META CANCEL_PLUS-LESSP-CORRECT)) (99 83 (:REWRITE DEFAULT-<-1)) (86 86 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (86 86 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (86 43 (:REWRITE USB-TIGHTEN)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (56 8 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (47 47 (:TYPE-PRESCRIPTION LOGBITP)) (43 43 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (36 4 (:LINEAR EXPT->-1)) (32 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (26 26 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (26 26 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST)) (24 24 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (24 24 (:REWRITE LOGHEAD-SUBST2)) (24 24 (:REWRITE LOGHEAD-SUBST)) (24 24 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (24 24 (:REWRITE LOGHEAD-+-REDUCE)) (24 24 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (24 24 (:META META-RULE-ERIC)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (22 22 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-UNARY-MINUS)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-LOGEXT-HACK-3 (641 16 (:REWRITE LOGHEAD-IDENTITY)) (363 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (317 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (172 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (132 7 (:LINEAR LOGHEAD-LEQ)) (111 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (105 105 (:REWRITE POWER2-INTEGER)) (96 65 (:REWRITE DEFAULT-+-2)) (88 67 (:REWRITE DEFAULT-<-2)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 80 (:REWRITE USB-LINEAR-REWRITE)) (80 80 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (75 67 (:REWRITE DEFAULT-<-1)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 58 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (58 29 (:REWRITE USB-TIGHTEN)) (49 49 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (49 7 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (45 28 (:REWRITE INTEGERP-+-MINUS-*-2)) (39 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 4 (:LINEAR EXPT->-1)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (24 24 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (24 24 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUBST2)) (22 22 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 22 (:META META-RULE-ERIC)) (21 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-+-CANCEL-BETTER-ALT-1 (159 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (111 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-+-2)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGHEAD-OF-LOGEXT-HACK-4 (1700 21 (:REWRITE LOGHEAD-IDENTITY)) (1324 24 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (969 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (450 43 (:REWRITE <-+-CONSTANT-CONSTANT)) (432 98 (:REWRITE INTEGERP-+-MINUS-*-2)) (325 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (310 262 (:REWRITE POWER2-INTEGER)) (303 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (210 134 (:REWRITE EXPT-COMPARE)) (168 12 (:LINEAR EXPT->-1)) (160 149 (:REWRITE DEFAULT-+-1)) (156 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (152 4 (:LINEAR LOGHEAD-LEQ)) (139 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (134 134 (:REWRITE USB-LINEAR-REWRITE)) (134 134 (:META CANCEL_PLUS-LESSP-CORRECT)) (130 130 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (128 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (122 122 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (122 8 (:REWRITE LOGBITP-+-SIMPLE)) (120 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (113 91 (:REWRITE DEFAULT-<-2)) (110 58 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (109 91 (:REWRITE DEFAULT-<-1)) (98 98 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (82 41 (:REWRITE USB-TIGHTEN)) (80 80 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (80 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (78 78 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 62 (:REWRITE FOLD-CONSTS-IN-+)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE EXPO-EXPT2)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (49 49 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (48 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (41 41 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (36 8 (:REWRITE LOGBITP-+-USB-V4)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 8 (:REWRITE LOGBITP-+-USB-V1)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (26 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (26 4 (:REWRITE LOGBITP-+-USB-V3)) (26 4 (:REWRITE LOGBITP-+-USB-V2)) (26 4 (:REWRITE LOGBITP-+-SIMPLE2)) (24 24 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (24 24 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (24 24 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 23 (:META META-RULE-ERIC)) (24 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (23 23 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (23 23 (:REWRITE LOGHEAD-SUBST2)) (23 23 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 12 (:REWRITE DEFAULT-UNARY-MINUS)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (15 15 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (15 15 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (15 15 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (10 10 (:TYPE-PRESCRIPTION POWER2P)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1))) (LOGHEAD-OF-LOGEXT-HACK-5 (791 25 (:REWRITE LOGHEAD-IDENTITY)) (704 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (397 34 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (337 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (317 53 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (295 172 (:REWRITE DEFAULT-+-2)) (294 24 (:REWRITE LOGBITP-+-SIMPLE)) (267 78 (:REWRITE INTEGERP-+-MINUS-*-2)) (196 196 (:REWRITE POWER2-INTEGER)) (168 12 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (132 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (130 118 (:REWRITE FOLD-CONSTS-IN-+)) (120 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (116 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 106 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (106 53 (:REWRITE USB-TIGHTEN)) (92 4 (:LINEAR LOGHEAD-LEQ)) (84 12 (:REWRITE SIGNED-BYTE-P-+)) (78 78 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 77 (:TYPE-PRESCRIPTION LOGBITP)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (66 52 (:REWRITE DEFAULT-<-2)) (66 24 (:REWRITE LOGBITP-+-USB-V4)) (64 64 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 52 (:REWRITE DEFAULT-<-1)) (60 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (57 24 (:REWRITE LOGBITP-+-USB-V1)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 53 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (45 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (45 12 (:REWRITE LOGBITP-+-USB-V3)) (45 12 (:REWRITE LOGBITP-+-USB-V2)) (45 12 (:REWRITE LOGBITP-+-SIMPLE2)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (39 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (34 34 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (34 34 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (28 28 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGHEAD-SUBST2)) (27 27 (:REWRITE LOGHEAD-SUBST)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 27 (:META META-RULE-ERIC)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST)) (26 26 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (26 26 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (26 26 (:REWRITE LOGHEAD-+-REDUCE)) (26 26 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 11 (:REWRITE DEFAULT-*-2)) (14 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (INTEGERP-<-HACK (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-HACK-MORE (6 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE RATIONALP-*)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-16-HACK (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (11 3 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (11 1 (:REWRITE MOD-=-0 . 2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK)) (9 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-OF-ONE-MORE (8535 89 (:REWRITE FLOOR-=-X/Y . 3)) (6148 918 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (5095 2153 (:REWRITE DEFAULT-*-2)) (4702 7 (:REWRITE FLOOR-=-X/Y . 4)) (4568 144 (:REWRITE RTL1)) (3871 205 (:REWRITE INTEGERP-+-MINUS-*-4)) (3599 2153 (:REWRITE DEFAULT-*-1)) (3497 144 (:REWRITE FLOOR-DETERMINED-1)) (3290 89 (:REWRITE FLOOR-=-X/Y . 2)) (2803 1128 (:REWRITE DEFAULT-+-2)) (2591 1665 (:REWRITE DEFAULT-<-2)) (2247 459 (:REWRITE DEFAULT-UNARY-/)) (2214 91 (:REWRITE INTEGERP-+-MINUS-*-2)) (2185 132 (:LINEAR X*Y>1-POSITIVE)) (2146 2146 (:REWRITE USB-LINEAR-REWRITE)) (1949 1128 (:REWRITE DEFAULT-+-1)) (1830 1665 (:REWRITE DEFAULT-<-1)) (1551 549 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1310 1310 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1218 1218 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1214 115 (:REWRITE FLOOR-TYPE-3 . 3)) (1146 10 (:LINEAR MOD-TYPE . 2)) (1092 115 (:REWRITE FLOOR-TYPE-4 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (893 54 (:DEFINITION NATP)) (888 54 (:REWRITE NATP-RW)) (871 115 (:REWRITE FLOOR-TYPE-4 . 3)) (655 655 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (604 604 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (549 549 (:REWRITE EXPO-MINUS-ERIC)) (467 161 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (457 165 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (396 22 (:LINEAR FLOOR-TYPE-2 . 1)) (394 103 (:REWRITE RTL-A-MILLION)) (386 22 (:LINEAR FLOOR-TYPE-1 . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (356 22 (:LINEAR FLOOR-TYPE-2 . 2)) (350 350 (:REWRITE POWER2-INTEGER)) (340 340 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (298 22 (:LINEAR FLOOR-TYPE-1 . 1)) (222 82 (:REWRITE DEFAULT-UNARY-MINUS)) (220 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (198 165 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (181 45 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (175 19 (:REWRITE INTEGERP-+-MINUS-*-1)) (170 170 (:LINEAR EXPT-LESS-THAN-1-HACK)) (147 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 48 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (133 7 (:REWRITE INTEGERP-+-MINUS-*-3)) (127 127 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (120 40 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (118 91 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (107 13 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (90 86 (:REWRITE FOLD-CONSTS-IN-*)) (79 79 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION NATP)) (50 48 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (50 22 (:REWRITE SUM-POWER-OF-TWO)) (48 3 (:REWRITE <-*-RIGHT-CANCEL)) (41 4 (:REWRITE FLOOR-WHEN-<-2)) (41 1 (:REWRITE EVENP-COLLECT-1)) (40 5 (:REWRITE MOD-HELPER-1)) (30 10 (:LINEAR MOD-TYPE . 3)) (30 10 (:LINEAR MOD-TYPE . 1)) (30 1 (:REWRITE EVENP-+-ALT)) (26 6 (:REWRITE EVENP-COLLAPSE)) (24 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE EQUAL-CONSTANT-+)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (9 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (9 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (7 7 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (7 7 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-LOGBIT-REASSEMBLE (49 5 (:REWRITE LOGHEAD-IDENTITY)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (13 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (13 1 (:REWRITE ASH-0)) (12 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 10 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE DEFAULT-<-2)) (9 1 (:REWRITE ZIP-OPEN)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE LOGBIT-TOO-BIG)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT32HACK (94 5 (:REWRITE LOGEXT-IDENTITY)) (89 6 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (32 19 (:REWRITE DEFAULT-<-2)) (28 4 (:REWRITE EVENP-*)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (27 27 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 9 (:REWRITE DEFAULT-+-2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-2 (585 16 (:REWRITE LOGBITP-+-SIMPLE)) (567 12 (:REWRITE LOGBITP-+-USB-V4)) (527 23 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (508 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (422 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (392 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (192 8 (:REWRITE LOGEXT-IDENTITY)) (182 10 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (130 2 (:REWRITE 0-<-*)) (128 2 (:REWRITE <-*-0)) (97 6 (:REWRITE EVENP-+-ALT)) (88 2 (:REWRITE EQUAL-LOGEXT-0)) (86 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (76 76 (:TYPE-PRESCRIPTION LOGBITP)) (75 16 (:REWRITE LOGBITP-+-USB-V1)) (64 32 (:REWRITE USB-TIGHTEN)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (59 8 (:REWRITE SIGNED-BYTE-P-+)) (56 39 (:REWRITE DEFAULT-<-2)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (53 6 (:REWRITE EVENP-)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (48 4 (:DEFINITION IFF)) (46 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 6 (:REWRITE EVENP-*)) (43 39 (:REWRITE DEFAULT-<-1)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (40 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (40 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 22 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (37 6 (:REWRITE LOGBITP-+-USB-V3)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 8 (:REWRITE LOGBITP-+-USB-V2)) (35 8 (:REWRITE LOGBITP-+-SIMPLE2)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE POWER2-INTEGER)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 27 (:META CANCEL_TIMES-EQUAL-CORRECT)) (27 27 (:META CANCEL_PLUS-EQUAL-CORRECT)) (27 18 (:REWRITE DEFAULT-+-2)) (24 22 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (23 23 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:REWRITE LOGBITP-SUBST-2)) (22 22 (:REWRITE LOGBITP-SUBST)) (22 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE DEFAULT-+-1)) (16 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-UNARY-MINUS)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST-2)) (7 5 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE DEFAULT-*-1)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT32HACK-3 (260 6 (:REWRITE LOGHEAD-IDENTITY)) (258 40 (:REWRITE LOGCAR-EVENP)) (229 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (188 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (148 12 (:REWRITE EVENP-+-ALT)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (126 4 (:LINEAR LOGEXT-BOUND-UPPER)) (110 8 (:REWRITE LOGBITP-+-SIMPLE)) (110 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (108 108 (:TYPE-PRESCRIPTION EVENP)) (106 5 (:REWRITE LOGEXT-IDENTITY)) (79 67 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (68 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 37 (:REWRITE DEFAULT-<-2)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE SIGNED-BYTE-P-+)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (44 39 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (44 37 (:REWRITE DEFAULT-<-1)) (33 32 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (31 8 (:REWRITE EVENP-)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 22 (:REWRITE DEFAULT-+-2)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (26 13 (:REWRITE USB-TIGHTEN)) (25 25 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 22 (:REWRITE DEFAULT-+-1)) (23 8 (:REWRITE LOGBITP-+-USB-V4)) (23 8 (:REWRITE LOGBITP-+-USB-V1)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 4 (:REWRITE LOGBITP-+-USB-V3)) (19 4 (:REWRITE LOGBITP-+-USB-V2)) (19 4 (:REWRITE LOGBITP-+-SIMPLE2)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 18 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE POWER2-INTEGER)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (14 14 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (14 14 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 7 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:META META-RULE-ERIC)) (6 5 (:REWRITE EVENP-OF-LOGEXT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-4 (296 20 (:REWRITE EVENP-+-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (87 10 (:REWRITE EVENP-)) (72 10 (:REWRITE EVENP-*)) (70 64 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 14 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-6 (224 6 (:LINEAR LOGEXT-BOUND-UPPER)) (166 2 (:REWRITE LOGHEAD-IDENTITY)) (142 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (117 5 (:REWRITE LOGEXT-IDENTITY)) (112 2 (:REWRITE <-+-NEGATIVE-0-1)) (108 12 (:LINEAR LOGEXT-BOUNDS-2)) (108 12 (:LINEAR LOGEXT-BOUNDS)) (103 24 (:REWRITE LOGCAR-EVENP)) (69 40 (:REWRITE DEFAULT-<-2)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (44 44 (:REWRITE USB-LINEAR-REWRITE)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (43 40 (:REWRITE DEFAULT-<-1)) (42 42 (:TYPE-PRESCRIPTION EVENP)) (35 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 2 (:REWRITE EVENP-+-ALT)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 28 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 2 (:REWRITE SIGNED-BYTE-P-+)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (22 19 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (17 4 (:REWRITE EVENP-)) (17 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE DEFAULT-+-2)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 3 (:REWRITE EVENP-OF-LOGEXT)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-7 (94 5 (:REWRITE LOGEXT-IDENTITY)) (43 2 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 21 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:REWRITE EVENP-*)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-*-2)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-*-1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-5 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 19 (:REWRITE DEFAULT-+-2)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 19 (:REWRITE DEFAULT-+-1)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-8 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 18 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGEXT-CASE (372 6 (:LINEAR LOGTAIL-LEQ)) (306 4 (:REWRITE LOGTAIL-LESSP)) (296 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (292 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (172 1 (:REWRITE ASH-0)) (168 1 (:REWRITE ZIP-OPEN)) (160 20 (:LINEAR LOGEXT-BOUNDS-2)) (160 20 (:LINEAR LOGEXT-BOUNDS)) (134 106 (:REWRITE DEFAULT-<-1)) (114 114 (:REWRITE USB-LINEAR-REWRITE)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (114 114 (:REWRITE EXPT-COMPARE)) (114 114 (:META CANCEL_PLUS-LESSP-CORRECT)) (112 106 (:REWRITE DEFAULT-<-2)) (90 10 (:LINEAR LOGEXT-BOUND-UPPER)) (80 10 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (52 2 (:REWRITE LOGTAIL-IDENTITY)) (42 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (35 35 (:REWRITE POWER2-INTEGER)) (35 1 (:REWRITE LOGTAIL-EQUAL-0)) (28 28 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 5 (:REWRITE USBP-LOGEXT-NARROWER)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (12 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGHEAD-CASE (662 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (274 1 (:REWRITE ASH-0)) (270 1 (:REWRITE ZIP-OPEN)) (255 38 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (210 8 (:REWRITE LOGTAIL-IDENTITY)) (156 134 (:REWRITE DEFAULT-<-1)) (149 134 (:REWRITE DEFAULT-<-2)) (144 144 (:REWRITE USB-LINEAR-REWRITE)) (144 144 (:REWRITE EXPT-COMPARE)) (144 144 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 12 (:LINEAR LOGHEAD-LEQ)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (82 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (82 10 (:LINEAR EXPT->-1)) (78 78 (:REWRITE POWER2-INTEGER)) (76 38 (:REWRITE USB-TIGHTEN)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (41 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (41 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (41 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (38 38 (:REWRITE LOGHEAD-SUBST2)) (38 38 (:META META-RULE-ERIC)) (36 1 (:REWRITE LOGTAIL-EQUAL-0)) (34 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 32 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (23 21 (:REWRITE DEFAULT-+-2)) (21 21 (:REWRITE DEFAULT-+-1)) (21 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGHEAD-SUM-WEIRD (561 16 (:REWRITE LOGHEAD-IDENTITY)) (279 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (262 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (207 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (144 4 (:LINEAR LOGHEAD-LEQ)) (115 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (84 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (80 8 (:REWRITE LOGBITP-+-SIMPLE)) (67 53 (:REWRITE DEFAULT-<-2)) (63 63 (:REWRITE USB-LINEAR-REWRITE)) (63 63 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE EXPT-COMPARE)) (63 63 (:META CANCEL_PLUS-LESSP-CORRECT)) (61 53 (:REWRITE DEFAULT-<-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 50 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (36 23 (:REWRITE DEFAULT-+-2)) (34 34 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (34 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 23 (:REWRITE DEFAULT-+-1)) (27 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE LOGBITP-+-USB-V4)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 8 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V3)) (15 4 (:REWRITE LOGBITP-+-USB-V2)) (15 4 (:REWRITE LOGBITP-+-SIMPLE2)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:DEFINITION FIX)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-CHOP-HACK-1 (234 4 (:REWRITE LOGHEAD-IDENTITY)) (180 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (146 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (66 66 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (66 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (31 4 (:REWRITE LOGBITP-+-SIMPLE)) (30 23 (:REWRITE DEFAULT-<-1)) (30 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 23 (:REWRITE DEFAULT-<-2)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 8 (:REWRITE USB-TIGHTEN)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (15 12 (:REWRITE DEFAULT-+-2)) (15 1 (:LINEAR EXPT->-1)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 12 (:REWRITE DEFAULT-+-1)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (HACK-BLAH (566 4 (:LINEAR LOGHEAD-LEQ)) (508 4 (:REWRITE <-*-0)) (232 14 (:REWRITE LOGHEAD-IDENTITY)) (182 4 (:DEFINITION IFF)) (104 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (96 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (94 82 (:REWRITE DEFAULT-<-2)) (87 87 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (87 87 (:META CANCEL_PLUS-LESSP-CORRECT)) (84 82 (:REWRITE DEFAULT-<-1)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (36 36 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (24 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (23 23 (:REWRITE POWER2-INTEGER)) (22 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (21 19 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGBITP)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (19 19 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 4 (:REWRITE EQUAL-LOGEXT-0)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (17 17 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 6 (:REWRITE DEFAULT-*-1)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 4 (:REWRITE DEFAULT-+-2)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGAPP-HACK-3 (284 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (202 10 (:REWRITE LOGHEAD-IDENTITY)) (145 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (129 12 (:REWRITE LOGBITP-+-SIMPLE)) (86 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (82 82 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (61 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (59 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (38 38 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (38 27 (:REWRITE DEFAULT-+-2)) (38 19 (:REWRITE USB-TIGHTEN)) (34 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 27 (:REWRITE DEFAULT-+-1)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (29 29 (:REWRITE USB-LINEAR-REWRITE)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (29 29 (:REWRITE EXPT-COMPARE)) (29 29 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (27 12 (:REWRITE LOGBITP-+-USB-V4)) (27 12 (:REWRITE LOGBITP-+-USB-V1)) (24 24 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (22 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (21 21 (:REWRITE DEFAULT-<-2)) (21 21 (:REWRITE DEFAULT-<-1)) (21 6 (:REWRITE LOGBITP-+-USB-V3)) (21 6 (:REWRITE LOGBITP-+-USB-V2)) (21 6 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 12 (:REWRITE FOLD-CONSTS-IN-+)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 6 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:META META-RULE-ERIC)) (12 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-HACK-4 (348 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (192 10 (:REWRITE LOGHEAD-IDENTITY)) (189 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (178 16 (:REWRITE LOGBITP-+-SIMPLE)) (112 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 86 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (76 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE SIGNED-BYTE-P-+)) (37 37 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 27 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE LOGBITP-+-USB-V4)) (31 16 (:REWRITE LOGBITP-+-USB-V1)) (27 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 27 (:REWRITE DEFAULT-+-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (23 8 (:REWRITE LOGBITP-+-USB-V3)) (23 8 (:REWRITE LOGBITP-+-USB-V2)) (23 8 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 13 (:REWRITE FOLD-CONSTS-IN-+)) (18 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:META META-RULE-ERIC)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGHEAD-HACK-BLAH (704 11 (:REWRITE LOGHEAD-IDENTITY)) (440 7 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (286 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (174 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (84 4 (:LINEAR LOGHEAD-LEQ)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (72 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (70 7 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 56 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (56 56 (:REWRITE USB-LINEAR-REWRITE)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (56 56 (:META CANCEL_PLUS-LESSP-CORRECT)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 44 (:REWRITE DEFAULT-<-1)) (48 24 (:REWRITE USB-TIGHTEN)) (45 44 (:REWRITE DEFAULT-<-2)) (38 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 2 (:REWRITE <-+-NEGATIVE-0-1)) (24 24 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 18 (:REWRITE DEFAULT-+-2)) (19 18 (:REWRITE DEFAULT-+-1)) (19 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 7 (:REWRITE DEFAULT-UNARY-MINUS)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE LOGHEAD-<=)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (7 7 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE UNICITY-OF-0))) (LOGHEAD-CANCEL-SIGH (205 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (65 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (19 18 (:REWRITE DEFAULT-+-2)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (18 18 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT-SUBST2 (180 18 (:REWRITE LOGEXT-IDENTITY)) (111 8 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (49 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 36 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (29 29 (:REWRITE POWER2-INTEGER)) (28 22 (:REWRITE DEFAULT-<-1)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:META META-RULE-ERIC)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGEXT-SUBST2-ALT (171 18 (:REWRITE LOGEXT-IDENTITY)) (100 6 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (34 34 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (28 22 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE USB-LINEAR-REWRITE)) (25 25 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:REWRITE EXPT-COMPARE)) (25 25 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (17 17 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (17 17 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER (1693 98 (:REWRITE LOGHEAD-IDENTITY)) (898 130 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (863 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (549 53 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (513 513 (:REWRITE USB-LINEAR-REWRITE)) (506 148 (:REWRITE USB-TIGHTEN)) (481 481 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (481 481 (:REWRITE EXPT-COMPARE)) (441 441 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (299 271 (:REWRITE DEFAULT-<-1)) (272 271 (:REWRITE DEFAULT-<-2)) (206 14 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (188 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (185 185 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (171 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (147 147 (:REWRITE POWER2-INTEGER)) (137 137 (:META META-RULE-ERIC)) (133 120 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (131 130 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (130 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (130 130 (:REWRITE DEFAULT-+-2)) (130 130 (:REWRITE DEFAULT-+-1)) (121 121 (:REWRITE LOGHEAD-SUBST)) (105 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (105 9 (:REWRITE ASH-AS-LOGTAIL)) (91 53 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (89 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (73 73 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (73 60 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (63 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (54 54 (:REWRITE LOGBITP-TOO-BIG)) (51 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (50 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (43 41 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (42 18 (:REWRITE LOGBIT-TOO-BIG)) (36 18 (:REWRITE LOGBIT-SUBST-SIMPLER)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 28 (:REWRITE EXPT-COMPARE-EQUAL)) (27 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (22 14 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (20 2 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (19 3 (:REWRITE COMMUTATIVITY-2-OF-+)) (18 18 (:REWRITE LOGBIT-SUBST)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 4 (:REWRITE COMMUTATIVITY-OF-+)) (15 15 (:REWRITE LOGHEAD-COMPARE-HACK)) (15 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 9 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (9 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 9 (:REWRITE ASH-0)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (5 5 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE INVERSE-OF-+)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION POWER2P))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT) (SHOW-BITS-AUX (33 4 (:REWRITE FLOOR-WHEN-<-2)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE DEFAULT-<-2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (7 1 (:REWRITE <-*-/-LEFT-COMMUTED)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE INTEGERP==>DENOMINATOR=1)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE DEFAULT-DENOMINATOR))) (SHOW-BITS) (LOGAPP-RECOLLAPSE (526 24 (:REWRITE LOGHEAD-IDENTITY)) (286 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (273 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (133 105 (:REWRITE EXPT-COMPARE)) (113 9 (:LINEAR LOGHEAD-LEQ)) (107 97 (:REWRITE DEFAULT-<-2)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (105 97 (:REWRITE DEFAULT-<-1)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (98 6 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (85 9 (:LINEAR EXPT->-1)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 33 (:REWRITE USB-TIGHTEN)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 2 (:REWRITE LOGTAIL-IDENTITY)) (34 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (29 29 (:REWRITE POWER2-INTEGER)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (29 29 (:REWRITE LOGHEAD-SUBST2)) (29 29 (:REWRITE LOGHEAD-SUBST)) (29 29 (:META META-RULE-ERIC)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (23 23 (:REWRITE <-+-CONSTANT-CONSTANT)) (23 15 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE ASH-0)) (22 22 (:REWRITE DEFAULT-+-2)) (22 22 (:REWRITE DEFAULT-+-1)) (19 1 (:REWRITE ZIP-OPEN)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 1 (:REWRITE NORMALIZE-EQUAL-0)) (16 16 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (15 2 (:REWRITE LOGTAIL-LESSP)) (12 4 (:REWRITE DEFAULT-*-2)) (12 1 (:REWRITE EQUAL-MINUS-MINUS)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 1 (:REWRITE ASH-GOES-TO-0)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE EQUAL-LOGHEAD-ASH-POS)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-NEG-LOGHEAD)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE TIMES-ZERO)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (D<NAME>) (MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:LINEAR X*Y>1-POSITIVE))) (MULTIPLY-BY-POSITIVE-INTEGER-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (TINY-ADDEND-DOESNT-MATTER-WHEN-COMPARING-INTEGERS (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (NON-MULTIPLE-ADDEND-DOESNT-MATTER-WHEN-COMPARING-MULTIPLES (206 6 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (82 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (79 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (78 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (78 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (48 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 6 (:LINEAR X*Y>1-POSITIVE)) (42 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (37 7 (:REWRITE EQUAL-1-HACK)) (34 34 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE DEFAULT-<-1)) (32 32 (:REWRITE DEFAULT-*-2)) (32 32 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE DEFAULT-UNARY-/)) (11 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED (84 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 50 (:REWRITE DEFAULT-<-2)) (76 50 (:REWRITE DEFAULT-<-1)) (62 22 (:REWRITE DEFAULT-*-2)) (58 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (56 7 (:LINEAR EXPT->-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (28 22 (:REWRITE DEFAULT-*-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (13 5 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED-NEG (52 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 32 (:REWRITE DEFAULT-<-1)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 32 (:REWRITE DEFAULT-<-2)) (38 14 (:REWRITE DEFAULT-+-2)) (35 13 (:REWRITE DEFAULT-*-2)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (28 14 (:REWRITE DEFAULT-+-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 26 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE DEFAULT-UNARY-MINUS)) (19 13 (:REWRITE DEFAULT-*-1)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 2 (:REWRITE EXPT-COMPARE-EQUAL)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (ARITHHACK3 (19 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-*)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-NUMERATOR))) (ARITHHACK4 (84 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (48 48 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (21 7 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT->-1)) (15 5 (:REWRITE DEFAULT-*-2)) (13 7 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 5 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-FW (804 2 (:REWRITE SIGNED-BYTE-P-+)) (217 20 (:LINEAR EXPT->-1)) (198 11 (:REWRITE LOGHEAD-IDENTITY)) (193 116 (:REWRITE EXPT-COMPARE)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (172 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (144 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (128 30 (:REWRITE <-+-CONSTANT-CONSTANT)) (125 79 (:REWRITE DEFAULT-<-1)) (116 116 (:REWRITE USB-LINEAR-REWRITE)) (116 116 (:META CANCEL_PLUS-LESSP-CORRECT)) (113 113 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (106 79 (:REWRITE DEFAULT-<-2)) (99 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (77 38 (:REWRITE DEFAULT-+-2)) (76 55 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (70 2 (:REWRITE LOGHEAD-<)) (70 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (56 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (55 38 (:REWRITE DEFAULT-+-1)) (51 20 (:REWRITE DEFAULT-*-2)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (45 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (41 5 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 4 (:LINEAR LOGHEAD-LEQ)) (34 14 (:REWRITE DEFAULT-UNARY-MINUS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (26 13 (:REWRITE USB-TIGHTEN)) (24 20 (:REWRITE DEFAULT-*-1)) (22 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE POWER2-INTEGER)) (17 10 (:REWRITE EXPONENTS-ADD)) (15 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 3 (:REWRITE EXPT-COMPARE-EQUAL)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:TYPE-PRESCRIPTION POWER2P)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE POWER2P-EXPT2-I)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 3 (:REWRITE POWER2P-INVERSE)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-BK (730 2 (:REWRITE SIGNED-BYTE-P-+)) (358 150 (:REWRITE EXPT-COMPARE)) (204 150 (:REWRITE USB-LINEAR-REWRITE)) (180 10 (:REWRITE LOGHEAD-IDENTITY)) (162 138 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 98 (:REWRITE DEFAULT-<-1)) (150 150 (:META CANCEL_PLUS-LESSP-CORRECT)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (132 98 (:REWRITE DEFAULT-<-2)) (131 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (124 68 (:REWRITE DEFAULT-+-2)) (114 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (109 77 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (101 6 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (99 68 (:REWRITE DEFAULT-+-1)) (94 37 (:REWRITE DEFAULT-*-2)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (59 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (59 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (56 22 (:REWRITE DEFAULT-UNARY-MINUS)) (56 2 (:REWRITE LOGHEAD-<)) (53 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 37 (:REWRITE DEFAULT-*-1)) (49 21 (:REWRITE EXPONENTS-ADD)) (49 4 (:REWRITE EXPO-SHIFT-CONSTANT)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (39 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (27 3 (:LINEAR LOGHEAD-LEQ)) (26 18 (:REWRITE FOLD-CONSTS-IN-+)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (24 12 (:REWRITE USB-TIGHTEN)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (17 17 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (SIGNED-BYTE-P-OF-LOGAPP (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (126 42 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (126 6 (:LINEAR EXPT->-1)) (78 24 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 47 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE LOGHEAD-IDENTITY)) (62 62 (:REWRITE USB-LINEAR-REWRITE)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (59 29 (:REWRITE DEFAULT-+-2)) (53 47 (:REWRITE DEFAULT-<-2)) (42 42 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (29 29 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 9 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE IFIX-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC))) (LOGEXT-SUBST-WITH-LOGHEAD (191 20 (:REWRITE LOGEXT-IDENTITY)) (90 5 (:REWRITE LOGHEAD-IDENTITY)) (66 66 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 20 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 31 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (31 31 (:REWRITE LOGEXT-SUBST2-ALT)) (31 31 (:REWRITE LOGEXT-SUBST2)) (31 31 (:REWRITE DEFAULT-<-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (19 19 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (19 19 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (19 19 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-EQUAL-TO-DIVIDES (738 2 (:REWRITE CANCEL-MOD-+-BASIC)) (720 6 (:REWRITE DIVIDES-HACK2)) (264 3 (:LINEAR MOD-TYPE . 2)) (244 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (236 1 (:REWRITE INTEGERP-UNARY-)) (147 6 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (131 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (126 3 (:LINEAR MOD-TYPE . 4)) (119 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (118 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (84 7 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (52 52 (:REWRITE USB-LINEAR-REWRITE)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:REWRITE DEFAULT-<-2)) (48 48 (:REWRITE DEFAULT-<-1)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 20 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (20 20 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (20 4 (:REWRITE COMMUTATIVITY-OF-+)) (16 8 (:REWRITE USB-TIGHTEN)) (15 5 (:REWRITE COMMUTATIVITY-OF-*)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE UNICITY-OF-0)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:LINEAR MOD-TYPE . 3)) (3 3 (:LINEAR MOD-TYPE . 1)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE LOGHEAD-SUBST-WEIRD)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION))) (LOGHEAD-EQUAL-TO-DIVIDES2 (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (10 1 (:REWRITE LOGHEAD-IDENTITY)) (9 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (9 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGHEAD8-PLUS-TIMES-256 (116 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (99 6 (:REWRITE LOGHEAD-IDENTITY)) (48 2 (:REWRITE LOGBITP-+-SIMPLE)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 12 (:REWRITE USB-TIGHTEN)) (21 2 (:REWRITE LOGBITP-+-USB-V4)) (17 2 (:LINEAR LOGHEAD-LEQ)) (15 2 (:REWRITE LOGBITP-+-USB-V1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE LOGBITP-SUBST-2)) (9 9 (:REWRITE LOGBITP-SUBST)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGBITP-+-USB-V3)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGBITP-+-USB-V2)) (7 1 (:REWRITE LOGBITP-+-SIMPLE2)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 1 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LEMMA (10 5 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-SIZE-MINUS-ONE (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGEXT-OF-2-TO-THE-SIZE-MINUS-ONE (98 98 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (25 25 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 6 (:REWRITE DEFAULT-+-2)) (9 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MINUS-OF-LOGEXT (1304 28 (:REWRITE LOGEXT-IDENTITY)) (550 132 (:REWRITE EXPT-COMPARE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (177 177 (:REWRITE USB-LINEAR-REWRITE)) (177 177 (:META CANCEL_PLUS-LESSP-CORRECT)) (159 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (154 9 (:REWRITE LOGHEAD-IDENTITY)) (121 9 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (121 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (121 9 (:REWRITE ASH-AS-LOGTAIL)) (110 11 (:REWRITE LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P)) (104 104 (:REWRITE DEFAULT-+-2)) (104 104 (:REWRITE DEFAULT-+-1)) (103 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (94 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 30 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (80 62 (:REWRITE DEFAULT-<-1)) (76 76 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (73 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (69 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 44 (:REWRITE EXPO-EXPT2)) (62 62 (:REWRITE DEFAULT-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (55 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (52 15 (:REWRITE USB-TIGHTEN)) (51 9 (:REWRITE LOGBIT-SUBST)) (47 47 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (47 47 (:REWRITE EXPONENTS-ADD)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 5 (:LINEAR LOGHEAD-LEQ)) (44 44 (:TYPE-PRESCRIPTION POWER2P)) (44 44 (:REWRITE POWER2P-EXPT2-I)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 38 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 13 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE POWER2-INTEGER)) (40 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (38 38 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (38 38 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (30 30 (:REWRITE LOGEXT-SUBST2-ALT)) (30 30 (:REWRITE LOGEXT-SUBST2)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (29 1 (:REWRITE EQUAL-LOGEXT---LOGEXT)) (23 20 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (23 5 (:REWRITE LOGBITP-SUBST)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (17 11 (:REWRITE SBP-LOGHEAD)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 9 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBIT-TOO-BIG)) (9 9 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:META META-RULE-ERIC)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (5 5 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN))) (LOGNOT-OF-LOGEXT) (LOGAPP-OF-SUM-OF-LOGHEAD-ONE (54 5 (:REWRITE LOGHEAD-IDENTITY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 7 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (8 7 (:REWRITE DEFAULT-+-2)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGAPP-OF-SUM-OF-LOGHEAD-TWO (92 4 (:LINEAR LOGAPP-LINEAR)) (88 8 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (32 16 (:REWRITE USB-TIGHTEN)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 9 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-OF-LOGEXT (542 6 (:LINEAR LOGEXT-BOUND-UPPER)) (342 27 (:REWRITE LOGEXT-IDENTITY)) (108 108 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (99 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (92 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (72 48 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 9 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (60 4 (:LINEAR EXPT->-1)) (58 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 27 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (45 45 (:REWRITE USB-LINEAR-REWRITE)) (45 45 (:REWRITE EXPT-COMPARE)) (45 45 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 34 (:REWRITE DEFAULT-<-1)) (36 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 34 (:REWRITE DEFAULT-<-2)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE DEFAULT-+-2)) (28 28 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (27 27 (:REWRITE LOGEXT-SUBST2-ALT)) (27 27 (:REWRITE LOGEXT-SUBST2)) (27 27 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-SPLIT-WHEN-USB-ONE-LONGER (266 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (253 69 (:REWRITE EXPT-COMPARE)) (133 5 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (119 5 (:LINEAR X*Y>1-POSITIVE)) (94 6 (:REWRITE POWER2-INTEGER)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 24 (:REWRITE EXPO-OF-NOT-RATIONALP)) (58 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (57 57 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 5 (:LINEAR EXPT->-1)) (50 49 (:REWRITE DEFAULT-<-2)) (49 49 (:REWRITE DEFAULT-<-1)) (47 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (35 35 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE POWER2P-EXPT2-I)) (24 24 (:REWRITE EXPO-MINUS-ERIC)) (24 24 (:REWRITE EXPO-EXPT2)) (24 1 (:REWRITE EQUAL-1-HACK)) (23 10 (:REWRITE DEFAULT-+-2)) (23 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (20 10 (:REWRITE USB-TIGHTEN)) (16 10 (:REWRITE DEFAULT-+-1)) (16 4 (:REWRITE LOGBIT-TOO-BIG)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (13 5 (:REWRITE DEFAULT-*-1)) (11 5 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (EQUALITY-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (<-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (22 22 (:REWRITE USB-LINEAR-REWRITE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-HACK-YUCK (104 3 (:LINEAR LOGHEAD-LEQ)) (82 10 (:REWRITE LOGHEAD-IDENTITY)) (25 21 (:META META-RULE-ERIC)) (23 23 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (12 1 (:REWRITE MY-LOGAPP-<-0)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (10 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 1 (:REWRITE LOGAPP-<)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:DEFINITION IFIX))) (LOGAPP-HACK-YUCK2 (118 118 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (33 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (20 5 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (9 8 (:META META-RULE-ERIC)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE DEFAULT-+-1)) (6 3 (:DEFINITION FIX)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-SUBST-IN-FIRST-ARG-2 (119 8 (:REWRITE LOGHEAD-IDENTITY)) (73 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (52 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (32 32 (:REWRITE POWER2-INTEGER)) (32 24 (:REWRITE DEFAULT-<-1)) (30 24 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 5 (:REWRITE DEFAULT-+-2)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-0-HACK (170 11 (:REWRITE LOGHEAD-IDENTITY)) (39 3 (:LINEAR LOGHEAD-LEQ)) (34 17 (:REWRITE USB-TIGHTEN)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 3 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 1 (:REWRITE UNICITY-OF-0)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-EQUAL-LOGHEAD-LONGER (1746 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1174 62 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (1151 431 (:REWRITE EXPT-COMPARE)) (1147 90 (:REWRITE LOGHEAD-IDENTITY)) (953 7 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (878 174 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (532 55 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (445 431 (:REWRITE USB-LINEAR-REWRITE)) (431 431 (:META CANCEL_PLUS-LESSP-CORRECT)) (392 367 (:REWRITE DEFAULT-<-1)) (388 388 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (378 367 (:REWRITE DEFAULT-<-2)) (359 359 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (348 174 (:REWRITE USB-TIGHTEN)) (286 174 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (260 260 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (237 94 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (225 7 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (216 72 (:REWRITE EXPO-OF-NOT-RATIONALP)) (209 209 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (201 197 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (194 23 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (181 174 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (180 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (174 174 (:TYPE-PRESCRIPTION LOGBITP)) (168 168 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 144 (:REWRITE POWER2-INTEGER)) (126 14 (:LINEAR LOGHEAD-LEQ)) (121 121 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (121 121 (:REWRITE LOGHEAD-SUBST2)) (121 121 (:REWRITE LOGHEAD-SUBST)) (121 121 (:REWRITE DEFAULT-+-2)) (121 121 (:REWRITE DEFAULT-+-1)) (121 121 (:META META-RULE-ERIC)) (96 49 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (87 87 (:REWRITE EXPT-COMPARE-EQUAL)) (84 84 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (79 79 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE POWER2P-EXPT2-I)) (72 72 (:REWRITE EXPO-MINUS-ERIC)) (72 72 (:REWRITE EXPO-EXPT2)) (63 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 7 (:REWRITE LOGHEAD-<)) (55 55 (:REWRITE EQUAL-CONSTANT-+)) (55 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (36 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (36 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 32 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (28 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE LOGHEAD-COMPARE-HACK)) (21 21 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (21 21 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (21 21 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (20 20 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (14 14 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (14 14 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 7 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT-SPLIT-GEN (274 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (270 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (262 4 (:REWRITE LOGTAIL-LESSP)) (248 4 (:LINEAR LOGTAIL-LEQ)) (128 16 (:LINEAR LOGEXT-BOUNDS-2)) (128 16 (:LINEAR LOGEXT-BOUNDS)) (78 62 (:REWRITE DEFAULT-<-1)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE DEFAULT-<-2)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 31 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-IDENTITY)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 3 (:REWRITE LOGEXT-IDENTITY)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE USBP-LOGEXT-NARROWER)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-SUBST2-ALT)) (3 3 (:REWRITE LOGEXT-SUBST2)) (3 3 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGTAIL-LOGEXT-EQUAL-0-REWRITE (93 3 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 2 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (39 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (35 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (25 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (22 2 (:REWRITE LOGEXT-IDENTITY)) (19 2 (:REWRITE LOGTAIL-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (17 13 (:REWRITE DEFAULT-<-2)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-1)) (11 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (10 9 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE SIGNED-BYTE-P-OF-LOGTAIL)) (4 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGEXT-SUBST2-ALT)) (2 2 (:REWRITE LOGEXT-SUBST2)) (2 2 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (1 1 (:REWRITE USBP-LOGEXT-NARROWER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-EQUAL-LOGEXT-LONGER (808 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (477 54 (:REWRITE LOGEXT-IDENTITY)) (424 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (356 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (307 6 (:LINEAR LOGHEAD-LEQ)) (187 187 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (181 19 (:REWRITE LOGHEAD-IDENTITY)) (171 171 (:REWRITE USB-LINEAR-REWRITE)) (171 171 (:REWRITE EXPT-COMPARE)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (168 42 (:REWRITE USBP-LOGEXT-NARROWER)) (167 167 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (163 163 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (144 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 72 (:REWRITE USB-TIGHTEN)) (144 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (143 130 (:REWRITE DEFAULT-<-1)) (136 72 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE DEFAULT-<-2)) (117 13 (:LINEAR EXPT-LESS-THAN-1-HACK)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE POWER2-INTEGER)) (88 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (86 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:TYPE-PRESCRIPTION LOGBITP)) (75 75 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (73 72 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (72 72 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (72 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (68 68 (:REWRITE DEFAULT-+-2)) (68 68 (:REWRITE DEFAULT-+-1)) (64 16 (:REWRITE DEFAULT-UNARY-MINUS)) (56 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (56 56 (:REWRITE LOGEXT-SUBST2-ALT)) (56 56 (:REWRITE LOGEXT-SUBST2)) (56 56 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (52 52 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (52 52 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (52 52 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 5 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (36 19 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (34 25 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (32 32 (:REWRITE EXPONENTS-ADD)) (29 5 (:REWRITE LOGTAIL-LOGEXT-EQUAL-0-REWRITE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (24 3 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 19 (:META META-RULE-ERIC)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (17 17 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 8 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (EXPT-WEAKLY-MONOTONIC-LINEAR (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 8 (:REWRITE DEFAULT-<-2)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE IFIX-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (PROD-NON-NEGATIVE-LINEAR) (PROD-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 1 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (PROD-LINEAR-ALT (14 2 (:LINEAR X*Y>1-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (4 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-OF-LOGAPP-2-GEN (718 14 (:REWRITE LOGHEAD-IDENTITY)) (319 141 (:REWRITE USB-LINEAR-REWRITE)) (265 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (200 130 (:REWRITE DEFAULT-<-2)) (171 21 (:LINEAR EXPT->-1)) (170 130 (:REWRITE DEFAULT-<-1)) (163 6 (:REWRITE LOGHEAD-<)) (143 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (141 141 (:META CANCEL_PLUS-LESSP-CORRECT)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 80 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 52 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (50 50 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (49 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 42 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (42 42 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (42 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 10 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE POWER2-INTEGER)) (35 21 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 17 (:REWRITE USB-TIGHTEN)) (34 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (17 17 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (10 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 3 (:REWRITE DEFAULT-*-2)) (8 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-*-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT))) (LOGTAIL-OF-SUM-OF-ASH (56 4 (:LINEAR LOGTAIL-LEQ)) (28 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (20 20 (:TYPE-PRESCRIPTION ASH)) (19 14 (:REWRITE DEFAULT-<-1)) (17 2 (:LINEAR EXPT->-1)) (16 14 (:REWRITE DEFAULT-<-2)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUM-OF-ASH-ALT (30 30 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (28 2 (:LINEAR LOGTAIL-LEQ)) (13 9 (:REWRITE DEFAULT-<-1)) (13 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (12 12 (:TYPE-PRESCRIPTION ASH)) (12 9 (:REWRITE DEFAULT-<-2)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR EXPT->-1)) (9 1 (:DEFINITION NATP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE ASH-0)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE NATP-RW)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION NATP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-GOES-TO-0))) (LOGTAIL-OF-SUB1-OF-ASH (94 2 (:LINEAR LOGTAIL-LEQ)) (72 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (18 2 (:REWRITE ASH-BOUND2)) (18 2 (:REWRITE ASH-BOUND1A)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 10 (:REWRITE DEFAULT-<-1)) (12 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (12 1 (:REWRITE LOGTAIL-OF-SUM-OF-ASH)) (12 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (10 10 (:REWRITE DEFAULT-<-2)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 7 (:REWRITE DEFAULT-+-2)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 2 (:REWRITE ASH-BOUND4)) (6 2 (:REWRITE ASH-BOUND3A)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 1 (:REWRITE ASH-0)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUB1-OF-LOGAPP (128 2 (:LINEAR LOGTAIL-LEQ)) (64 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (44 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (42 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (18 2 (:REWRITE LOGAPP-<)) (16 16 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 8 (:LINEAR LOGAPP-LINEAR)) (10 5 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST))) (LOGHEAD-IDENTITY-2 (95 95 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (70 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (27 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (21 13 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE POWER2-INTEGER)) (16 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (8 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY (46 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (27 11 (:REWRITE USB-LINEAR-REWRITE)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY-ALT (12 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (USB-OF-SUM-WITH-TWO-OTHER-ADDENDS-HACK (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (26 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (24 15 (:REWRITE DEFAULT-<-2)) (24 2 (:LINEAR EXPT->-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 15 (:REWRITE DEFAULT-<-1)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-OF-PROD-LEMMA-ALT-GEN (2748 32 (:LINEAR LOGHEAD-LEQ)) (1612 19 (:REWRITE <-*-0)) (880 52 (:REWRITE LOGHEAD-IDENTITY)) (429 63 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (368 368 (:REWRITE USB-LINEAR-REWRITE)) (368 368 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (368 368 (:REWRITE EXPT-COMPARE)) (368 368 (:META CANCEL_PLUS-LESSP-CORRECT)) (351 343 (:REWRITE DEFAULT-<-1)) (349 343 (:REWRITE DEFAULT-<-2)) (330 19 (:DEFINITION IFF)) (280 280 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (162 19 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (162 19 (:LINEAR PROD-LINEAR)) (162 19 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (161 19 (:LINEAR PROD-LINEAR-ALT)) (161 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 19 (:LINEAR X*Y>1-POSITIVE)) (143 19 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (126 63 (:REWRITE USB-TIGHTEN)) (119 119 (:META META-RULE-ERIC)) (106 106 (:REWRITE LOGHEAD-SUBST)) (105 105 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (101 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (88 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (85 85 (:REWRITE EXPT-COMPARE-EQUAL)) (83 9 (:REWRITE LOGHEAD-<=)) (82 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (79 79 (:TYPE-PRESCRIPTION LOGBITP)) (79 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (76 76 (:TYPE-PRESCRIPTION IFIX)) (74 11 (:LINEAR EXPT->-1)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (53 47 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (50 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (45 45 (:REWRITE POWER2-INTEGER)) (44 36 (:REWRITE DEFAULT-*-2)) (37 36 (:REWRITE DEFAULT-*-1)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (30 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 2 (:REWRITE NORMALIZE-EQUAL-0)) (26 26 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-+-1)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (18 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-TIMES-16-OF-LOGAPP (268 6 (:REWRITE 0-<-*)) (235 7 (:REWRITE LOGHEAD-IDENTITY)) (183 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (124 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (119 3 (:LINEAR LOGHEAD-LEQ)) (88 5 (:REWRITE NORMALIZE-EQUAL-0)) (57 57 (:REWRITE USB-LINEAR-REWRITE)) (57 57 (:REWRITE EXPT-COMPARE)) (57 57 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 5 (:REWRITE EQUAL-MINUS-MINUS)) (48 6 (:REWRITE <-Y-*-Y-X)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (33 28 (:REWRITE DEFAULT-<-1)) (33 6 (:LINEAR LOGAPP-LINEAR)) (28 28 (:REWRITE DEFAULT-<-2)) (28 10 (:REWRITE EQUAL-1-HACK)) (27 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 25 (:META CANCEL_TIMES-EQUAL-CORRECT)) (25 25 (:META CANCEL_PLUS-EQUAL-CORRECT)) (25 5 (:REWRITE SUM-POWER-OF-TWO)) (24 3 (:REWRITE <-*-Y-X-Y)) (24 2 (:REWRITE MY-LOGAPP-<-0)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 1 (:REWRITE <-*-0)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE USB-TIGHTEN)) (18 3 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:META META-RULE-ERIC)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (8 8 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 6 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (7 7 (:DEFINITION IFF)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-<)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:DEFINITION IFIX)) (1 1 (:REWRITE ZP-OPEN))) (LOGHEAD-OF-MINUS-COMPARE-WHEN-USB (231 231 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (29 15 (:REWRITE DEFAULT-<-1)) (21 15 (:REWRITE DEFAULT-<-2)) (20 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 6 (:REWRITE DEFAULT-+-2)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 6 (:REWRITE DEFAULT-+-1)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:META META-RULE-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGBIT-TOO-BIG-NO-FREE-VARS (111 1 (:REWRITE FLOOR-=-X/Y . 3)) (90 11 (:LINEAR EXPT->-1)) (87 32 (:REWRITE EXPT-COMPARE)) (85 1 (:REWRITE FLOOR-TYPE-3 . 2)) (51 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (48 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (45 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (43 30 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE RTL1)) (34 1 (:REWRITE FLOOR-DETERMINED-1)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 30 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (25 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (22 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 6 (:REWRITE DEFAULT-*-2)) (15 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 1 (:REWRITE LOGBIT-TOO-BIG)) (12 12 (:REWRITE POWER2-INTEGER)) (12 1 (:REWRITE LOGBITP-TOO-BIG)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 6 (:REWRITE EXPO-EXPT2)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 2 (:DEFINITION IFIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE POWER2P-SHIFT-2)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION IFIX)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT (1127 71 (:REWRITE LOGHEAD-IDENTITY)) (570 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (472 4 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (261 127 (:REWRITE DEFAULT-+-2)) (231 139 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (227 127 (:REWRITE DEFAULT-+-1)) (179 179 (:REWRITE POWER2-INTEGER)) (167 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 116 (:REWRITE DEFAULT-<-2)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (143 143 (:REWRITE EXPT-COMPARE)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (139 139 (:META META-RULE-ERIC)) (139 127 (:REWRITE LOGHEAD-SUBST)) (139 17 (:LINEAR EXPT->-1)) (135 116 (:REWRITE DEFAULT-<-1)) (127 127 (:REWRITE LOGHEAD-SUBST2)) (119 82 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (116 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (86 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (84 42 (:REWRITE USB-TIGHTEN)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (79 17 (:REWRITE EXPT-COMPARE-EQUAL)) (77 71 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (76 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (72 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (69 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (66 66 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (64 24 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (62 2 (:REWRITE LOGHEAD-<)) (57 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (56 2 (:REWRITE <-OF-LOGHEADS-REWRITE)) (53 53 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 42 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 21 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (34 34 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (34 34 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (32 32 (:REWRITE FOLD-CONSTS-IN-+)) (28 22 (:REWRITE DEFAULT-UNARY-MINUS)) (23 23 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 4 (:REWRITE EXPO-EXPT2)) (21 21 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (19 19 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 12 (:REWRITE INTEGERP-+-MINUS-*-2)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 12 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (8 4 (:DEFINITION FIX)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD))) (LOGHEAD-OF-1 (125 8 (:REWRITE LOGHEAD-IDENTITY)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 27 (:REWRITE DEFAULT-<-2)) (31 27 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE USB-LINEAR-REWRITE)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (27 27 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE POWER2-INTEGER)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT-NON-SPLITTING (185 15 (:REWRITE LOGHEAD-IDENTITY)) (105 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 3 (:LINEAR LOGHEAD-LEQ)) (48 34 (:REWRITE DEFAULT-<-2)) (47 24 (:REWRITE DEFAULT-+-2)) (46 24 (:REWRITE DEFAULT-+-1)) (44 34 (:REWRITE DEFAULT-<-1)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE POWER2-INTEGER)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (25 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (22 22 (:META META-RULE-ERIC)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE ZP-OPEN)) (6 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT (54 3 (:REWRITE LOGHEAD-IDENTITY)) (49 49 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (30 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC))) (LOGHEAD-SUM-SUBST-HELPER-BETTER (519 16 (:REWRITE LOGHEAD-IDENTITY)) (263 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (232 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (172 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (74 53 (:REWRITE DEFAULT-<-2)) (68 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (57 53 (:REWRITE DEFAULT-<-1)) (53 53 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 6 (:LINEAR LOGHEAD-LEQ)) (46 46 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (46 23 (:REWRITE USB-TIGHTEN)) (43 43 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (43 43 (:REWRITE POWER2-INTEGER)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR EXPT->-1)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE DEFAULT-+-2)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 3 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 3 (:DEFINITION FIX)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-ONE-MORE-WRAPS-AROUND (327 24 (:REWRITE LOGHEAD-IDENTITY)) (119 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 52 (:REWRITE USB-LINEAR-REWRITE)) (79 9 (:LINEAR LOGHEAD-LEQ)) (78 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (71 50 (:REWRITE DEFAULT-<-1)) (60 50 (:REWRITE DEFAULT-<-2)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (49 23 (:REWRITE DEFAULT-+-2)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (46 46 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE USB-TIGHTEN)) (42 23 (:REWRITE DEFAULT-+-1)) (39 9 (:REWRITE EXPT-COMPARE-EQUAL)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (32 32 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 2 (:REWRITE LOGHEAD-<)) (13 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 4 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE ZP-OPEN)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGHEAD-IDENTITY-2-ALT (89 1 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 9 (:REWRITE USB-TIGHTEN)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-SUM-SPLIT-INTO-2-CASES-FORCED (502 36 (:REWRITE LOGHEAD-IDENTITY)) (297 297 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (198 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (116 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (67 42 (:REWRITE DEFAULT-<-2)) (61 32 (:REWRITE DEFAULT-+-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (59 32 (:REWRITE DEFAULT-+-2)) (50 42 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE USB-LINEAR-REWRITE)) (47 47 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE EXPT-COMPARE)) (47 47 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (41 41 (:REWRITE LOGHEAD-SUBST2)) (41 41 (:REWRITE LOGHEAD-SUBST)) (39 1 (:REWRITE LOGHEAD-<)) (38 38 (:REWRITE POWER2-INTEGER)) (38 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR LOGHEAD-LEQ)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST)) (5 5 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (5 5 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE LOGHEAD-+-REDUCE)) (5 5 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE DEFAULT-*-1))) (LOGHEAD-EQUALITY-IMPOSSIBLE (300 6 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (157 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (96 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 67 (:REWRITE DEFAULT-+-2)) (67 67 (:REWRITE DEFAULT-+-1)) (66 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (42 42 (:REWRITE LOGHEAD-SUBST2)) (42 42 (:REWRITE LOGHEAD-SUBST)) (42 42 (:META META-RULE-ERIC)) (37 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE USB-TIGHTEN)) (13 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST-WEIRD)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+))) (NOT-UNSIGNED-BYTE-P-WHEN-J-IS-NEGATIVE (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE (151 151 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 4 (:REWRITE LOGHEAD-IDENTITY)) (69 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE USB-TIGHTEN)) (15 1 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 2 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (12 4 (:REWRITE COMMUTATIVITY-OF-+)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (7 1 (:REWRITE LOGHEAD-<)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:META META-RULE-ERIC)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBIT-TOO-BIG)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DUMB)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (103 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (31 31 (:REWRITE USB-LINEAR-REWRITE)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 31 (:META CANCEL_PLUS-LESSP-CORRECT)) (29 3 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (22 1 (:REWRITE LOGHEAD-<)) (20 17 (:REWRITE DEFAULT-<-2)) (18 6 (:REWRITE FOLD-CONSTS-IN-+)) (17 17 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 5 (:REWRITE COMMUTATIVITY-OF-+)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE (340 340 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (265 17 (:REWRITE LOGHEAD-IDENTITY)) (206 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (129 129 (:REWRITE POWER2-INTEGER)) (123 4 (:REWRITE LOGHEAD-<)) (118 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (108 46 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (102 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (97 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (78 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (73 45 (:REWRITE DEFAULT-<-2)) (72 72 (:REWRITE USB-LINEAR-REWRITE)) (72 72 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (72 72 (:REWRITE EXPT-COMPARE)) (72 72 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (70 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (69 25 (:REWRITE USB-TIGHTEN)) (61 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (49 45 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 23 (:REWRITE INTEGERP-+-MINUS-*-2)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (23 23 (:REWRITE FIX-DOES-NOTHING)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 18 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-SUBST2)) (17 17 (:REWRITE LOGHEAD-SUBST)) (17 17 (:META META-RULE-ERIC)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-REASSEMBLE (37 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (29 3 (:REWRITE LOGTAIL-IDENTITY)) (22 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (12 6 (:REWRITE USB-TIGHTEN)) (11 8 (:REWRITE DEFAULT-<-2)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE DEFAULT-<-1)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-PLUS-LOGTAIL-REASSEMBLE (142 8 (:REWRITE LOGTAIL-LESSP)) (98 2 (:LINEAR PROD-LINEAR)) (78 50 (:REWRITE EXPT-COMPARE)) (74 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (72 8 (:LINEAR LOGTAIL-LEQ)) (68 2 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (64 4 (:REWRITE LOGHEAD-IDENTITY)) (64 2 (:LINEAR PROD-LINEAR-ALT)) (58 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 37 (:REWRITE DEFAULT-<-1)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (48 48 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 37 (:REWRITE DEFAULT-<-2)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 2 (:REWRITE LOGTAIL-IDENTITY)) (27 10 (:REWRITE USB-TIGHTEN)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 5 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 5 (:REWRITE DEFAULT-*-1)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 6 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE UNICITY-OF-1)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE TIMES-ZERO)) (6 2 (:REWRITE FIX-DOES-NOTHING)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (X-EQUAL-SUM-OF-LOGHEAD-CANCEL (216 12 (:REWRITE LOGHEAD-IDENTITY)) (204 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (196 28 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (189 12 (:REWRITE LOGTAIL-LESSP)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (172 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (151 109 (:REWRITE EXPT-COMPARE)) (138 3 (:LINEAR PROD-LINEAR)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (109 109 (:REWRITE USB-LINEAR-REWRITE)) (109 109 (:META CANCEL_PLUS-LESSP-CORRECT)) (108 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 3 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (96 12 (:LINEAR LOGTAIL-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (93 3 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (92 86 (:REWRITE DEFAULT-<-2)) (87 3 (:LINEAR PROD-LINEAR-ALT)) (86 86 (:REWRITE DEFAULT-<-1)) (84 28 (:REWRITE USB-TIGHTEN)) (75 3 (:LINEAR X*Y>1-POSITIVE)) (64 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (48 4 (:REWRITE LOGTAIL-IDENTITY)) (44 44 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (36 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (32 4 (:LINEAR EXPT->-1)) (28 28 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 16 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE DEFAULT-+-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 7 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 3 (:REWRITE UNICITY-OF-1)) (9 9 (:REWRITE TIMES-ZERO)) (9 3 (:REWRITE FIX-DOES-NOTHING)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 3 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SIGNED-BYTE-P-OF-X-MINUS-2-TO-THEN-MINUS-ONE-WHEN-USB (115 1 (:REWRITE SIGNED-BYTE-P-+)) (58 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (39 39 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE EXPT-COMPARE)) (20 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (19 11 (:REWRITE DEFAULT-<-2)) (17 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-*-2)) (13 9 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE DEFAULT-+-1)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (1 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE-CONSTANT-VERSION (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (HALF-CANCEL) (LOGEXT-PLUS-EXPT2N-REWRITE (504 6 (:REWRITE LOGHEAD-IDENTITY)) (393 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (329 59 (:REWRITE EXPT-COMPARE)) (167 79 (:REWRITE USB-LINEAR-REWRITE)) (123 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (95 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (79 79 (:META CANCEL_PLUS-LESSP-CORRECT)) (60 25 (:REWRITE DEFAULT-*-2)) (57 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (54 54 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (53 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 23 (:REWRITE DEFAULT-+-2)) (36 27 (:REWRITE DEFAULT-<-2)) (36 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (30 23 (:REWRITE DEFAULT-+-1)) (29 25 (:REWRITE DEFAULT-*-1)) (28 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 27 (:REWRITE DEFAULT-<-1)) (22 11 (:REWRITE USB-TIGHTEN)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 2 (:REWRITE LOGBITP-TOO-BIG)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 4 (:REWRITE IFIX-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:META META-RULE-ERIC)) (6 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE LOGBITP-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-PLUS-EXPT2N-REWRITE-CONSTANT-VERSION (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-EQUAL-REWRITE (488 34 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (482 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (438 8 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (371 16 (:REWRITE LOGHEAD-IDENTITY)) (371 8 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (258 6 (:LINEAR LOGHEAD-LEQ)) (239 15 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (237 39 (:REWRITE USB-TIGHTEN)) (208 208 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (205 86 (:REWRITE EXPT-COMPARE)) (201 19 (:REWRITE LOGBITP-SUBST-2)) (166 21 (:REWRITE <-+-CONSTANT-CONSTANT)) (90 26 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (78 78 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (77 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (77 2 (:REWRITE LOGBITP-LOGEXT)) (73 73 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (68 68 (:TYPE-PRESCRIPTION LOGBITP)) (63 56 (:REWRITE DEFAULT-<-1)) (56 56 (:REWRITE DEFAULT-<-2)) (49 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (38 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (35 35 (:REWRITE DEFAULT-+-2)) (35 35 (:REWRITE DEFAULT-+-1)) (34 34 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (33 33 (:REWRITE POWER2-INTEGER)) (30 15 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 2 (:REWRITE USBP-LOGEXT-NARROWER)) (27 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGEXT-BOUND-UPPER)) (26 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (25 25 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (23 16 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (21 14 (:REWRITE EXPO-EXPT2)) (18 18 (:META META-RULE-ERIC)) (17 17 (:REWRITE LOGBITP-SUBST)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGEXT-SUBST2)) (16 9 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (14 14 (:REWRITE POWER2P-EXPT2-I)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (10 10 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE DUMB))) (UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 4 (:REWRITE DEFAULT-<-1)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (5 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MOVE-NEGATED-TERM-HACK (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 3 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGIOR-HACK (4 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE LOGIOR-AS-B-IOR)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST))) (LOGBITP-BOUND (86 1 (:REWRITE FLOOR-=-X/Y . 3)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (30 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (25 13 (:REWRITE DEFAULT-<-2)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-SIMPLE-CASES)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (17 1 (:REWRITE FLOOR-TYPE-3 . 2)) (15 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (ASH-EQUAL-REWRITE (530 10 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (461 9 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (450 9 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (318 180 (:REWRITE USB-LINEAR-REWRITE)) (243 3 (:REWRITE ASH-BOUND4)) (237 3 (:REWRITE ASH-BOUND3A)) (215 177 (:REWRITE EXPT-COMPARE)) (182 142 (:REWRITE DEFAULT-<-1)) (180 180 (:META CANCEL_PLUS-LESSP-CORRECT)) (170 170 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (166 142 (:REWRITE DEFAULT-<-2)) (155 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (147 137 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (118 10 (:REWRITE LOGBITP-SUBST)) (108 10 (:LINEAR EXPT->-1)) (83 28 (:REWRITE USB-TIGHTEN)) (74 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 6 (:LINEAR PROD-LINEAR-ALT)) (62 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (54 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (54 6 (:REWRITE ASH-AS-LOGTAIL)) (54 6 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (54 6 (:LINEAR PROD-LINEAR)) (54 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (54 3 (:REWRITE LOGTAIL-IDENTITY)) (50 4 (:REWRITE ASH-0)) (49 47 (:REWRITE DEFAULT-+-2)) (48 6 (:LINEAR X*Y>1-POSITIVE)) (48 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (47 47 (:REWRITE DEFAULT-+-1)) (45 45 (:TYPE-PRESCRIPTION LOGBITP)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (37 4 (:REWRITE ZIP-OPEN)) (36 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 2 (:REWRITE LOGBITP-ASH)) (29 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (27 3 (:REWRITE ASH-BOUND2)) (27 3 (:REWRITE ASH-BOUND1A)) (24 24 (:REWRITE POWER2-INTEGER)) (23 4 (:REWRITE UNSIGNED-BYTE-P-ASH)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 5 (:REWRITE <=-0-ASH)) (20 4 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (19 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 6 (:REWRITE DEFAULT-*-2)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 5 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGBITP-SUBST-2)) (9 6 (:REWRITE DEFAULT-*-1)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META META-RULE-ERIC)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE <-*-0)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (6 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (ASSOCIATIVITY-OF-LOGAPP-BETTER-BACK (126 126 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (114 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (110 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (47 47 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (46 4 (:REWRITE MY-LOGAPP-<-0)) (25 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (24 16 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE POWER2-INTEGER)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE DEFAULT-<-2)) (13 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE LOGAPP-<)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (7 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE <-+-NEGATIVE-0-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (EXPT-EXECUTE (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (EXPT-EXECUTE-REWRITE (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGAPP-EQUAL-CONSTANT (132 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (128 8 (:REWRITE LOGHEAD-IDENTITY)) (102 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (72 4 (:REWRITE LOGTAIL-IDENTITY)) (60 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (56 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 22 (:REWRITE USB-TIGHTEN)) (42 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 33 (:REWRITE DEFAULT-<-2)) (38 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (34 33 (:REWRITE DEFAULT-<-1)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 33 (:REWRITE POWER2-INTEGER)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (19 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 14 (:REWRITE DEFAULT-+-2)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:REWRITE DEFAULT-+-1)) (12 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 2 (:REWRITE ASH-0)) (8 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:DEFINITION FIX)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-COMPARE-TO-MAX) (LOGHEAD-EQUAL-MAX-PLUS-SOMETHING-ELSE (60 6 (:REWRITE LOGHEAD-IDENTITY)) (20 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:TYPE-PRESCRIPTION LOGBITP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (5 3 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE USB-LINEAR-REWRITE)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGHEAD-PLUS-EXPT-AS-THIRD-ADDEND (1072 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (848 194 (:REWRITE POWER2-INTEGER)) (790 104 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (700 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (624 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (622 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (464 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (432 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (424 32 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (400 8 (:REWRITE LOGHEAD-IDENTITY)) (350 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (220 16 (:REWRITE LOGBITP-+-SIMPLE)) (204 28 (:REWRITE <-+-CONSTANT-CONSTANT)) (148 148 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (142 142 (:REWRITE USB-LINEAR-REWRITE)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (142 142 (:REWRITE EXPT-COMPARE)) (142 142 (:META CANCEL_PLUS-LESSP-CORRECT)) (137 118 (:REWRITE DEFAULT-<-2)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (128 128 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (125 118 (:REWRITE DEFAULT-<-1)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 58 (:REWRITE FIX-DOES-NOTHING)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (90 30 (:REWRITE EXPO-OF-NOT-RATIONALP)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 40 (:DEFINITION FIX)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 4 (:LINEAR LOGHEAD-LEQ)) (68 32 (:REWRITE USB-TIGHTEN)) (64 64 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (62 34 (:REWRITE DEFAULT-+-2)) (60 30 (:REWRITE EXPO-EXPT2)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (51 51 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (40 40 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 30 (:TYPE-PRESCRIPTION POWER2P)) (30 30 (:REWRITE POWER2P-EXPT2-I)) (30 30 (:REWRITE EXPO-MINUS-ERIC)) (27 3 (:LINEAR EXPT->-1)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG))) (LOGHEAD-OF-DIFFERENCE (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (242 161 (:REWRITE DEFAULT-+-2)) (204 161 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (174 18 (:LINEAR LOGHEAD-LEQ)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (108 86 (:REWRITE DEFAULT-<-1)) (107 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (LOGHEAD-OF-DIFFERENCE-ALT (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (255 170 (:REWRITE DEFAULT-+-2)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (223 170 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (168 18 (:LINEAR LOGHEAD-LEQ)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (141 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (108 86 (:REWRITE DEFAULT-<-1)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (49 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (HACK<) (LOGAPP-LOGHEAD-HACK-16-31 (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (48 4 (:LINEAR LOGAPP-LINEAR)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (10 6 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 3 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (9 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (8 1 (:REWRITE HACK<)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEADS-OF-SUM-ALMOST-EQUAL (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 15 (:REWRITE DEFAULT-+-2)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEADS-OF-SUM-ALMOST-EQUAL-ALT (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (20 14 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-SUM-OF-LOGAPP (726 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (616 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (545 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (504 13 (:REWRITE LOGHEAD-IDENTITY)) (482 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (256 80 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (224 34 (:REWRITE <-+-CONSTANT-CONSTANT)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (148 148 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (121 121 (:REWRITE POWER2-INTEGER)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE USB-LINEAR-REWRITE)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (99 99 (:META CANCEL_PLUS-LESSP-CORRECT)) (97 73 (:REWRITE DEFAULT-<-2)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (88 88 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 42 (:REWRITE USB-TIGHTEN)) (84 84 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (82 73 (:REWRITE DEFAULT-<-1)) (80 40 (:DEFINITION FIX)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (58 58 (:TYPE-PRESCRIPTION LOGBITP)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 34 (:REWRITE DEFAULT-+-2)) (48 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 40 (:REWRITE FIX-DOES-NOTHING)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (28 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (22 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE LOGHEAD-LOGAPP-2)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGHEAD-OF-SUM-OF-LOGAPP-1 (780 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (773 19 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (670 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (589 11 (:REWRITE LOGHEAD-IDENTITY)) (524 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (479 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (312 96 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (232 42 (:REWRITE <-+-CONSTANT-CONSTANT)) (212 212 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (145 145 (:REWRITE POWER2-INTEGER)) (136 8 (:REWRITE USB-OF-LOGAPP-2-GEN)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (106 106 (:META CANCEL_PLUS-LESSP-CORRECT)) (104 80 (:REWRITE DEFAULT-<-2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (104 8 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (102 8 (:REWRITE LOGBITP-+-USB-V2)) (100 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (96 80 (:REWRITE DEFAULT-<-1)) (96 48 (:DEFINITION FIX)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 39 (:REWRITE USB-TIGHTEN)) (78 78 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (60 48 (:REWRITE INTEGERP-+-MINUS-*-2)) (60 48 (:REWRITE FIX-DOES-NOTHING)) (58 8 (:REWRITE LOGBITP-+-USB-V4)) (57 36 (:REWRITE DEFAULT-+-2)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 55 (:TYPE-PRESCRIPTION LOGBITP)) (48 48 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (39 39 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (39 36 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (23 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (20 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (19 19 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGAPP-OF-ASH (569 5 (:REWRITE LOGAPP-<)) (352 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (314 2 (:REWRITE LOGBITP-LOGAPP-BETTER)) (164 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (162 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (156 112 (:REWRITE DEFAULT-<-1)) (154 84 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (145 145 (:REWRITE EXPT-COMPARE)) (145 145 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (119 112 (:REWRITE DEFAULT-<-2)) (81 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (81 9 (:REWRITE ASH-AS-LOGTAIL)) (79 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (79 9 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (70 9 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (64 8 (:LINEAR EXPT->-1)) (62 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (57 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (56 56 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (50 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (48 1 (:LINEAR LOGHEAD-LEQ)) (46 23 (:REWRITE USB-TIGHTEN)) (44 28 (:REWRITE DEFAULT-+-2)) (43 43 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 9 (:REWRITE ASH-0)) (30 28 (:REWRITE DEFAULT-+-1)) (29 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 2 (:REWRITE LOGBITP-ASH)) (28 1 (:REWRITE LOGHEAD-IDENTITY)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 2 (:REWRITE <-0-+-NEGATIVE-1)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 6 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (20 2 (:REWRITE UNSIGNED-BYTE-P-ASH)) (18 18 (:TYPE-PRESCRIPTION ZIP)) (18 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 15 (:META META-RULE-ERIC)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE HACK<)) (11 11 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (11 11 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE ZIP-OPEN)) (9 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 6 (:REWRITE USB-OF-LOGAPP-2-GEN)) (8 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 1 (:REWRITE LOGHEAD-LOGAPP-BETTER)) (8 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (EQUAL-LOGAPP-WITH-LOGTAIL-OF-SELF-REWRITE (121 13 (:REWRITE LOGHEAD-IDENTITY)) (46 46 (:TYPE-PRESCRIPTION LOGBITP)) (46 23 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 1 (:REWRITE ASH-0)) (37 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 4 (:LINEAR LOGHEAD-LEQ)) (34 1 (:REWRITE ZIP-OPEN)) (30 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (30 3 (:REWRITE LOGTAIL-IDENTITY)) (28 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 9 (:REWRITE HACK<)) (23 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (18 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (17 17 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR LOGTAIL-LEQ)) (15 15 (:REWRITE POWER2-INTEGER)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (11 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE DEFAULT-<-1)) (9 1 (:REWRITE LOGTAIL-EQUAL-0)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGAPP-EQUAL-LOGAPP-REWRITE-SPECIAL (78 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (56 4 (:REWRITE LOGHEAD-IDENTITY)) (46 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (26 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 3 (:REWRITE HACK<)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 11 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LARGER-LOGHEAD-ISNT-LESS (879 24 (:REWRITE LOGTAIL-IDENTITY)) (818 96 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (715 360 (:REWRITE EXPT-COMPARE)) (632 94 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (622 12 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (615 37 (:REWRITE LOGHEAD-IDENTITY)) (614 360 (:REWRITE USB-LINEAR-REWRITE)) (605 12 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (499 25 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (476 6 (:LINEAR X*Y>1-POSITIVE)) (448 24 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (447 24 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (395 299 (:REWRITE DEFAULT-<-2)) (390 299 (:REWRITE DEFAULT-<-1)) (360 360 (:META CANCEL_PLUS-LESSP-CORRECT)) (348 326 (:REWRITE POWER2-INTEGER)) (335 335 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (329 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (312 24 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (287 287 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (273 108 (:REWRITE USB-TIGHTEN)) (216 20 (:REWRITE LOGHEAD-<)) (176 176 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (171 171 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (148 148 (:TYPE-PRESCRIPTION LOGBITP)) (147 114 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (145 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (118 107 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (110 16 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (108 12 (:LINEAR LOGHEAD-LEQ)) (105 35 (:REWRITE EXPO-OF-NOT-RATIONALP)) (99 4 (:REWRITE LOGHEAD-<=)) (97 96 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (94 94 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (93 76 (:REWRITE DEFAULT-+-2)) (90 57 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (83 76 (:REWRITE DEFAULT-+-1)) (79 20 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (70 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (67 37 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (59 24 (:REWRITE DEFAULT-*-2)) (57 56 (:META META-RULE-ERIC)) (56 56 (:REWRITE LOGHEAD-SUBST2)) (56 24 (:REWRITE LOGBITP-SUBST)) (54 24 (:REWRITE DEFAULT-*-1)) (53 24 (:REWRITE MOVE-NEGATED-TERM-HACK)) (51 35 (:REWRITE EXPO-EXPT2)) (49 49 (:REWRITE EXPT-COMPARE-EQUAL)) (49 49 (:META CANCEL_TIMES-EQUAL-CORRECT)) (49 49 (:META CANCEL_PLUS-EQUAL-CORRECT)) (49 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (45 37 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (40 8 (:REWRITE LOGCAR-EVENP)) (39 12 (:DEFINITION QUOTEP)) (39 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION POWER2P)) (35 35 (:REWRITE POWER2P-EXPT2-I)) (35 35 (:REWRITE EXPO-MINUS-ERIC)) (33 1 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (32 8 (:REWRITE LOGCAR-0-REWRITE)) (28 10 (:REWRITE HACK<)) (26 26 (:REWRITE EQUAL-CONSTANT-+)) (24 24 (:TYPE-PRESCRIPTION EVENP)) (24 24 (:REWRITE LOGBITP-SUBST-2)) (24 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION QUOTEP)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 10 (:REWRITE <-OF-LOGTAIL)) (18 9 (:DEFINITION FIX)) (17 9 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (16 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 9 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 4 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (3 3 (:REWRITE DEFAULT-CAR)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGAPP-<-NO-SAME-X (71 71 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (71 71 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (51 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 3 (:REWRITE HACK<)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE USB-OF-LOGAPP-2-GEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:META META-RULE-ERIC)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)))
true
(SBP-LOGHEAD-HELPER (128 4 (:REWRITE LOGHEAD-IDENTITY)) (100 4 (:DEFINITION UNSIGNED-BYTE-P)) (76 4 (:DEFINITION INTEGER-RANGE-P)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 14 (:REWRITE DEFAULT-<-2)) (16 14 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR LOGHEAD-LEQ)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:META META-RULE-ERIC)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (SBP-LOGHEAD (39 31 (:REWRITE DEFAULT-<-2)) (39 3 (:REWRITE LOGHEAD-IDENTITY)) (36 31 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE TOP-BIT-MEANS-<)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (25 25 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (18 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE SBP-LOGHEAD-HELPER)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:TYPE-PRESCRIPTION LOGHEAD-TYPE))) (LOGCAR-LOGXOR (7052 3 (:DEFINITION LOGIOR*)) (7037 8 (:REWRITE LOGCDR-LOGAND)) (6849 14 (:DEFINITION LOGAND*)) (6448 28 (:REWRITE LOGCDR-LOGNOT)) (6065 199 (:DEFINITION UNSIGNED-BYTE-P*)) (5123 276 (:REWRITE LOGCAR-IDENTITY)) (5062 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (5003 68 (:REWRITE LOGNOT-ZIP)) (4994 12 (:DEFINITION LOGMASKP*)) (4868 34 (:DEFINITION LOGNOT*)) (4769 32 (:REWRITE ZIP-OPEN)) (3818 138 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (3697 188 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3117 184 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (1842 1842 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (1678 126 (:REWRITE EQUAL-BIT-1)) (1673 414 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1630 6 (:REWRITE LOGIOR-AS-B-IOR)) (1502 62 (:REWRITE B-NOT-OPEN-1)) (1013 276 (:REWRITE LOGCAR-EVENP)) (752 2 (:REWRITE LOGCDR-LOGXOR)) (608 10 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (601 601 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (546 546 (:TYPE-PRESCRIPTION EVENP)) (520 118 (:REWRITE EQUAL-1-HACK)) (480 276 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (470 294 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (416 108 (:REWRITE LOGCAR-0-REWRITE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (414 414 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (414 414 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (366 289 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (349 349 (:REWRITE TOP-BIT-MEANS-<)) (333 333 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (325 304 (:REWRITE DEFAULT-<-1)) (304 304 (:REWRITE DEFAULT-<-2)) (258 258 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (224 18 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (203 14 (:REWRITE LOGNOT-NEG)) (191 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (171 29 (:REWRITE LOGCDR-<-0)) (147 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (132 132 (:TYPE-PRESCRIPTION LOGNOT)) (101 14 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (88 2 (:REWRITE LOGIOR-=-0)) (76 76 (:TYPE-PRESCRIPTION LOGMASKP)) (76 76 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (70 70 (:TYPE-PRESCRIPTION ZIP)) (55 28 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (55 28 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (54 2 (:REWRITE LOGAND-NEG)) (52 12 (:REWRITE EQUAL-0-LOGAND-BIT)) (40 40 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (28 28 (:REWRITE LOGAND---EXPT-REWRITE)) (20 4 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGXOR)) (18 18 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (18 10 (:REWRITE IFIX-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EQUAL-LOGAND---EXPT-0-REWRITE)) (10 2 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (8 8 (:TYPE-PRESCRIPTION BINARY-LOGIOR)) (6 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-B-NOT)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGCAR)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (LOGXOR-LOGNOT-ONE (141 10 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (41 41 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 10 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 10 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-LOGNOT-TWO (117 9 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (53 9 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (21 13 (:REWRITE LOGAND-WITH-MASK-ERIC)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (18 12 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 12 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (16 9 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (15 15 (:REWRITE LOGAND---EXPT-REWRITE)) (15 9 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1))) (LOGXOR-NEG (116 8 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (50 6 (:REWRITE LOGNOT-ZIP)) (34 34 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (34 4 (:REWRITE ZIP-OPEN)) (27 15 (:REWRITE LOGAND-WITH-MASK-ERIC)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (21 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (20 2 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (17 17 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (17 17 (:REWRITE LOGAND---EXPT-REWRITE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 8 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO)) (2 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE IFIX-INTEGERP))) (INTEGERP-LOGAND) (INTEGERP-LOGXOR) (INTEGERP-LOGIOR) (INTEGERP-LOGEXT) (RATIONALP-LOGAND) (RATIONALP-LOGXOR) (RATIONALP-LOGIOR) (RATIONALP-LOGEXT) (LOGBITP-TOO-BIG (91 91 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (27 17 (:REWRITE DEFAULT-<-2)) (24 17 (:REWRITE DEFAULT-<-1)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 3 (:LINEAR EXPT->-1)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 1 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (USBP-LOGEXT-NARROWER (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE TOP-BIT-MEANS-<)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META META-RULE-ERIC))) (PERHAPS-<=-1-IS-USB1? (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (2 2 (:REWRITE LOGAND---EXPT-REWRITE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE DEFAULT-<-1))) (SIGNED-BYTE-P-OF-LOGEXT (186 6 (:REWRITE LOGEXT-IDENTITY)) (158 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (138 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:LINEAR LOGCAR-RANGE-LINEAR)) (72 9 (:REWRITE LOGCAR-IDENTITY)) (45 9 (:REWRITE LOGCAR-EVENP)) (40 40 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (22 17 (:REWRITE DEFAULT-<-2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (21 21 (:TYPE-PRESCRIPTION EVENP)) (21 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 17 (:REWRITE DEFAULT-<-1)) (18 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 3 (:REWRITE LOGCAR-0-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR LOGEXT-BOUNDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGXOR-CANCEL2 (24 17 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (21 17 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 4 (:REWRITE IFIX-INTEGERP))) (SBP32-NEGATION (80 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (51 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (44 1 (:REWRITE SIGNED-BYTE-P--2)) (29 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE TOP-BIT-MEANS-<)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE SBP-BOUND-1)) (5 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-LOGEXT-BETTER (85 85 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 4 (:REWRITE LOGEXT-IDENTITY)) (10 10 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (10 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (8 4 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-+-EXPT (21595 114 (:REWRITE LOGEXT-IDENTITY)) (18961 206 (:DEFINITION SIGNED-BYTE-P*)) (17578 405 (:DEFINITION UNSIGNED-BYTE-P*)) (17372 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (12767 644 (:REWRITE LOGCAR-IDENTITY)) (10740 1038 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10229 327 (:REWRITE EQUAL-BIT-1)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (6422 308 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (5783 195 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5554 358 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4845 81 (:REWRITE NORMALIZE-EQUAL-0)) (3257 88 (:REWRITE SIGNED-BYTE-P-+)) (2444 47 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1578 1061 (:REWRITE DEFAULT-<-1)) (1481 316 (:REWRITE EQUAL-1-HACK)) (1354 1354 (:REWRITE TOP-BIT-MEANS-<)) (1352 364 (:REWRITE <-+-CONSTANT-CONSTANT)) (1261 848 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1233 1233 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1215 1066 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1061 1061 (:REWRITE DEFAULT-<-2)) (1044 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1038 1038 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (933 722 (:REWRITE DEFAULT-+-2)) (925 925 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (784 722 (:REWRITE DEFAULT-+-1)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (730 557 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (626 626 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (626 626 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (479 358 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (416 283 (:LINEAR EXPT-LESS-THAN-1-HACK)) (408 408 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (382 123 (:REWRITE DEFAULT-UNARY-MINUS)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (238 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (155 17 (:REWRITE LOGCONS-<-0)) (149 149 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (77 11 (:REWRITE LOGCDR-+2)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 12 (:REWRITE LOGCDR-<-0)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (42 42 (:TYPE-PRESCRIPTION BITP)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (22 22 (:REWRITE SBP-BOUND-1)) (22 22 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (22 11 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (22 11 (:REWRITE UNSIGNED-BYTE-P-LOGCDR-BRIDGE5)) (22 11 (:REWRITE UNSIGNED-BYTE-P-1+)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT (26036 114 (:REWRITE LOGEXT-IDENTITY)) (20875 172 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (20663 489 (:DEFINITION UNSIGNED-BYTE-P*)) (20553 210 (:DEFINITION SIGNED-BYTE-P*)) (13627 644 (:REWRITE LOGCAR-IDENTITY)) (11585 1195 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10269 331 (:REWRITE EQUAL-BIT-1)) (7201 207 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (7126 200 (:REWRITE B-NOT-OPEN-1)) (7044 132 (:REWRITE ARITH-MOVE-NEGATED-TERM)) (6434 320 (:REWRITE EQUAL-LOGCDR-CONSTANT-BRIDGE)) (3545 88 (:REWRITE SIGNED-BYTE-P-+)) (3499 84 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (2466 58 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (1824 285 (:REWRITE LOGCDR-EQUAL-0-REWRITE)) (1745 1199 (:REWRITE DEFAULT-+-2)) (1616 1199 (:REWRITE DEFAULT-+-1)) (1603 932 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (1552 307 (:REWRITE <-+-CONSTANT-CONSTANT)) (1523 1330 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1514 327 (:REWRITE EQUAL-1-HACK)) (1485 179 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1406 1406 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1332 1332 (:REWRITE TOP-BIT-MEANS-<)) (1231 1045 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (1201 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1199 1199 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1195 1195 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1041 951 (:REWRITE DEFAULT-<-2)) (974 951 (:REWRITE DEFAULT-<-1)) (906 689 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (877 877 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (828 28 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (754 644 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (634 634 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (634 634 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (550 377 (:LINEAR EXPT-LESS-THAN-1-HACK)) (500 15 (:REWRITE NORMALIZE-EQUAL-0)) (416 416 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (322 179 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (292 4 (:REWRITE EQUAL-LOGCONS-0)) (282 47 (:REWRITE SUM-POWER-OF-TWO)) (274 274 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (272 4 (:DEFINITION BFIX$INLINE)) (265 87 (:REWRITE DEFAULT-UNARY-MINUS)) (252 114 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (226 113 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (216 108 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (213 97 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (193 193 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (188 188 (:TYPE-PRESCRIPTION BITP-OF-B-NOT)) (188 94 (:REWRITE BFIX-B-FUNCTIONS)) (176 88 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (160 1 (:REWRITE EQUAL-LOGEXT-0)) (144 8 (:REWRITE SIGNED-BYTE-P--2)) (131 13 (:REWRITE LOGCONS-<-0)) (112 8 (:REWRITE EQUAL-MINUS-MINUS)) (94 94 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (89 52 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (76 28 (:REWRITE DEFAULT-*-2)) (75 3 (:DEFINITION LOGHEAD*-BETTER)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (66 66 (:TYPE-PRESCRIPTION BITP)) (66 6 (:REWRITE <-+-NEGATIVE-0-1)) (53 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (53 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (44 1 (:REWRITE LOGBITP-OF-LOGCDR2)) (40 4 (:REWRITE LOGCDR-EXPT)) (39 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (34 17 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (28 28 (:REWRITE DEFAULT-*-1)) (26 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (24 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (18 1 (:DEFINITION LOGBITP*-BETTER)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 4 (:REWRITE EXPT-2-EQUAL-1-REWRITE)) (7 1 (:REWRITE EVENP-OF-LOGCONS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 4 (:DEFINITION =)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 1 (:REWRITE EVENP-OF-LOGCAR)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE USBP-LOGEXT-NARROWER)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (2 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (2 1 (:LINEAR LOGHEAD-LEQ)) (1 1 (:REWRITE LOGCAR-OF-TIMES))) (LOGEXT-IGNORES-SUBTRACTION-OF-EXPT-ALT (261 257 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (204 10 (:REWRITE LOGEXT-IDENTITY)) (84 4 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (60 6 (:REWRITE SIGNED-BYTE-P-+)) (48 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 10 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 19 (:REWRITE DEFAULT-+-2)) (22 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 19 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 5 (:REWRITE DEFAULT-UNARY-MINUS)) (14 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE TOP-BIT-MEANS-<)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 2 (:REWRITE SIGNED-BYTE-P--2)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-TO-SIGNED) (SIGNED-TO-UNSIGNED) (LOGHEAD--OF--LOGEXT-WHEN-UNSIGNED-BYTE-P (504 2 (:LINEAR LOGHEAD-LEQ)) (438 4 (:LINEAR LOGEXT-BOUNDS)) (310 5 (:REWRITE LOGEXT-IDENTITY)) (269 5 (:DEFINITION SIGNED-BYTE-P)) (104 104 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (80 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (72 8 (:LINEAR EXPT->-1)) (69 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (65 49 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (45 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 25 (:REWRITE DEFAULT-<-2)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 7 (:REWRITE DEFAULT-UNARY-MINUS)) (27 25 (:REWRITE DEFAULT-<-1)) (21 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (17 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE))) (LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P (450 10 (:REWRITE LOGHEAD-IDENTITY)) (410 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (256 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (228 228 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (212 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (106 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (98 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 53 (:REWRITE DEFAULT-<-2)) (70 70 (:REWRITE TOP-BIT-MEANS-<)) (60 53 (:REWRITE DEFAULT-<-1)) (58 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (44 44 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (40 10 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (36 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 5 (:LINEAR EXPT->-1)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (30 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 4 (:REWRITE LOGHEAD-<)) (24 4 (:LINEAR LOGHEAD-LEQ)) (20 14 (:REWRITE DEFAULT-+-2)) (20 14 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE SBP-LOGHEAD)) (14 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (11 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (11 2 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:META META-RULE-ERIC)) (9 9 (:REWRITE FIX-DOES-NOTHING)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (4 4 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE SBP-BOUND-1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT))) (LOGHEAD-EQUAL-REWRITE (288 288 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (260 5 (:REWRITE LOGHEAD-IDENTITY)) (234 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (68 3 (:LINEAR LOGHEAD-LEQ)) (54 39 (:REWRITE DEFAULT-<-2)) (50 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (49 49 (:REWRITE TOP-BIT-MEANS-<)) (49 49 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (49 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (45 39 (:REWRITE DEFAULT-<-1)) (44 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (32 24 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (29 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (14 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 1 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (10 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1))) (LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE (329 5 (:REWRITE LOGHEAD-IDENTITY)) (299 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (246 246 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (94 70 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (76 5 (:REWRITE EXPT-IS-WEAKLY-INCREASING-FOR-BASE>1)) (50 5 (:REWRITE LOGEXT-IDENTITY)) (48 29 (:REWRITE DEFAULT-<-2)) (46 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (40 4 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 29 (:REWRITE DEFAULT-<-1)) (38 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (38 3 (:LINEAR LOGHEAD-LEQ)) (36 6 (:LINEAR EXPT->-1)) (34 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (27 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (9 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE RATIONALP-+)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE (113 4 (:REWRITE SBP-BOUND)) (48 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 19 (:REWRITE DEFAULT-<-1)) (31 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (31 19 (:REWRITE DEFAULT-<-2)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (24 24 (:REWRITE TOP-BIT-MEANS-<)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (21 2 (:LINEAR EXPT->-1)) (20 13 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:DEFINITION FIX)) (12 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO (175 5 (:REWRITE SBP-BOUND)) (64 28 (:REWRITE DEFAULT-<-1)) (59 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (55 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 21 (:REWRITE DEFAULT-+-2)) (45 28 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 26 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 21 (:REWRITE DEFAULT-+-1)) (31 3 (:LINEAR EXPT->-1)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (10 10 (:REWRITE EXPONENTS-ADD)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (10 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (7 7 (:REWRITE SBP-BOUND-1)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE RATIONALP-+)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE (263 247 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (198 4 (:REWRITE SBP-BOUND)) (93 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (68 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (61 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE DEFAULT-<-1)) (41 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (41 4 (:LINEAR EXPT->-1)) (39 27 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (37 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 23 (:REWRITE DEFAULT-<-2)) (33 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (32 32 (:REWRITE TOP-BIT-MEANS-<)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (22 22 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 13 (:REWRITE DEFAULT-+-1)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 8 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR (357 357 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (49 24 (:REWRITE DEFAULT-<-1)) (47 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 24 (:REWRITE DEFAULT-<-2)) (31 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE TOP-BIT-MEANS-<)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 13 (:REWRITE DEFAULT-+-2)) (28 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (21 13 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 1 (:REWRITE SBP-BOUND)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE RATIONALP-+)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (SB-FREE-BACKCHAIN (140 4 (:REWRITE SBP-BOUND)) (24 12 (:REWRITE DEFAULT-+-2)) (21 12 (:REWRITE DEFAULT-+-1)) (19 8 (:REWRITE DEFAULT-<-1)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 8 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (SB-FREE-BACKCHAIN1 (200 4 (:REWRITE SBP-BOUND)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (49 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (33 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (30 18 (:REWRITE DEFAULT-+-2)) (27 18 (:REWRITE DEFAULT-+-1)) (22 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 8 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE DEFAULT-<-2)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (14 14 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (11 11 (:REWRITE EXPONENTS-ADD)) (10 1 (:LINEAR EXPT->-1)) (8 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE FALSIFY-SIGNED-BYTE-P))) (UNSIGNED-BYTE-P-LOGAPP-BETTER (181 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (146 9 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (101 101 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (95 70 (:REWRITE DEFAULT-<-1)) (86 86 (:REWRITE TOP-BIT-MEANS-<)) (86 86 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 70 (:REWRITE DEFAULT-<-2)) (79 67 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (78 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (51 6 (:LINEAR EXPT->-1)) (44 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (44 3 (:REWRITE SBP-BOUND)) (43 37 (:REWRITE DEFAULT-+-2)) (40 40 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (39 37 (:REWRITE DEFAULT-+-1)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (33 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (17 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 1 (:REWRITE LOGHEAD-IDENTITY)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 3 (:REWRITE ASH-0)) (12 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (6 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 4 (:REWRITE IFIX-INTEGERP)) (6 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE SBP-BOUND-1)) (3 3 (:REWRITE RATIONALP-+)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (ASH-<=-TO-SBP (197 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (172 2 (:REWRITE <-*-/-LEFT)) (135 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (100 2 (:REWRITE EXPONENTS-ADD)) (88 2 (:REWRITE EXPT-MINUS)) (70 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 3 (:LINEAR X*Y>1-POSITIVE)) (56 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (42 23 (:REWRITE DEFAULT-<-2)) (36 36 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 3 (:LINEAR EXPT->-1)) (30 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 1 (:REWRITE ASH-BOUND3)) (25 23 (:REWRITE DEFAULT-<-1)) (25 7 (:REWRITE DEFAULT-*-2)) (22 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (19 7 (:REWRITE DEFAULT-*-1)) (18 2 (:REWRITE COMMUTATIVITY-OF-*)) (17 1 (:REWRITE EQUAL-1-HACK)) (16 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 3 (:REWRITE ASH-0)) (12 1 (:REWRITE INTEGERP-EXPT)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (11 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE <-1-EXPT)) (8 1 (:REWRITE EQUAL-BIT-1)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 2 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (6 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 1 (:REWRITE ASH-BOUND4A)) (6 1 (:REWRITE ASH-BOUND2A)) (6 1 (:REWRITE ASH-BOUND1)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 1 (:REWRITE DEFAULT-NUMERATOR))) (LOGEXT-BOUNDS-2 (518 8 (:REWRITE LOGEXT-IDENTITY)) (159 159 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 4 (:REWRITE SBP-BOUND)) (136 8 (:LINEAR LOGCAR-RANGE-LINEAR)) (110 10 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (98 3 (:LINEAR LOGEXT-BOUNDS)) (96 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 10 (:REWRITE LOGCAR-IDENTITY)) (60 6 (:LINEAR EXPT->-1)) (52 48 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 10 (:REWRITE LOGCAR-EVENP)) (34 34 (:REWRITE TOP-BIT-MEANS-<)) (34 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (33 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 18 (:REWRITE DEFAULT-<-1)) (29 17 (:REWRITE DEFAULT-+-1)) (26 18 (:REWRITE DEFAULT-<-2)) (25 17 (:REWRITE DEFAULT-+-2)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (22 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (20 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (12 2 (:REWRITE COMMUTATIVITY-OF-+)) (10 10 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (10 10 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 10 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (10 10 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (9 9 (:REWRITE EXPONENTS-ADD)) (9 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE SBP-BOUND-1)) (4 4 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE RATIONALP-+))) (BITP-SIGNED-BYTE-P-32 (8 1 (:REWRITE EQUAL-BIT-1)) (2 2 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (NEGATIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 2 (:LINEAR MOD-TYPE . 2)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (44 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (40 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (26 18 (:REWRITE DEFAULT-<-2)) (26 18 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (18 18 (:REWRITE TOP-BIT-MEANS-<)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (POSITIVE-BOUND-LOGHEAD-REWRITE (100 4 (:REWRITE MOD-=-0 . 2)) (79 13 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (50 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (50 2 (:LINEAR MOD-TYPE . 2)) (45 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (41 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (32 32 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 18 (:REWRITE DEFAULT-*-2)) (28 20 (:REWRITE DEFAULT-<-2)) (28 20 (:REWRITE DEFAULT-<-1)) (24 18 (:REWRITE DEFAULT-*-1)) (24 6 (:REWRITE FOLD-CONSTS-IN-*)) (24 6 (:REWRITE COMMUTATIVITY-OF-*)) (20 20 (:REWRITE TOP-BIT-MEANS-<)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE INTEGERP-+-MINUS-*-4)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-NON-ZERO-TYPE (28 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (28 4 (:LINEAR LOGHEAD-BOUND)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (10 4 (:LINEAR LOGHEAD-LEQ)) (5 1 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-OF-LOGCAR (272 12 (:REWRITE LOGCAR-IDENTITY)) (56 12 (:REWRITE LOGCAR-EVENP)) (38 34 (:REWRITE DEFAULT-<-1)) (37 34 (:REWRITE DEFAULT-<-2)) (35 35 (:REWRITE TOP-BIT-MEANS-<)) (35 35 (:REWRITE EXPT-COMPARE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 1 (:REWRITE EQUAL-BIT-1)) (23 15 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (21 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (14 14 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE EQUAL-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (SIGNED-BYTE-P-OF-LOGCAR (109 7 (:REWRITE MOD-=-0 . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (77 77 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (63 28 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (62 35 (:REWRITE DEFAULT-<-1)) (44 35 (:REWRITE DEFAULT-<-2)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (39 39 (:REWRITE TOP-BIT-MEANS-<)) (39 39 (:REWRITE EXPT-COMPARE)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (37 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (37 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE DEFAULT-*-2)) (25 25 (:REWRITE DEFAULT-*-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 7 (:REWRITE FOLD-CONSTS-IN-*)) (18 1 (:LINEAR MOD-TYPE . 2)) (16 16 (:REWRITE INTEGERP-+-MINUS-*-4)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 1 (:REWRITE SBP-BOUND)) (10 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE DEFAULT-+-2)) (9 2 (:REWRITE EQUAL-1-HACK)) (7 7 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE DEFAULT-+-1)) (6 2 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGBITP-TEST-OF-TOP-BIT (765 363 (:REWRITE DEFAULT-*-2)) (705 363 (:REWRITE DEFAULT-*-1)) (510 50 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (493 5 (:REWRITE RTL1)) (456 182 (:REWRITE DEFAULT-+-2)) (418 418 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (358 31 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (302 38 (:REWRITE POWER2-INTEGER)) (283 5 (:REWRITE FLOOR-=-X/Y . 3)) (267 8 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (252 240 (:REWRITE EXPT-COMPARE)) (239 239 (:REWRITE TOP-BIT-MEANS-<)) (239 239 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (222 182 (:REWRITE DEFAULT-+-1)) (213 159 (:REWRITE DEFAULT-<-1)) (213 61 (:REWRITE EXPT-COMPARE-EQUAL)) (209 209 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (195 159 (:REWRITE DEFAULT-<-2)) (187 19 (:REWRITE INTEGERP-+-MINUS-*-4)) (147 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (125 25 (:REWRITE DEFAULT-UNARY-/)) (104 1 (:REWRITE EVENP-COLLECT-1)) (93 15 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (92 7 (:REWRITE EVENP-COLLAPSE)) (87 3 (:REWRITE EVENP-*)) (85 1 (:REWRITE EVENP-+)) (83 5 (:REWRITE FLOOR-=-X/Y . 2)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (65 5 (:REWRITE FLOOR-DETERMINED-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (63 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (61 5 (:REWRITE FLOOR-SIMPLE-CASES)) (58 8 (:LINEAR EXPT->-1)) (57 19 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (55 55 (:TYPE-PRESCRIPTION POWER2P)) (53 2 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 9 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (34 34 (:REWRITE POWER2P-EXPT2-I)) (32 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (27 27 (:REWRITE EXPO-EXPT2)) (23 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 5 (:REWRITE FLOOR-TYPE-3 . 3)) (23 5 (:REWRITE FLOOR-TYPE-3 . 2)) (21 21 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (21 21 (:REWRITE FOLD-CONSTS-IN-*)) (21 1 (:LINEAR X*Y>1-POSITIVE)) (20 5 (:REWRITE FLOOR-TYPE-4 . 3)) (20 5 (:REWRITE FLOOR-TYPE-4 . 2)) (20 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (18 18 (:REWRITE SBP-BOUND-1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 7 (:REWRITE POWER2P-INVERSE)) (14 1 (:REWRITE EVENP-+-ALT)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (13 1 (:REWRITE SBP-BOUND)) (12 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 1 (:REWRITE DISTRIBUTIVITY)) (10 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (4 1 (:REWRITE POWER2P-SHIFT-2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-PROD-3)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGBITP-TEST-OF-TOP-BIT-ALT (297 5 (:REWRITE RTL1)) (194 3 (:REWRITE FLOOR-=-X/Y . 3)) (93 17 (:REWRITE POWER2-INTEGER)) (91 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (69 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (62 46 (:REWRITE DEFAULT-<-2)) (58 8 (:LINEAR EXPT->-1)) (56 56 (:REWRITE TOP-BIT-MEANS-<)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (55 3 (:REWRITE FLOOR-=-X/Y . 2)) (54 46 (:REWRITE DEFAULT-<-1)) (53 5 (:REWRITE FLOOR-DETERMINED-1)) (47 14 (:REWRITE DEFAULT-*-2)) (45 15 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (41 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (37 37 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (35 9 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (26 26 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (25 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (23 7 (:REWRITE EXPT-COMPARE-EQUAL)) (20 12 (:REWRITE DEFAULT-+-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (18 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 3 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-*-1)) (14 12 (:REWRITE DEFAULT-+-1)) (13 3 (:REWRITE FLOOR-TYPE-3 . 3)) (13 1 (:REWRITE SBP-BOUND)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE EVENP-COLLAPSE)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE SBP-BOUND-1)) (8 3 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (7 5 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (4 2 (:REWRITE POWER2P-INVERSE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGHEAD-LOGCDR (58 3 (:REWRITE LOGHEAD-IDENTITY)) (44 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (18 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (7 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 6 (:REWRITE TOP-BIT-MEANS-<)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 5 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE DEFAULT-<-1)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-+-LOGHEAD-SIMPLE (140 3 (:REWRITE LOGBITP-+-TOO-BIG)) (48 6 (:REWRITE LOGHEAD-IDENTITY)) (41 2 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (29 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 6 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE DEFAULT-+-1)) (6 6 (:META META-RULE-ERIC)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (3 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (95 95 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (79 41 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (44 44 (:REWRITE TOP-BIT-MEANS-<)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (41 41 (:REWRITE POWER2-INTEGER)) (41 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (34 28 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (181 2 (:REWRITE SIGNED-BYTE-P-+----SIMPLE)) (115 115 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (86 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 39 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (71 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (71 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (65 2 (:REWRITE SBP-BOUND)) (60 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (54 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (52 4 (:LINEAR EXPT->-1)) (47 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 43 (:REWRITE TOP-BIT-MEANS-<)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (39 39 (:REWRITE POWER2-INTEGER)) (39 27 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (33 27 (:REWRITE DEFAULT-<-1)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 12 (:REWRITE DEFAULT-+-2)) (22 12 (:REWRITE DEFAULT-+-1)) (20 10 (:REWRITE INTEGERP-+-MINUS-*-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 11 (:REWRITE FIX-DOES-NOTHING)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 3 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (5 5 (:REWRITE RATIONALP-+)) (4 4 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SBP-BOUND-1)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2 (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION (250 2 (:REWRITE SIGNED-BYTE-P-+)) (88 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (79 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (77 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 3 (:REWRITE EXPT-BOUND-AS-LOGBITP)) (62 34 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (57 31 (:REWRITE DEFAULT-<-1)) (50 50 (:REWRITE TOP-BIT-MEANS-<)) (50 3 (:REWRITE SBP-BOUND)) (46 31 (:REWRITE DEFAULT-<-2)) (46 26 (:REWRITE DEFAULT-+-2)) (43 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 34 (:REWRITE POWER2-INTEGER)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 9 (:REWRITE DEFAULT-UNARY-MINUS)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (15 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (15 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (14 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (14 1 (:DEFINITION UNSIGNED-BYTE-P)) (12 10 (:REWRITE EXPONENTS-ADD)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE SBP-BOUND-1)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:TYPE-PRESCRIPTION INTEGER-RANGE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (*ARK*-LOGAND-B-AND (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-IOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (23 23 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (*ARK*-LOGAND-B-XOR (82 12 (:REWRITE LOGCAR-IDENTITY)) (76 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (62 12 (:REWRITE LOGCAR-EVENP)) (32 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 10 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (22 22 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (20 20 (:TYPE-PRESCRIPTION EVENP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE B-NOT-OPEN-1)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (6 6 (:REWRITE LOGAND---EXPT-REWRITE)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (6 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (*ARK*-LOGAND-LOGCAR (132 20 (:REWRITE LOGCAR-IDENTITY)) (100 20 (:REWRITE LOGCAR-EVENP)) (52 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (48 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (35 35 (:REWRITE POWER2-INTEGER)) (35 35 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (32 32 (:TYPE-PRESCRIPTION EVENP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE-V2)) (9 9 (:REWRITE LOGAND---EXPT-REWRITE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (9 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-<-1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2))) (LOGXOR-1 (11 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (5 1 (:REWRITE LOGAND---EXPT-REWRITE)) (4 4 (:TYPE-PRESCRIPTION LOGNOT)) (4 4 (:REWRITE TOP-BIT-MEANS-<)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 1 (:REWRITE LOGNOT-ZIP)) (4 1 (:REWRITE LOGCAR-EVENP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE B-NOT-OPEN-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 1 (:REWRITE CANCEL-EQUAL-LOGNOT . 2)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP))) (IFIX-LOGXOR (4 2 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGXOR-REWRITE)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1))) (EQUAL-LOGCAR-1 (38 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 4 (:REWRITE LOGCAR-IDENTITY)) (19 4 (:REWRITE LOGCAR-EVENP)) (11 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 4 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGCAR-OF-B-XOR (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 3 (:REWRITE LOGCAR-EVENP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (6 4 (:REWRITE B-NOT-OPEN-1)) (6 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION BITP-OF-B-IOR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION))) (LOGCAR-OF-B-AND (32 4 (:REWRITE EQUAL-BIT-1)) (16 2 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 3 (:REWRITE LOGCAR-EVENP)) (12 4 (:REWRITE EQUAL-1-HACK)) (12 4 (:REWRITE BFIX-BITP)) (10 3 (:REWRITE LOGCAR-IDENTITY)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:TYPE-PRESCRIPTION BITP)) (6 6 (:TYPE-PRESCRIPTION EVENP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEXT-BOUND-2 (103 7 (:REWRITE LOGEXT-IDENTITY)) (52 2 (:LINEAR LOGEXT-BOUNDS)) (48 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (12 12 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (2 2 (:REWRITE TOP-BIT-MEANS-<)) (2 2 (:REWRITE EXPT-COMPARE)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-BOUND-REWRITE-1) (LOGEXT-BOUND-REWRITE-2) (LOGEXT-BOUND-UPPER (111 111 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (13 1 (:LINEAR EXPT->-1)) (9 9 (:REWRITE TOP-BIT-MEANS-<)) (9 9 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (8 8 (:REWRITE EXPONENTS-ADD)) (8 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-LOGHEAD-BETTER (811 35 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (451 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (286 41 (:REWRITE LOGCAR-IDENTITY)) (188 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 114 (:REWRITE EXPT-COMPARE)) (164 15 (:REWRITE LOGHEAD-IDENTITY)) (136 100 (:REWRITE DEFAULT-<-2)) (125 125 (:REWRITE POWER2-INTEGER)) (125 125 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (116 100 (:REWRITE DEFAULT-<-1)) (113 43 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (110 110 (:REWRITE TOP-BIT-MEANS-<)) (97 97 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (90 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (85 85 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (77 77 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (72 35 (:REWRITE LOGBITP-TOO-BIG)) (72 4 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (64 64 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (37 3 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (36 9 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (36 4 (:LINEAR LOGHEAD-LEQ)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 3 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (27 27 (:REWRITE EXPT-COMPARE-EQUAL)) (27 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (26 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 10 (:REWRITE IFIX-INTEGERP)) (21 21 (:REWRITE LOGHEAD-SUBST2)) (21 21 (:REWRITE LOGHEAD-SUBST)) (21 21 (:META META-RULE-ERIC)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (11 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 5 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE POWER2P-EXPT2-I)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1))) (LOGBIT-LOGHEAD-BETTER (548 6 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (504 14 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (486 16 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (469 75 (:REWRITE EXPT-COMPARE-EQUAL)) (392 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (352 80 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (195 3 (:REWRITE LOGBITP-+-EXPT-1-N-REWRITE)) (183 183 (:REWRITE EXPT-COMPARE)) (182 182 (:REWRITE TOP-BIT-MEANS-<)) (167 150 (:REWRITE DEFAULT-<-2)) (154 150 (:REWRITE DEFAULT-<-1)) (137 18 (:REWRITE LOGCAR-IDENTITY)) (126 21 (:REWRITE EQUAL-BIT-1)) (126 14 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (125 8 (:LINEAR LOGHEAD-LEQ)) (117 3 (:REWRITE LOGHEAD-OF-MINUS)) (116 17 (:REWRITE <-+-CONSTANT-CONSTANT)) (112 112 (:REWRITE POWER2-INTEGER)) (112 112 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (112 14 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (107 18 (:REWRITE LOGCAR-EVENP)) (101 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (95 95 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (93 21 (:REWRITE EQUAL-1-HACK)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (79 55 (:REWRITE DEFAULT-+-2)) (71 71 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 55 (:REWRITE DEFAULT-+-1)) (66 21 (:REWRITE EXPO-OF-NOT-RATIONALP)) (66 3 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (65 18 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (57 3 (:REWRITE LOGBITP-+-TOO-BIG)) (55 55 (:REWRITE LOGHEAD-SUBST2)) (55 55 (:REWRITE LOGHEAD-SUBST)) (55 55 (:META META-RULE-ERIC)) (54 3 (:REWRITE <-*-0)) (52 49 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 28 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (27 27 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 21 (:REWRITE EXPO-EXPT2)) (24 3 (:REWRITE NORMALIZE-EQUAL-0)) (21 21 (:REWRITE POWER2P-EXPT2-I)) (21 21 (:REWRITE EXPO-MINUS-ERIC)) (21 3 (:DEFINITION IFF)) (19 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD-SIMPLE)) (18 3 (:REWRITE LOGBITP-+-LOGHEAD)) (18 3 (:REWRITE LOGBITP-+---EXPT-REWRITE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-1+)) (13 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (9 5 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 1 (:REWRITE LOGCONS-<-0)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT))) (LOGCAR-LOGAPP-BETTER (230 34 (:REWRITE LOGCAR-IDENTITY)) (210 35 (:REWRITE LOGCAR-EVENP)) (120 34 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (114 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (96 56 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (56 56 (:REWRITE POWER2-INTEGER)) (56 5 (:REWRITE B-NOT-OPEN-1)) (36 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (34 1 (:REWRITE EVENP-+-ALT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:TYPE-PRESCRIPTION NFIX)) (20 20 (:TYPE-PRESCRIPTION IFIX)) (15 1 (:REWRITE LOGHEAD-IDENTITY)) (14 1 (:REWRITE EVENP-*)) (12 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE TOP-BIT-MEANS-<)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE EVENP-OF-LOGHEAD)) (6 2 (:REWRITE IFIX-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-LOGAPP-BETTER (1177 220 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (910 126 (:REWRITE LOGCAR-IDENTITY)) (468 32 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (416 416 (:REWRITE TOP-BIT-MEANS-<)) (416 416 (:REWRITE EXPT-COMPARE)) (404 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (362 319 (:REWRITE DEFAULT-<-2)) (360 319 (:REWRITE DEFAULT-<-1)) (287 257 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (260 220 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (257 257 (:REWRITE POWER2-INTEGER)) (228 220 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (220 220 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (208 112 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 174 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (155 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z)) (154 154 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (132 124 (:REWRITE DEFAULT-+-2)) (128 124 (:REWRITE DEFAULT-+-1)) (121 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (107 107 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (102 102 (:REWRITE LOGBITP-TOO-BIG)) (98 2 (:REWRITE SBP-BOUND)) (87 9 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (73 73 (:REWRITE EXPT-COMPARE-EQUAL)) (73 14 (:REWRITE INTEGERP-UNARY-)) (70 7 (:REWRITE LOGHEAD-IDENTITY)) (66 10 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (61 3 (:DEFINITION MAX)) (58 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (54 18 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (42 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (38 36 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (36 36 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (35 19 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (34 31 (:REWRITE DEFAULT-UNARY-MINUS)) (34 6 (:LINEAR EXPT->-1)) (32 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (30 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (28 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (24 12 (:DEFINITION FIX)) (22 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 14 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (18 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (16 4 (:REWRITE ASH-0)) (16 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 2 (:REWRITE <-0-+-NEGATIVE-1)) (16 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (13 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE RATIONALP-UNARY--)) (10 5 (:REWRITE RATIONALP-+)) (10 2 (:REWRITE FOLD-CONSTS-IN-+)) (10 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 9 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (8 8 (:TYPE-PRESCRIPTION POWER2P)) (8 8 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE SBP-BOUND-1)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-ZERO)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0))) (LOGEXT-OF-LOGEXT-SAME (1020 973 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (646 304 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (498 10 (:REWRITE LOGHEAD-IDENTITY)) (394 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (344 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (336 75 (:REWRITE INTEGERP-+-MINUS-*-2)) (304 304 (:REWRITE POWER2-INTEGER)) (264 132 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (261 12 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (175 175 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (141 141 (:REWRITE TOP-BIT-MEANS-<)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (141 141 (:REWRITE EXPT-COMPARE)) (136 71 (:REWRITE FIX-DOES-NOTHING)) (136 31 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (129 86 (:REWRITE DEFAULT-<-1)) (127 127 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (126 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (120 9 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (115 86 (:REWRITE DEFAULT-<-2)) (108 12 (:LINEAR LOGHEAD-LEQ)) (107 75 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (99 8 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (94 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (92 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 56 (:REWRITE RATIONALP-+)) (82 6 (:LINEAR EXPT->-1)) (78 3 (:REWRITE NORMALIZE-EQUAL-0)) (68 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (64 37 (:REWRITE DEFAULT-+-2)) (64 8 (:REWRITE LOGCAR-IDENTITY)) (56 8 (:REWRITE INTEGERP-UNARY-)) (52 50 (:META META-RULE-ERIC)) (51 3 (:REWRITE EQUAL-MINUS-MINUS)) (50 37 (:REWRITE DEFAULT-+-1)) (49 49 (:REWRITE LOGHEAD-SUBST2)) (45 8 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 8 (:REWRITE INTEGERP-+-MINUS-*-1)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (26 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (25 8 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (24 3 (:REWRITE EQUAL-BIT-1)) (23 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 4 (:REWRITE RATIONALP-UNARY--)) (14 1 (:REWRITE IFIX-INTEGERP)) (14 1 (:REWRITE EQUAL-LOGHEAD-0-SBP-V2)) (12 12 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (11 6 (:REWRITE DEFAULT-UNARY-MINUS)) (10 1 (:REWRITE EQUAL-LOGHEAD-0-SBP)) (9 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 3 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (5 5 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (5 5 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-1+)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (LOGEXT-+-LOGEXT-BETTER-ALT (165 6 (:LINEAR LOGEXT-BOUND-UPPER)) (107 8 (:REWRITE LOGEXT-IDENTITY)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (60 33 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 33 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE TOP-BIT-MEANS-<)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (28 18 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE POWER2-INTEGER)) (18 18 (:REWRITE LOGEXT-OPEN-LOGBIT-SIGN-KNOWN)) (16 10 (:REWRITE DEFAULT-+-2)) (15 9 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE DEFAULT-+-1)) (9 9 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (9 9 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 6 (:REWRITE FIX-DOES-NOTHING)) (8 4 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE RATIONALP-+)) (4 4 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE LOGEXT-+-CANCEL)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGBITP-OF-PRODUCT-WITH-2 (974 69 (:REWRITE POWER2-INTEGER)) (743 4 (:REWRITE FLOOR-=-X/Y . 3)) (712 46 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (524 14 (:REWRITE <-*-/-LEFT)) (504 9 (:REWRITE <-*-Y-X-Y)) (424 13 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (410 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (300 6 (:REWRITE 0-<-*)) (280 4 (:REWRITE RTL1)) (280 4 (:REWRITE FLOOR-SIMPLE-CASES)) (280 4 (:REWRITE FLOOR-DETERMINED-1)) (261 6 (:REWRITE <-*-0)) (249 5 (:REWRITE EVENP-COLLAPSE)) (243 4 (:REWRITE FLOOR-TYPE-3 . 3)) (236 27 (:REWRITE INTEGERP-+-MINUS-*-4)) (232 4 (:REWRITE FLOOR-TYPE-4 . 2)) (222 37 (:LINEAR X*Y>1-POSITIVE)) (219 4 (:REWRITE FLOOR-TYPE-3 . 2)) (217 4 (:REWRITE FLOOR-TYPE-4 . 3)) (215 215 (:REWRITE TOP-BIT-MEANS-<)) (215 215 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (215 215 (:REWRITE EXPT-COMPARE)) (207 11 (:REWRITE EXPO-SHIFT-CONSTANT)) (198 21 (:REWRITE EXPO-/-POWER2P-ALT)) (196 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (185 14 (:REWRITE <-*-/-RIGHT)) (184 63 (:REWRITE EXPT-COMPARE-EQUAL)) (179 79 (:REWRITE DEFAULT-*-2)) (177 4 (:REWRITE EVENP-*)) (160 124 (:REWRITE DEFAULT-<-2)) (148 14 (:REWRITE NORMALIZE-EQUAL-0)) (136 18 (:LINEAR EXPT->-1)) (134 13 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (129 12 (:DEFINITION IFF)) (126 124 (:REWRITE DEFAULT-<-1)) (126 13 (:REWRITE INTEGERP-PROD-3)) (112 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (111 21 (:REWRITE COMMUTATIVITY-OF-+)) (102 7 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 4 (:REWRITE FLOOR-=-X/Y . 2)) (97 79 (:REWRITE DEFAULT-*-1)) (91 29 (:REWRITE EXPO-OF-NOT-RATIONALP)) (87 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (77 29 (:REWRITE FOLD-CONSTS-IN-*)) (67 67 (:TYPE-PRESCRIPTION POWER2P)) (62 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 56 (:REWRITE DEFAULT-+-2)) (59 56 (:REWRITE DEFAULT-+-1)) (53 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 50 (:REWRITE POWER2P-EXPT2-I)) (45 21 (:REWRITE UNICITY-OF-0)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (42 21 (:REWRITE POWER2P-INVERSE)) (40 11 (:REWRITE POWER2P-SHIFT-2)) (33 29 (:REWRITE EXPO-EXPT2)) (32 2 (:REWRITE MOVE---TO-CONSTANT-IN-EQUAL)) (31 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (29 29 (:REWRITE EXPO-MINUS-ERIC)) (26 23 (:REWRITE DEFAULT-UNARY-MINUS)) (24 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 4 (:REWRITE DEFAULT-UNARY-/)) (20 15 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (17 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE TIMES-ZERO)) (16 2 (:REWRITE EQUAL-BIT-1)) (13 13 (:REWRITE SBP-BOUND-1)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 8 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-+)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGBITP-OF-PRODUCT-WITH-1/2 (1584 78 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (1522 12 (:REWRITE FLOOR-=-X/Y . 3)) (1184 104 (:REWRITE POWER2-INTEGER)) (993 40 (:REWRITE <-*-/-LEFT)) (401 12 (:REWRITE RTL1)) (401 12 (:REWRITE FLOOR-SIMPLE-CASES)) (401 12 (:REWRITE FLOOR-DETERMINED-1)) (399 8 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (383 61 (:REWRITE INTEGERP-+-MINUS-*-4)) (371 56 (:LINEAR X*Y>1-POSITIVE)) (351 131 (:REWRITE DEFAULT-*-2)) (330 8 (:REWRITE EVENP-*)) (320 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (300 8 (:REWRITE INTEGERP-*-1/2*X*EXPT-BRIDGE)) (279 279 (:REWRITE TOP-BIT-MEANS-<)) (279 279 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (279 279 (:REWRITE EXPT-COMPARE)) (265 12 (:REWRITE FLOOR-TYPE-3 . 3)) (265 12 (:REWRITE FLOOR-TYPE-3 . 2)) (253 196 (:REWRITE DEFAULT-<-2)) (249 12 (:REWRITE FLOOR-TYPE-4 . 3)) (249 12 (:REWRITE FLOOR-TYPE-4 . 2)) (234 26 (:REWRITE EXPO-/-POWER2P-ALT)) (230 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (210 30 (:LINEAR EXPT->-1)) (210 16 (:REWRITE <-*-/-RIGHT)) (203 196 (:REWRITE DEFAULT-<-1)) (202 12 (:REWRITE FLOOR-=-X/Y . 2)) (187 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (166 131 (:REWRITE DEFAULT-*-1)) (130 26 (:REWRITE COMMUTATIVITY-OF-+)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (104 104 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (100 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (96 32 (:REWRITE EXPO-OF-NOT-RATIONALP)) (82 61 (:REWRITE DEFAULT-+-2)) (80 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (70 70 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (69 69 (:TYPE-PRESCRIPTION POWER2P)) (66 33 (:REWRITE FOLD-CONSTS-IN-*)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 30 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (61 61 (:REWRITE DEFAULT-+-1)) (61 13 (:REWRITE EXPT-COMPARE-EQUAL)) (60 60 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (58 58 (:REWRITE POWER2P-EXPT2-I)) (52 26 (:REWRITE UNICITY-OF-0)) (52 26 (:REWRITE POWER2P-INVERSE)) (40 8 (:REWRITE DEFAULT-UNARY-/)) (36 30 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (32 32 (:REWRITE EXPO-MINUS-ERIC)) (32 32 (:REWRITE EXPO-EXPT2)) (30 30 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE DEFAULT-UNARY-MINUS)) (20 5 (:REWRITE POWER2P-SHIFT-2)) (18 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE SBP-BOUND-1)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE INTEGERP-PROD-3)) (6 6 (:REWRITE ODDP-OF-*)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (5 5 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE ODDP-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGBITP-OF-*-EXPT-2-SPECIAL (309 24 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (158 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (95 18 (:REWRITE LOGCAR-IDENTITY)) (76 28 (:REWRITE DEFAULT-*-2)) (68 21 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (62 46 (:REWRITE DEFAULT-<-2)) (57 57 (:REWRITE TOP-BIT-MEANS-<)) (57 57 (:REWRITE EXPT-COMPARE)) (56 56 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (54 46 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE POWER2-INTEGER)) (42 42 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (42 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (37 28 (:REWRITE DEFAULT-*-1)) (37 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 36 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (36 36 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 24 (:REWRITE LOGBITP-TOO-BIG)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (18 18 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (11 11 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SBP-BOUND-1)) (1 1 (:REWRITE ZIP-OPEN))) (LOGBITP-OF-*-EXPT-2-SPECIAL-CONST (96 7 (:REWRITE LOGBITP-N-UNSIGNED-BYTE-P-N)) (51 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 9 (:REWRITE LOGCAR-IDENTITY)) (19 15 (:REWRITE DEFAULT-<-2)) (17 15 (:REWRITE DEFAULT-<-1)) (15 15 (:REWRITE TOP-BIT-MEANS-<)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 8 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE INTEGERP-*-CONSTANT-MEANS-1)) (9 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC))) (THE-CHECK-NOOP) (LOGAND-BOUND (74 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (43 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGNOT-BOUND (16 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 3 (:REWRITE LOGNOT-ZIP)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (5 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (3 3 (:REWRITE ZIP-OPEN)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGEQV-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGIOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (5 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGXOR-BOUND (303 13 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (160 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (116 3 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (65 2 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (50 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 13 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 28 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (22 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 1 (:REWRITE UNSIGNED-BYTE-P-LOGXOR)) (18 18 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 18 (:REWRITE LOGBITP-TOO-BIG)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 4 (:REWRITE LOGNOT-ZIP)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (13 13 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (13 13 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE ZIP-OPEN)) (4 4 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (3 2 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE DEFAULT-<-2)) (3 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGXOR-BIT-BOUND (4 4 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE LOGXOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGXOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGIOR-BOUND1) (LOGAND-BOUND-REWRITE-1 (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (2 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-BOUND-REWRITE-2 (3 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (ASH--15-HACK (17 1 (:REWRITE ASH-BOUND4)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:REWRITE ASH-BOUND2)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 1 (:REWRITE ASH-0)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0))) (ASH--8-HACK (17 1 (:REWRITE ASH-BOUND4)) (17 1 (:REWRITE ASH-BOUND3)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (6 1 (:REWRITE ASH-BOUND2)) (6 1 (:REWRITE ASH-BOUND1)) (6 1 (:REWRITE <-*-/-RIGHT-COMMUTED)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 1 (:REWRITE ASH-BOUND2A)) (5 1 (:REWRITE ASH-BOUND1A)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-BOUND4A))) (LOGIOR-BOUND-REWRITE-7 (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (*ARK*-+* (2116 1460 (:REWRITE DEFAULT-+-2)) (1790 1460 (:REWRITE DEFAULT-+-1)) (1459 1071 (:REWRITE DEFAULT-*-2)) (1071 1071 (:REWRITE DEFAULT-*-1)) (934 788 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (780 780 (:REWRITE EXPT-COMPARE-EQUAL)) (680 105 (:REWRITE EQUAL-1-HACK)) (552 398 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (443 279 (:REWRITE SUM-POWER-OF-TWO)) (435 58 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (174 29 (:REWRITE <-+-CONSTANT-CONSTANT)) (169 169 (:REWRITE POWER2-INTEGER)) (123 41 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (96 32 (:REWRITE BFIX-BITP)) (92 92 (:TYPE-PRESCRIPTION BITP)) (89 89 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (89 89 (:REWRITE EXPT-COMPARE)) (78 14 (:REWRITE EQUAL-LOGCONS)) (75 66 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE DEFAULT-UNARY-MINUS)) (41 41 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (41 41 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (31 31 (:REWRITE DEFAULT-<-2)) (31 31 (:REWRITE DEFAULT-<-1)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:TYPE-PRESCRIPTION LOGCDR-LOGCDR-INDUCTION))) (*ARK*-SIGNED-BYTE-P-+-BRIDGE (7 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (*ARK*-SIGNED-BYTE-P-31-23-BRIDGE (4 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (SIGNED-BYTE-P-32-BRIDGE (8 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (SIGNED-BYTE-P-32-BRIDGE2 (44 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (25 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 2 (:REWRITE ERIC9)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-32-+-BRIDGE (17 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (6 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (UNSIGNED-BYTE-P-+--EXPT-17-BRIDGE (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-LOGHEAD-7-65535 (26 2 (:REWRITE MOD-=-0 . 2)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (24 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (22 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (13 1 (:LINEAR MOD-TYPE . 2)) (12 8 (:REWRITE DEFAULT-<-2)) (12 8 (:REWRITE DEFAULT-<-1)) (12 3 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (10 10 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (9 6 (:REWRITE DEFAULT-*-2)) (9 6 (:REWRITE DEFAULT-*-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (LOGHEAD-31-LOGCDR-BRIDGE (187 14 (:REWRITE MOD-=-0 . 2)) (185 15 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (169 98 (:REWRITE DEFAULT-*-2)) (167 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (158 15 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (121 98 (:REWRITE DEFAULT-*-1)) (104 74 (:REWRITE DEFAULT-<-2)) (104 74 (:REWRITE DEFAULT-<-1)) (90 90 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (90 90 (:REWRITE EXPT-COMPARE)) (90 50 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (88 87 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (87 87 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (78 6 (:LINEAR MOD-TYPE . 2)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 50 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 40 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (35 17 (:REWRITE DEFAULT-+-2)) (33 33 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 15 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (24 2 (:LINEAR FLOOR-TYPE-2 . 2)) (24 2 (:LINEAR FLOOR-TYPE-2 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (22 22 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (22 14 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (22 2 (:LINEAR FLOOR-TYPE-1 . 2)) (22 2 (:LINEAR FLOOR-TYPE-1 . 1)) (17 17 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (14 14 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (10 2 (:REWRITE CANCEL-MOD-+-BASIC)) (6 6 (:LINEAR MOD-TYPE . 3)) (6 6 (:LINEAR MOD-TYPE . 1)) (6 1 (:REWRITE DISTRIBUTIVITY-ALT)) (6 1 (:DEFINITION IFIX)) (4 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (*ARK*-LOGAND-BIT-CONSTANT (714 7 (:DEFINITION BINARY-LOGAND)) (252 14 (:REWRITE FLOOR-BY-TWICE-HACK)) (182 14 (:REWRITE FLOOR-OF-SHIFT-RIGHT-2)) (126 21 (:REWRITE COMMUTATIVITY-OF-+)) (84 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (84 14 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 56 (:REWRITE DEFAULT-+-2)) (77 56 (:REWRITE DEFAULT-+-1)) (70 63 (:REWRITE DEFAULT-*-2)) (70 14 (:REWRITE FOLD-CONSTS-IN-*)) (63 63 (:REWRITE DEFAULT-*-1)) (56 56 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (42 28 (:REWRITE FIX-DOES-NOTHING)) (42 14 (:REWRITE UNICITY-OF-0)) (42 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (36 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (36 9 (:REWRITE LOGCAR-EVENP)) (32 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (28 28 (:TYPE-PRESCRIPTION LOGMASKP)) (28 28 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (28 14 (:REWRITE UNICITY-OF-1)) (17 9 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE POWER2-INTEGER)) (14 14 (:REWRITE INTEGERP-+-MINUS-*-2)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION IFIX)) (7 7 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (LOGIOR-LOGXOR (123 16 (:REWRITE LOGIOR-AS-B-IOR)) (64 4 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (30 16 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (27 16 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (16 16 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 8 (:REWRITE LOGNOT-ZIP)) (12 8 (:REWRITE LOGAND-WITH-MASK-ERIC)) (12 8 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION LOGNOT)) (8 8 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGIOR-LOGIOR-CONST)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE ZIP-OPEN))) (LOGXOR-LOGIOR (153 23 (:REWRITE LOGIOR-AS-B-IOR)) (80 5 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (76 8 (:REWRITE LOGNOT-ZIP)) (63 2 (:REWRITE ZIP-OPEN)) (49 30 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (48 30 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (48 1 (:REWRITE UNSIGNED-BYTE-P-LOGIOR)) (46 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (42 30 (:REWRITE LOGAND-WITH-MASK-ERIC)) (40 23 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (40 23 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (28 28 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (23 23 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGMASKP)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE LOGIOR-LOGIOR-CONST)) (5 1 (:REWRITE EQUAL-LOGIOR-SINGLE-BIT)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGIOR-=-0)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE EQUAL-LOGIOR-CONST-CONST))) (*ARK*-FOLD-IN-TWO-CROCK (137 43 (:REWRITE DEFAULT-*-2)) (84 84 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (64 7 (:REWRITE ZIP-OPEN)) (60 12 (:LINEAR X*Y>1-POSITIVE)) (43 43 (:REWRITE DEFAULT-*-1)) (43 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (34 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (33 27 (:REWRITE DEFAULT-+-1)) (33 3 (:REWRITE NORMALIZE-EQUAL-0)) (32 32 (:REWRITE EXPT-COMPARE)) (27 27 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-<-2)) (26 26 (:REWRITE DEFAULT-<-1)) (24 3 (:REWRITE EQUAL-MINUS-MINUS)) (16 4 (:REWRITE SUM-POWER-OF-TWO)) (15 15 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:REWRITE EXPT-2-CRUNCHER)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EXPO-MINUS-ERIC))) (*ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE (56 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (17 1 (:REWRITE EQUAL-1-HACK)) (15 2 (:REWRITE POWER2-INTEGER)) (5 3 (:REWRITE DEFAULT-<-1)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (*ARK*-ASH-POS-LOGHEAD-CHEATER (4324 55 (:REWRITE LOGHEAD-IDENTITY)) (4167 125 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (2807 51 (:DEFINITION UNSIGNED-BYTE-P*)) (746 719 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (676 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (618 618 (:REWRITE EXPT-COMPARE)) (553 553 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (512 153 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (374 374 (:REWRITE DEFAULT-<-2)) (374 374 (:REWRITE DEFAULT-<-1)) (351 17 (:REWRITE ZIP-OPEN)) (331 21 (:REWRITE ASH-0)) (297 27 (:REWRITE NORMALIZE-EQUAL-0)) (288 12 (:DEFINITION EXPT)) (278 278 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (244 244 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (239 223 (:REWRITE DEFAULT-+-2)) (226 223 (:REWRITE DEFAULT-+-1)) (216 27 (:REWRITE EQUAL-MINUS-MINUS)) (179 179 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (174 151 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (153 153 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (153 153 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (135 27 (:REWRITE SUM-POWER-OF-TWO)) (135 27 (:REWRITE EQUAL-1-HACK)) (119 64 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (119 64 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (115 115 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (113 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (99 99 (:REWRITE EXPT-COMPARE-EQUAL)) (66 6 (:LINEAR LOGHEAD-LEQ)) (64 64 (:META META-RULE-ERIC)) (64 25 (:REWRITE ASH-GOES-TO-0)) (63 40 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (61 38 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (60 45 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (60 27 (:REWRITE DEFAULT-*-2)) (50 25 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (48 33 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (46 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (44 26 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (39 12 (:REWRITE COMMUTATIVITY-OF-+)) (35 25 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (32 32 (:REWRITE LOGHEAD-SUBST)) (27 27 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (27 27 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE DEFAULT-*-1)) (27 9 (:REWRITE EXPT-2-CRUNCHER)) (23 23 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (21 3 (:REWRITE LOGCDR-<-0)) (13 13 (:TYPE-PRESCRIPTION ZIP)) (9 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (*ARK*-ASH-POS-LOGHEAD-CHEATER2 (8591 131 (:REWRITE LOGHEAD-IDENTITY)) (8032 237 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (5344 109 (:DEFINITION UNSIGNED-BYTE-P*)) (1448 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1258 1258 (:REWRITE EXPT-COMPARE)) (1104 299 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1095 1095 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (774 766 (:REWRITE DEFAULT-<-2)) (766 766 (:REWRITE DEFAULT-<-1)) (644 90 (:REWRITE EQUAL-1-HACK)) (638 557 (:REWRITE DEFAULT-+-2)) (565 557 (:REWRITE DEFAULT-+-1)) (536 536 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (526 74 (:REWRITE ASH-0)) (472 472 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (448 12 (:REWRITE ZIP-OPEN)) (373 77 (:REWRITE SUM-POWER-OF-TWO)) (363 88 (:REWRITE LOGCAR-EVENP)) (340 293 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (299 299 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (299 299 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (271 140 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (260 260 (:REWRITE EXPT-COMPARE-EQUAL)) (257 140 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (239 239 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 150 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (192 129 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (184 16 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (156 78 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (148 79 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (140 140 (:META META-RULE-ERIC)) (140 12 (:LINEAR LOGHEAD-LEQ)) (135 88 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (129 82 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (115 78 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (99 46 (:REWRITE DEFAULT-*-2)) (90 82 (:REWRITE DEFAULT-UNARY-MINUS)) (78 78 (:REWRITE ASH-GOES-TO-0)) (74 74 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (70 70 (:REWRITE LOGHEAD-SUBST2)) (70 70 (:REWRITE LOGHEAD-SUBST)) (61 61 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (49 7 (:REWRITE LOGCDR-<-0)) (46 46 (:REWRITE DEFAULT-*-1)) (21 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 18 (:REWRITE POWER2-INTEGER)) (8 8 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (ASH-LOGXOR (504 4 (:REWRITE ASH-0)) (496 4 (:REWRITE ZIP-OPEN)) (204 8 (:LINEAR LOGAND-BOUND)) (160 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (136 8 (:LINEAR LOGNOT-BOUND)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (120 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (68 4 (:REWRITE SIGNED-BYTE-P-LOGOPS)) (59 4 (:REWRITE LOGIOR-AS-B-IOR)) (52 4 (:REWRITE LOGNOT-NEG)) (32 4 (:REWRITE EQUAL-0-LOGAND-BIT)) (29 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE EXPT-COMPARE)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (17 16 (:REWRITE DEFAULT-<-2)) (17 16 (:REWRITE DEFAULT-<-1)) (16 16 (:TYPE-PRESCRIPTION LOGNOT)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 4 (:REWRITE ASH-AS-LOGTAIL)) (11 1 (:REWRITE UNSIGNED-BYTE-P-ASH)) (10 4 (:REWRITE LOGNOT-ZIP)) (8 4 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (7 1 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE))) (ASH-LOGAND-NEG (184 8 (:LINEAR LOGAND-BOUND)) (136 8 (:REWRITE SIGNED-BYTE-P-ASH)) (58 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (58 8 (:REWRITE LOGTAIL-IDENTITY)) (56 8 (:REWRITE <=-0-ASH)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 2)) (52 4 (:LINEAR LOGAND-UPPER-BOUND-ERIC . 1)) (36 36 (:REWRITE EXPT-COMPARE)) (31 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (28 28 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (19 9 (:REWRITE LOGAND-WITH-MASK-ERIC)) (17 17 (:REWRITE DEFAULT-UNARY-MINUS)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (13 9 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (13 9 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:TYPE-PRESCRIPTION LOGMASKP)) (10 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (8 8 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:TYPE-PRESCRIPTION ADD1-INDUCTION)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (ASH-LEAVES-ONE-BIT-LEFT-HELPER (431 4 (:REWRITE LOGTAIL-IDENTITY)) (325 11 (:DEFINITION EXPT)) (158 154 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 4 (:REWRITE ZIP-OPEN)) (71 62 (:REWRITE DEFAULT-<-2)) (64 62 (:REWRITE DEFAULT-<-1)) (63 59 (:REWRITE DEFAULT-+-1)) (59 59 (:REWRITE DEFAULT-+-2)) (55 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 31 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (44 4 (:REWRITE NORMALIZE-EQUAL-0)) (42 12 (:REWRITE COMMUTATIVITY-OF-+)) (32 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 4 (:REWRITE EQUAL-MINUS-MINUS)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (30 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (26 26 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (25 5 (:REWRITE EQUAL-1-HACK)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 6 (:REWRITE LOGBITP-TOO-BIG)) (21 7 (:REWRITE EXPT-2-CRUNCHER)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 4 (:REWRITE SUM-POWER-OF-TWO)) (19 5 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (12 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE DEFAULT-UNARY-MINUS)) (7 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPONENTS-ADD)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE FALSIFY-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ZP-OPEN))) (ASH-LEAVES-ONE-BIT-LEFT (302 2 (:REWRITE LOGTAIL-IDENTITY)) (235 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (189 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (87 31 (:REWRITE EXPT-COMPARE)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (78 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 4 (:REWRITE POWER2-INTEGER)) (51 3 (:REWRITE EQUAL-1-HACK)) (40 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (38 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 19 (:REWRITE DEFAULT-<-1)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 7 (:REWRITE EXPO-OF-NOT-RATIONALP)) (19 19 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE EXPO-/-POWER2P-ALT)) (16 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE UNICITY-OF-0)) (12 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 9 (:REWRITE POWER2P-EXPT2-I)) (9 7 (:REWRITE EXPO-EXPT2)) (9 3 (:REWRITE DEFAULT-NUMERATOR)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE INVERSE-OF-+)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-*-1))) (ASH-NEG-LOGHEAD (839 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (432 130 (:REWRITE EXPT-COMPARE)) (315 7 (:REWRITE EXPT-MINUS)) (252 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (234 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (157 10 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (144 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (142 13 (:REWRITE LOGHEAD-IDENTITY)) (123 123 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE DEFAULT-+-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (85 5 (:REWRITE EQUAL-1-HACK)) (67 57 (:REWRITE DEFAULT-<-1)) (63 7 (:REWRITE EXPO-/-POWER2P-ALT)) (61 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (59 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (57 57 (:REWRITE DEFAULT-<-2)) (57 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 9 (:REWRITE POWER2-INTEGER)) (41 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (38 2 (:REWRITE EXPO-SHIFT-CONSTANT)) (36 4 (:LINEAR LOGHEAD-LEQ)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 7 (:REWRITE DEFAULT-UNARY-/)) (33 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE DEFAULT-UNARY-MINUS)) (27 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE POWER2P-EXPT2-I)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 19 (:REWRITE EXPO-EXPT2)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (19 11 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:META META-RULE-ERIC)) (18 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 5 (:REWRITE DEFAULT-NUMERATOR)) (14 7 (:REWRITE POWER2P-INVERSE)) (13 11 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 2 (:REWRITE POWER2P-SHIFT-2)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE LOGCDR-<-0)) (6 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE EXPONENTS-ADD)) (3 3 (:TYPE-PRESCRIPTION ADD1-SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE ZP-OPEN))) (SIGNED-BYTE-P-OF-LOGTAIL (342 132 (:REWRITE EXPT-COMPARE)) (256 8 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (255 8 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (245 8 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (159 91 (:REWRITE DEFAULT-<-2)) (152 23 (:LINEAR EXPT->-1)) (139 53 (:REWRITE DEFAULT-*-2)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (104 47 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (102 91 (:REWRITE DEFAULT-<-1)) (93 53 (:REWRITE DEFAULT-*-1)) (87 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (81 27 (:REWRITE EXPO-OF-NOT-RATIONALP)) (70 5 (:REWRITE LOGTAIL-IDENTITY)) (60 51 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (60 24 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 1 (:REWRITE INTEGERP-UNARY-)) (35 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 8 (:REWRITE DEFAULT-UNARY-MINUS)) (27 27 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (15 15 (:REWRITE FOLD-CONSTS-IN-*)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL))) (USBP-OVER-LOGAND (242 4 (:LINEAR LOGAND-BOUND)) (118 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (116 44 (:REWRITE EXPT-COMPARE)) (98 2 (:REWRITE UNSIGNED-BYTE-P-LOGAND)) (93 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (42 30 (:REWRITE DEFAULT-<-2)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (35 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 30 (:REWRITE DEFAULT-<-1)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 3 (:LINEAR EXPT->-1)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:TYPE-PRESCRIPTION POWER2P)) (12 4 (:REWRITE LOGAND-WITH-MASK-ERIC)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (9 9 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (8 8 (:TYPE-PRESCRIPTION LOGMASKP)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EXPO-EXPT2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 2 (:REWRITE LOGAND-NEG)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-OF-LOGEXT (761 6 (:LINEAR LOGHEAD-LEQ)) (727 28 (:REWRITE LOGEXT-IDENTITY)) (640 23 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (363 21 (:REWRITE LOGHEAD-IDENTITY)) (315 70 (:REWRITE LOGCAR-EVENP)) (306 34 (:LINEAR LOGCAR-RANGE-LINEAR)) (247 10 (:LINEAR LOGEXT-BOUNDS-2)) (236 236 (:REWRITE POWER2-INTEGER)) (184 10 (:LINEAR LOGEXT-BOUNDS)) (163 5 (:LINEAR LOGEXT-BOUND-UPPER)) (156 156 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (150 87 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (150 26 (:REWRITE LOGCAR-0-REWRITE)) (147 147 (:TYPE-PRESCRIPTION EVENP)) (140 91 (:REWRITE DEFAULT-<-2)) (128 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 91 (:REWRITE DEFAULT-<-1)) (94 94 (:REWRITE EXPT-COMPARE)) (94 15 (:REWRITE USBP-LOGEXT-NARROWER)) (91 91 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (78 78 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (63 5 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (59 59 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 56 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (54 3 (:REWRITE LOGBITP-LOGCAR)) (48 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (40 40 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (37 34 (:REWRITE LOGHEAD-SUBST2)) (34 34 (:REWRITE LOGHEAD-SUBST)) (34 34 (:META META-RULE-ERIC)) (31 31 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (21 3 (:LINEAR EXPT->-1)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK))) (SIGNED-BYTE-P-OF-1 (23 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 7 (:REWRITE DEFAULT-<-1)) (9 9 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-<-2)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE POWER2-INTEGER)) (4 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X (56 1 (:REWRITE UNSIGNED-BYTE-P-OF-X-MINUS-1)) (49 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (45 28 (:REWRITE DEFAULT-<-2)) (37 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (33 28 (:REWRITE DEFAULT-<-1)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (24 4 (:LINEAR EXPT->-1)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (20 20 (:REWRITE POWER2-INTEGER)) (17 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 4 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGIOR-UNSIGNED-BYTE-P-16-ONE (10 1 (:REWRITE LOGIOR-AS-B-IOR)) (6 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION))) (LOGIOR-UNSIGNED-BYTE-P-16-TWO (30 3 (:REWRITE LOGIOR-AS-B-IOR)) (12 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-1))) (LOGEXT-MINUS (3500 158 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1543 236 (:REWRITE EXPT-COMPARE-EQUAL)) (1073 133 (:LINEAR EXPT->-1)) (1000 21 (:REWRITE RTL1)) (1000 21 (:REWRITE FLOOR-SIMPLE-CASES)) (1000 21 (:REWRITE FLOOR-DETERMINED-1)) (876 26 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (812 266 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (645 645 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (630 477 (:REWRITE DEFAULT-<-2)) (624 124 (:REWRITE POWER2-INTEGER)) (567 567 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (567 567 (:REWRITE EXPT-COMPARE)) (553 79 (:REWRITE DEFAULT-UNARY-/)) (537 498 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (477 477 (:REWRITE DEFAULT-<-1)) (462 124 (:REWRITE DEFAULT-+-2)) (440 139 (:REWRITE DEFAULT-UNARY-MINUS)) (408 135 (:REWRITE DEFAULT-*-2)) (366 102 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (359 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (346 7 (:REWRITE ODDP-OF-*)) (326 8 (:REWRITE FLOOR-=-X/Y . 2)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (308 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (292 73 (:REWRITE EXPO-OF-NOT-RATIONALP)) (288 249 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (280 56 (:REWRITE EQUAL-1-HACK)) (258 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (244 61 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (229 124 (:REWRITE DEFAULT-+-1)) (216 54 (:REWRITE EXPT-2-CRUNCHER)) (211 211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (204 51 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (200 200 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 133 (:LINEAR EXPT-LESS-THAN-1-HACK)) (164 12 (:REWRITE EXPO-/-POWER2P-ALT)) (153 153 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (146 146 (:TYPE-PRESCRIPTION POWER2P)) (146 73 (:REWRITE EXPO-EXPT2)) (135 135 (:REWRITE DEFAULT-*-1)) (130 10 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (102 102 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (91 13 (:REWRITE FLOOR-TYPE-3 . 3)) (91 13 (:REWRITE FLOOR-TYPE-3 . 2)) (88 25 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (85 85 (:REWRITE POWER2P-EXPT2-I)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (84 84 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (82 25 (:LINEAR MOD-TYPE . 3)) (82 25 (:LINEAR MOD-TYPE . 1)) (78 13 (:REWRITE FLOOR-TYPE-4 . 3)) (78 13 (:REWRITE FLOOR-TYPE-4 . 2)) (73 73 (:REWRITE EXPO-MINUS-ERIC)) (56 56 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (26 26 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (26 26 (:REWRITE EXPONENTS-ADD)) (26 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (25 25 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (24 12 (:REWRITE POWER2P-INVERSE)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (9 6 (:REWRITE INTEGERP-+-MINUS-*-1)) (1 1 (:REWRITE FOLD-CONSTS-IN-+))) (PLUS-OF-LOGAPP-SUCK-IN (92 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (81 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (64 30 (:REWRITE DEFAULT-+-2)) (42 30 (:REWRITE DEFAULT-+-1)) (34 29 (:REWRITE DEFAULT-<-2)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 29 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 2 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE POWER2-INTEGER)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 5 (:LINEAR EXPT->-1)) (19 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (8 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 3 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (PLUS-OF-LOGAPP-SUCK-IN-ALT (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (PLUS-MINUS-HALF-COLLECT) (LOGHEAD-OF-PROD-OF-LOGEXT-HELPER (52714 108 (:REWRITE <-*-0)) (52714 108 (:REWRITE 0-<-*)) (43020 216 (:DEFINITION IFF)) (20420 387 (:REWRITE FLOOR-=-X/Y . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 3)) (17652 387 (:REWRITE FLOOR-TYPE-3 . 2)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (16471 190 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 3)) (13283 387 (:REWRITE FLOOR-TYPE-4 . 2)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (12109 190 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (11778 1198 (:REWRITE INTEGERP-+-MINUS-*-4)) (10073 2195 (:REWRITE DEFAULT-*-2)) (9895 1462 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9752 174 (:LINEAR MOD-TYPE . 2)) (7135 387 (:REWRITE FLOOR-=-X/Y . 2)) (6437 3307 (:REWRITE DEFAULT-<-2)) (6174 190 (:REWRITE MOD-=-0 . 2)) (5628 389 (:REWRITE RTL1)) (5628 389 (:REWRITE FLOOR-DETERMINED-1)) (4699 4699 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4699 4699 (:REWRITE EXPT-COMPARE)) (4580 67 (:REWRITE NORMALIZE-EQUAL-0)) (4312 3307 (:REWRITE DEFAULT-<-1)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4046 4046 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4015 365 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3625 725 (:REWRITE DEFAULT-UNARY-/)) (3469 1106 (:REWRITE EXPT-COMPARE-EQUAL)) (3294 366 (:REWRITE EXPO-/-POWER2P-ALT)) (3110 2195 (:REWRITE DEFAULT-*-1)) (2304 2304 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2211 2211 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2154 718 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2101 2101 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1998 30 (:REWRITE INTEGERP-+-MINUS-*-2)) (1977 659 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1688 67 (:REWRITE EQUAL-MINUS-MINUS)) (1545 309 (:LINEAR X*Y>1-POSITIVE)) (1495 60 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1488 24 (:REWRITE MOD-=-0 . 1)) (1458 810 (:REWRITE DEFAULT-+-2)) (1438 126 (:REWRITE INTEGERP-PROD-3)) (1426 126 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (1347 67 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1275 1275 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1244 4 (:REWRITE CANCEL-FLOOR-+-BASIC)) (1050 1050 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1032 718 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1024 64 (:REWRITE <-0-+-NEGATIVE-1)) (993 471 (:REWRITE DEFAULT-UNARY-MINUS)) (957 286 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (837 810 (:REWRITE DEFAULT-+-1)) (732 366 (:REWRITE UNICITY-OF-0)) (732 366 (:REWRITE POWER2P-INVERSE)) (659 659 (:REWRITE EXPO-MINUS-ERIC)) (573 191 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (570 190 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (552 24 (:REWRITE MOD-TYPE)) (540 174 (:LINEAR MOD-TYPE . 3)) (538 174 (:LINEAR MOD-TYPE . 1)) (533 529 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (320 64 (:REWRITE SUM-POWER-OF-TWO)) (316 191 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (256 256 (:LINEAR EXPT-LESS-THAN-1-HACK)) (224 112 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (192 6 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (182 90 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (182 90 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (112 112 (:TYPE-PRESCRIPTION EVENP)) (64 64 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (32 32 (:TYPE-PRESCRIPTION IFF)) (30 30 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (15 3 (:REWRITE EQUAL-1-HACK)) (13 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (11 11 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (8 2 (:REWRITE INTEGERP-UNARY-)) (8 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT))) (LOGHEAD-OF-PROD-OF-LOGEXT (466 4 (:LINEAR LOGHEAD-LEQ)) (414 4 (:REWRITE <-*-0)) (168 12 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:DEFINITION IFF)) (122 84 (:REWRITE DEFAULT-<-2)) (92 84 (:REWRITE DEFAULT-<-1)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (88 4 (:REWRITE LOGEXT-IDENTITY)) (84 12 (:LINEAR LOGEXT-BOUNDS-2)) (84 12 (:LINEAR LOGEXT-BOUNDS)) (72 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 68 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (54 54 (:REWRITE POWER2-INTEGER)) (52 52 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (46 46 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (38 38 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (32 32 (:TYPE-PRESCRIPTION IFIX)) (32 8 (:REWRITE LOGCAR-EVENP)) (24 24 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (22 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 18 (:META META-RULE-ERIC)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (16 16 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 10 (:REWRITE DEFAULT-*-2)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (14 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR EXPT->-1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (10 10 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT (60 60 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 3 (:REWRITE LOGTAIL-IDENTITY)) (42 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (39 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE EXPT-COMPARE)) (24 3 (:REWRITE LOGHEAD-IDENTITY)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SPLIT (153 11 (:REWRITE LOGHEAD-IDENTITY)) (140 140 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 28 (:REWRITE DEFAULT-<-1)) (28 28 (:REWRITE DEFAULT-<-2)) (26 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGHEAD-LEQ)) (14 13 (:META META-RULE-ERIC)) (13 13 (:REWRITE POWER2-INTEGER)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-EQUAL-LOGAPP-REWRITE-HELPER (291 23 (:REWRITE LOGHEAD-IDENTITY)) (137 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (100 91 (:REWRITE DEFAULT-<-1)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (91 91 (:REWRITE DEFAULT-<-2)) (79 10 (:LINEAR LOGHEAD-LEQ)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (57 57 (:REWRITE POWER2-INTEGER)) (52 51 (:META META-RULE-ERIC)) (41 41 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (36 6 (:REWRITE ASH-AS-LOGTAIL)) (30 5 (:LINEAR EXPT->-1)) (25 10 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (12 3 (:REWRITE ASH-0)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 5 (:REWRITE IFIX-INTEGERP)) (8 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:TYPE-PRESCRIPTION ZIP)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE ZIP-OPEN)) (3 3 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (3 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE CANCEL-EQUAL-+-*))) (LOGAPP-EQUAL-LOGAPP-REWRITE (574 49 (:REWRITE LOGHEAD-IDENTITY)) (304 304 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (280 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (255 45 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (186 143 (:REWRITE DEFAULT-<-1)) (167 143 (:REWRITE DEFAULT-<-2)) (145 145 (:REWRITE POWER2-INTEGER)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (143 143 (:REWRITE EXPT-COMPARE)) (109 109 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (94 49 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (93 12 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (81 12 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (74 74 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 49 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (69 69 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (67 67 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (56 7 (:LINEAR LOGHEAD-LEQ)) (53 53 (:META META-RULE-ERIC)) (49 49 (:REWRITE LOGHEAD-SUBST)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 45 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (45 45 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 15 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (27 4 (:LINEAR EXPT->-1)) (22 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (19 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGAPP-EQUAL-LOGAPP-REWRITE-NO-SPLIT (44 44 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 44 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (44 4 (:REWRITE LOGHEAD-IDENTITY)) (16 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-SPLIT-SPECIAL (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-SPLIT (235 17 (:REWRITE LOGHEAD-IDENTITY)) (201 201 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (134 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (88 88 (:REWRITE EXPT-COMPARE)) (72 72 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (53 48 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (30 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE POWER2-INTEGER)) (20 19 (:META META-RULE-ERIC)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (15 15 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-TWO-LOGEXTS-REWRITE-HELPER (1446 1446 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1241 78 (:REWRITE LOGHEAD-IDENTITY)) (856 102 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (476 476 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (476 476 (:REWRITE EXPT-COMPARE)) (456 17 (:LINEAR LOGHEAD-LEQ)) (325 35 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (270 255 (:REWRITE DEFAULT-<-1)) (266 266 (:REWRITE POWER2-INTEGER)) (265 255 (:REWRITE DEFAULT-<-2)) (200 102 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (179 94 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (149 149 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (133 129 (:REWRITE DEFAULT-+-1)) (133 123 (:META META-RULE-ERIC)) (133 78 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (129 129 (:REWRITE DEFAULT-+-2)) (123 123 (:REWRITE LOGHEAD-SPLIT-SPECIAL)) (113 113 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (104 104 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 102 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (102 102 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (84 6 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (83 10 (:LINEAR EXPT->-1)) (71 71 (:REWRITE EXPT-COMPARE-EQUAL)) (70 70 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (60 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (50 4 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (50 4 (:REWRITE ASH-AS-LOGTAIL)) (40 20 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (40 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 35 (:REWRITE LOGBITP-TOO-BIG)) (26 14 (:REWRITE FOLD-CONSTS-IN-+)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 10 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (12 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 8 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RIGHT-CANCELLATION-FOR-+)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 4 (:REWRITE ASH-0)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (EQUAL-OF-TWO-LOGEXTS-REWRITE (468 38 (:REWRITE LOGEXT-IDENTITY)) (220 52 (:REWRITE LOGCAR-EVENP)) (154 6 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (142 142 (:REWRITE POWER2-INTEGER)) (105 14 (:REWRITE LOGHEAD-IDENTITY)) (96 96 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (96 12 (:LINEAR LOGEXT-BOUND-UPPER)) (94 52 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (90 90 (:TYPE-PRESCRIPTION EVENP)) (90 48 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (88 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (76 38 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (66 66 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (56 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (51 35 (:REWRITE DEFAULT-<-1)) (50 35 (:REWRITE DEFAULT-<-2)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE EXPT-COMPARE)) (36 6 (:REWRITE LOGCAR-0-REWRITE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 31 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (30 30 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (30 30 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (30 30 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (30 30 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 21 (:META META-RULE-ERIC)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (13 13 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 13 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (8 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (LOGEXT-OF-PRODUCT-OF-LOGEXT (2889 28 (:REWRITE FLOOR-=-X/Y . 3)) (1826 142 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1752 48 (:REWRITE <-*-0)) (1752 48 (:REWRITE 0-<-*)) (1680 96 (:DEFINITION IFF)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (1598 1598 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (1371 34 (:REWRITE FLOOR-SIMPLE-CASES)) (1363 34 (:REWRITE RTL1)) (1363 34 (:REWRITE FLOOR-DETERMINED-1)) (1336 76 (:REWRITE INTEGERP-+-MINUS-*-4)) (1263 988 (:REWRITE DEFAULT-<-2)) (1258 46 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (1253 294 (:REWRITE DEFAULT-*-2)) (1211 988 (:REWRITE DEFAULT-<-1)) (1189 1189 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1189 1189 (:REWRITE EXPT-COMPARE)) (861 28 (:REWRITE FLOOR-=-X/Y . 2)) (822 215 (:REWRITE DEFAULT-+-2)) (795 159 (:LINEAR X*Y>1-POSITIVE)) (770 462 (:REWRITE EXPT-COMPARE-EQUAL)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (723 31 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (707 71 (:REWRITE DEFAULT-UNARY-/)) (703 294 (:REWRITE DEFAULT-*-1)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (683 31 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (599 28 (:REWRITE FLOOR-TYPE-3 . 3)) (599 28 (:REWRITE FLOOR-TYPE-3 . 2)) (590 29 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (590 29 (:REWRITE INTEGERP-PROD-3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 3)) (567 28 (:REWRITE FLOOR-TYPE-4 . 2)) (556 556 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (532 38 (:REWRITE EXPO-/-POWER2P-ALT)) (450 215 (:REWRITE DEFAULT-+-1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (437 437 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (394 98 (:REWRITE DEFAULT-UNARY-MINUS)) (385 326 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (364 44 (:LINEAR EXPT->-1)) (303 21 (:REWRITE EQUAL-1-HACK)) (288 72 (:REWRITE EXPT-2-CRUNCHER)) (260 65 (:REWRITE EXPO-OF-NOT-RATIONALP)) (256 88 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (250 19 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (238 238 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (222 163 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (211 58 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (197 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (168 14 (:REWRITE NORMALIZE-EQUAL-0)) (162 6 (:DEFINITION ZEROP)) (156 54 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (147 43 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (136 43 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (136 34 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (131 54 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (118 44 (:LINEAR EXPT-LESS-THAN-1-HACK)) (112 14 (:REWRITE EQUAL-MINUS-MINUS)) (90 90 (:REWRITE FOLD-CONSTS-IN-*)) (80 38 (:REWRITE UNICITY-OF-0)) (76 38 (:REWRITE POWER2P-INVERSE)) (72 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 69 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (65 65 (:REWRITE EXPO-MINUS-ERIC)) (56 4 (:REWRITE ASSOCIATIVITY-OF-*)) (40 7 (:REWRITE DEFAULT-NUMERATOR)) (38 19 (:REWRITE INTEGERP-+-MINUS-*-2)) (31 31 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (31 31 (:REWRITE EXPONENTS-ADD)) (19 19 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (14 14 (:REWRITE FOLD-CONSTS-IN-+)) (14 14 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (7 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (7 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-PRODUCT-OF-LOGEXT-ALT (346 8 (:LINEAR LOGEXT-BOUND-UPPER)) (240 2 (:REWRITE <-*-0)) (112 16 (:LINEAR LOGEXT-BOUNDS-2)) (112 16 (:LINEAR LOGEXT-BOUNDS)) (90 2 (:LINEAR X*Y>1-POSITIVE)) (86 51 (:REWRITE DEFAULT-<-2)) (53 53 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 53 (:REWRITE EXPT-COMPARE)) (51 51 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 2 (:DEFINITION IFF)) (33 33 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (21 3 (:REWRITE LOGEXT-IDENTITY)) (17 17 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE EQUAL-LOGEXT-0)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (ASH-OF-LOGTAIL-DOES-NOTHING-REWRITE (1858 115 (:LINEAR X*Y>1-POSITIVE)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1125 1125 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (901 13 (:LINEAR FLOOR-TYPE-2 . 1)) (897 13 (:LINEAR FLOOR-TYPE-2 . 2)) (894 26 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (886 13 (:LINEAR FLOOR-TYPE-1 . 2)) (886 13 (:LINEAR FLOOR-TYPE-1 . 1)) (705 45 (:REWRITE RATIONALP-*)) (558 326 (:REWRITE DEFAULT-<-1)) (558 12 (:REWRITE RTL1)) (539 326 (:REWRITE DEFAULT-<-2)) (530 35 (:REWRITE <-*-0)) (470 32 (:REWRITE 0-<-*)) (466 30 (:REWRITE <-*-/-LEFT)) (453 138 (:REWRITE POWER2-INTEGER)) (440 109 (:REWRITE DEFAULT-*-2)) (440 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (432 13 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (404 26 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (389 12 (:REWRITE FLOOR-SIMPLE-CASES)) (374 12 (:REWRITE FLOOR-TYPE-3 . 2)) (361 12 (:REWRITE FLOOR-DETERMINED-1)) (359 12 (:REWRITE FLOOR-TYPE-4 . 3)) (351 76 (:LINEAR EXPT->-1)) (338 12 (:REWRITE FLOOR-TYPE-4 . 2)) (329 12 (:REWRITE FLOOR-TYPE-3 . 3)) (288 12 (:REWRITE FLOOR-=-X/Y . 3)) (273 109 (:REWRITE DEFAULT-*-1)) (254 12 (:REWRITE FLOOR-=-X/Y . 2)) (243 81 (:REWRITE EXPO-OF-NOT-RATIONALP)) (184 152 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (177 177 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (166 52 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (158 76 (:LINEAR EXPT-LESS-THAN-1-HACK)) (145 57 (:REWRITE EXPT-COMPARE-EQUAL)) (100 100 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (100 12 (:REWRITE <-*-/-RIGHT)) (96 1 (:REWRITE MOD-=-0 . 2)) (84 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (81 81 (:REWRITE EXPO-MINUS-ERIC)) (81 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (67 1 (:REWRITE FLOOR-=-X/Y . 4)) (65 13 (:REWRITE DEFAULT-UNARY-/)) (55 11 (:DEFINITION IFF)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (33 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (31 31 (:REWRITE FOLD-CONSTS-IN-*)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (17 1 (:REWRITE EVENP-COLLAPSE)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (15 15 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (15 1 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (11 11 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:TYPE-PRESCRIPTION EVENP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ASH (943 14 (:REWRITE FLOOR-SIMPLE-CASES)) (927 56 (:LINEAR X*Y>1-POSITIVE)) (811 334 (:REWRITE EXPT-COMPARE)) (499 14 (:REWRITE RTL1)) (499 14 (:REWRITE FLOOR-DETERMINED-1)) (357 251 (:REWRITE DEFAULT-<-1)) (356 251 (:REWRITE DEFAULT-<-2)) (323 5 (:REWRITE FLOOR-=-X/Y . 3)) (310 10 (:REWRITE 0-<-*)) (305 10 (:REWRITE <-*-0)) (296 38 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (291 291 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (273 115 (:REWRITE DEFAULT-*-2)) (262 6 (:LINEAR FLOOR-TYPE-2 . 2)) (254 6 (:LINEAR FLOOR-TYPE-2 . 1)) (252 30 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (252 30 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (252 6 (:LINEAR FLOOR-TYPE-1 . 1)) (248 6 (:LINEAR FLOOR-TYPE-1 . 2)) (235 36 (:LINEAR EXPT->-1)) (205 20 (:DEFINITION IFF)) (193 115 (:REWRITE DEFAULT-*-1)) (153 51 (:REWRITE EXPO-OF-NOT-RATIONALP)) (150 150 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (150 39 (:REWRITE POWER2-INTEGER)) (135 5 (:REWRITE FLOOR-=-X/Y . 2)) (125 1 (:REWRITE FLOOR-=-X/Y . 4)) (123 5 (:REWRITE FLOOR-TYPE-3 . 3)) (121 5 (:REWRITE FLOOR-TYPE-3 . 2)) (119 7 (:REWRITE COMMUTATIVITY-2-OF-*)) (117 5 (:REWRITE FLOOR-TYPE-4 . 3)) (116 5 (:REWRITE FLOOR-TYPE-4 . 2)) (104 64 (:REWRITE EXPT-COMPARE-EQUAL)) (102 102 (:TYPE-PRESCRIPTION POWER2P)) (83 19 (:REWRITE DEFAULT-UNARY-/)) (78 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (75 33 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (74 74 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 72 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 51 (:REWRITE EXPO-EXPT2)) (57 33 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (54 54 (:REWRITE POWER2P-EXPT2-I)) (51 51 (:REWRITE EXPO-MINUS-ERIC)) (46 2 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (46 2 (:REWRITE INTEGERP-PROD-3)) (44 4 (:REWRITE EQUAL-1-HACK)) (42 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (41 41 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 3 (:REWRITE <-*-RIGHT-CANCEL)) (32 16 (:REWRITE DEFAULT-+-2)) (31 13 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (24 4 (:REWRITE /-CANCELLATION-ON-RIGHT)) (22 22 (:REWRITE FOLD-CONSTS-IN-*)) (22 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (22 2 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 16 (:REWRITE DEFAULT-+-1)) (15 3 (:REWRITE COMMUTATIVITY-OF-+)) (13 13 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE UNICITY-OF-0)) (6 3 (:REWRITE POWER2P-INVERSE)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (B-NOT-EQUAL-0-REWRITE (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE EQUAL-1-HACK)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER))) (B-NOT-EQUAL-1-REWRITE (10 3 (:REWRITE EQUAL-1-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (3 1 (:REWRITE BFIX-BITP)) (2 2 (:TYPE-PRESCRIPTION BITP)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1))) (UNSIGNED-BYTE-P-1-CHOICES) (LOGEXT-OF-PROD-OF-LOGHEAD (468 26 (:REWRITE LOGEXT-IDENTITY)) (276 4 (:LINEAR LOGEXT-BOUND-UPPER)) (250 28 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (224 4 (:REWRITE <-*-0)) (60 4 (:DEFINITION IFF)) (56 56 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (51 26 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (42 6 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:TYPE-PRESCRIPTION IFIX)) (36 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (28 28 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (28 28 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (26 26 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (25 23 (:REWRITE DEFAULT-<-2)) (24 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 4 (:LINEAR X*Y>1-POSITIVE)) (17 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (17 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (17 1 (:LINEAR LOGHEAD-BOUND)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 2 (:REWRITE LOGHEAD-<=)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE LOGHEAD-NON-ZERO-TYPE)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK))) (ASH-LOGEXT (43467 47 (:REWRITE ASH-0)) (43357 22 (:REWRITE ZIP-OPEN)) (16868 164 (:DEFINITION LOGEXT*-BETTER)) (15577 328 (:REWRITE LOGEXT-IDENTITY)) (14339 19 (:REWRITE EQUAL-LOGEXT-0)) (9000 344 (:DEFINITION SIGNED-BYTE-P*)) (8244 164 (:REWRITE SIGNED-BYTE-P-OF-LOGCDR)) (8019 114 (:REWRITE LOGHEAD-IDENTITY)) (6777 57 (:DEFINITION LOGHEAD*-BETTER)) (5381 19 (:LINEAR LOGHEAD-UPPER-BOUND)) (4699 1545 (:REWRITE <-+-CONSTANT-CONSTANT)) (4668 114 (:DEFINITION UNSIGNED-BYTE-P*)) (4386 57 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (3821 19 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (3516 228 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2752 344 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2169 2169 (:REWRITE EXPT-COMPARE)) (2167 2167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2068 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (1960 280 (:REWRITE <-0-+-NEGATIVE-1)) (1758 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1743 1431 (:REWRITE DEFAULT-<-2)) (1647 1431 (:REWRITE DEFAULT-<-1)) (1636 164 (:REWRITE EQUAL-1-HACK)) (1591 1591 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1586 194 (:REWRITE EXPONENTS-ADD)) (1540 385 (:REWRITE LOGCAR-EVENP)) (1454 883 (:REWRITE DEFAULT-+-2)) (1198 1070 (:REWRITE EXPT-COMPARE-EQUAL)) (934 934 (:TYPE-PRESCRIPTION EVENP)) (883 883 (:REWRITE DEFAULT-+-1)) (856 566 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (852 852 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (852 852 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (852 852 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (816 136 (:REWRITE SUM-POWER-OF-TWO)) (784 16 (:REWRITE EXPT-MINUS)) (742 19 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (713 713 (:REWRITE FOLD-CONSTS-IN-+)) (688 688 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (679 679 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (650 650 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (640 32 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (637 331 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (619 619 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (595 75 (:LINEAR EXPT-LESS-THAN-1-HACK)) (570 570 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (549 549 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (492 328 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (393 89 (:REWRITE DEFAULT-UNARY-MINUS)) (385 385 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (357 150 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (328 164 (:REWRITE LOGCAR-0-REWRITE)) (300 164 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (292 40 (:LINEAR LOGEXT-BOUND-UPPER)) (285 285 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (272 272 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (267 114 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (256 16 (:REWRITE COMMUTATIVITY-2-OF-*)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (228 228 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (228 228 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (221 221 (:TYPE-PRESCRIPTION LOGCDR-TYPE)) (179 47 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (179 47 (:REWRITE ASH-AS-LOGTAIL)) (171 114 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (164 164 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (162 162 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (152 152 (:TYPE-PRESCRIPTION LOGHEAD-TYPE)) (144 48 (:REWRITE DEFAULT-*-2)) (144 48 (:REWRITE DEFAULT-*-1)) (136 136 (:REWRITE EQUAL-CONSTANT-+)) (133 19 (:LINEAR LOGHEAD-LEQ)) (128 16 (:REWRITE /-CANCELLATION-ON-LEFT)) (114 114 (:META META-RULE-ERIC)) (112 16 (:REWRITE COMMUTATIVITY-OF-*)) (89 47 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (80 16 (:REWRITE DEFAULT-UNARY-/)) (69 47 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (69 47 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (57 57 (:REWRITE LOGHEAD-SUBST2)) (57 57 (:REWRITE LOGHEAD-SUBST)) (48 48 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (48 16 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (48 16 (:REWRITE EXPO-OF-NOT-RATIONALP)) (47 47 (:REWRITE ASH-GOES-TO-0)) (32 32 (:TYPE-PRESCRIPTION POWER2P)) (32 32 (:REWRITE FOLD-CONSTS-IN-*)) (25 25 (:TYPE-PRESCRIPTION ZIP)) (16 16 (:REWRITE POWER2P-EXPT2-I)) (16 16 (:REWRITE EXPO-MINUS-ERIC)) (16 16 (:REWRITE EXPO-EXPT2)) (14 2 (:REWRITE <=-0-ASH)) (3 3 (:REWRITE POWER2-INTEGER))) (ASH-PLUS-CONSTANT-SUCK-IN (34 34 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (34 34 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (14 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (12 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:REWRITE DEFAULT-<-1)) (7 5 (:REWRITE DEFAULT-+-2)) (7 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (7 1 (:REWRITE ASH-AS-LOGTAIL)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 1 (:LINEAR EXPT->-1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (<-OF-LOGTAIL (1666 22 (:REWRITE FLOOR-=-X/Y . 3)) (880 40 (:REWRITE INTEGERP-+-MINUS-*-4)) (806 66 (:REWRITE POWER2-INTEGER)) (752 100 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (490 22 (:REWRITE RTL1)) (490 22 (:REWRITE FLOOR-SIMPLE-CASES)) (490 22 (:REWRITE FLOOR-DETERMINED-1)) (442 22 (:REWRITE FLOOR-=-X/Y . 2)) (419 271 (:REWRITE DEFAULT-<-2)) (409 123 (:REWRITE DEFAULT-*-2)) (347 299 (:REWRITE EXPT-COMPARE)) (312 52 (:LINEAR EXPT->-1)) (295 295 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (280 20 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (273 271 (:REWRITE DEFAULT-<-1)) (250 50 (:REWRITE DEFAULT-UNARY-/)) (207 47 (:REWRITE EXPT-COMPARE-EQUAL)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (180 180 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (180 20 (:REWRITE EXPO-/-POWER2P-ALT)) (144 144 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (144 16 (:LINEAR X*Y>1-POSITIVE)) (142 22 (:REWRITE FLOOR-TYPE-3 . 3)) (142 22 (:REWRITE FLOOR-TYPE-3 . 2)) (139 123 (:REWRITE DEFAULT-*-1)) (136 2 (:REWRITE FLOOR-=-X/Y . 4)) (132 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (122 22 (:REWRITE FLOOR-TYPE-4 . 3)) (122 22 (:REWRITE FLOOR-TYPE-4 . 2)) (104 104 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (100 20 (:REWRITE COMMUTATIVITY-OF-+)) (92 48 (:REWRITE DEFAULT-+-2)) (88 88 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (66 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (64 64 (:REWRITE POWER2P-EXPT2-I)) (64 2 (:REWRITE EQUAL-*-/-2)) (60 20 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (56 48 (:REWRITE DEFAULT-+-1)) (52 52 (:LINEAR EXPT-LESS-THAN-1-HACK)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 44 (:REWRITE EXPO-EXPT2)) (40 20 (:REWRITE UNICITY-OF-0)) (40 20 (:REWRITE POWER2P-INVERSE)) (28 4 (:LINEAR FLOOR-TYPE-2 . 2)) (28 4 (:LINEAR FLOOR-TYPE-2 . 1)) (24 4 (:LINEAR FLOOR-TYPE-1 . 2)) (24 4 (:LINEAR FLOOR-TYPE-1 . 1)) (22 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (22 22 (:REWRITE FIX-DOES-NOTHING)) (20 20 (:REWRITE DEFAULT-UNARY-MINUS)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-< (5114 164 (:REWRITE INTEGERP-+-MINUS-*-4)) (4742 342 (:REWRITE POWER2-INTEGER)) (4409 414 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (3826 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3674 3674 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3445 1450 (:REWRITE DEFAULT-*-2)) (3376 358 (:LINEAR X*Y>1-POSITIVE)) (3025 40 (:REWRITE FLOOR-=-X/Y . 3)) (2883 2275 (:REWRITE EXPT-COMPARE)) (2791 1450 (:REWRITE DEFAULT-*-1)) (2650 98 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2522 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (2498 98 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (2119 1645 (:REWRITE DEFAULT-<-1)) (2100 1645 (:REWRITE DEFAULT-<-2)) (1621 763 (:REWRITE DEFAULT-+-2)) (1442 206 (:LINEAR EXPT->-1)) (1388 1388 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1264 254 (:REWRITE EXPT-COMPARE-EQUAL)) (1065 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (1049 1049 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (1035 207 (:REWRITE DEFAULT-UNARY-/)) (990 110 (:REWRITE EXPO-/-POWER2P-ALT)) (956 956 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (948 14 (:LINEAR MOD-TYPE . 2)) (922 763 (:REWRITE DEFAULT-+-1)) (887 40 (:REWRITE RTL1)) (887 40 (:REWRITE FLOOR-SIMPLE-CASES)) (887 40 (:REWRITE FLOOR-DETERMINED-1)) (777 259 (:REWRITE EXPO-OF-NOT-RATIONALP)) (733 40 (:REWRITE FLOOR-=-X/Y . 2)) (704 704 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (694 694 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (514 514 (:TYPE-PRESCRIPTION POWER2P)) (412 412 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (369 369 (:REWRITE POWER2P-EXPT2-I)) (303 101 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (275 107 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (271 40 (:REWRITE FLOOR-TYPE-3 . 3)) (271 40 (:REWRITE FLOOR-TYPE-3 . 2)) (259 259 (:REWRITE EXPO-MINUS-ERIC)) (259 259 (:REWRITE EXPO-EXPT2)) (259 163 (:REWRITE DEFAULT-UNARY-MINUS)) (258 258 (:META CANCEL_TIMES-EQUAL-CORRECT)) (238 40 (:REWRITE FLOOR-TYPE-4 . 3)) (238 40 (:REWRITE FLOOR-TYPE-4 . 2)) (220 110 (:REWRITE POWER2P-INVERSE)) (206 206 (:LINEAR EXPT-LESS-THAN-1-HACK)) (142 142 (:REWRITE FOLD-CONSTS-IN-*)) (140 2 (:REWRITE FLOOR-=-X/Y . 4)) (135 55 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (113 107 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (108 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (83 83 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (72 2 (:REWRITE EQUAL-*-/-2)) (55 55 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (54 6 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 6 (:LINEAR FLOOR-TYPE-2 . 2)) (48 6 (:LINEAR FLOOR-TYPE-2 . 1)) (42 6 (:LINEAR FLOOR-TYPE-1 . 2)) (42 6 (:LINEAR FLOOR-TYPE-1 . 1)) (30 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (30 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (14 14 (:LINEAR MOD-TYPE . 3)) (14 14 (:LINEAR MOD-TYPE . 1)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGAPP-<= (335 335 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (220 2 (:REWRITE LOGHEAD-<=)) (218 4 (:REWRITE LOGHEAD-<)) (164 8 (:REWRITE LOGTAIL-IDENTITY)) (159 12 (:REWRITE LOGHEAD-IDENTITY)) (152 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (131 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (120 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (117 97 (:REWRITE DEFAULT-<-2)) (113 97 (:REWRITE DEFAULT-<-1)) (111 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (105 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (97 97 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (97 97 (:REWRITE EXPT-COMPARE)) (97 97 (:META CANCEL_PLUS-LESSP-CORRECT)) (82 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (64 8 (:LINEAR LOGTAIL-LEQ)) (57 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (48 6 (:REWRITE LOGTAIL-LESSP)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 4 (:REWRITE <-OF-LOGTAIL)) (32 4 (:LINEAR LOGHEAD-LEQ)) (31 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 4 (:LINEAR EXPT->-1)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (ASH-LOGCDR-1-BETTER (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (16 16 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (14 12 (:REWRITE DEFAULT-*-2)) (13 12 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (6 1 (:DEFINITION IFIX)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGCDR-LOGAPP (144 9 (:REWRITE LOGHEAD-IDENTITY)) (92 4 (:REWRITE UNSIGNED-BYTE-P-OF-LOGCDR)) (68 68 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (68 68 (:REWRITE EXPT-COMPARE)) (68 68 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 64 (:REWRITE POWER2-INTEGER)) (62 50 (:REWRITE DEFAULT-<-1)) (62 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 50 (:REWRITE DEFAULT-<-2)) (48 48 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 28 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (28 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 2 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-2)) (14 14 (:REWRITE DEFAULT-+-1)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 3 (:REWRITE ASH-0)) (9 1 (:REWRITE LOGCDR-<-0)) (8 4 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 6 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE ZP-OPEN)) (3 3 (:REWRITE ASH-GOES-TO-0)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE ZIP-OPEN)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKYY (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (USB-TIGHTEN (638 2 (:REWRITE FLOOR-=-X/Y . 3)) (340 16 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (280 21 (:REWRITE POWER2-INTEGER)) (132 4 (:REWRITE DISTRIBUTIVITY-OF-/-OVER-*)) (107 11 (:REWRITE EXPT-COMPARE-EQUAL)) (97 4 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (88 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (85 35 (:REWRITE DEFAULT-*-2)) (85 2 (:REWRITE FLOOR-=-X/Y . 2)) (83 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (82 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (73 2 (:REWRITE FLOOR-TYPE-3 . 2)) (72 4 (:REWRITE INTEGERP-PROD-3)) (64 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (64 38 (:REWRITE DEFAULT-<-2)) (64 2 (:REWRITE RTL1)) (64 2 (:REWRITE FLOOR-DETERMINED-1)) (60 5 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (59 59 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (59 59 (:REWRITE EXPT-COMPARE)) (59 59 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 6 (:REWRITE EXPO-/-POWER2P-ALT)) (50 4 (:REWRITE COMMUTATIVITY-2-OF-*)) (41 41 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 35 (:REWRITE DEFAULT-*-1)) (38 38 (:REWRITE DEFAULT-<-1)) (38 35 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 6 (:REWRITE COMMUTATIVITY-OF-+)) (27 27 (:TYPE-PRESCRIPTION POWER2P)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (19 19 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE POWER2P-EXPT2-I)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 5 (:REWRITE POWER2P-SHIFT-2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:REWRITE EXPO-EXPT2)) (12 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 6 (:REWRITE UNICITY-OF-0)) (12 6 (:REWRITE POWER2P-INVERSE)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (6 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (4 4 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 3 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 1 (:REWRITE IFIX-INTEGERP))) (LOGHEAD-WHEN-KNOW-TOP-BIT (134 134 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (48 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (19 17 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (16 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE USB-TIGHTEN)) (11 10 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-TWO (123 123 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 8 (:REWRITE LOGHEAD-IDENTITY)) (50 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (49 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 18 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (15 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 10 (:META META-RULE-ERIC)) (11 7 (:REWRITE USB-TIGHTEN)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE POWER2-INTEGER)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-WHEN-KNOW-TOP-BIT-THREE (217 217 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (197 13 (:REWRITE LOGHEAD-IDENTITY)) (135 3 (:LINEAR LOGHEAD-LEQ)) (125 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (121 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (81 81 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (81 81 (:REWRITE EXPT-COMPARE)) (79 79 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 42 (:REWRITE DEFAULT-<-1)) (42 42 (:REWRITE DEFAULT-<-2)) (26 20 (:META META-RULE-ERIC)) (26 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 8 (:REWRITE FOLD-CONSTS-IN-+)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (17 17 (:REWRITE DEFAULT-+-2)) (17 17 (:REWRITE DEFAULT-+-1)) (16 16 (:REWRITE POWER2-INTEGER)) (15 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (LOGTAIL-LEAVES-SINGLE-BIT (172 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (90 54 (:REWRITE DEFAULT-<-2)) (84 4 (:REWRITE FLOOR-=-X/Y . 3)) (82 54 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE RTL1)) (72 4 (:REWRITE FLOOR-DETERMINED-1)) (64 4 (:REWRITE FLOOR-=-X/Y . 2)) (58 58 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (58 58 (:REWRITE EXPT-COMPARE)) (58 58 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 12 (:REWRITE DEFAULT-UNARY-/)) (54 26 (:REWRITE DEFAULT-*-2)) (52 4 (:REWRITE FLOOR-TYPE-3 . 3)) (52 4 (:REWRITE FLOOR-TYPE-3 . 2)) (48 4 (:REWRITE FLOOR-TYPE-4 . 3)) (48 4 (:REWRITE FLOOR-TYPE-4 . 2)) (48 4 (:REWRITE EQUAL-1-HACK)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 26 (:REWRITE DEFAULT-*-1)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 2 (:LINEAR FLOOR-TYPE-2 . 2)) (26 2 (:LINEAR FLOOR-TYPE-2 . 1)) (24 2 (:LINEAR FLOOR-TYPE-1 . 2)) (24 2 (:LINEAR FLOOR-TYPE-1 . 1)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (24 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (22 2 (:LINEAR X*Y>1-POSITIVE)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 8 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (10 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (8 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 3 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER))) (ASH-SUCK-IN-SPECIAL (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (88 8 (:LINEAR X*Y>1-POSITIVE)) (88 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (68 8 (:DEFINITION IFF)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (38 38 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (38 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 24 (:REWRITE DEFAULT-<-2)) (32 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (24 24 (:REWRITE DEFAULT-<-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 15 (:REWRITE DEFAULT-*-2)) (19 15 (:REWRITE DEFAULT-*-1)) (18 10 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 8 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:REWRITE POWER2-INTEGER))) (UNSIGNED-BYTE-P-OF-ONE-MORE-THAN-X (55 2 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (38 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (35 5 (:LINEAR EXPT->-1)) (30 20 (:REWRITE DEFAULT-<-2)) (27 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE DEFAULT-<-1)) (17 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 6 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2))) (LOGTAIL-SHIFT-16 (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (449 233 (:REWRITE DEFAULT-*-2)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (305 161 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (273 233 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (161 161 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (49 49 (:REWRITE POWER2-INTEGER)) (48 48 (:REWRITE INTEGERP-+-MINUS-*-4)) (36 8 (:REWRITE DEFAULT-+-2)) (8 8 (:REWRITE DEFAULT-+-1))) (EVENP-OF-MOD (28 1 (:REWRITE MOD-=-0 . 2)) (21 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 8 (:REWRITE DEFAULT-*-1)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 12 (:REWRITE DEFAULT-<-2)) (13 12 (:REWRITE DEFAULT-<-1)) (13 8 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE POWER2-INTEGER)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (9 9 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:REWRITE RTL1)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (8 1 (:REWRITE FLOOR-SIMPLE-CASES)) (8 1 (:REWRITE FLOOR-DETERMINED-1)) (8 1 (:REWRITE FLOOR-=-X/Y . 3)) (8 1 (:REWRITE FLOOR-=-X/Y . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (6 1 (:REWRITE DEFAULT-UNARY-MINUS)) (6 1 (:REWRITE DEFAULT-+-2)) (5 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:DEFINITION ZEROP)) (2 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (LOGTAIL-OF-ONE-MORE-WHEN-EVEN (713 713 (:REWRITE EXPT-COMPARE)) (654 59 (:REWRITE FLOOR-TYPE-3 . 3)) (654 59 (:REWRITE FLOOR-TYPE-3 . 2)) (578 59 (:REWRITE FLOOR-TYPE-4 . 3)) (578 59 (:REWRITE FLOOR-TYPE-4 . 2)) (564 524 (:REWRITE DEFAULT-<-2)) (547 507 (:REWRITE DEFAULT-*-1)) (502 59 (:REWRITE RTL1)) (502 59 (:REWRITE FLOOR-DETERMINED-1)) (482 50 (:REWRITE FLOOR-=-X/Y . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (324 324 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (297 297 (:REWRITE DEFAULT-+-1)) (196 196 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (163 163 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (141 13 (:LINEAR FLOOR-TYPE-2 . 2)) (141 13 (:LINEAR FLOOR-TYPE-2 . 1)) (135 34 (:REWRITE CANCEL-FLOOR-+-BASIC)) (125 13 (:LINEAR FLOOR-TYPE-1 . 2)) (125 13 (:LINEAR FLOOR-TYPE-1 . 1)) (116 8 (:REWRITE FLOOR-=-X/Y . 4)) (105 105 (:REWRITE POWER2-INTEGER)) (79 63 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-4)) (63 63 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (43 43 (:REWRITE EXPT-COMPARE-EQUAL)) (42 42 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (33 1 (:REWRITE EQUAL-*-/-1)) (26 10 (:REWRITE SUM-POWER-OF-TWO)) (23 20 (:REWRITE INTEGERP-+-MINUS-*-2)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (20 20 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (17 17 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (15 2 (:REWRITE IFIX-INTEGERP)) (12 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (7 7 (:REWRITE MY-EQUAL-/)) (7 2 (:LINEAR X*Y>1-POSITIVE)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1))) (SUM-WITH-SHIFT-BECOMES-LOGAPP (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 3 (:REWRITE DEFAULT-*-2)) (7 1 (:LINEAR EXPT->-1)) (6 2 (:REWRITE DEFAULT-+-2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (5 5 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 3 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SUM-WITH-SHIFT-BECOMES-LOGAPP-CONSTANT-VERSION (396 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (303 303 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (273 2 (:REWRITE LOGTAIL-IDENTITY)) (254 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (102 34 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (101 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (100 40 (:REWRITE EXPT-COMPARE)) (71 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (71 3 (:LINEAR EXPT->-1)) (60 30 (:REWRITE DEFAULT-<-2)) (50 50 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 30 (:REWRITE DEFAULT-<-1)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 38 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (38 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (36 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (32 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (24 24 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (22 11 (:REWRITE USB-TIGHTEN)) (22 1 (:REWRITE NATP-RW)) (22 1 (:REWRITE LOGHEAD-CANCEL-LEMMA-ALT)) (20 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (17 7 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (14 4 (:REWRITE EXPO-EXPT2)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 1 (:LINEAR EXPO-LOWER-BOUND)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:LINEAR EXPO-LOWER-POS)) (7 1 (:LINEAR EXPO-LOWER-BOUND-2)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:DEFINITION ABS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:META META-RULE-ERIC)) (5 3 (:REWRITE EXPO-OF-INTEGER)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-PLUS-ASH (4879 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (4860 72 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (4859 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4585 22 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (4565 22 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3602 117 (:LINEAR X*Y>1-POSITIVE)) (3564 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (2886 74 (:REWRITE 0-<-*)) (2812 36 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (2775 74 (:REWRITE <-*-0)) (2484 1326 (:REWRITE EXPT-COMPARE)) (2399 123 (:REWRITE INTEGERP-+-MINUS-*-4)) (2250 276 (:REWRITE POWER2-INTEGER)) (2105 22 (:REWRITE MOD-=-0 . 2)) (1739 148 (:DEFINITION IFF)) (1432 36 (:LINEAR FLOOR-TYPE-2 . 2)) (1416 10 (:LINEAR MOD-TYPE . 2)) (1414 979 (:REWRITE DEFAULT-<-1)) (1404 36 (:LINEAR FLOOR-TYPE-2 . 1)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 2)) (1372 36 (:LINEAR FLOOR-TYPE-1 . 1)) (1326 1326 (:META CANCEL_PLUS-LESSP-CORRECT)) (1241 1241 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1178 17 (:REWRITE FLOOR-TYPE-3 . 3)) (1164 979 (:REWRITE DEFAULT-<-2)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 3)) (1127 17 (:REWRITE FLOOR-TYPE-4 . 2)) (1127 17 (:REWRITE FLOOR-TYPE-3 . 2)) (1031 94 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1027 375 (:REWRITE DEFAULT-*-2)) (833 833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (781 104 (:LINEAR EXPT->-1)) (732 375 (:REWRITE DEFAULT-*-1)) (687 26 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (683 683 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (621 351 (:REWRITE EXPT-COMPARE-EQUAL)) (600 40 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (566 17 (:REWRITE RTL1)) (566 17 (:REWRITE FLOOR-SIMPLE-CASES)) (566 17 (:REWRITE FLOOR-DETERMINED-1)) (507 169 (:REWRITE EXPO-OF-NOT-RATIONALP)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (477 477 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (475 104 (:LINEAR EXPT-LESS-THAN-1-HACK)) (459 169 (:REWRITE DEFAULT-+-2)) (442 13 (:REWRITE DISTRIBUTIVITY-ALT)) (438 146 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (391 17 (:REWRITE FLOOR-=-X/Y . 3)) (391 17 (:REWRITE FLOOR-=-X/Y . 2)) (360 40 (:REWRITE EXPO-/-POWER2P-ALT)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (325 325 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (321 321 (:TYPE-PRESCRIPTION POWER2P)) (297 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (239 169 (:REWRITE EXPO-EXPT2)) (235 47 (:REWRITE DEFAULT-UNARY-/)) (209 209 (:REWRITE POWER2P-EXPT2-I)) (208 208 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (195 169 (:REWRITE DEFAULT-+-1)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (178 178 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (171 171 (:REWRITE FOLD-CONSTS-IN-*)) (169 169 (:REWRITE EXPO-MINUS-ERIC)) (146 146 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (116 36 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (106 106 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 23 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (81 27 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (80 40 (:REWRITE POWER2P-INVERSE)) (74 74 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (69 23 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (66 22 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (50 10 (:LINEAR MOD-TYPE . 3)) (48 10 (:LINEAR MOD-TYPE . 1)) (40 40 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (19 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (13 13 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (10 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-LINEAR (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 60 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (34 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (28 2 (:LINEAR LOGTAIL-LEQ)) (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 1 (:REWRITE LOGTAIL-IDENTITY)) (20 10 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (12 6 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 8 (:REWRITE DEFAULT-+-1)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE DEFAULT-+-2)) (8 2 (:REWRITE ASH-0)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (3 3 (:REWRITE ASH-AS-LOGTAIL)) (3 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (3 3 (:META META-RULE-ERIC)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (SIGNED-BYTE-P-OF-ONE-LESS-THAN-X (271 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (107 1 (:REWRITE EQUAL-MINUS-MINUS)) (82 6 (:LINEAR EXPT->-1)) (77 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (60 22 (:REWRITE POWER2-INTEGER)) (60 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (42 26 (:REWRITE DEFAULT-<-1)) (41 41 (:REWRITE EXPT-COMPARE)) (41 41 (:META CANCEL_PLUS-LESSP-CORRECT)) (37 26 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE SIGNED-BYTE-P-+)) (32 10 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 6 (:REWRITE EXPT-COMPARE-EQUAL)) (29 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (28 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 13 (:REWRITE DEFAULT-+-2)) (23 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (22 2 (:REWRITE EXPO-EXPT2)) (19 13 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 4 (:REWRITE DEFAULT-UNARY-MINUS)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 6 (:REWRITE FIX-DOES-NOTHING)) (10 5 (:DEFINITION FIX)) (8 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (3 3 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (3 3 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (2 2 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 1 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (1 1 (:TYPE-PRESCRIPTION EVENP))) (LOGBITP-OF-ONE-LESS-CASE-1 (197 4 (:REWRITE RTL1)) (104 1 (:REWRITE MOD-=-0 . 2)) (98 12 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (75 4 (:REWRITE FLOOR-DETERMINED-1)) (56 8 (:LINEAR EXPT->-1)) (52 37 (:REWRITE DEFAULT-<-2)) (49 49 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 3 (:REWRITE ODDP-OF-*)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 37 (:REWRITE DEFAULT-<-1)) (36 12 (:REWRITE DEFAULT-*-2)) (30 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (30 6 (:REWRITE DEFAULT-UNARY-/)) (28 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (24 2 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 20 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE DEFAULT-+-1)) (13 1 (:LINEAR MOD-TYPE . 4)) (13 1 (:LINEAR MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (12 12 (:REWRITE DEFAULT-*-1)) (12 1 (:LINEAR MOD-TYPE . 2)) (12 1 (:LINEAR MOD-TYPE . 1)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (2 2 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION FLOOR)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (FLOOR-OF-MINUS-1-CASE-1 (1225 1212 (:REWRITE DEFAULT-*-2)) (1212 1212 (:REWRITE DEFAULT-*-1)) (1175 44 (:REWRITE FLOOR-=-X/Y . 3)) (1100 430 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (956 956 (:REWRITE EXPT-COMPARE)) (923 44 (:REWRITE FLOOR-=-X/Y . 2)) (852 49 (:REWRITE RTL1)) (813 58 (:REWRITE CANCEL-FLOOR-+-BASIC)) (758 659 (:REWRITE DEFAULT-<-1)) (659 659 (:REWRITE DEFAULT-<-2)) (572 572 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (537 44 (:REWRITE FLOOR-TYPE-3 . 3)) (523 49 (:REWRITE FLOOR-SIMPLE-CASES)) (523 49 (:REWRITE FLOOR-DETERMINED-1)) (522 44 (:REWRITE FLOOR-TYPE-3 . 2)) (498 447 (:REWRITE DEFAULT-+-2)) (474 44 (:REWRITE FLOOR-TYPE-4 . 2)) (447 447 (:REWRITE DEFAULT-+-1)) (434 70 (:LINEAR X*Y>1-POSITIVE)) (424 44 (:REWRITE FLOOR-TYPE-4 . 3)) (402 67 (:REWRITE EQUAL-1-HACK)) (317 215 (:REWRITE DEFAULT-UNARY-/)) (312 312 (:REWRITE POWER2-INTEGER)) (264 264 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (234 234 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (216 72 (:REWRITE INTEGERP-UNARY-)) (194 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (174 6 (:REWRITE FLOOR-=-X/Y . 4)) (170 11 (:LINEAR FLOOR-TYPE-2 . 2)) (170 11 (:LINEAR FLOOR-TYPE-2 . 1)) (151 151 (:META CANCEL_TIMES-EQUAL-CORRECT)) (151 11 (:LINEAR FLOOR-TYPE-1 . 2)) (151 11 (:LINEAR FLOOR-TYPE-1 . 1)) (145 145 (:REWRITE EXPT-COMPARE-EQUAL)) (123 123 (:REWRITE DEFAULT-UNARY-MINUS)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (98 14 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (96 72 (:REWRITE INTEGERP-+-MINUS-*-1)) (92 92 (:REWRITE FOLD-CONSTS-IN-*)) (84 49 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (69 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (67 67 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (56 56 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (49 49 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (40 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (36 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 1 (:REWRITE EVENP-COLLECT-1)) (32 20 (:REWRITE /-CANCELLATION-ON-RIGHT)) (30 30 (:REWRITE FOLD-CONSTS-IN-+)) (25 1 (:REWRITE EVENP-+-ALT)) (17 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (16 12 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (16 12 (:REWRITE INTEGERP-PROD-3)) (15 3 (:REWRITE EVENP-COLLAPSE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT))) (LOGBITP-OF-ONE-LESS-CASE-2 (104 1 (:REWRITE MOD-=-0 . 2)) (90 8 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (65 2 (:REWRITE FLOOR-=-X/Y . 2)) (49 9 (:REWRITE POWER2-INTEGER)) (48 4 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (47 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 33 (:REWRITE DEFAULT-<-2)) (39 33 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (36 36 (:REWRITE EXPT-COMPARE)) (36 36 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 5 (:LINEAR EXPT->-1)) (31 2 (:REWRITE RTL1)) (31 2 (:REWRITE FLOOR-SIMPLE-CASES)) (31 2 (:REWRITE FLOOR-DETERMINED-1)) (27 7 (:REWRITE EXPT-COMPARE-EQUAL)) (26 2 (:LINEAR MOD-TYPE . 4)) (26 2 (:LINEAR MOD-TYPE . 3)) (24 2 (:LINEAR MOD-TYPE . 2)) (24 2 (:LINEAR MOD-TYPE . 1)) (21 7 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE DEFAULT-UNARY-/)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (12 12 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 6 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 2 (:REWRITE FLOOR-TYPE-3 . 3)) (9 2 (:REWRITE FLOOR-TYPE-3 . 2)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (8 6 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (8 2 (:REWRITE FLOOR-TYPE-4 . 3)) (8 2 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-=-X/Y . 3)) (2 1 (:REWRITE UNICITY-OF-0)) (2 1 (:REWRITE POWER2P-INVERSE)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-LESS (495 44 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (466 11 (:REWRITE RTL1)) (230 5 (:REWRITE ODDP-OF-*)) (216 11 (:REWRITE FLOOR-DETERMINED-1)) (203 29 (:LINEAR EXPT->-1)) (188 8 (:REWRITE INTEGERP-+-MINUS-*-4)) (184 4 (:REWRITE FLOOR-=-X/Y . 2)) (146 62 (:REWRITE DEFAULT-*-2)) (142 106 (:REWRITE DEFAULT-<-2)) (141 3 (:REWRITE INTEGERP-UNARY-)) (139 139 (:META CANCEL_PLUS-LESSP-CORRECT)) (134 24 (:REWRITE EXPT-COMPARE-EQUAL)) (117 106 (:REWRITE DEFAULT-<-1)) (117 97 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (110 22 (:REWRITE DEFAULT-UNARY-/)) (108 36 (:REWRITE EXPO-OF-NOT-RATIONALP)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (70 62 (:REWRITE DEFAULT-*-1)) (68 68 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (66 2 (:REWRITE DISTRIBUTIVITY-ALT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (61 23 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (58 58 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 48 (:REWRITE DEFAULT-+-2)) (52 48 (:REWRITE DEFAULT-+-1)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (40 5 (:REWRITE FLOOR-TYPE-3 . 3)) (40 5 (:REWRITE FLOOR-TYPE-3 . 2)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (36 36 (:REWRITE EXPO-MINUS-ERIC)) (35 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (35 5 (:REWRITE FLOOR-TYPE-4 . 3)) (35 5 (:REWRITE FLOOR-TYPE-4 . 2)) (34 2 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (33 11 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (32 32 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (30 23 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 20 (:REWRITE DEFAULT-UNARY-MINUS)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (24 24 (:META CANCEL_PLUS-EQUAL-CORRECT)) (22 1 (:REWRITE MOD-=-0 . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-OF-ONE-LESS-THAN-X (1976 48 (:REWRITE RTL1)) (1223 140 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (851 48 (:REWRITE FLOOR-DETERMINED-1)) (652 20 (:REWRITE FLOOR-=-X/Y . 2)) (634 226 (:REWRITE DEFAULT-*-2)) (489 301 (:REWRITE DEFAULT-<-2)) (412 412 (:META CANCEL_PLUS-LESSP-CORRECT)) (406 58 (:LINEAR EXPT->-1)) (375 65 (:REWRITE EXPT-COMPARE-EQUAL)) (350 70 (:REWRITE DEFAULT-UNARY-/)) (333 301 (:REWRITE DEFAULT-<-1)) (302 226 (:REWRITE DEFAULT-*-1)) (276 92 (:REWRITE EXPO-OF-NOT-RATIONALP)) (261 93 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (225 225 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (212 58 (:REWRITE <-+-CONSTANT-CONSTANT)) (184 114 (:REWRITE DEFAULT-+-2)) (168 21 (:REWRITE FLOOR-TYPE-3 . 3)) (168 21 (:REWRITE FLOOR-TYPE-3 . 2)) (166 166 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (152 114 (:REWRITE DEFAULT-+-1)) (147 21 (:REWRITE FLOOR-TYPE-4 . 3)) (147 21 (:REWRITE FLOOR-TYPE-4 . 2)) (142 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (141 3 (:REWRITE INTEGERP-UNARY-)) (129 1 (:REWRITE FLOOR-=-X/Y . 4)) (116 116 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (112 93 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (106 8 (:LINEAR FLOOR-TYPE-2 . 2)) (106 8 (:LINEAR FLOOR-TYPE-2 . 1)) (102 4 (:LINEAR X*Y>1-POSITIVE)) (93 31 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (92 92 (:REWRITE EXPO-MINUS-ERIC)) (92 8 (:LINEAR FLOOR-TYPE-1 . 2)) (92 8 (:LINEAR FLOOR-TYPE-1 . 1)) (91 91 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (73 41 (:REWRITE DEFAULT-UNARY-MINUS)) (65 65 (:META CANCEL_TIMES-EQUAL-CORRECT)) (65 65 (:META CANCEL_PLUS-EQUAL-CORRECT)) (65 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (58 58 (:LINEAR EXPT-LESS-THAN-1-HACK)) (55 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (22 1 (:REWRITE MOD-=-0 . 2)) (20 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (10 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (3 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-ONE-LESS-THAN-X (337 20 (:DEFINITION UNSIGNED-BYTE-P)) (329 17 (:REWRITE LOGHEAD-IDENTITY)) (277 20 (:DEFINITION INTEGER-RANGE-P)) (226 226 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (136 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (100 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (82 2 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (53 47 (:REWRITE DEFAULT-<-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (47 47 (:REWRITE DEFAULT-<-2)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:META META-RULE-ERIC)) (35 23 (:REWRITE DEFAULT-+-2)) (34 1 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (33 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (32 32 (:REWRITE LOGHEAD-SUBST2)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (24 3 (:LINEAR LOGHEAD-LEQ)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (23 23 (:REWRITE DEFAULT-+-1)) (22 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (20 20 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (20 20 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPT-COMPARE-EQUAL)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 3 (:REWRITE LOGHEAD-<)) (10 10 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (7 7 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGAPP-<))) (EQUAL-+-HACK-GEN (42 40 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 5 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:REWRITE DEFAULT-+-2)) (6 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE))) (EQUAL-CONSTANT-+-BLAH (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (12 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE SUM-POWER-OF-TWO)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE EQUAL-CONSTANT-+)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (HACKY) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT (453 14 (:REWRITE LOGHEAD-IDENTITY)) (243 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (224 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (59 46 (:REWRITE DEFAULT-<-2)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (55 55 (:REWRITE EXPT-COMPARE)) (55 55 (:META CANCEL_PLUS-LESSP-CORRECT)) (52 46 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (36 36 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (29 29 (:REWRITE POWER2-INTEGER)) (27 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (26 16 (:REWRITE DEFAULT-+-2)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (23 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE LOGEXT-IDENTITY)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:REWRITE DEFAULT-+-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:REWRITE LOGHEAD-SUBST)) (15 15 (:META META-RULE-ERIC)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE DEFAULT-*-1)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-SUM-OF-PROD-OF-LOGEXT-BLAH (360 8 (:REWRITE LOGHEAD-IDENTITY)) (216 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (184 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (80 4 (:LINEAR LOGHEAD-LEQ)) (72 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (60 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (46 36 (:REWRITE DEFAULT-<-2)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 36 (:REWRITE DEFAULT-<-1)) (36 36 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 4 (:LINEAR X*Y>1-POSITIVE)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (14 14 (:TYPE-PRESCRIPTION IFIX)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1))) (REMOVEME4 (524 16 (:REWRITE LOGHEAD-IDENTITY)) (257 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (237 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (158 4 (:LINEAR LOGHEAD-LEQ)) (109 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 3 (:REWRITE LOGEXT-IDENTITY)) (77 55 (:REWRITE DEFAULT-<-2)) (68 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (67 55 (:REWRITE DEFAULT-<-1)) (67 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (66 42 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (54 27 (:REWRITE USB-TIGHTEN)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 48 (:REWRITE POWER2-INTEGER)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (40 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (35 35 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 8 (:REWRITE LOGCAR-EVENP)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (31 18 (:REWRITE DEFAULT-+-2)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 18 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (14 14 (:TYPE-PRESCRIPTION EVENP)) (14 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE LOGCAR-0-REWRITE)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (REMOVEME7 (556 14 (:REWRITE LOGHEAD-IDENTITY)) (244 10 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (234 31 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (176 4 (:LINEAR LOGHEAD-LEQ)) (108 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (101 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (91 10 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 49 (:REWRITE DEFAULT-<-2)) (63 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (62 31 (:REWRITE USB-TIGHTEN)) (51 49 (:REWRITE DEFAULT-<-1)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 8 (:LINEAR X*Y>1-POSITIVE)) (35 35 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 21 (:REWRITE DEFAULT-+-2)) (35 18 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (33 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE POWER2-INTEGER)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (31 31 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (31 31 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (31 31 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 21 (:REWRITE DEFAULT-+-1)) (28 4 (:REWRITE COMMUTATIVITY-OF-+)) (25 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 24 (:TYPE-PRESCRIPTION IFIX)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 18 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 2 (:LINEAR EXPT->-1)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE UNICITY-OF-0)) (10 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 4 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 3 (:REWRITE IFIX-INTEGERP)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE DEFAULT-*-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (SIGNED-BYTE-P-OF-TRUNCATE (216 119 (:REWRITE DEFAULT-<-1)) (212 7 (:REWRITE TRUNCATE-TYPE . 2)) (161 11 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (123 123 (:META CANCEL_PLUS-LESSP-CORRECT)) (121 14 (:DEFINITION ABS)) (119 119 (:REWRITE DEFAULT-<-2)) (110 110 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (107 7 (:REWRITE TRUNCATE-=-X/Y . 2)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 4)) (93 93 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 3)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 2)) (70 70 (:TYPE-PRESCRIPTION TRUNCATE-TYPE . 1)) (68 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (65 65 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (62 11 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (56 17 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (55 14 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (44 44 (:REWRITE POWER2-INTEGER)) (34 10 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (34 6 (:LINEAR TRUNCATE-TYPE . 3)) (30 6 (:LINEAR TRUNCATE-TYPE . 4)) (22 11 (:REWRITE USB-TIGHTEN)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:TYPE-PRESCRIPTION ABS)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (11 11 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (11 11 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (11 11 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (11 11 (:REWRITE DEFAULT-UNARY-MINUS)) (10 7 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR TRUNCATE-TYPE . 1)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:LINEAR X*Y>1-POSITIVE))) (BITP-RANGE) (LOGCAR-OF-LOGBIT (25 5 (:REWRITE LOGCAR-EVENP)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION EVENP)) (10 5 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (5 5 (:REWRITE POWER2-INTEGER)) (4 3 (:REWRITE DEFAULT-<-2)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-SHIFT-HACK (978 84 (:REWRITE <-*-/-LEFT-COMMUTED)) (461 244 (:REWRITE DEFAULT-*-2)) (450 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (352 16 (:REWRITE FLOOR-TYPE-3 . 3)) (352 16 (:REWRITE FLOOR-TYPE-3 . 2)) (320 16 (:REWRITE FLOOR-TYPE-4 . 3)) (320 16 (:REWRITE FLOOR-TYPE-4 . 2)) (308 164 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (288 16 (:REWRITE RTL1)) (288 16 (:REWRITE FLOOR-SIMPLE-CASES)) (288 16 (:REWRITE FLOOR-DETERMINED-1)) (284 244 (:REWRITE DEFAULT-*-1)) (248 248 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (248 248 (:REWRITE EXPT-COMPARE)) (248 248 (:META CANCEL_PLUS-LESSP-CORRECT)) (224 16 (:REWRITE FLOOR-=-X/Y . 3)) (224 16 (:REWRITE FLOOR-=-X/Y . 2)) (216 128 (:REWRITE DEFAULT-<-1)) (168 128 (:REWRITE DEFAULT-<-2)) (164 164 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (76 76 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (70 4 (:LINEAR FLOOR-TYPE-2 . 2)) (70 4 (:LINEAR FLOOR-TYPE-2 . 1)) (64 4 (:LINEAR FLOOR-TYPE-1 . 2)) (64 4 (:LINEAR FLOOR-TYPE-1 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (58 58 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 55 (:REWRITE POWER2-INTEGER)) (49 49 (:REWRITE INTEGERP-+-MINUS-*-4)) (43 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (4 4 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (HACKZ (24 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (16 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR X*Y>1-POSITIVE)) (9 3 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (HACKZZ (13 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (6 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE RTL-A-MILLION)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (NO-INTEGERPS-BETWEEN-0-AND-1) (NO-INTEGERPS-BETWEEN-0-AND-MINUS-1) (INTEGERP-OF-UNARY-/-WHEN-INTEGER-P (25 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE NO-INTEGERPS-BETWEEN-0-AND-1)) (14 2 (:REWRITE NORMALIZE-<-MINUS-/)) (14 2 (:REWRITE EQUAL-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 9 (:REWRITE DEFAULT-<-2)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT))) (ARITHHACK2 (34 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 2 (:REWRITE DEFAULT-UNARY-/)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (FLOOR-OF-ONE-MORE-CASE-1 (1385 77 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (1111 21 (:REWRITE 0-<-*)) (935 93 (:REWRITE INTEGERP-+-MINUS-*-4)) (864 41 (:REWRITE FLOOR-TYPE-4 . 2)) (766 191 (:REWRITE EQUAL-1-HACK)) (726 270 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (691 41 (:REWRITE FLOOR-TYPE-3 . 3)) (656 656 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (656 656 (:REWRITE EXPT-COMPARE)) (575 575 (:REWRITE DEFAULT-<-2)) (575 575 (:REWRITE DEFAULT-<-1)) (542 20 (:REWRITE CANCEL-FLOOR-+-BASIC)) (524 471 (:META CANCEL_PLUS-EQUAL-CORRECT)) (471 471 (:META CANCEL_TIMES-EQUAL-CORRECT)) (470 470 (:REWRITE EXPT-COMPARE-EQUAL)) (464 40 (:REWRITE FLOOR-=-X/Y . 2)) (454 404 (:REWRITE DEFAULT-*-2)) (452 41 (:REWRITE FLOOR-SIMPLE-CASES)) (432 14 (:REWRITE CANCEL-MOD-+-BASIC)) (404 404 (:REWRITE DEFAULT-*-1)) (392 41 (:REWRITE RTL1)) (392 41 (:REWRITE FLOOR-DETERMINED-1)) (384 64 (:LINEAR X*Y>1-POSITIVE)) (383 41 (:REWRITE FLOOR-TYPE-3 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (339 339 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (308 66 (:REWRITE <-*-/-LEFT)) (296 14 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (291 21 (:DEFINITION IFF)) (268 268 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (243 135 (:REWRITE DEFAULT-UNARY-/)) (193 11 (:LINEAR FLOOR-TYPE-2 . 2)) (190 31 (:REWRITE <-*-/-RIGHT)) (176 11 (:LINEAR FLOOR-TYPE-1 . 2)) (148 43 (:REWRITE RTL-A-MILLION)) (145 145 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (139 13 (:REWRITE INTEGERP-+-MINUS-*-2)) (119 11 (:LINEAR FLOOR-TYPE-2 . 1)) (114 114 (:REWRITE POWER2-INTEGER)) (113 41 (:REWRITE FLOOR-TYPE-4 . 3)) (109 74 (:REWRITE DEFAULT-+-2)) (106 2 (:REWRITE FLOOR-=-X/Y . 4)) (102 39 (:REWRITE MY-EQUAL-/)) (85 32 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (79 79 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (74 74 (:REWRITE DEFAULT-+-1)) (60 3 (:LINEAR MOD-TYPE . 2)) (48 48 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE NORMALIZE-EQUAL-0)) (43 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (29 29 (:REWRITE FOLD-CONSTS-IN-*)) (29 11 (:LINEAR FLOOR-TYPE-1 . 1)) (24 1 (:REWRITE EQUAL-MINUS-MINUS)) (23 23 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (21 21 (:REWRITE TIMES-ZERO)) (21 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (17 3 (:LINEAR MOD-TYPE . 3)) (16 4 (:DEFINITION ZEROP)) (13 13 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (12 12 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (8 8 (:REWRITE FOLD-CONSTS-IN-+)) (7 7 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (7 7 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (7 7 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:LINEAR MOD-TYPE . 1)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (FLOOR-OF-ONE-MORE-CASE-2 (6450 33 (:REWRITE FLOOR-OF-ONE-MORE-CASE-1)) (2266 105 (:REWRITE CANCEL-MOD-+-BASIC)) (1598 758 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1532 1532 (:REWRITE DEFAULT-*-2)) (1532 1532 (:REWRITE DEFAULT-*-1)) (1440 400 (:REWRITE EQUAL-1-HACK)) (1432 52 (:REWRITE MOD-=-0 . 2)) (975 36 (:REWRITE FLOOR-=-X/Y . 3)) (900 900 (:REWRITE EXPT-COMPARE)) (873 109 (:REWRITE INTEGERP-+-MINUS-*-4)) (726 726 (:REWRITE DEFAULT-<-2)) (726 726 (:REWRITE DEFAULT-<-1)) (716 36 (:REWRITE FLOOR-=-X/Y . 2)) (702 702 (:META CANCEL_TIMES-EQUAL-CORRECT)) (698 698 (:REWRITE EXPT-COMPARE-EQUAL)) (593 24 (:LINEAR MOD-TYPE . 2)) (552 48 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (539 539 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (529 519 (:REWRITE DEFAULT-+-2)) (526 379 (:REWRITE DEFAULT-UNARY-/)) (519 519 (:REWRITE DEFAULT-+-1)) (500 6 (:REWRITE CANCEL-MOD-+-3)) (377 125 (:REWRITE RTL-A-MILLION)) (341 39 (:REWRITE RTL1)) (341 39 (:REWRITE FLOOR-DETERMINED-1)) (338 52 (:REWRITE INTEGERP-+-MINUS-*-2)) (329 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (312 312 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (222 36 (:REWRITE FLOOR-TYPE-3 . 2)) (177 177 (:REWRITE POWER2-INTEGER)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (168 168 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (168 52 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (157 24 (:LINEAR MOD-TYPE . 3)) (134 134 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (124 124 (:REWRITE FOLD-CONSTS-IN-*)) (120 36 (:REWRITE FLOOR-TYPE-3 . 3)) (112 28 (:DEFINITION ZEROP)) (108 36 (:REWRITE FLOOR-TYPE-4 . 2)) (104 17 (:LINEAR X*Y>1-POSITIVE)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (102 18 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (90 3 (:REWRITE FLOOR-=-X/Y . 4)) (84 84 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (84 16 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (84 16 (:REWRITE INTEGERP-PROD-3)) (79 13 (:LINEAR FLOOR-TYPE-2 . 1)) (70 28 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (56 56 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (56 56 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (53 53 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (53 53 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 52 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 48 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (44 44 (:REWRITE FOLD-CONSTS-IN-+)) (44 32 (:REWRITE /-CANCELLATION-ON-RIGHT)) (41 41 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (41 41 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (36 36 (:REWRITE FLOOR-TYPE-4 . 3)) (34 13 (:LINEAR FLOOR-TYPE-2 . 2)) (31 13 (:LINEAR FLOOR-TYPE-1 . 2)) (24 24 (:LINEAR MOD-TYPE . 1)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:LINEAR FLOOR-TYPE-1 . 1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (FLOOR-OF-ONE-MORE (821 31 (:REWRITE FLOOR-=-X/Y . 3)) (731 43 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (642 64 (:REWRITE INTEGERP-+-MINUS-*-4)) (534 194 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (505 120 (:REWRITE EQUAL-1-HACK)) (382 16 (:REWRITE CANCEL-MOD-+-BASIC)) (337 337 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (337 337 (:REWRITE EXPT-COMPARE)) (337 337 (:REWRITE DEFAULT-<-2)) (337 337 (:REWRITE DEFAULT-<-1)) (337 337 (:META CANCEL_PLUS-LESSP-CORRECT)) (252 31 (:REWRITE FLOOR-=-X/Y . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (242 242 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (235 31 (:REWRITE RTL1)) (235 31 (:REWRITE FLOOR-SIMPLE-CASES)) (235 31 (:REWRITE FLOOR-DETERMINED-1)) (229 229 (:REWRITE DEFAULT-*-2)) (229 229 (:REWRITE DEFAULT-*-1)) (227 31 (:REWRITE FLOOR-TYPE-3 . 3)) (216 216 (:REWRITE EXPT-COMPARE-EQUAL)) (216 216 (:META CANCEL_TIMES-EQUAL-CORRECT)) (216 216 (:META CANCEL_PLUS-EQUAL-CORRECT)) (205 31 (:REWRITE FLOOR-TYPE-3 . 2)) (199 97 (:REWRITE DEFAULT-UNARY-/)) (199 31 (:REWRITE FLOOR-TYPE-4 . 2)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (120 1 (:REWRITE FLOOR-=-X/Y . 4)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (86 86 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (84 12 (:LINEAR FLOOR-TYPE-2 . 1)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (84 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 15 (:REWRITE RTL-A-MILLION)) (77 42 (:REWRITE DEFAULT-+-2)) (72 72 (:REWRITE POWER2-INTEGER)) (54 12 (:LINEAR FLOOR-TYPE-2 . 2)) (48 12 (:LINEAR FLOOR-TYPE-1 . 2)) (45 45 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (42 42 (:REWRITE DEFAULT-+-1)) (40 10 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (40 5 (:LINEAR MOD-TYPE . 3)) (35 5 (:LINEAR MOD-TYPE . 2)) (34 34 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (33 2 (:REWRITE CANCEL-FLOOR-+-BASIC)) (32 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (31 31 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:REWRITE FLOOR-TYPE-4 . 3)) (24 6 (:DEFINITION ZEROP)) (23 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 12 (:LINEAR FLOOR-TYPE-1 . 1)) (8 8 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (8 8 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 8 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-HELPER-1 (994 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (915 391 (:REWRITE DEFAULT-+-2)) (790 391 (:REWRITE DEFAULT-+-1)) (657 70 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (576 262 (:REWRITE DEFAULT-*-1)) (552 262 (:REWRITE DEFAULT-*-2)) (486 6 (:REWRITE MOD-=-0 . 2)) (484 484 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (350 10 (:REWRITE INTEGERP-+-MINUS-*-4)) (277 93 (:REWRITE EXPO-OF-NOT-RATIONALP)) (242 242 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (212 26 (:REWRITE INTEGERP-+-MINUS-*-1)) (196 10 (:REWRITE INTEGERP-+-MINUS-*-3)) (175 35 (:REWRITE DEFAULT-UNARY-/)) (166 2 (:LINEAR MOD-TYPE . 2)) (149 149 (:META CANCEL_TIMES-EQUAL-CORRECT)) (112 74 (:REWRITE DEFAULT-<-1)) (108 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (100 74 (:REWRITE DEFAULT-<-2)) (93 93 (:REWRITE EXPO-MINUS-ERIC)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (82 82 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (80 28 (:REWRITE DEFAULT-UNARY-MINUS)) (63 21 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (59 59 (:REWRITE POWER2-INTEGER)) (58 58 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (48 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (40 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (32 2 (:REWRITE RTL-A-MILLION)) (27 7 (:REWRITE SUM-POWER-OF-TWO)) (21 3 (:LINEAR EXPT->-1)) (18 6 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (18 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (15 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE FOLD-CONSTS-IN-*)) (6 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (6 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:LINEAR MOD-TYPE . 3)) (6 2 (:LINEAR MOD-TYPE . 1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ONE-TWO-MULTIPLES-FIT (40 10 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (34 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (32 7 (:REWRITE EQUAL-1-HACK)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 5 (:REWRITE DEFAULT-UNARY-/)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE DEFAULT-<-1)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (3 3 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (MOD-HELPER-2 (748 748 (:REWRITE DEFAULT-+-2)) (748 748 (:REWRITE DEFAULT-+-1)) (738 738 (:REWRITE DEFAULT-*-2)) (738 738 (:REWRITE DEFAULT-*-1)) (516 516 (:REWRITE EXPT-COMPARE)) (446 306 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (360 360 (:REWRITE DEFAULT-<-2)) (360 360 (:REWRITE DEFAULT-<-1)) (260 15 (:REWRITE MOD-=-0 . 2)) (200 200 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (187 187 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (158 58 (:REWRITE EQUAL-1-HACK)) (153 153 (:REWRITE DEFAULT-UNARY-/)) (146 146 (:META CANCEL_TIMES-EQUAL-CORRECT)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (139 139 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (134 134 (:REWRITE EXPT-COMPARE-EQUAL)) (126 21 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (111 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 34 (:REWRITE INTEGERP-+-MINUS-*-4)) (100 100 (:REWRITE FOLD-CONSTS-IN-*)) (84 84 (:REWRITE POWER2-INTEGER)) (62 27 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 27 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (27 27 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (21 21 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (20 20 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (20 2 (:REWRITE INTEGERP-+-MINUS-*-1)) (18 18 (:REWRITE FOLD-CONSTS-IN-+)) (15 15 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (14 14 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (12 12 (:REWRITE SUM-POWER-OF-TWO)) (12 12 (:REWRITE EQUAL-CONSTANT-+)) (12 12 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (8 8 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (6 1 (:LINEAR X*Y>1-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (3 3 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGBITP-OF-ONE-MORE (1768 180 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (1125 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (1032 12 (:REWRITE FLOOR-=-X/Y . 3)) (859 44 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (591 22 (:REWRITE INTEGERP-+-MINUS-*-2)) (564 8 (:REWRITE MOD-=-0 . 2)) (522 6 (:LINEAR MOD-TYPE . 2)) (450 90 (:REWRITE DEFAULT-UNARY-/)) (405 135 (:REWRITE EXPO-OF-NOT-RATIONALP)) (336 116 (:REWRITE DEFAULT-*-2)) (285 161 (:REWRITE DEFAULT-<-2)) (280 12 (:REWRITE RTL1)) (280 12 (:REWRITE FLOOR-SIMPLE-CASES)) (280 12 (:REWRITE FLOOR-DETERMINED-1)) (274 274 (:META CANCEL_TIMES-EQUAL-CORRECT)) (274 274 (:META CANCEL_PLUS-EQUAL-CORRECT)) (264 12 (:REWRITE FLOOR-=-X/Y . 2)) (256 12 (:REWRITE FLOOR-TYPE-3 . 2)) (172 57 (:REWRITE DEFAULT-+-2)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (165 165 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (164 164 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (161 161 (:REWRITE DEFAULT-<-1)) (156 52 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (135 135 (:REWRITE EXPO-MINUS-ERIC)) (128 116 (:REWRITE DEFAULT-*-1)) (123 57 (:REWRITE DEFAULT-+-1)) (122 122 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (120 10 (:REWRITE RTL-A-MILLION)) (102 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (96 12 (:REWRITE FLOOR-TYPE-3 . 3)) (94 94 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (90 30 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (87 87 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (86 2 (:REWRITE CANCEL-MOD-+-BASIC)) (85 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (84 12 (:REWRITE FLOOR-TYPE-4 . 2)) (79 79 (:REWRITE POWER2-INTEGER)) (68 19 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (61 61 (:LINEAR EXPT-LESS-THAN-1-HACK)) (47 47 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (30 30 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (28 28 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 8 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (22 22 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (22 22 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (19 19 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (18 6 (:LINEAR MOD-TYPE . 3)) (18 6 (:LINEAR MOD-TYPE . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-TYPE-4 . 3)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGBIT-OF-ONE-MORE (85 5 (:REWRITE LOGHEAD-IDENTITY)) (40 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (24 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:REWRITE DEFAULT-<-2)) (20 20 (:REWRITE DEFAULT-<-1)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (19 19 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE DEFAULT-+-2)) (7 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (OTHER-WAY (957 956 (:REWRITE DEFAULT-*-2)) (956 956 (:REWRITE DEFAULT-*-1)) (681 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (589 587 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (587 587 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (489 489 (:REWRITE EXPT-COMPARE)) (468 27 (:REWRITE RTL1)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (418 418 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (343 343 (:REWRITE DEFAULT-+-2)) (343 343 (:REWRITE DEFAULT-+-1)) (260 260 (:REWRITE DEFAULT-<-2)) (260 260 (:REWRITE DEFAULT-<-1)) (161 28 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 28 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (122 122 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (108 27 (:REWRITE FLOOR-DETERMINED-1)) (105 15 (:REWRITE ERIC700)) (104 8 (:LINEAR MOD-TYPE . 2)) (98 98 (:REWRITE POWER2-INTEGER)) (78 78 (:REWRITE INTEGERP-+-MINUS-*-4)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (61 22 (:REWRITE FLOOR-TYPE-3 . 3)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (56 56 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (55 22 (:REWRITE FLOOR-TYPE-4 . 3)) (55 22 (:REWRITE FLOOR-TYPE-4 . 2)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (34 33 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (33 33 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (31 31 (:META CANCEL_TIMES-EQUAL-CORRECT)) (29 29 (:REWRITE EXPT-COMPARE-EQUAL)) (28 8 (:REWRITE INTEGERP-+-MINUS-*-2)) (27 12 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (26 26 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (21 21 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE HACKYY)) (17 1 (:REWRITE ODDP-+)) (8 8 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:LINEAR MOD-TYPE . 3)) (8 8 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE ODDP-OF-*))) (FLOOR-LINEAR-1 (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (39 39 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 10 (:REWRITE DEFAULT-*-2)) (20 4 (:REWRITE COMMUTATIVITY-OF-*)) (18 2 (:REWRITE FLOOR-=-X/Y . 3)) (18 2 (:REWRITE FLOOR-=-X/Y . 2)) (16 2 (:REWRITE FLOOR-TYPE-3 . 3)) (16 2 (:REWRITE FLOOR-TYPE-3 . 2)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:REWRITE DEFAULT-<-2)) (14 14 (:REWRITE DEFAULT-<-1)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 2 (:REWRITE FLOOR-TYPE-4 . 3)) (14 2 (:REWRITE FLOOR-TYPE-4 . 2)) (12 2 (:REWRITE RTL1)) (12 2 (:REWRITE FLOOR-SIMPLE-CASES)) (12 2 (:REWRITE FLOOR-DETERMINED-1)) (10 10 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 1 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 2 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (2 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE DEFAULT-+-1))) (FLOOR-WHEN-<-2 (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (31 31 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (23 12 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (19 19 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (19 19 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (19 19 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 2 (:LINEAR FLOOR-TYPE-2 . 2)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE DEFAULT-*-2)) (12 12 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (8 2 (:LINEAR FLOOR-TYPE-1 . 2)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:LINEAR FLOOR-TYPE-1 . 1)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (ONE-WAY (3276 30 (:REWRITE RTL)) (1008 990 (:REWRITE DEFAULT-*-2)) (990 990 (:REWRITE DEFAULT-*-1)) (878 29 (:REWRITE RTL1)) (557 555 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (555 555 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (546 546 (:REWRITE EXPT-COMPARE)) (365 365 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (349 349 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (311 311 (:REWRITE DEFAULT-<-2)) (311 311 (:REWRITE DEFAULT-<-1)) (303 303 (:REWRITE DEFAULT-+-2)) (303 303 (:REWRITE DEFAULT-+-1)) (289 44 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (230 44 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (223 29 (:REWRITE FLOOR-SIMPLE-CASES)) (208 16 (:LINEAR MOD-TYPE . 2)) (159 159 (:REWRITE POWER2-INTEGER)) (149 149 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (138 138 (:REWRITE INTEGERP-+-MINUS-*-4)) (110 29 (:REWRITE FLOOR-DETERMINED-1)) (99 99 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (63 24 (:REWRITE FLOOR-TYPE-3 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 3)) (57 24 (:REWRITE FLOOR-TYPE-4 . 2)) (56 16 (:REWRITE INTEGERP-+-MINUS-*-2)) (52 51 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (51 51 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (45 6 (:REWRITE <-*-/-RIGHT-COMMUTED)) (38 38 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (27 3 (:REWRITE FLOOR-=-X/Y . 3)) (27 3 (:REWRITE FLOOR-=-X/Y . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (20 20 (:REWRITE FOLD-CONSTS-IN-+)) (20 20 (:REWRITE EXPT-COMPARE-EQUAL)) (18 3 (:REWRITE HACKYY)) (16 16 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (16 16 (:LINEAR MOD-TYPE . 3)) (16 16 (:LINEAR MOD-TYPE . 1)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-SPLIT-X-REWRITE) (LOGHEAD-SPLIT-Y-REWRITE (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 18 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE DEFAULT-+-1)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT (238 14 (:REWRITE LOGHEAD-IDENTITY)) (113 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (67 67 (:REWRITE EXPT-COMPARE)) (67 67 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (54 51 (:REWRITE DEFAULT-<-1)) (54 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (51 51 (:REWRITE DEFAULT-<-2)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (35 35 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 15 (:REWRITE USB-TIGHTEN)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGHEAD-LEQ)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE DEFAULT-+-2)) (19 19 (:REWRITE DEFAULT-+-1)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (18 16 (:META META-RULE-ERIC)) (17 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 2 (:REWRITE DEFAULT-*-2)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGTAIL-EQUAL-MINUS-ONE-REWRITE (105 1 (:REWRITE FLOOR-=-X/Y . 3)) (68 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (48 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (45 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (42 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (41 1 (:REWRITE FLOOR-TYPE-1)) (39 39 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (39 39 (:REWRITE EXPT-COMPARE)) (39 39 (:META CANCEL_PLUS-LESSP-CORRECT)) (39 29 (:REWRITE DEFAULT-<-1)) (37 29 (:REWRITE DEFAULT-<-2)) (35 5 (:LINEAR EXPT->-1)) (30 1 (:REWRITE RTL1)) (30 1 (:REWRITE FLOOR-SIMPLE-CASES)) (30 1 (:REWRITE FLOOR-DETERMINED-1)) (28 8 (:REWRITE EXPT-COMPARE-EQUAL)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (17 17 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 5 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE POWER2-INTEGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 6 (:REWRITE DEFAULT-+-1)) (8 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (7 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE DEFAULT-*-1)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (<-OF-ASH (82 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (49 1 (:REWRITE FLOOR-WHEN-<-2)) (33 1 (:LINEAR X*Y>1-POSITIVE)) (25 12 (:REWRITE EXPT-COMPARE)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (24 24 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (24 4 (:REWRITE EXPT-COMPARE-EQUAL)) (21 3 (:LINEAR EXPT->-1)) (18 8 (:REWRITE DEFAULT-*-2)) (15 9 (:REWRITE DEFAULT-<-2)) (14 8 (:REWRITE DEFAULT-*-1)) (12 12 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 9 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (7 7 (:REWRITE POWER2-INTEGER)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP))) (LOGTAIL-SHIFT (3500 130 (:LINEAR X*Y>1-POSITIVE)) (2958 122 (:REWRITE ARITHHACK2)) (2805 34 (:REWRITE <-*-0)) (2679 34 (:REWRITE 0-<-*)) (1879 16 (:REWRITE FLOOR-TYPE-4 . 2)) (1851 16 (:REWRITE FLOOR-TYPE-4 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 3)) (1783 16 (:REWRITE FLOOR-TYPE-3 . 2)) (1662 68 (:DEFINITION IFF)) (1053 857 (:REWRITE DEFAULT-<-2)) (1033 1007 (:REWRITE EXPT-COMPARE)) (1029 857 (:REWRITE DEFAULT-<-1)) (1007 1007 (:META CANCEL_PLUS-LESSP-CORRECT)) (1005 1005 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (817 16 (:REWRITE FLOOR-WHEN-<-2)) (812 16 (:REWRITE FLOOR-OF-INTEGER-BY-1)) (663 16 (:REWRITE RTL1)) (663 16 (:REWRITE FLOOR-SIMPLE-CASES)) (663 16 (:REWRITE FLOOR-DETERMINED-1)) (640 64 (:REWRITE NORMALIZE-<-MINUS-/)) (621 45 (:REWRITE INTEGERP-+-MINUS-*-4)) (570 16 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (538 538 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (497 497 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (460 351 (:REWRITE EXPT-COMPARE-EQUAL)) (360 16 (:REWRITE FLOOR-=-X/Y . 3)) (360 16 (:REWRITE FLOOR-=-X/Y . 2)) (351 351 (:META CANCEL_TIMES-EQUAL-CORRECT)) (351 351 (:META CANCEL_PLUS-EQUAL-CORRECT)) (326 128 (:REWRITE MY-EQUAL-/)) (310 4 (:LINEAR FLOOR-TYPE-2 . 2)) (310 4 (:LINEAR FLOOR-TYPE-2 . 1)) (300 4 (:LINEAR FLOOR-TYPE-1 . 2)) (300 4 (:LINEAR FLOOR-TYPE-1 . 1)) (286 88 (:REWRITE <-*-/-LEFT-COMMUTED)) (236 98 (:REWRITE DEFAULT-*-2)) (230 32 (:REWRITE <-*-/-RIGHT-COMMUTED)) (200 98 (:REWRITE DEFAULT-*-1)) (168 19 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (146 18 (:REWRITE EQUAL-1-HACK)) (133 133 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (90 90 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (72 12 (:REWRITE DEFAULT-UNARY-/)) (68 12 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (64 22 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 4 (:REWRITE <-*-/-RIGHT)) (49 3 (:REWRITE INTEGERP-PROD-OF-3-FIRST-TWO)) (49 3 (:REWRITE INTEGERP-PROD-3)) (46 7 (:LINEAR EXPT->-1)) (45 23 (:REWRITE DEFAULT-+-2)) (42 1 (:REWRITE NORMALIZE-EQUAL-0)) (37 37 (:REWRITE FOLD-CONSTS-IN-*)) (36 12 (:REWRITE EXPO-OF-NOT-RATIONALP)) (32 22 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (29 14 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE DEFAULT-+-1)) (18 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 1 (:REWRITE EXPO-SHIFT)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (12 12 (:REWRITE EXPO-MINUS-ERIC)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:REWRITE EXPO-/-POWER2P-ALT)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (7 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 1 (:REWRITE EQUAL-MINUS-MINUS)) (5 5 (:REWRITE EXPO-SHIFT-CONSTANT)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGTAIL-SHIFT-CONSTANT-VERSION (104 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (97 97 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 2 (:REWRITE LOGTAIL-IDENTITY)) (64 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (33 20 (:REWRITE DEFAULT-<-2)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (17 2 (:REWRITE POWER2P-OF-NON-POSITIVE)) (16 2 (:LINEAR LOGTAIL-LEQ)) (14 13 (:REWRITE DEFAULT-+-2)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE DEFAULT-+-1)) (12 2 (:LINEAR EXPT->-1)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (10 4 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:REWRITE EXPO-MINUS-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-*-1)) (4 2 (:REWRITE UNICITY-OF-0)) (3 3 (:REWRITE EXPONENTS-ADD)) (3 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE POWER2P-OF-NON-RATIONAL)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (DIVIDES) (DIVIDES-HACK (14 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 8 (:REWRITE POWER2-INTEGER)) (6 4 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE DEFAULT-*-1)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 3 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 1 (:REWRITE INTEGERP-UNARY-)) (3 3 (:REWRITE DEFAULT-+-2)) (3 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE FIX-DOES-NOTHING))) (DIVIDES-HACK2 (4 3 (:REWRITE DEFAULT-*-2)) (4 3 (:REWRITE DEFAULT-*-1)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-OF-SUM (60 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (21 3 (:REWRITE DEFAULT-UNARY-/)) (18 3 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 6 (:REWRITE DEFAULT-*-2)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 6 (:REWRITE DEFAULT-*-1)) (8 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1))) (DIVIDES-OF-SUM-2 (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 12 (:REWRITE POWER2-INTEGER)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2B (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 11 (:REWRITE POWER2-INTEGER)) (10 4 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 6 (:REWRITE DEFAULT-*-2)) (8 6 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 2 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (DIVIDES-OF-SUM-2C (42 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (19 5 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:REWRITE POWER2-INTEGER)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (11 8 (:REWRITE DEFAULT-+-1)) (11 8 (:REWRITE DEFAULT-*-2)) (10 8 (:REWRITE DEFAULT-+-2)) (10 8 (:REWRITE DEFAULT-*-1)) (10 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (5 5 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (4 4 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-UNARY-MINUS (22 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (8 2 (:REWRITE DEFAULT-UNARY-/)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE POWER2-INTEGER)) (5 4 (:REWRITE DEFAULT-*-2)) (5 4 (:REWRITE DEFAULT-*-1)) (5 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (2 1 (:DEFINITION NOT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (DIVIDES-OF-TIMES-1 (40 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (14 2 (:REWRITE DEFAULT-UNARY-/)) (12 2 (:REWRITE EQUAL-1-HACK)) (8 6 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 4 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P))) (DIVIDES-OF-TIMES-2) (INTEGERP-SQUEEZE-HACK (3 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK (96 3 (:REWRITE EQUAL-1-HACK)) (84 6 (:LINEAR X*Y>1-POSITIVE)) (78 6 (:REWRITE ARITHHACK2)) (26 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-*-2)) (11 11 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 1 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE DEFAULT-NUMERATOR)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (INTEGERP-SQUEEZE-HACK-2 (4 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-SQUEEZE-HACK-3 (15 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (11 1 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 1 (:REWRITE ARITHHACK2)) (6 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (DIVIDES-SQUEEZE-HACK-2 (178 12 (:LINEAR X*Y>1-POSITIVE)) (166 12 (:REWRITE ARITHHACK2)) (109 5 (:REWRITE EQUAL-1-HACK)) (101 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (54 54 (:REWRITE DEFAULT-<-2)) (54 54 (:REWRITE DEFAULT-<-1)) (50 6 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (47 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 21 (:REWRITE EXPT-COMPARE-EQUAL)) (21 21 (:META CANCEL_TIMES-EQUAL-CORRECT)) (21 21 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:REWRITE DEFAULT-*-2)) (18 18 (:REWRITE DEFAULT-*-1)) (12 3 (:REWRITE DEFAULT-UNARY-/)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-POSITIVE-LEFT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-RIGHT)) (7 1 (:REWRITE <-UNARY-/-NEGATIVE-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE DEFAULT-NUMERATOR)) (4 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (3 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE (5570 770 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (5427 5427 (:REWRITE EXPT-COMPARE)) (4950 770 (:REWRITE DIVIDES-SQUEEZE-HACK)) (4857 4028 (:REWRITE DEFAULT-+-2)) (4570 4028 (:REWRITE DEFAULT-+-1)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (4368 4368 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (4135 3897 (:REWRITE DEFAULT-<-1)) (3961 3897 (:REWRITE DEFAULT-<-2)) (3323 3095 (:REWRITE DEFAULT-*-2)) (3125 3095 (:REWRITE DEFAULT-*-1)) (2898 124 (:REWRITE INTEGERP-+-MINUS-*-2)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (2171 364 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (1913 364 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (1833 1833 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1509 1509 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (1196 236 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (752 44 (:REWRITE DIVIDES-OF-TIMES-2)) (658 658 (:META CANCEL_TIMES-EQUAL-CORRECT)) (628 52 (:REWRITE SUM-POWER-OF-TWO)) (594 594 (:REWRITE EXPT-COMPARE-EQUAL)) (488 68 (:REWRITE DIVIDES-OF-SUM)) (409 409 (:REWRITE POWER2-INTEGER)) (365 364 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (364 364 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (315 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (274 274 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (212 200 (:REWRITE DEFAULT-UNARY-MINUS)) (144 16 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (140 140 (:REWRITE FOLD-CONSTS-IN-+)) (139 124 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (128 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (124 52 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (64 32 (:REWRITE USB-TIGHTEN)) (52 52 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (52 52 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (45 45 (:LINEAR MOD-TYPE . 3)) (45 45 (:LINEAR MOD-TYPE . 1)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 32 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (30 30 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (26 26 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 16 (:REWRITE EQUAL-CONSTANT-+)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT))) (MOD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (74 8 (:REWRITE DIVIDES-HACK2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (68 68 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (67 2 (:REWRITE CANCEL-MOD-+-BASIC)) (66 5 (:REWRITE MOD-=-0 . 2)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (34 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (30 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (25 3 (:REWRITE INTEGERP-+-MINUS-*-1)) (22 22 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (22 22 (:REWRITE EXPT-COMPARE)) (22 22 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 8 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (21 3 (:REWRITE INTEGERP-UNARY-)) (18 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (18 8 (:REWRITE DIVIDES-SQUEEZE-HACK)) (16 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (13 2 (:REWRITE <-0-+-NEGATIVE-1)) (13 2 (:REWRITE <-+-NEGATIVE-0-1)) (12 4 (:REWRITE COMMUTATIVITY-OF-*)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (9 1 (:REWRITE DISTRIBUTIVITY-ALT)) (8 8 (:TYPE-PRESCRIPTION DIVIDES)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE-ALT (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (134 57 (:REWRITE DEFAULT-+-1)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (118 57 (:REWRITE DEFAULT-+-2)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (102 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (14 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGHEAD-OF-DIFFERENCE-EQUAL-0-REWRITE (937 68 (:REWRITE LOGHEAD-IDENTITY)) (413 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (389 60 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (155 138 (:REWRITE DEFAULT-<-1)) (155 60 (:REWRITE DEFAULT-+-1)) (144 138 (:REWRITE DEFAULT-<-2)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (121 60 (:REWRITE DEFAULT-+-2)) (120 120 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (120 60 (:REWRITE USB-TIGHTEN)) (114 114 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (96 11 (:LINEAR LOGHEAD-LEQ)) (95 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (88 88 (:META META-RULE-ERIC)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 70 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (68 68 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (60 60 (:TYPE-PRESCRIPTION LOGBITP)) (60 60 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (60 60 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (60 60 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 25 (:REWRITE DEFAULT-UNARY-MINUS)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 5 (:LINEAR EXPT->-1)) (24 24 (:META CANCEL_TIMES-EQUAL-CORRECT)) (19 19 (:REWRITE EXPT-COMPARE-EQUAL)) (18 1 (:REWRITE LOGHEAD-<=)) (17 17 (:REWRITE LOGHEAD-COMPARE-HACK)) (17 17 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (15 15 (:REWRITE POWER2-INTEGER)) (13 2 (:REWRITE LOGHEAD-<)) (11 11 (:REWRITE FOLD-CONSTS-IN-+)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (11 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 2 (:REWRITE SUM-POWER-OF-TWO)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (5 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (MOD-16-32 (40 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (40 5 (:REWRITE MOD-=-0 . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (33 33 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (30 5 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (27 23 (:REWRITE DEFAULT-<-2)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 23 (:REWRITE DEFAULT-<-1)) (23 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (21 7 (:REWRITE COMMUTATIVITY-OF-*)) (16 2 (:LINEAR MOD-TYPE . 2)) (14 14 (:REWRITE DEFAULT-*-2)) (14 14 (:REWRITE DEFAULT-*-1)) (11 11 (:REWRITE POWER2-INTEGER)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-4)) (5 5 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (5 5 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (5 5 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ASH1-IS-MULT2 (300 11 (:REWRITE FLOOR-WHEN-<-2)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (198 18 (:LINEAR X*Y>1-POSITIVE)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (68 8 (:DEFINITION IFF)) (64 64 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (64 64 (:REWRITE EXPT-COMPARE)) (64 64 (:META CANCEL_PLUS-LESSP-CORRECT)) (63 45 (:REWRITE DEFAULT-<-2)) (55 45 (:REWRITE DEFAULT-<-1)) (48 8 (:DEFINITION NOT)) (24 16 (:REWRITE DEFAULT-*-2)) (24 8 (:REWRITE UNICITY-OF-1)) (21 11 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (20 20 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (20 16 (:REWRITE DEFAULT-*-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (16 16 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 8 (:REWRITE FIX-DOES-NOTHING)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (11 11 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (8 8 (:REWRITE FOLD-CONSTS-IN-*)) (8 4 (:REWRITE DEFAULT-+-2)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 3 (:REWRITE POWER2-INTEGER)) (3 2 (:REWRITE IFIX-INTEGERP))) (ASH-IS-MULT2 (385 13 (:REWRITE FLOOR-WHEN-<-2)) (222 22 (:LINEAR X*Y>1-POSITIVE)) (204 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (124 4 (:REWRITE <-*-0)) (124 4 (:REWRITE 0-<-*)) (110 10 (:REWRITE <-*-X-Y-Y)) (104 2 (:LINEAR FLOOR-TYPE-2 . 2)) (104 2 (:LINEAR FLOOR-TYPE-2 . 1)) (98 2 (:LINEAR FLOOR-TYPE-1 . 2)) (98 2 (:LINEAR FLOOR-TYPE-1 . 1)) (96 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (90 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (76 2 (:LINEAR FLOOR-LINEAR-1)) (74 56 (:REWRITE DEFAULT-<-2)) (74 56 (:REWRITE DEFAULT-<-1)) (68 8 (:DEFINITION IFF)) (56 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 2 (:REWRITE ZIP-OPEN)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (50 50 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (40 18 (:REWRITE DEFAULT-*-2)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 13 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (27 1 (:REWRITE <-*-Y-X-Y)) (25 18 (:REWRITE DEFAULT-*-1)) (24 8 (:REWRITE UNICITY-OF-1)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 16 (:REWRITE DEFAULT-+-2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (ASH-OPEN (1454 22 (:LINEAR X*Y>1-POSITIVE)) (419 12 (:REWRITE FLOOR-WHEN-<-2)) (338 4 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (251 243 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (172 4 (:REWRITE <-*-0)) (172 4 (:REWRITE 0-<-*)) (160 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (148 2 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (146 2 (:LINEAR FLOOR-TYPE-2 . 2)) (146 2 (:LINEAR FLOOR-TYPE-2 . 1)) (140 2 (:LINEAR FLOOR-TYPE-1 . 2)) (140 2 (:LINEAR FLOOR-TYPE-1 . 1)) (122 2 (:LINEAR FLOOR-LINEAR-1)) (100 55 (:REWRITE DEFAULT-<-1)) (91 55 (:REWRITE DEFAULT-<-2)) (76 76 (:REWRITE EXPT-COMPARE)) (76 76 (:META CANCEL_PLUS-LESSP-CORRECT)) (68 8 (:DEFINITION IFF)) (64 18 (:REWRITE DEFAULT-*-2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (60 60 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (57 12 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (56 2 (:REWRITE ZIP-OPEN)) (48 8 (:REWRITE UNICITY-OF-1)) (37 18 (:REWRITE DEFAULT-*-1)) (34 2 (:REWRITE NORMALIZE-EQUAL-0)) (32 16 (:REWRITE DEFAULT-+-2)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (23 23 (:META CANCEL_PLUS-EQUAL-CORRECT)) (23 16 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 2 (:REWRITE EQUAL-MINUS-MINUS)) (18 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (12 12 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (12 2 (:REWRITE EQUAL-1-HACK)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (9 9 (:REWRITE FOLD-CONSTS-IN-*)) (8 8 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER))) (SHIFT-IS-MULT2 (82 6 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (76 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (52 4 (:REWRITE MOD-=-0 . 2)) (50 6 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (32 2 (:REWRITE 0-<-*)) (31 23 (:REWRITE DEFAULT-<-2)) (31 23 (:REWRITE DEFAULT-<-1)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (30 30 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 2 (:LINEAR MOD-TYPE . 2)) (22 16 (:REWRITE DEFAULT-*-2)) (22 16 (:REWRITE DEFAULT-*-1)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 2 (:LINEAR X*Y>1-POSITIVE)) (10 6 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (10 1 (:REWRITE FLOOR-WHEN-<-2)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGERP-+-MINUS-*-4)) (6 1 (:REWRITE <-*-Y-X-Y)) (4 4 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR MOD-TYPE . 3)) (2 2 (:LINEAR MOD-TYPE . 1)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP))) (SHIFT-BOUNDS (56 4 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (52 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (32 2 (:REWRITE 0-<-*)) (26 4 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (26 2 (:REWRITE MOD-=-0 . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (25 25 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (18 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 1 (:LINEAR MOD-TYPE . 2)) (11 8 (:REWRITE DEFAULT-*-2)) (11 8 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 4 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (6 1 (:REWRITE FLOOR-WHEN-<-2)) (4 4 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:DEFINITION IFF)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:LINEAR MOD-TYPE . 3)) (1 1 (:LINEAR MOD-TYPE . 1))) (UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT (152 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (72 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (45 27 (:REWRITE EXPT-COMPARE)) (40 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (35 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 3 (:LINEAR EXPT->-1)) (32 19 (:REWRITE DEFAULT-<-2)) (28 28 (:META CANCEL_PLUS-LESSP-CORRECT)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (23 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 19 (:REWRITE DEFAULT-<-1)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE EXPO-EXPT2)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (EXTEND-< (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LINEAR-REWRITE (56 56 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGBITP-TOP-BIT-WHEN-SIGNED-BYTE-P (775 365 (:REWRITE DEFAULT-*-2)) (707 365 (:REWRITE DEFAULT-*-1)) (504 58 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (454 5 (:REWRITE RTL1)) (436 166 (:REWRITE DEFAULT-+-2)) (410 410 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (271 5 (:REWRITE FLOOR-=-X/Y . 3)) (252 62 (:REWRITE EXPT-COMPARE-EQUAL)) (207 193 (:REWRITE EXPT-COMPARE)) (206 166 (:REWRITE DEFAULT-+-1)) (205 205 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (200 200 (:REWRITE USB-LINEAR-REWRITE)) (192 192 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (179 129 (:REWRITE DEFAULT-<-1)) (169 129 (:REWRITE DEFAULT-<-2)) (160 11 (:REWRITE INTEGERP-+-MINUS-*-4)) (145 29 (:REWRITE DEFAULT-UNARY-/)) (133 4 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (95 95 (:REWRITE LOGBITP-TEST-OF-TOP-BIT)) (82 9 (:LINEAR EXPT->-1)) (68 5 (:REWRITE FLOOR-SIMPLE-CASES)) (68 5 (:REWRITE FLOOR-DETERMINED-1)) (68 5 (:REWRITE FLOOR-=-X/Y . 2)) (64 64 (:META CANCEL_TIMES-EQUAL-CORRECT)) (62 62 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (60 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 15 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (43 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (40 40 (:TYPE-PRESCRIPTION POWER2P)) (40 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (29 5 (:REWRITE FLOOR-TYPE-3 . 3)) (29 5 (:REWRITE FLOOR-TYPE-3 . 2)) (26 5 (:REWRITE FLOOR-TYPE-4 . 3)) (26 5 (:REWRITE FLOOR-TYPE-4 . 2)) (25 1 (:LINEAR X*Y>1-POSITIVE)) (22 22 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE POWER2P-EXPT2-I)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (20 20 (:REWRITE EXPO-EXPT2)) (20 2 (:REWRITE EVENP-COLLAPSE)) (20 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (19 19 (:REWRITE FOLD-CONSTS-IN-*)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 2 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (15 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (13 13 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (10 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (5 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (3 3 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-2 (72 9 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (12 11 (:META META-RULE-ERIC)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE DEFAULT-<-1)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGORC1-OF-ZERO-TWO (80 2 (:LINEAR LOGIOR-BND-ERIC-LINEAR)) (63 6 (:REWRITE LOGIOR-AS-B-IOR)) (15 6 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 6 (:REWRITE USB-TIGHTEN)) (9 6 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (9 6 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (5 2 (:REWRITE LOGNOT-ZIP)) (3 3 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE ZIP-OPEN))) (LOGORC1-OF-ZERO-ONE) (LOGEQV-OF-ZERO-ONE (80 4 (:LINEAR LOGEQV-BOUND)) (46 17 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (5 1 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 1 (:REWRITE LOGNOT-ZIP)) (3 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 1 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE LOGAND-WITH-MASK-ERIC)) (1 1 (:TYPE-PRESCRIPTION LOGMASKP)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGEQV-COMMUTATIVE (76 4 (:LINEAR LOGEQV-BOUND)) (40 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 3 (:REWRITE LOGAND-WITH-MASK-ERIC)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION LOGORC1)) (6 6 (:TYPE-PRESCRIPTION LOGMASKP)) (6 3 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (3 3 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2 (6250 11 (:DEFINITION BINARY-LOGAND)) (6215 65 (:LINEAR X*Y>1-POSITIVE)) (5180 11 (:REWRITE <-OF-LOGTAIL)) (2666 123 (:REWRITE FLOOR-WHEN-<-2)) (1911 49 (:REWRITE INTEGERP-+-MINUS-*-1)) (1592 36 (:REWRITE LOGTAIL-IDENTITY)) (1285 147 (:REWRITE <-*-/-LEFT-COMMUTED)) (1104 1104 (:REWRITE USB-LINEAR-REWRITE)) (1104 1104 (:META CANCEL_PLUS-LESSP-CORRECT)) (1096 1096 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1096 1096 (:REWRITE EXPT-COMPARE)) (903 854 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (876 12 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER)) (870 40 (:REWRITE EQUAL-1-HACK)) (746 611 (:REWRITE DEFAULT-<-1)) (735 35 (:REWRITE EQUAL-MINUS-MINUS)) (715 5 (:REWRITE LOGCDR-*-1/2-EXPT)) (704 50 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (685 611 (:REWRITE DEFAULT-<-2)) (647 20 (:REWRITE ZIP-OPEN)) (617 196 (:REWRITE EXPT-COMPARE-EQUAL)) (615 92 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (593 593 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (568 344 (:REWRITE DEFAULT-*-2)) (566 156 (:REWRITE FOLD-CONSTS-IN-*)) (552 127 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (548 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (533 73 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (500 12 (:REWRITE 0-<-*)) (498 8 (:REWRITE LOGTAIL-LESSP)) (476 12 (:REWRITE <-*-0)) (444 24 (:REWRITE NORMALIZE-EQUAL-0)) (424 6 (:LINEAR FLOOR-TYPE-2 . 2)) (414 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-2-ALT)) (406 6 (:LINEAR FLOOR-TYPE-2 . 1)) (406 6 (:LINEAR FLOOR-TYPE-1 . 2)) (397 344 (:REWRITE DEFAULT-*-1)) (388 6 (:LINEAR FLOOR-TYPE-1 . 1)) (386 27 (:LINEAR LOGTAIL-LEQ)) (384 6 (:LINEAR FLOOR-BOUNDED-BY-/-BETTER-1-ALT)) (380 20 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (351 18 (:REWRITE FLOOR-TYPE-3 . 3)) (347 170 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (340 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (333 264 (:REWRITE DEFAULT-+-2)) (330 26 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (324 18 (:REWRITE FLOOR-TYPE-3 . 2)) (318 6 (:LINEAR FLOOR-LINEAR-1)) (317 36 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (306 18 (:REWRITE FLOOR-TYPE-4 . 2)) (293 264 (:REWRITE DEFAULT-+-1)) (288 36 (:REWRITE <-*-/-RIGHT-COMMUTED)) (279 18 (:REWRITE RTL1)) (279 18 (:REWRITE FLOOR-TYPE-4 . 3)) (279 18 (:REWRITE FLOOR-SIMPLE-CASES)) (279 18 (:REWRITE FLOOR-DETERMINED-1)) (240 200 (:META CANCEL_TIMES-EQUAL-CORRECT)) (237 79 (:REWRITE EXPO-OF-NOT-RATIONALP)) (234 32 (:LINEAR EXPT->-1)) (230 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (225 18 (:REWRITE FLOOR-=-X/Y . 3)) (225 18 (:REWRITE FLOOR-=-X/Y . 2)) (224 112 (:REWRITE USB-TIGHTEN)) (216 24 (:DEFINITION IFF)) (196 196 (:META CANCEL_PLUS-EQUAL-CORRECT)) (178 178 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (176 29 (:REWRITE COMMUTATIVITY-OF-+)) (170 170 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (150 150 (:REWRITE INTEGERP-+-MINUS-*-4)) (140 28 (:REWRITE SUM-POWER-OF-TWO)) (140 20 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (136 136 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (126 18 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (113 113 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (112 112 (:TYPE-PRESCRIPTION LOGBITP)) (112 112 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (108 18 (:REWRITE DISTRIBUTIVITY-ALT)) (100 5 (:REWRITE LOGTAIL-SHIFT-CONSTANT-VERSION)) (97 11 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-RIGHT)) (96 32 (:REWRITE FOLD-CONSTS-IN-+)) (94 92 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (92 92 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (92 80 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (90 46 (:REWRITE DEFAULT-UNARY-MINUS)) (90 18 (:REWRITE CANCEL-FLOOR-+-BASIC)) (82 82 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (80 28 (:REWRITE LOGAND-WITH-MASK-ERIC)) (79 79 (:REWRITE EXPO-MINUS-ERIC)) (73 73 (:REWRITE INTEGERP-+-MINUS-*-2)) (72 54 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (72 4 (:REWRITE EQUAL-CONSTANT-+)) (70 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (68 36 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (64 64 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (62 10 (:REWRITE DISTRIBUTIVITY)) (60 30 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (52 52 (:TYPE-PRESCRIPTION LOGMASKP)) (34 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (32 32 (:LINEAR EXPT-LESS-THAN-1-HACK)) (28 28 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (28 28 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (27 27 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (24 4 (:REWRITE EVENP-+-ALT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (20 20 (:REWRITE FLOOR-UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE)) (13 13 (:REWRITE EVENP-*)) (11 11 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (8 8 (:REWRITE MY-EQUAL-/)) (4 4 (:REWRITE EVENP-+)) (3 3 (:TYPE-PRESCRIPTION SUB1-LOGCDR-INDUCTION)) (3 3 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1))) (LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION (397 9 (:REWRITE EXPO-COMPARISON-REWRITE-TO-BOUND-2)) (122 2 (:REWRITE LOGTAIL-IDENTITY)) (115 2 (:REWRITE ASH-0)) (108 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (107 2 (:REWRITE ZIP-OPEN)) (104 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (104 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (104 2 (:REWRITE ASH-AS-LOGTAIL)) (89 89 (:REWRITE USB-LINEAR-REWRITE)) (89 89 (:REWRITE EXPT-COMPARE)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (74 74 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (51 2 (:REWRITE LOGTAIL-EQUAL-0)) (50 1 (:LINEAR EXPT->-1)) (48 44 (:REWRITE DEFAULT-<-1)) (44 44 (:REWRITE DEFAULT-<-2)) (44 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (36 4 (:LINEAR LOGTAIL-LEQ)) (34 32 (:REWRITE DEFAULT-+-2)) (32 32 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 18 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 10 (:REWRITE EXPO-MINUS-ERIC)) (9 3 (:REWRITE EXPT-EXPO-WHEN-POWER2P)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE USB-TIGHTEN)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE LOGAND-WITH-MASK-ERIC)) (4 4 (:TYPE-PRESCRIPTION LOGMASKP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAND-EXPT-REWRITE)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:LINEAR EXPO-LOWER-POS)) (1 1 (:LINEAR EXPO-LOWER-BOUND-2))) (DIVIDE-BOTH-SIDES-HACK) (CANCEL-NEGATED-CASE (51 3 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (25 1 (:REWRITE <-*-0)) (15 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 7 (:REWRITE DEFAULT-*-1)) (8 1 (:DEFINITION IFF)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:REWRITE DEFAULT-*-2)) (7 1 (:REWRITE EQUAL-1-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE DEFAULT-UNARY-/)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION (58 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 1 (:REWRITE FLOOR-WHEN-<-2)) (32 2 (:LINEAR X*Y>1-POSITIVE)) (29 1 (:REWRITE <-*-0)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (18 18 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (18 18 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (15 9 (:REWRITE DEFAULT-<-1)) (12 6 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-*-1)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE POWER2-INTEGER)) (6 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:DEFINITION IFF)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGEQV-NEG (123 7 (:REWRITE LOGIOR-AS-B-IOR)) (60 3 (:REWRITE USBP-OVER-LOGAND)) (29 29 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (28 14 (:REWRITE LOGAND-WITH-MASK-ERIC)) (24 12 (:REWRITE USB-TIGHTEN)) (23 14 (:REWRITE LOGAND-WHEN-I-IS-NOT-AN-INTEGERP)) (22 14 (:REWRITE LOGAND-WHEN-J-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 16 (:REWRITE LOGAND-WITH-NEGATIVE-OF-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE LOGAND-EXPT-CONSTANT-VERSION)) (14 14 (:TYPE-PRESCRIPTION LOGMASKP)) (13 7 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 7 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (11 7 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE LOGNOT-ZIP)) (5 5 (:TYPE-PRESCRIPTION BINARY-LOGAND)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-OF-LOGNOT (65 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (21 2 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (18 13 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 2 (:REWRITE ODD-EQUAL-EXPT-CHEAP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EVENP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS))) (LOGBIT-SUBST-SIMPLER (108 6 (:REWRITE LOGHEAD-IDENTITY)) (54 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (23 23 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (23 23 (:REWRITE EXPT-COMPARE)) (23 23 (:META CANCEL_PLUS-LESSP-CORRECT)) (21 19 (:REWRITE DEFAULT-<-1)) (20 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 6 (:REWRITE USB-TIGHTEN)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGBIT-OF-LOGCAR (136 30 (:REWRITE LOGCAR-EVENP)) (62 25 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 52 (:REWRITE POWER2-INTEGER)) (44 44 (:TYPE-PRESCRIPTION EVENP)) (34 4 (:REWRITE EQUAL-1-HACK)) (19 11 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 5 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1))) (LOGHEAD-WHEN-MOSTLY-0 (499 499 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (156 10 (:REWRITE LOGHEAD-IDENTITY)) (97 97 (:REWRITE USB-LINEAR-REWRITE)) (92 92 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (92 92 (:REWRITE EXPT-COMPARE)) (90 81 (:REWRITE DEFAULT-<-2)) (88 81 (:REWRITE DEFAULT-<-1)) (75 75 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (74 4 (:REWRITE ASH-0)) (72 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (63 7 (:LINEAR LOGHEAD-LEQ)) (58 4 (:REWRITE ZIP-OPEN)) (50 50 (:REWRITE DEFAULT-+-2)) (50 50 (:REWRITE DEFAULT-+-1)) (49 4 (:REWRITE ASH-AS-LOGTAIL)) (48 48 (:REWRITE LOGHEAD-SUBST2)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:META META-RULE-ERIC)) (45 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (40 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE POWER2-INTEGER)) (35 4 (:REWRITE ASH-GOES-TO-0)) (30 15 (:REWRITE USB-TIGHTEN)) (24 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 22 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 3 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (16 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (13 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (12 4 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (11 11 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE DEFAULT-UNARY-MINUS)) (6 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGHEAD-SUBST-SIMPLER-2 (658 42 (:REWRITE LOGHEAD-IDENTITY)) (528 528 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (299 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (298 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (127 127 (:REWRITE USB-LINEAR-REWRITE)) (125 14 (:LINEAR LOGHEAD-LEQ)) (123 123 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (123 123 (:REWRITE EXPT-COMPARE)) (113 113 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (102 89 (:REWRITE DEFAULT-<-1)) (91 89 (:REWRITE DEFAULT-<-2)) (84 42 (:REWRITE USB-TIGHTEN)) (60 60 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (57 43 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (54 54 (:META META-RULE-ERIC)) (54 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (49 49 (:REWRITE POWER2-INTEGER)) (48 44 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (44 44 (:REWRITE LOGHEAD-SUBST)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (38 3 (:REWRITE ASH-0)) (30 30 (:REWRITE DEFAULT-+-2)) (30 30 (:REWRITE DEFAULT-+-1)) (29 2 (:REWRITE ZIP-OPEN)) (27 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (27 3 (:REWRITE ASH-AS-LOGTAIL)) (26 22 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 3 (:REWRITE ASH-GOES-TO-0)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (19 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL (417 417 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (223 12 (:REWRITE LOGHEAD-IDENTITY)) (196 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (127 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (110 110 (:REWRITE USB-LINEAR-REWRITE)) (107 11 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (103 103 (:REWRITE EXPT-COMPARE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (70 8 (:LINEAR LOGHEAD-LEQ)) (69 3 (:REWRITE ASH-0)) (63 57 (:REWRITE DEFAULT-<-1)) (57 57 (:REWRITE DEFAULT-<-2)) (57 3 (:REWRITE ZIP-OPEN)) (54 3 (:REWRITE ASH-GOES-TO-0)) (51 3 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (51 3 (:REWRITE ASH-AS-LOGTAIL)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (42 12 (:REWRITE LOGBIT-SUBST-SIMPLER)) (38 38 (:REWRITE DEFAULT-+-2)) (38 38 (:REWRITE DEFAULT-+-1)) (34 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (32 5 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (30 15 (:REWRITE USB-TIGHTEN)) (28 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (25 25 (:META META-RULE-ERIC)) (21 21 (:REWRITE LOGHEAD-SUBST)) (19 19 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (19 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 13 (:META CANCEL_TIMES-EQUAL-CORRECT)) (13 13 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (9 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 3 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (3 3 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGAPP-LOGHEAD-DROP (127 8 (:REWRITE LOGHEAD-IDENTITY)) (64 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (63 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 58 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (33 27 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE USB-LINEAR-REWRITE)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (30 30 (:REWRITE EXPT-COMPARE)) (30 30 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 27 (:REWRITE DEFAULT-<-2)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT->-1)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE POWER2-INTEGER)) (14 7 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-EQUAL-LOGAPP-SAME-REWRITE (57 5 (:REWRITE LOGHEAD-IDENTITY)) (52 52 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (23 23 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (21 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 2 (:REWRITE EQUAL-1-HACK)) (15 14 (:REWRITE DEFAULT-<-2)) (15 14 (:REWRITE DEFAULT-<-1)) (10 5 (:REWRITE USB-TIGHTEN)) (9 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:META META-RULE-ERIC)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-LOGHEAD-ONE-SHORTER-REWRITE (154 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (87 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (52 4 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (43 43 (:REWRITE USB-LINEAR-REWRITE)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (23 23 (:REWRITE DEFAULT-<-2)) (23 23 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE DEFAULT-+-2)) (15 15 (:REWRITE DEFAULT-+-1)) (14 7 (:REWRITE USB-TIGHTEN)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 2 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS (204 11 (:REWRITE LOGHEAD-IDENTITY)) (196 196 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 86 (:REWRITE USB-LINEAR-REWRITE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 85 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (85 85 (:REWRITE EXPT-COMPARE)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (49 46 (:REWRITE DEFAULT-<-2)) (48 46 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (39 39 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (34 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 16 (:REWRITE USB-TIGHTEN)) (30 27 (:REWRITE DEFAULT-+-2)) (27 27 (:REWRITE DEFAULT-+-1)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT (204 11 (:REWRITE LOGHEAD-IDENTITY)) (199 199 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (137 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (116 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (86 6 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (85 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (67 67 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 47 (:REWRITE DEFAULT-<-2)) (49 47 (:REWRITE DEFAULT-<-1)) (40 40 (:REWRITE POWER2-INTEGER)) (40 40 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (31 28 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE USB-TIGHTEN)) (28 28 (:REWRITE DEFAULT-+-1)) (28 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 14 (:META META-RULE-ERIC)) (15 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (12 6 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (12 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 1 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (7 5 (:REWRITE FIX-DOES-NOTHING)) (6 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:DEFINITION FIX)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 1 (:REWRITE COMMUTATIVITY-OF-+)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE ASH-0)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT (204 9 (:REWRITE LOGHEAD-IDENTITY)) (140 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (91 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (31 3 (:LINEAR LOGHEAD-LEQ)) (22 11 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 12 (:REWRITE DEFAULT-+-2)) (13 12 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 9 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-SUBST (18 1 (:REWRITE LOGHEAD-IDENTITY)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGBITP-SUBST (36 2 (:REWRITE LOGHEAD-IDENTITY)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE EXPT-COMPARE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:META META-RULE-ERIC))) (LOGBITP-SUBST-2 (91 6 (:REWRITE LOGHEAD-IDENTITY)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 17 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-EQUAL-MIN-VALUE-HACK (64 8 (:LINEAR LOGHEAD-LEQ)) (60 6 (:REWRITE LOGHEAD-IDENTITY)) (51 51 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (44 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (38 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE USB-TIGHTEN)) (15 15 (:REWRITE LOGHEAD-SUBST2)) (15 15 (:META META-RULE-ERIC)) (14 9 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE LOGHEAD-SUBST-2)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:REWRITE DEFAULT-<-2)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (7 7 (:REWRITE LOGBIT-SUBST-SIMPLER)) (7 7 (:REWRITE LOGBIT-SUBST)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR))) (LOGHEAD-SPLIT-GEN (618 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (251 35 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (242 1 (:REWRITE ASH-0)) (238 1 (:REWRITE ZIP-OPEN)) (208 8 (:REWRITE LOGTAIL-IDENTITY)) (199 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (112 112 (:REWRITE USB-LINEAR-REWRITE)) (112 112 (:REWRITE EXPT-COMPARE)) (112 112 (:META CANCEL_PLUS-LESSP-CORRECT)) (110 110 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (108 100 (:REWRITE DEFAULT-<-1)) (104 8 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (100 100 (:REWRITE DEFAULT-<-2)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (80 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (72 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (70 35 (:REWRITE USB-TIGHTEN)) (70 8 (:LINEAR LOGHEAD-LEQ)) (67 67 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (64 8 (:LINEAR EXPT->-1)) (44 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (35 35 (:TYPE-PRESCRIPTION LOGBITP)) (35 35 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (35 35 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (35 35 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (26 1 (:REWRITE LOGTAIL-EQUAL-0)) (25 25 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (25 25 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE LOGHEAD-SUBST)) (25 25 (:META META-RULE-ERIC)) (24 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (23 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (ASH-EQUAL-EXPT-REWRITE (35 1 (:REWRITE FLOOR-WHEN-<-2)) (17 4 (:REWRITE EXPT-COMPARE)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 1)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (15 15 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (8 1 (:LINEAR EXPT->-1)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPO-MINUS-ERIC)) (1 1 (:REWRITE EXPO-EXPT2)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-EQUAL-EXPT-REWRITE (573 573 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (324 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (261 11 (:REWRITE LOGHEAD-IDENTITY)) (183 183 (:REWRITE USB-LINEAR-REWRITE)) (175 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (167 167 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (120 8 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (107 107 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (97 89 (:REWRITE DEFAULT-<-1)) (89 89 (:REWRITE DEFAULT-<-2)) (86 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (80 80 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (68 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 6 (:REWRITE LOGTAIL-IDENTITY)) (63 1 (:REWRITE FLOOR-WHEN-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (52 6 (:LINEAR LOGHEAD-LEQ)) (47 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (44 22 (:REWRITE USB-TIGHTEN)) (42 41 (:REWRITE DEFAULT-+-1)) (41 41 (:REWRITE DEFAULT-+-2)) (40 20 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 1 (:LINEAR X*Y>1-POSITIVE)) (30 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (29 29 (:META META-RULE-ERIC)) (28 28 (:REWRITE LOGHEAD-SUBST2)) (25 25 (:REWRITE POWER2-INTEGER)) (24 6 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE ASH-0)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 8 (:REWRITE LOGBIT-SUBST)) (20 1 (:REWRITE ZIP-OPEN)) (17 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (17 1 (:REWRITE ASH-AS-LOGTAIL)) (16 4 (:REWRITE LOGBITP-SUBST)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:META CANCEL_PLUS-EQUAL-CORRECT)) (11 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (10 1 (:REWRITE LOGBIT-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGBIT-SUBST-SIMPLER)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE DEFAULT-*-1)) (5 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-GOES-TO-0))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-N-MINUS-1 (10 10 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (6 3 (:REWRITE DEFAULT-+-2)) (6 3 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (1 1 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN (82 5 (:REWRITE LOGHEAD-IDENTITY)) (71 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (59 59 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (39 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (37 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (35 3 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (29 29 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (27 18 (:REWRITE DEFAULT-<-1)) (25 22 (:REWRITE DEFAULT-+-2)) (25 22 (:REWRITE DEFAULT-+-1)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 3 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 9 (:REWRITE USB-TIGHTEN)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 3 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 3 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (4 4 (:REWRITE EXPONENTS-ADD)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION (70 70 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (20 2 (:REWRITE LOGHEAD-IDENTITY)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (UNSIGNED-BYTE-P-PLUS-LIMIT (307 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (87 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (74 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (63 49 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (62 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 4 (:LINEAR EXPT->-1)) (40 26 (:REWRITE DEFAULT-<-2)) (38 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (35 26 (:REWRITE DEFAULT-<-1)) (23 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (17 6 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:REWRITE POWER2-INTEGER)) (10 5 (:REWRITE USB-TIGHTEN)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 5 (:REWRITE DEFAULT-+-2)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (5 5 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (5 5 (:REWRITE DEFAULT-+-1)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 1 (:DEFINITION FIX))) (PLUS-OF-LOGAPP-SUCK-IN-GEN2 (94 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 16 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (26 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (20 16 (:REWRITE DEFAULT-+-1)) (18 18 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (7 7 (:REWRITE LOGHEAD-SUM-SUBST)) (7 7 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (7 7 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (7 7 (:REWRITE LOGHEAD-+-REDUCE)) (7 7 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE POWER2-INTEGER)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-SUCK-IN-ONE-PLUS (345 21 (:REWRITE LOGHEAD-IDENTITY)) (108 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (85 59 (:REWRITE DEFAULT-<-2)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (56 56 (:REWRITE POWER2-INTEGER)) (56 8 (:LINEAR EXPT->-1)) (45 45 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (42 21 (:REWRITE USB-TIGHTEN)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (35 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 10 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (8 8 (:REWRITE LOGHEAD-OF-ONE-MORE-THAN-X)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE SUM-POWER-OF-TWO)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EQUAL-CONSTANT-+)) (3 1 (:REWRITE EXPO-OF-NOT-RATIONALP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 1 (:REWRITE EXPO-EXPT2)) (1 1 (:REWRITE POWER2P-EXPT2-I)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPO-MINUS-ERIC))) (LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT (74 74 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 5 (:REWRITE LOGHEAD-IDENTITY)) (35 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (29 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 13 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-2)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE DEFAULT-+-2)) (7 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-NORMALIZE-CONSTANT-ARG (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 11 (:REWRITE DEFAULT-<-1)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGHEAD-IDENTITY)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-SUBST-IN-FIRST-ARG (65 5 (:REWRITE LOGHEAD-IDENTITY)) (42 42 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (30 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (28 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (19 14 (:REWRITE DEFAULT-<-1)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (18 18 (:REWRITE EXPT-COMPARE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 14 (:REWRITE DEFAULT-<-2)) (13 13 (:REWRITE POWER2-INTEGER)) (9 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 1 (:REWRITE LOGAPP-LOGHEAD-DROP)) (7 6 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (ODD-<-EVEN-TIGHTEN (16 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGAPP-DOES-NOTHING-REWRITE (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (11 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGTAIL-IDENTITY)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 3 (:REWRITE USB-TIGHTEN)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGAPP-OF-LOGHEAD (60 60 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 3 (:REWRITE LOGHEAD-IDENTITY)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (27 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 13 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:REWRITE DEFAULT-<-2)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGBIT-DOES-NOTHING-REWRITE (112 1 (:REWRITE FLOOR-=-X/Y . 3)) (49 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (46 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (43 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (29 9 (:REWRITE EXPT-COMPARE-EQUAL)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (20 14 (:REWRITE DEFAULT-<-2)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 16 (:REWRITE USB-LINEAR-REWRITE)) (16 16 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 2 (:LINEAR EXPT->-1)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE DEFAULT-<-1)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 9 (:REWRITE POWER2-INTEGER)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:REWRITE FLOOR-TYPE-3 . 2)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 1 (:REWRITE FLOOR-TYPE-4 . 3)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-OF-ONE-MORE))) (LOGBIT-OF-USB-1 (44 11 (:REWRITE LOGCAR-EVENP)) (27 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (24 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (22 22 (:TYPE-PRESCRIPTION EVENP)) (18 9 (:REWRITE USB-TIGHTEN)) (15 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (11 11 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (11 1 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2 1 (:REWRITE EQUAL-1-HACK)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-CONSTANT-FALSE-FROM-USB (70 70 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:LINEAR EXPT->-1)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 3 (:REWRITE DEFAULT-<-2)) (4 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS))) (LOGHEAD-CANCEL-CONSTANTS-HACK (6648 6648 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6546 427 (:REWRITE LOGHEAD-IDENTITY)) (3190 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2863 407 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1275 856 (:REWRITE DEFAULT-<-2)) (998 856 (:REWRITE DEFAULT-<-1)) (881 881 (:REWRITE USB-LINEAR-REWRITE)) (874 874 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (874 874 (:REWRITE EXPT-COMPARE)) (856 107 (:LINEAR LOGHEAD-LEQ)) (814 814 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (814 407 (:REWRITE USB-TIGHTEN)) (781 781 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (767 767 (:REWRITE POWER2-INTEGER)) (734 427 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (658 658 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (643 248 (:REWRITE DEFAULT-+-2)) (622 442 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (572 400 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (563 248 (:REWRITE DEFAULT-+-1)) (472 442 (:REWRITE LOGHEAD-SUBST)) (442 442 (:REWRITE LOGHEAD-SUBST2)) (442 442 (:META META-RULE-ERIC)) (427 427 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (407 407 (:TYPE-PRESCRIPTION LOGBITP)) (407 407 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (407 407 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (407 407 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (389 389 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (372 200 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (311 23 (:REWRITE LOGHEAD-<)) (234 26 (:LINEAR EXPT->-1)) (208 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (154 28 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (115 5 (:REWRITE LOGHEAD-<=)) (89 51 (:REWRITE DEFAULT-UNARY-MINUS)) (84 84 (:REWRITE FOLD-CONSTS-IN-+)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 34 (:REWRITE EXPT-COMPARE-EQUAL)) (34 34 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (34 34 (:META CANCEL_TIMES-EQUAL-CORRECT)) (34 34 (:META CANCEL_PLUS-EQUAL-CORRECT)) (28 28 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 14 (:REWRITE SUM-POWER-OF-TWO)) (14 14 (:REWRITE EQUAL-CONSTANT-+)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (LOGBIT-TOO-BIG (44 44 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 5 (:REWRITE DEFAULT-<-2)) (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST))) (EQUAL-TO-ASH-1-REWRITE (39 4 (:REWRITE ASH-0)) (26 4 (:REWRITE ZIP-OPEN)) (16 7 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (14 2 (:REWRITE EQUAL-1-HACK)) (10 10 (:REWRITE EXPT-COMPARE-EQUAL)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (10 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGCDR-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-CONSTANT))) (LOGHEAD-OF-LOGEXT-HACK-1 (8001 48 (:REWRITE LOGHEAD-IDENTITY)) (7243 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (6880 12 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (2294 192 (:REWRITE <-+-CONSTANT-CONSTANT)) (2186 11 (:REWRITE LOGHEAD-COMPARE-HACK)) (1821 690 (:REWRITE POWER2-INTEGER)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1716 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1447 366 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (1403 48 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1172 1068 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1081 625 (:REWRITE EXPT-COMPARE)) (1005 193 (:REWRITE INTEGERP-+-MINUS-*-2)) (954 66 (:LINEAR EXPT->-1)) (888 66 (:LINEAR EXPT-LESS-THAN-1-HACK)) (836 532 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (625 625 (:REWRITE USB-LINEAR-REWRITE)) (625 625 (:META CANCEL_PLUS-LESSP-CORRECT)) (621 72 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (601 601 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (597 144 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (564 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN)) (518 8 (:LINEAR LOGHEAD-LEQ)) (480 16 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (476 16 (:LINEAR LOGEXT-BOUNDS-2)) (469 411 (:REWRITE DEFAULT-<-2)) (467 411 (:REWRITE DEFAULT-<-1)) (456 88 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (456 16 (:LINEAR LOGEXT-BOUNDS)) (440 4 (:REWRITE LOGHEAD-EQUAL-EXPT-REWRITE)) (395 28 (:REWRITE LOGEXT-IDENTITY)) (374 75 (:REWRITE EXPO-EXPT2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (314 314 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (311 175 (:REWRITE DEFAULT-+-2)) (265 69 (:META META-RULE-ERIC)) (257 75 (:REWRITE EXPO-OF-NOT-RATIONALP)) (217 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (200 100 (:REWRITE USB-TIGHTEN)) (193 193 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (193 175 (:REWRITE DEFAULT-+-1)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (188 188 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (161 17 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (149 149 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (134 134 (:TYPE-PRESCRIPTION LOGBITP)) (132 132 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (128 4 (:REWRITE <-+-NEGATIVE-0-1)) (111 43 (:REWRITE DEFAULT-UNARY-MINUS)) (100 100 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (99 99 (:TYPE-PRESCRIPTION POWER2P)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (94 94 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (88 88 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (88 88 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (86 69 (:REWRITE LOGHEAD-SUBST)) (86 43 (:DEFINITION FIX)) (83 13 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (76 17 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (75 75 (:REWRITE POWER2P-EXPT2-I)) (75 75 (:REWRITE EXPO-MINUS-ERIC)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 69 (:REWRITE LOGHEAD-SUBST2)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 8 (:LINEAR LOGEXT-BOUND-UPPER)) (57 47 (:META CANCEL_PLUS-EQUAL-CORRECT)) (56 56 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (56 56 (:REWRITE EXPONENTS-ADD)) (56 17 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (48 48 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (47 47 (:META CANCEL_TIMES-EQUAL-CORRECT)) (44 44 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 44 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (44 44 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (38 38 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (37 37 (:REWRITE EXPT-COMPARE-EQUAL)) (37 15 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (17 17 (:REWRITE LOGBITP-TOO-BIG)) (17 17 (:REWRITE LOGBITP-SUBST-2)) (17 17 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 4 (:REWRITE SIGNED-BYTE-P-OF-LOGEXT)) (8 4 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-1-ALT (3233 40 (:REWRITE LOGHEAD-IDENTITY)) (2475 36 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (2182 7 (:REWRITE LOGHEAD-COMPARE-HACK)) (1944 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (1405 370 (:REWRITE POWER2-INTEGER)) (1395 40 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (979 166 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (862 76 (:REWRITE <-+-CONSTANT-CONSTANT)) (861 93 (:REWRITE INTEGERP-+-MINUS-*-2)) (726 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (637 7 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (580 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (548 8 (:LINEAR LOGHEAD-LEQ)) (516 84 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (513 361 (:REWRITE EXPT-COMPARE)) (436 404 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (436 332 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (361 361 (:REWRITE USB-LINEAR-REWRITE)) (361 361 (:META CANCEL_PLUS-LESSP-CORRECT)) (354 26 (:LINEAR EXPT->-1)) (353 353 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (328 26 (:LINEAR EXPT-LESS-THAN-1-HACK)) (325 275 (:REWRITE DEFAULT-<-2)) (320 7 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (307 275 (:REWRITE DEFAULT-<-1)) (257 61 (:META META-RULE-ERIC)) (240 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (235 12 (:REWRITE LOGEXT-IDENTITY)) (234 234 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (213 123 (:REWRITE DEFAULT-+-2)) (203 20 (:REWRITE LOGBITP-+-SIMPLE)) (194 55 (:REWRITE EXPO-EXPT2)) (189 7 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (177 56 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (177 55 (:REWRITE EXPO-OF-NOT-RATIONALP)) (177 13 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (176 88 (:REWRITE USB-TIGHTEN)) (174 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (173 28 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (172 172 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (162 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (139 22 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (137 123 (:REWRITE DEFAULT-+-1)) (125 125 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (124 124 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (114 114 (:TYPE-PRESCRIPTION LOGBITP)) (98 14 (:LINEAR LOGCAR-RANGE-LINEAR)) (93 93 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (93 13 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (91 28 (:REWRITE LOGCAR-EVENP)) (88 88 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (84 84 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (84 84 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (78 61 (:REWRITE LOGHEAD-SUBST)) (78 20 (:REWRITE LOGBITP-+-USB-V4)) (75 20 (:REWRITE LOGBITP-+-USB-V1)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (70 35 (:DEFINITION FIX)) (69 6 (:REWRITE COMMUTATIVITY-2-OF-+)) (68 13 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (65 10 (:REWRITE LOGBITP-+-USB-V3)) (65 10 (:REWRITE LOGBITP-+-USB-V2)) (65 10 (:REWRITE LOGBITP-+-SIMPLE2)) (64 61 (:REWRITE LOGHEAD-SUBST2)) (63 63 (:TYPE-PRESCRIPTION POWER2P)) (55 55 (:REWRITE POWER2P-EXPT2-I)) (55 55 (:REWRITE EXPO-MINUS-ERIC)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (52 52 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (52 13 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (49 49 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (49 49 (:TYPE-PRESCRIPTION EVENP)) (47 27 (:REWRITE DEFAULT-UNARY-MINUS)) (45 35 (:META CANCEL_PLUS-EQUAL-CORRECT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (36 36 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (36 36 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (36 36 (:REWRITE LOGHEAD-SUM-SUBST)) (36 36 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (36 36 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (36 36 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (36 36 (:REWRITE LOGHEAD-+-REDUCE)) (36 36 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (35 35 (:META CANCEL_TIMES-EQUAL-CORRECT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (32 7 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (32 4 (:LINEAR LOGEXT-BOUND-UPPER)) (28 28 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 1 (:REWRITE SIGNED-BYTE-P-BASE-CASES)) (24 24 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (24 24 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (24 24 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (24 24 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (23 9 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (21 7 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (21 7 (:REWRITE LOGCAR-0-REWRITE)) (20 2 (:REWRITE EQUAL-LOGHEAD-ALMOST-0)) (19 12 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 16 (:REWRITE FOLD-CONSTS-IN-+)) (18 3 (:REWRITE DISTRIBUTIVITY-OF-MINUS-OVER-+)) (13 13 (:REWRITE LOGBITP-TOO-BIG)) (13 13 (:REWRITE LOGBITP-SUBST-2)) (13 13 (:REWRITE LOGBITP-SUBST)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (12 12 (:REWRITE EXPONENTS-ADD)) (7 7 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (7 7 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (7 7 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 3 (:REWRITE FUNCTIONAL-SELF-INVERSION-OF-MINUS)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION))) (LOGHEAD-OF-LOGEXT-HACK-2 (961 22 (:REWRITE LOGHEAD-IDENTITY)) (537 22 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (475 43 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (320 16 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (192 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (184 8 (:LINEAR LOGHEAD-LEQ)) (160 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (153 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (149 149 (:REWRITE POWER2-INTEGER)) (146 114 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (109 68 (:REWRITE DEFAULT-+-2)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 83 (:REWRITE DEFAULT-<-2)) (102 102 (:REWRITE USB-LINEAR-REWRITE)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (102 102 (:META CANCEL_PLUS-LESSP-CORRECT)) (99 83 (:REWRITE DEFAULT-<-1)) (86 86 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (86 86 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (86 43 (:REWRITE USB-TIGHTEN)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (59 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (56 8 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (47 47 (:TYPE-PRESCRIPTION LOGBITP)) (43 43 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (43 43 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (43 43 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (43 24 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (36 4 (:LINEAR EXPT->-1)) (32 16 (:REWRITE INTEGERP-+-MINUS-*-3)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (26 26 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (26 26 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (24 24 (:REWRITE LOGHEAD-SUM-SUBST)) (24 24 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (24 24 (:REWRITE LOGHEAD-SUBST2)) (24 24 (:REWRITE LOGHEAD-SUBST)) (24 24 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (24 24 (:REWRITE LOGHEAD-+-REDUCE)) (24 24 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (24 24 (:META META-RULE-ERIC)) (24 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (22 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (22 22 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (12 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-UNARY-MINUS)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-LOGEXT-HACK-3 (641 16 (:REWRITE LOGHEAD-IDENTITY)) (363 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (317 29 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (172 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (132 7 (:LINEAR LOGHEAD-LEQ)) (111 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (105 105 (:REWRITE POWER2-INTEGER)) (96 65 (:REWRITE DEFAULT-+-2)) (88 67 (:REWRITE DEFAULT-<-2)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 80 (:REWRITE USB-LINEAR-REWRITE)) (80 80 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (80 80 (:REWRITE EXPT-COMPARE)) (80 80 (:META CANCEL_PLUS-LESSP-CORRECT)) (75 67 (:REWRITE DEFAULT-<-1)) (65 65 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (58 58 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (58 29 (:REWRITE USB-TIGHTEN)) (49 49 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (49 7 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (45 28 (:REWRITE INTEGERP-+-MINUS-*-2)) (39 22 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 4 (:LINEAR EXPT->-1)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (29 29 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (29 29 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (24 24 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (24 24 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUBST2)) (22 22 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 22 (:META META-RULE-ERIC)) (21 14 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 4 (:REWRITE LOGBITP-+-USB-V4)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (15 4 (:REWRITE LOGBITP-+-USB-V1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (14 7 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (13 2 (:REWRITE LOGBITP-+-USB-V3)) (13 2 (:REWRITE LOGBITP-+-USB-V2)) (13 2 (:REWRITE LOGBITP-+-SIMPLE2)) (11 11 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (11 8 (:REWRITE DEFAULT-*-2)) (8 8 (:REWRITE DEFAULT-*-1)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (7 7 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-+-CANCEL-BETTER-ALT-1 (159 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (111 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-+-2)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGHEAD-OF-LOGEXT-HACK-4 (1700 21 (:REWRITE LOGHEAD-IDENTITY)) (1324 24 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (969 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (450 43 (:REWRITE <-+-CONSTANT-CONSTANT)) (432 98 (:REWRITE INTEGERP-+-MINUS-*-2)) (325 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (310 262 (:REWRITE POWER2-INTEGER)) (303 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (293 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (210 134 (:REWRITE EXPT-COMPARE)) (168 12 (:LINEAR EXPT->-1)) (160 149 (:REWRITE DEFAULT-+-1)) (156 12 (:LINEAR EXPT-LESS-THAN-1-HACK)) (152 4 (:LINEAR LOGHEAD-LEQ)) (139 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (134 134 (:REWRITE USB-LINEAR-REWRITE)) (134 134 (:META CANCEL_PLUS-LESSP-CORRECT)) (130 130 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (128 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (122 122 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (122 8 (:REWRITE LOGBITP-+-SIMPLE)) (120 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (113 91 (:REWRITE DEFAULT-<-2)) (110 58 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (109 91 (:REWRITE DEFAULT-<-1)) (98 98 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (82 41 (:REWRITE USB-TIGHTEN)) (80 80 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (80 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (78 78 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (70 62 (:REWRITE FOLD-CONSTS-IN-+)) (63 63 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE EXPO-EXPT2)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (49 49 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (48 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (41 41 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (36 8 (:REWRITE LOGBITP-+-USB-V4)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 23 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 8 (:REWRITE LOGBITP-+-USB-V1)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (26 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (26 4 (:REWRITE LOGBITP-+-USB-V3)) (26 4 (:REWRITE LOGBITP-+-USB-V2)) (26 4 (:REWRITE LOGBITP-+-SIMPLE2)) (24 24 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (24 24 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (24 24 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (24 23 (:META META-RULE-ERIC)) (24 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (23 23 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (23 23 (:REWRITE LOGHEAD-SUBST2)) (23 23 (:REWRITE LOGHEAD-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (22 22 (:REWRITE LOGHEAD-SUM-SUBST)) (22 22 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (22 22 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (22 22 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (22 22 (:REWRITE LOGHEAD-+-REDUCE)) (22 22 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (22 12 (:REWRITE DEFAULT-UNARY-MINUS)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (15 15 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (15 15 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (15 15 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (15 15 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 10 (:META CANCEL_PLUS-EQUAL-CORRECT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 6 (:REWRITE INTEGERP-+-MINUS-*-3)) (10 10 (:TYPE-PRESCRIPTION POWER2P)) (10 10 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1))) (LOGHEAD-OF-LOGEXT-HACK-5 (791 25 (:REWRITE LOGHEAD-IDENTITY)) (704 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (397 34 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (337 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (317 53 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (295 172 (:REWRITE DEFAULT-+-2)) (294 24 (:REWRITE LOGBITP-+-SIMPLE)) (267 78 (:REWRITE INTEGERP-+-MINUS-*-2)) (196 196 (:REWRITE POWER2-INTEGER)) (168 12 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (132 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (130 118 (:REWRITE FOLD-CONSTS-IN-+)) (120 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (116 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (108 108 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (106 106 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (106 53 (:REWRITE USB-TIGHTEN)) (92 4 (:LINEAR LOGHEAD-LEQ)) (84 12 (:REWRITE SIGNED-BYTE-P-+)) (78 78 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (77 77 (:TYPE-PRESCRIPTION LOGBITP)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (66 52 (:REWRITE DEFAULT-<-2)) (66 24 (:REWRITE LOGBITP-+-USB-V4)) (64 64 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 52 (:REWRITE DEFAULT-<-1)) (60 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (58 58 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (57 24 (:REWRITE LOGBITP-+-USB-V1)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 53 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (53 53 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (53 53 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (45 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (45 12 (:REWRITE LOGBITP-+-USB-V3)) (45 12 (:REWRITE LOGBITP-+-USB-V2)) (45 12 (:REWRITE LOGBITP-+-SIMPLE2)) (42 42 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (39 27 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (34 34 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (34 34 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (30 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (30 3 (:REWRITE LOGEXT-IDENTITY)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (28 28 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGHEAD-SUBST2)) (27 27 (:REWRITE LOGHEAD-SUBST)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (27 27 (:META META-RULE-ERIC)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (26 26 (:REWRITE LOGHEAD-SUM-SUBST)) (26 26 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (26 26 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (26 26 (:REWRITE LOGHEAD-+-REDUCE)) (26 26 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (21 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (20 2 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (18 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 11 (:REWRITE DEFAULT-*-2)) (14 10 (:REWRITE DEFAULT-UNARY-MINUS)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE DEFAULT-*-1)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (6 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 4 (:REWRITE INTEGERP-+-MINUS-*-3)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (INTEGERP-<-HACK (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (DIVIDES-HACK-MORE (6 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE RATIONALP-*)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-4))) (DIVIDES-16-HACK (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (17 17 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (11 3 (:REWRITE DIVIDES-SQUEEZE-HACK-3)) (11 1 (:REWRITE MOD-=-0 . 2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK-2)) (9 3 (:REWRITE DIVIDES-SQUEEZE-HACK)) (9 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (8 1 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (8 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGTAIL-OF-ONE-MORE (8535 89 (:REWRITE FLOOR-=-X/Y . 3)) (6148 918 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (5095 2153 (:REWRITE DEFAULT-*-2)) (4702 7 (:REWRITE FLOOR-=-X/Y . 4)) (4568 144 (:REWRITE RTL1)) (3871 205 (:REWRITE INTEGERP-+-MINUS-*-4)) (3599 2153 (:REWRITE DEFAULT-*-1)) (3497 144 (:REWRITE FLOOR-DETERMINED-1)) (3290 89 (:REWRITE FLOOR-=-X/Y . 2)) (2803 1128 (:REWRITE DEFAULT-+-2)) (2591 1665 (:REWRITE DEFAULT-<-2)) (2247 459 (:REWRITE DEFAULT-UNARY-/)) (2214 91 (:REWRITE INTEGERP-+-MINUS-*-2)) (2185 132 (:LINEAR X*Y>1-POSITIVE)) (2146 2146 (:REWRITE USB-LINEAR-REWRITE)) (1949 1128 (:REWRITE DEFAULT-+-1)) (1830 1665 (:REWRITE DEFAULT-<-1)) (1551 549 (:REWRITE EXPO-OF-NOT-RATIONALP)) (1310 1310 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1218 1218 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1214 115 (:REWRITE FLOOR-TYPE-3 . 3)) (1146 10 (:LINEAR MOD-TYPE . 2)) (1092 115 (:REWRITE FLOOR-TYPE-4 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (965 965 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (893 54 (:DEFINITION NATP)) (888 54 (:REWRITE NATP-RW)) (871 115 (:REWRITE FLOOR-TYPE-4 . 3)) (655 655 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (604 604 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (549 549 (:REWRITE EXPO-MINUS-ERIC)) (467 161 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (457 165 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (396 22 (:LINEAR FLOOR-TYPE-2 . 1)) (394 103 (:REWRITE RTL-A-MILLION)) (386 22 (:LINEAR FLOOR-TYPE-1 . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (380 380 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (356 22 (:LINEAR FLOOR-TYPE-2 . 2)) (350 350 (:REWRITE POWER2-INTEGER)) (340 340 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (298 22 (:LINEAR FLOOR-TYPE-1 . 1)) (222 82 (:REWRITE DEFAULT-UNARY-MINUS)) (220 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (198 165 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (181 45 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (175 19 (:REWRITE INTEGERP-+-MINUS-*-1)) (170 170 (:LINEAR EXPT-LESS-THAN-1-HACK)) (147 45 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (142 48 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (133 7 (:REWRITE INTEGERP-+-MINUS-*-3)) (127 127 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (120 40 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (118 91 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (107 13 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (90 86 (:REWRITE FOLD-CONSTS-IN-*)) (79 79 (:REWRITE REDUCE-INTEGERP-+-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION NATP)) (50 48 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (50 22 (:REWRITE SUM-POWER-OF-TWO)) (48 3 (:REWRITE <-*-RIGHT-CANCEL)) (41 4 (:REWRITE FLOOR-WHEN-<-2)) (41 1 (:REWRITE EVENP-COLLECT-1)) (40 5 (:REWRITE MOD-HELPER-1)) (30 10 (:LINEAR MOD-TYPE . 3)) (30 10 (:LINEAR MOD-TYPE . 1)) (30 1 (:REWRITE EVENP-+-ALT)) (26 6 (:REWRITE EVENP-COLLAPSE)) (24 8 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:REWRITE EQUAL-CONSTANT-+)) (13 13 (:TYPE-PRESCRIPTION EVENP)) (9 3 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (9 3 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (7 7 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (7 7 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-LOGBIT-REASSEMBLE (49 5 (:REWRITE LOGHEAD-IDENTITY)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (13 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (13 1 (:REWRITE ASH-0)) (12 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 10 (:REWRITE DEFAULT-<-1)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE DEFAULT-<-2)) (9 1 (:REWRITE ZIP-OPEN)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE USB-TIGHTEN)) (7 3 (:REWRITE LOGBIT-TOO-BIG)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE DEFAULT-*-1)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION IFIX)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT32HACK (94 5 (:REWRITE LOGEXT-IDENTITY)) (89 6 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 32 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (32 19 (:REWRITE DEFAULT-<-2)) (28 4 (:REWRITE EVENP-*)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (27 27 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 9 (:REWRITE DEFAULT-+-2)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-2 (585 16 (:REWRITE LOGBITP-+-SIMPLE)) (567 12 (:REWRITE LOGBITP-+-USB-V4)) (527 23 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (508 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (422 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (392 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (192 8 (:REWRITE LOGEXT-IDENTITY)) (182 10 (:REWRITE LOGHEAD-IDENTITY)) (156 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (130 2 (:REWRITE 0-<-*)) (128 2 (:REWRITE <-*-0)) (97 6 (:REWRITE EVENP-+-ALT)) (88 2 (:REWRITE EQUAL-LOGEXT-0)) (86 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (76 76 (:TYPE-PRESCRIPTION LOGBITP)) (75 16 (:REWRITE LOGBITP-+-USB-V1)) (64 32 (:REWRITE USB-TIGHTEN)) (62 62 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (59 8 (:REWRITE SIGNED-BYTE-P-+)) (56 39 (:REWRITE DEFAULT-<-2)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (53 6 (:REWRITE EVENP-)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (50 50 (:REWRITE EXPT-COMPARE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (48 4 (:DEFINITION IFF)) (46 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (44 6 (:REWRITE EVENP-*)) (43 39 (:REWRITE DEFAULT-<-1)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (40 36 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (40 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 22 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (37 6 (:REWRITE LOGBITP-+-USB-V3)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (35 8 (:REWRITE LOGBITP-+-USB-V2)) (35 8 (:REWRITE LOGBITP-+-SIMPLE2)) (33 33 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (31 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE POWER2-INTEGER)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 27 (:META CANCEL_TIMES-EQUAL-CORRECT)) (27 27 (:META CANCEL_PLUS-EQUAL-CORRECT)) (27 18 (:REWRITE DEFAULT-+-2)) (24 22 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (23 23 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (23 23 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (23 23 (:REWRITE EXPT-COMPARE-EQUAL)) (22 22 (:REWRITE LOGBITP-SUBST-2)) (22 22 (:REWRITE LOGBITP-SUBST)) (22 12 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE DEFAULT-+-1)) (16 8 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE DEFAULT-UNARY-MINUS)) (8 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (7 7 (:REWRITE LOGHEAD-SUBST-2)) (7 5 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE DEFAULT-*-1)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT32HACK-3 (260 6 (:REWRITE LOGHEAD-IDENTITY)) (258 40 (:REWRITE LOGCAR-EVENP)) (229 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (188 9 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (148 12 (:REWRITE EVENP-+-ALT)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (126 4 (:LINEAR LOGEXT-BOUND-UPPER)) (110 8 (:REWRITE LOGBITP-+-SIMPLE)) (110 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (108 108 (:TYPE-PRESCRIPTION EVENP)) (106 5 (:REWRITE LOGEXT-IDENTITY)) (79 67 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (72 8 (:LINEAR LOGEXT-BOUNDS-2)) (72 8 (:LINEAR LOGEXT-BOUNDS)) (68 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 37 (:REWRITE DEFAULT-<-2)) (56 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (54 6 (:REWRITE SIGNED-BYTE-P-+)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (44 39 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (44 37 (:REWRITE DEFAULT-<-1)) (33 32 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (31 8 (:REWRITE EVENP-)) (30 30 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 22 (:REWRITE DEFAULT-+-2)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (26 13 (:REWRITE USB-TIGHTEN)) (25 25 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 22 (:REWRITE DEFAULT-+-1)) (23 8 (:REWRITE LOGBITP-+-USB-V4)) (23 8 (:REWRITE LOGBITP-+-USB-V1)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (20 20 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 4 (:REWRITE LOGBITP-+-USB-V3)) (19 4 (:REWRITE LOGBITP-+-USB-V2)) (19 4 (:REWRITE LOGBITP-+-SIMPLE2)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (18 18 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 18 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE POWER2-INTEGER)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (14 14 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (14 14 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (14 14 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (14 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 7 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (9 9 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:META META-RULE-ERIC)) (6 5 (:REWRITE EVENP-OF-LOGEXT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-4 (296 20 (:REWRITE EVENP-+-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (87 10 (:REWRITE EVENP-)) (72 10 (:REWRITE EVENP-*)) (70 64 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (52 2 (:LINEAR LOGEXT-BOUND-UPPER)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 14 (:REWRITE DEFAULT-+-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 16 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 15 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE DEFAULT-*-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-UNARY-MINUS)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-6 (224 6 (:LINEAR LOGEXT-BOUND-UPPER)) (166 2 (:REWRITE LOGHEAD-IDENTITY)) (142 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (135 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (117 5 (:REWRITE LOGEXT-IDENTITY)) (112 2 (:REWRITE <-+-NEGATIVE-0-1)) (108 12 (:LINEAR LOGEXT-BOUNDS-2)) (108 12 (:LINEAR LOGEXT-BOUNDS)) (103 24 (:REWRITE LOGCAR-EVENP)) (69 40 (:REWRITE DEFAULT-<-2)) (54 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (44 44 (:REWRITE USB-LINEAR-REWRITE)) (44 44 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (44 44 (:REWRITE EXPT-COMPARE)) (44 44 (:META CANCEL_PLUS-LESSP-CORRECT)) (43 40 (:REWRITE DEFAULT-<-1)) (42 42 (:TYPE-PRESCRIPTION EVENP)) (35 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (31 31 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 2 (:REWRITE EVENP-+-ALT)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (28 28 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (28 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (25 2 (:REWRITE SIGNED-BYTE-P-+)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (22 19 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 20 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (17 4 (:REWRITE EVENP-)) (17 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 1 (:LINEAR EXPT->-1)) (14 14 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (11 11 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE DEFAULT-+-2)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (10 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 8 (:REWRITE DEFAULT-+-1)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 3 (:REWRITE EVENP-OF-LOGEXT)) (4 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:META META-RULE-ERIC)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (LOGEXT32HACK-7 (94 5 (:REWRITE LOGEXT-IDENTITY)) (43 2 (:REWRITE EVENP-+-ALT)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:REWRITE LOGHEAD-IDENTITY)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (32 19 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (23 21 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (21 21 (:REWRITE POWER2-INTEGER)) (21 19 (:REWRITE DEFAULT-<-1)) (20 20 (:REWRITE USB-LINEAR-REWRITE)) (20 20 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (20 20 (:REWRITE EXPT-COMPARE)) (20 20 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (14 2 (:REWRITE EVENP-*)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (10 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 3 (:REWRITE DEFAULT-*-2)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-*-1)) (2 2 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-5 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 19 (:REWRITE DEFAULT-+-2)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (20 19 (:REWRITE DEFAULT-+-1)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGEXT32HACK-8 (182 12 (:REWRITE EVENP-+-ALT)) (159 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (94 5 (:REWRITE LOGEXT-IDENTITY)) (81 4 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (49 45 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (49 4 (:REWRITE LOGBITP-+-SIMPLE)) (48 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (43 5 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (42 6 (:REWRITE EVENP-*)) (42 2 (:REWRITE SIGNED-BYTE-P-OF-LOGCAR)) (42 2 (:LINEAR LOGEXT-BOUND-UPPER)) (38 25 (:REWRITE DEFAULT-<-2)) (36 4 (:LINEAR LOGEXT-BOUNDS-2)) (36 4 (:LINEAR LOGEXT-BOUNDS)) (33 33 (:REWRITE POWER2-INTEGER)) (32 32 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (28 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (27 25 (:REWRITE DEFAULT-<-1)) (23 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 18 (:REWRITE DEFAULT-+-2)) (21 21 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (18 18 (:REWRITE DEFAULT-+-1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 4 (:LINEAR LOGCAR-RANGE-LINEAR)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (15 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (14 14 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (14 14 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (14 14 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR X*Y>1-POSITIVE)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:REWRITE FOLD-CONSTS-IN-+)) (8 5 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 5 (:REWRITE DEFAULT-*-2)) (6 2 (:REWRITE LOGCAR-0-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE DEFAULT-*-1)) (5 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGEXT-CASE (372 6 (:LINEAR LOGTAIL-LEQ)) (306 4 (:REWRITE LOGTAIL-LESSP)) (296 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (292 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (172 1 (:REWRITE ASH-0)) (168 1 (:REWRITE ZIP-OPEN)) (160 20 (:LINEAR LOGEXT-BOUNDS-2)) (160 20 (:LINEAR LOGEXT-BOUNDS)) (134 106 (:REWRITE DEFAULT-<-1)) (114 114 (:REWRITE USB-LINEAR-REWRITE)) (114 114 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (114 114 (:REWRITE EXPT-COMPARE)) (114 114 (:META CANCEL_PLUS-LESSP-CORRECT)) (112 106 (:REWRITE DEFAULT-<-2)) (90 10 (:LINEAR LOGEXT-BOUND-UPPER)) (80 10 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (52 2 (:REWRITE LOGTAIL-IDENTITY)) (42 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (35 35 (:REWRITE POWER2-INTEGER)) (35 1 (:REWRITE LOGTAIL-EQUAL-0)) (28 28 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 25 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (25 5 (:REWRITE USBP-LOGEXT-NARROWER)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (12 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGAPP-RECOMBINE-LOGHEAD-CASE (662 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (325 19 (:REWRITE LOGHEAD-IDENTITY)) (274 1 (:REWRITE ASH-0)) (270 1 (:REWRITE ZIP-OPEN)) (255 38 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (210 8 (:REWRITE LOGTAIL-IDENTITY)) (156 134 (:REWRITE DEFAULT-<-1)) (149 134 (:REWRITE DEFAULT-<-2)) (144 144 (:REWRITE USB-LINEAR-REWRITE)) (144 144 (:REWRITE EXPT-COMPARE)) (144 144 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 12 (:LINEAR LOGHEAD-LEQ)) (88 8 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (82 17 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (82 10 (:LINEAR EXPT->-1)) (78 78 (:REWRITE POWER2-INTEGER)) (76 38 (:REWRITE USB-TIGHTEN)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (41 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (41 38 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (41 35 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (39 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 38 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (38 38 (:REWRITE LOGHEAD-SUBST2)) (38 38 (:META META-RULE-ERIC)) (36 1 (:REWRITE LOGTAIL-EQUAL-0)) (34 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 32 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (23 21 (:REWRITE DEFAULT-+-2)) (21 21 (:REWRITE DEFAULT-+-1)) (21 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (16 8 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-<)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (12 12 (:META CANCEL_TIMES-EQUAL-CORRECT)) (12 12 (:META CANCEL_PLUS-EQUAL-CORRECT)) (10 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (8 8 (:REWRITE EQUAL-CONSTANT-+)) (6 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (3 3 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 2 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:DEFINITION FIX)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (LOGHEAD-SUM-WEIRD (561 16 (:REWRITE LOGHEAD-IDENTITY)) (279 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (262 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (207 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (144 4 (:LINEAR LOGHEAD-LEQ)) (115 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (84 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (80 8 (:REWRITE LOGBITP-+-SIMPLE)) (67 53 (:REWRITE DEFAULT-<-2)) (63 63 (:REWRITE USB-LINEAR-REWRITE)) (63 63 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (63 63 (:REWRITE EXPT-COMPARE)) (63 63 (:META CANCEL_PLUS-LESSP-CORRECT)) (61 53 (:REWRITE DEFAULT-<-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (58 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (50 50 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (44 44 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 38 (:TYPE-PRESCRIPTION LOGBITP)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (36 23 (:REWRITE DEFAULT-+-2)) (34 34 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (34 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (32 4 (:LINEAR LOGEXT-BOUNDS-2)) (32 4 (:LINEAR LOGEXT-BOUNDS)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 23 (:REWRITE DEFAULT-+-1)) (27 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE LOGBITP-+-USB-V4)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 8 (:REWRITE LOGBITP-+-USB-V1)) (18 18 (:REWRITE LOGHEAD-SUBST2)) (18 18 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 2 (:LINEAR LOGEXT-BOUND-UPPER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 4 (:REWRITE LOGBITP-+-USB-V3)) (15 4 (:REWRITE LOGBITP-+-USB-V2)) (15 4 (:REWRITE LOGBITP-+-SIMPLE2)) (14 2 (:REWRITE SIGNED-BYTE-P-+)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (12 12 (:REWRITE LOGHEAD-SUM-SUBST)) (12 12 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 12 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE LOGHEAD-+-REDUCE)) (12 12 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 6 (:DEFINITION FIX)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (8 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-CHOP-HACK-1 (234 4 (:REWRITE LOGHEAD-IDENTITY)) (180 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (146 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 1 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (66 66 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (66 9 (:REWRITE <-+-CONSTANT-CONSTANT)) (47 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (31 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (31 4 (:REWRITE LOGBITP-+-SIMPLE)) (30 23 (:REWRITE DEFAULT-<-1)) (30 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (30 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (24 12 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (23 23 (:REWRITE DEFAULT-<-2)) (19 4 (:REWRITE LOGBITP-+-USB-V4)) (19 4 (:REWRITE LOGBITP-+-USB-V1)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE LOGBITP-+-USB-V3)) (17 2 (:REWRITE LOGBITP-+-USB-V2)) (17 2 (:REWRITE LOGBITP-+-SIMPLE2)) (16 8 (:REWRITE USB-TIGHTEN)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (15 12 (:REWRITE DEFAULT-+-2)) (15 1 (:LINEAR EXPT->-1)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 12 (:REWRITE DEFAULT-+-1)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (12 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 4 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 5 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (5 5 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (5 5 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (5 5 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (5 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD))) (HACK-BLAH (566 4 (:LINEAR LOGHEAD-LEQ)) (508 4 (:REWRITE <-*-0)) (232 14 (:REWRITE LOGHEAD-IDENTITY)) (182 4 (:DEFINITION IFF)) (104 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (96 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (96 12 (:LINEAR LOGEXT-BOUNDS-2)) (96 12 (:LINEAR LOGEXT-BOUNDS)) (94 82 (:REWRITE DEFAULT-<-2)) (87 87 (:REWRITE USB-LINEAR-REWRITE)) (87 87 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (87 87 (:REWRITE EXPT-COMPARE)) (87 87 (:META CANCEL_PLUS-LESSP-CORRECT)) (84 82 (:REWRITE DEFAULT-<-1)) (66 66 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (49 49 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (48 6 (:LINEAR LOGEXT-BOUND-UPPER)) (36 36 (:TYPE-PRESCRIPTION LOGEXT-TYPE)) (32 32 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (32 16 (:REWRITE USB-TIGHTEN)) (28 4 (:LINEAR X*Y>1-POSITIVE)) (24 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (24 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (23 23 (:REWRITE POWER2-INTEGER)) (22 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (21 19 (:META CANCEL_PLUS-EQUAL-CORRECT)) (21 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGBITP)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (19 19 (:META CANCEL_TIMES-EQUAL-CORRECT)) (18 4 (:REWRITE EQUAL-LOGEXT-0)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (17 17 (:REWRITE EXPT-COMPARE-EQUAL)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (12 12 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 2 (:REWRITE LOGEXT-IDENTITY)) (10 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (9 9 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 6 (:REWRITE DEFAULT-*-2)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 6 (:REWRITE DEFAULT-*-1)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 4 (:REWRITE DEFAULT-+-2)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGAPP-HACK-3 (284 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (202 10 (:REWRITE LOGHEAD-IDENTITY)) (145 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (129 12 (:REWRITE LOGBITP-+-SIMPLE)) (86 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (82 82 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (61 12 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (59 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (38 38 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (38 27 (:REWRITE DEFAULT-+-2)) (38 19 (:REWRITE USB-TIGHTEN)) (34 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 27 (:REWRITE DEFAULT-+-1)) (31 31 (:TYPE-PRESCRIPTION LOGBITP)) (29 29 (:REWRITE USB-LINEAR-REWRITE)) (29 29 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (29 29 (:REWRITE EXPT-COMPARE)) (29 29 (:META CANCEL_PLUS-LESSP-CORRECT)) (28 4 (:REWRITE SIGNED-BYTE-P-+)) (27 12 (:REWRITE LOGBITP-+-USB-V4)) (27 12 (:REWRITE LOGBITP-+-USB-V1)) (24 24 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (22 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (21 21 (:REWRITE DEFAULT-<-2)) (21 21 (:REWRITE DEFAULT-<-1)) (21 6 (:REWRITE LOGBITP-+-USB-V3)) (21 6 (:REWRITE LOGBITP-+-USB-V2)) (21 6 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (19 19 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (16 12 (:REWRITE FOLD-CONSTS-IN-+)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 6 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 4 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (12 12 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (12 12 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:META META-RULE-ERIC)) (12 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (8 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (7 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-+-REDUCE)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TOO-BIG)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 4 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-*-2)) (5 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (4 4 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGAPP-HACK-4 (348 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (192 10 (:REWRITE LOGHEAD-IDENTITY)) (189 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (178 16 (:REWRITE LOGBITP-+-SIMPLE)) (112 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 86 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (76 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (51 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 21 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (42 42 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 21 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE SIGNED-BYTE-P-+)) (37 37 (:TYPE-PRESCRIPTION LOGBITP)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 27 (:REWRITE DEFAULT-+-2)) (31 16 (:REWRITE LOGBITP-+-USB-V4)) (31 16 (:REWRITE LOGBITP-+-USB-V1)) (27 27 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 27 (:REWRITE DEFAULT-+-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (24 24 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (24 24 (:REWRITE EXPT-COMPARE)) (24 24 (:META CANCEL_PLUS-LESSP-CORRECT)) (24 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (23 8 (:REWRITE LOGBITP-+-USB-V3)) (23 8 (:REWRITE LOGBITP-+-USB-V2)) (23 8 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 21 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (21 21 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 13 (:REWRITE FOLD-CONSTS-IN-+)) (18 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE DEFAULT-<-2)) (16 16 (:REWRITE DEFAULT-<-1)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (14 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:META META-RULE-ERIC)) (10 1 (:REWRITE LOGEXT-IDENTITY)) (9 9 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (5 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 3 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE DEFAULT-*-1)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (2 2 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (1 1 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGHEAD-HACK-BLAH (704 11 (:REWRITE LOGHEAD-IDENTITY)) (440 7 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (286 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (174 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (84 4 (:LINEAR LOGHEAD-LEQ)) (83 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (72 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (70 7 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (66 56 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (60 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (56 56 (:REWRITE USB-LINEAR-REWRITE)) (56 56 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (56 56 (:REWRITE EXPT-COMPARE)) (56 56 (:META CANCEL_PLUS-LESSP-CORRECT)) (51 51 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (50 44 (:REWRITE DEFAULT-<-1)) (48 24 (:REWRITE USB-TIGHTEN)) (45 44 (:REWRITE DEFAULT-<-2)) (38 3 (:LINEAR EXPT->-1)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 2 (:REWRITE <-+-NEGATIVE-0-1)) (24 24 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (19 18 (:REWRITE DEFAULT-+-2)) (19 18 (:REWRITE DEFAULT-+-1)) (19 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (14 7 (:REWRITE DEFAULT-UNARY-MINUS)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (10 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:REWRITE LOGHEAD-<=)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (7 7 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE MINUS-CANCELLATION-ON-LEFT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE FIX-DOES-NOTHING)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE UNICITY-OF-0))) (LOGHEAD-CANCEL-SIGH (205 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (101 6 (:REWRITE LOGHEAD-IDENTITY)) (66 6 (:REWRITE LOGBITP-+-SIMPLE)) (65 3 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (52 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (45 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (38 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (34 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 6 (:REWRITE LOGBITP-+-USB-V4)) (20 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (19 19 (:REWRITE POWER2-INTEGER)) (19 18 (:REWRITE DEFAULT-+-2)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (18 18 (:REWRITE DEFAULT-+-1)) (17 6 (:REWRITE LOGBITP-+-USB-V1)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (15 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 3 (:REWRITE LOGBITP-+-USB-V3)) (14 3 (:REWRITE LOGBITP-+-USB-V2)) (14 3 (:REWRITE LOGBITP-+-SIMPLE2)) (13 1 (:REWRITE SIGNED-BYTE-P-+)) (12 12 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (12 6 (:DEFINITION FIX)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (8 3 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (7 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 6 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 6 (:REWRITE FIX-DOES-NOTHING)) (7 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (6 6 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (6 6 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:META META-RULE-ERIC)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 4 (:REWRITE DEFAULT-<-2)) (5 3 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (3 3 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (3 3 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (3 3 (:REWRITE LOGHEAD-COMPARE-HACK)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE LOGHEAD-CANCEL-CONSTANTS-HACK))) (LOGEXT-SUBST2 (180 18 (:REWRITE LOGEXT-IDENTITY)) (111 8 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (49 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (48 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 36 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (29 29 (:REWRITE POWER2-INTEGER)) (28 22 (:REWRITE DEFAULT-<-1)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 18 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (18 18 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 18 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:META META-RULE-ERIC)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGEXT-SUBST2-ALT (171 18 (:REWRITE LOGEXT-IDENTITY)) (100 6 (:REWRITE LOGHEAD-IDENTITY)) (68 68 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (54 38 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (46 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:LINEAR LOGEXT-BOUND-UPPER)) (35 19 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 18 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (34 34 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (28 22 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE POWER2-INTEGER)) (25 25 (:REWRITE USB-LINEAR-REWRITE)) (25 25 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (25 25 (:REWRITE EXPT-COMPARE)) (25 25 (:META CANCEL_PLUS-LESSP-CORRECT)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (22 22 (:REWRITE DEFAULT-<-2)) (22 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (20 20 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 18 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (17 17 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (17 17 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (17 17 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (17 17 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER (1693 98 (:REWRITE LOGHEAD-IDENTITY)) (898 130 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (863 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (549 53 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (513 513 (:REWRITE USB-LINEAR-REWRITE)) (506 148 (:REWRITE USB-TIGHTEN)) (481 481 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (481 481 (:REWRITE EXPT-COMPARE)) (441 441 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (299 271 (:REWRITE DEFAULT-<-1)) (272 271 (:REWRITE DEFAULT-<-2)) (206 14 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (188 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (185 185 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (171 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (168 111 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (147 147 (:REWRITE POWER2-INTEGER)) (137 137 (:META META-RULE-ERIC)) (133 120 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (131 130 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (130 130 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (130 130 (:REWRITE DEFAULT-+-2)) (130 130 (:REWRITE DEFAULT-+-1)) (121 121 (:REWRITE LOGHEAD-SUBST)) (105 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (105 9 (:REWRITE ASH-AS-LOGTAIL)) (91 53 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (89 6 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (73 73 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (73 60 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (63 17 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (54 54 (:REWRITE LOGBITP-TOO-BIG)) (51 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (50 50 (:META CANCEL_TIMES-EQUAL-CORRECT)) (50 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (43 41 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (42 18 (:REWRITE LOGBIT-TOO-BIG)) (36 18 (:REWRITE LOGBIT-SUBST-SIMPLER)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (33 18 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (28 28 (:REWRITE EXPT-COMPARE-EQUAL)) (27 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (26 26 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (22 14 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (20 2 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (19 3 (:REWRITE COMMUTATIVITY-2-OF-+)) (18 18 (:REWRITE LOGBIT-SUBST)) (18 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 4 (:REWRITE COMMUTATIVITY-OF-+)) (15 15 (:REWRITE LOGHEAD-COMPARE-HACK)) (15 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (15 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE DEFAULT-UNARY-MINUS)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 9 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (9 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 9 (:REWRITE ASH-0)) (6 6 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (5 5 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE INVERSE-OF-+)) (4 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (4 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE ASH-1-WHEN-C-IS-NEGATIVE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (1 1 (:TYPE-PRESCRIPTION POWER2P))) (EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT) (SHOW-BITS-AUX (33 4 (:REWRITE FLOOR-WHEN-<-2)) (10 10 (:REWRITE USB-LINEAR-REWRITE)) (10 10 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (10 10 (:REWRITE EXPT-COMPARE)) (10 10 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE DEFAULT-<-2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-3 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 2)) (7 7 (:TYPE-PRESCRIPTION FLOOR-TYPE-1 . 1)) (7 1 (:REWRITE <-*-/-LEFT-COMMUTED)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (5 5 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (2 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE INTEGERP==>DENOMINATOR=1)) (1 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (1 1 (:REWRITE DEFAULT-NUMERATOR)) (1 1 (:REWRITE DEFAULT-DENOMINATOR))) (SHOW-BITS) (LOGAPP-RECOLLAPSE (526 24 (:REWRITE LOGHEAD-IDENTITY)) (286 33 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (273 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (133 105 (:REWRITE EXPT-COMPARE)) (113 9 (:LINEAR LOGHEAD-LEQ)) (107 97 (:REWRITE DEFAULT-<-2)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (105 97 (:REWRITE DEFAULT-<-1)) (103 103 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (98 6 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (85 9 (:LINEAR EXPT->-1)) (76 76 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 33 (:REWRITE USB-TIGHTEN)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (49 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 28 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 2 (:REWRITE LOGTAIL-IDENTITY)) (34 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (33 33 (:TYPE-PRESCRIPTION LOGBITP)) (33 33 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (33 33 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (33 33 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (32 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (31 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 8 (:META CANCEL_PLUS-EQUAL-CORRECT)) (29 29 (:REWRITE POWER2-INTEGER)) (29 29 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (29 29 (:REWRITE LOGHEAD-SUBST2)) (29 29 (:REWRITE LOGHEAD-SUBST)) (29 29 (:META META-RULE-ERIC)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (23 23 (:REWRITE <-+-CONSTANT-CONSTANT)) (23 15 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE ASH-0)) (22 22 (:REWRITE DEFAULT-+-2)) (22 22 (:REWRITE DEFAULT-+-1)) (19 1 (:REWRITE ZIP-OPEN)) (18 18 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (18 2 (:LINEAR LOGTAIL-LEQ)) (18 1 (:REWRITE NORMALIZE-EQUAL-0)) (16 16 (:TYPE-PRESCRIPTION LOGTAIL-TYPE)) (15 2 (:REWRITE LOGTAIL-LESSP)) (12 4 (:REWRITE DEFAULT-*-2)) (12 1 (:REWRITE EQUAL-MINUS-MINUS)) (11 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (10 4 (:REWRITE DEFAULT-*-1)) (9 9 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (9 1 (:REWRITE ASH-GOES-TO-0)) (8 8 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE EQUAL-LOGHEAD-ASH-POS)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-NEG-LOGHEAD)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE TIMES-ZERO)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION))) (DPI:NAME:<NAME>END_PI) (MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (1 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (1 1 (:LINEAR X*Y>1-POSITIVE))) (MULTIPLY-BY-POSITIVE-INTEGER-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (TINY-ADDEND-DOESNT-MATTER-WHEN-COMPARING-INTEGERS (7 5 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2-INTEGER)) (2 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (NON-MULTIPLE-ADDEND-DOESNT-MATTER-WHEN-COMPARING-MULTIPLES (206 6 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (82 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (79 24 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (78 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (78 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (48 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (46 46 (:REWRITE USB-LINEAR-REWRITE)) (46 46 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (46 46 (:REWRITE EXPT-COMPARE)) (46 46 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 6 (:LINEAR X*Y>1-POSITIVE)) (42 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (37 7 (:REWRITE EQUAL-1-HACK)) (34 34 (:REWRITE DEFAULT-<-2)) (34 34 (:REWRITE DEFAULT-<-1)) (32 32 (:REWRITE DEFAULT-*-2)) (32 32 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE DEFAULT-UNARY-/)) (11 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (9 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (4 4 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED (84 84 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (84 50 (:REWRITE DEFAULT-<-2)) (76 50 (:REWRITE DEFAULT-<-1)) (62 22 (:REWRITE DEFAULT-*-2)) (58 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (56 7 (:LINEAR EXPT->-1)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (28 22 (:REWRITE DEFAULT-*-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (13 5 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (4 4 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (4 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (COMPARE-OF-ADD-TO-SHIFTED-NEG (52 52 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (48 32 (:REWRITE DEFAULT-<-1)) (43 43 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (43 43 (:REWRITE EXPT-COMPARE)) (43 43 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 32 (:REWRITE DEFAULT-<-2)) (38 14 (:REWRITE DEFAULT-+-2)) (35 13 (:REWRITE DEFAULT-*-2)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (28 14 (:REWRITE DEFAULT-+-1)) (28 1 (:REWRITE INTEGERP-+-MINUS-*-4)) (26 26 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (22 8 (:REWRITE DEFAULT-UNARY-MINUS)) (19 13 (:REWRITE DEFAULT-*-1)) (15 5 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 2 (:REWRITE EXPT-COMPARE-EQUAL)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (7 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE EXPO-SHIFT-CONSTANT))) (ARITHHACK3 (19 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE DEFAULT-*-1)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 1 (:REWRITE EQUAL-1-HACK)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE DEFAULT-+-1)) (5 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (3 3 (:REWRITE DEFAULT-UNARY-/)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE FOLD-CONSTS-IN-*)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-NUMERATOR))) (ARITHHACK4 (84 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (48 48 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (21 7 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR EXPT->-1)) (15 5 (:REWRITE DEFAULT-*-2)) (13 7 (:REWRITE DEFAULT-+-1)) (12 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 10 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 6 (:REWRITE DEFAULT-<-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 5 (:REWRITE DEFAULT-*-1)) (7 7 (:REWRITE USB-LINEAR-REWRITE)) (7 7 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (7 7 (:REWRITE EXPT-COMPARE)) (7 7 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-FW (804 2 (:REWRITE SIGNED-BYTE-P-+)) (217 20 (:LINEAR EXPT->-1)) (198 11 (:REWRITE LOGHEAD-IDENTITY)) (193 116 (:REWRITE EXPT-COMPARE)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND)) (172 40 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (144 4 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (128 30 (:REWRITE <-+-CONSTANT-CONSTANT)) (125 79 (:REWRITE DEFAULT-<-1)) (116 116 (:REWRITE USB-LINEAR-REWRITE)) (116 116 (:META CANCEL_PLUS-LESSP-CORRECT)) (113 113 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 98 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (106 79 (:REWRITE DEFAULT-<-2)) (99 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (99 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (94 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (77 38 (:REWRITE DEFAULT-+-2)) (76 55 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (74 8 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (70 2 (:REWRITE LOGHEAD-<)) (70 2 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (67 20 (:LINEAR EXPT-LESS-THAN-1-HACK)) (56 1 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (55 38 (:REWRITE DEFAULT-+-1)) (51 20 (:REWRITE DEFAULT-*-2)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 1 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (45 1 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (41 5 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (36 4 (:LINEAR LOGHEAD-LEQ)) (34 14 (:REWRITE DEFAULT-UNARY-MINUS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (26 13 (:REWRITE USB-TIGHTEN)) (24 20 (:REWRITE DEFAULT-*-1)) (22 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE POWER2-INTEGER)) (17 10 (:REWRITE EXPONENTS-ADD)) (15 11 (:REWRITE FOLD-CONSTS-IN-+)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (13 13 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (13 3 (:REWRITE EXPT-COMPARE-EQUAL)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:TYPE-PRESCRIPTION POWER2P)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (9 9 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (7 7 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE POWER2P-EXPT2-I)) (7 7 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (6 6 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (6 3 (:REWRITE POWER2P-INVERSE)) (5 1 (:REWRITE DEFAULT-UNARY-/)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (SIGNED-BYTE-P-OF-LOGAPP-BK (730 2 (:REWRITE SIGNED-BYTE-P-+)) (358 150 (:REWRITE EXPT-COMPARE)) (204 150 (:REWRITE USB-LINEAR-REWRITE)) (180 10 (:REWRITE LOGHEAD-IDENTITY)) (162 138 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 98 (:REWRITE DEFAULT-<-1)) (150 150 (:META CANCEL_PLUS-LESSP-CORRECT)) (143 143 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (132 98 (:REWRITE DEFAULT-<-2)) (131 2 (:REWRITE *-PRESERVES->=-FOR-NONNEGATIVES)) (124 68 (:REWRITE DEFAULT-+-2)) (114 6 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (109 77 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (101 6 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (100 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (99 68 (:REWRITE DEFAULT-+-1)) (94 37 (:REWRITE DEFAULT-*-2)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (77 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (59 2 (:REWRITE X*Y>1-POSITIVE-LEMMA)) (59 2 (:REWRITE *-PRESERVES->-FOR-NONNEGATIVES-1)) (56 22 (:REWRITE DEFAULT-UNARY-MINUS)) (56 2 (:REWRITE LOGHEAD-<)) (53 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (50 37 (:REWRITE DEFAULT-*-1)) (49 21 (:REWRITE EXPONENTS-ADD)) (49 4 (:REWRITE EXPO-SHIFT-CONSTANT)) (48 48 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (43 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (39 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (27 3 (:REWRITE EXPO-/-POWER2P-ALT)) (27 3 (:LINEAR LOGHEAD-LEQ)) (26 18 (:REWRITE FOLD-CONSTS-IN-+)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (24 12 (:REWRITE USB-TIGHTEN)) (20 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (18 2 (:REWRITE <-UNARY-/-POSITIVE-RIGHT)) (17 17 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (15 3 (:REWRITE DEFAULT-UNARY-/)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (12 12 (:TYPE-PRESCRIPTION LOGBITP)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (7 7 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 2 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (3 3 (:TYPE-PRESCRIPTION EXPO-INTEGER-TYPE)) (3 3 (:REWRITE FOLD-CONSTS-IN-*)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (SIGNED-BYTE-P-OF-LOGAPP (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (262 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (126 42 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (126 6 (:LINEAR EXPT->-1)) (78 24 (:REWRITE <-+-CONSTANT-CONSTANT)) (77 47 (:REWRITE DEFAULT-<-1)) (72 4 (:REWRITE LOGHEAD-IDENTITY)) (62 62 (:REWRITE USB-LINEAR-REWRITE)) (62 62 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (62 62 (:REWRITE EXPT-COMPARE)) (62 62 (:META CANCEL_PLUS-LESSP-CORRECT)) (59 29 (:REWRITE DEFAULT-+-2)) (53 47 (:REWRITE DEFAULT-<-2)) (42 42 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (40 40 (:REWRITE POWER2-INTEGER)) (36 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (29 29 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (18 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 6 (:LINEAR EXPT-LESS-THAN-1-HACK)) (13 13 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (12 12 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (12 12 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (10 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 9 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (8 4 (:REWRITE USB-TIGHTEN)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 5 (:REWRITE IFIX-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-TYPE)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (6 6 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (6 6 (:REWRITE EXPONENTS-ADD)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC))) (LOGEXT-SUBST-WITH-LOGHEAD (191 20 (:REWRITE LOGEXT-IDENTITY)) (90 5 (:REWRITE LOGHEAD-IDENTITY)) (66 66 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (56 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (39 20 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (38 38 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (36 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (35 31 (:REWRITE DEFAULT-<-1)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (33 33 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (33 33 (:REWRITE EXPT-COMPARE)) (33 33 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 8 (:REWRITE DEFAULT-UNARY-MINUS)) (31 31 (:REWRITE LOGEXT-SUBST2-ALT)) (31 31 (:REWRITE LOGEXT-SUBST2)) (31 31 (:REWRITE DEFAULT-<-2)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (26 26 (:REWRITE POWER2-INTEGER)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (19 19 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (19 19 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (19 19 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (19 19 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (18 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (18 2 (:LINEAR LOGHEAD-LEQ)) (16 16 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (16 16 (:REWRITE EXPONENTS-ADD)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (14 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (5 5 (:META META-RULE-ERIC)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LOGHEAD-EQUAL-TO-DIVIDES (738 2 (:REWRITE CANCEL-MOD-+-BASIC)) (720 6 (:REWRITE DIVIDES-HACK2)) (264 3 (:LINEAR MOD-TYPE . 2)) (244 1 (:REWRITE INTEGERP-+-MINUS-*-1)) (236 1 (:REWRITE INTEGERP-UNARY-)) (147 6 (:LINEAR MOD-BOUNDED-BY-MODULUS)) (131 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (126 3 (:LINEAR MOD-TYPE . 4)) (119 20 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (118 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (106 20 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (84 7 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (80 80 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (52 52 (:REWRITE USB-LINEAR-REWRITE)) (52 52 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (48 48 (:REWRITE DEFAULT-<-2)) (48 48 (:REWRITE DEFAULT-<-1)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (29 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (26 26 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 20 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (20 20 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (20 20 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (20 4 (:REWRITE COMMUTATIVITY-OF-+)) (16 8 (:REWRITE USB-TIGHTEN)) (15 5 (:REWRITE COMMUTATIVITY-OF-*)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (10 10 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE DEFAULT-*-1)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (10 1 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (9 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE UNICITY-OF-0)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (7 7 (:META META-RULE-ERIC)) (7 1 (:REWRITE FUNCTIONAL-COMMUTATIVITY-OF-MINUS-*-LEFT)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EXPT-COMPARE-EQUAL)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:LINEAR MOD-TYPE . 3)) (3 3 (:LINEAR MOD-TYPE . 1)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (1 1 (:REWRITE LOGHEAD-SUM-SUBST)) (1 1 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE LOGHEAD-SUBST-WEIRD)) (1 1 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE LOGHEAD-+-REDUCE)) (1 1 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION))) (LOGHEAD-EQUAL-TO-DIVIDES2 (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 3)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 2)) (22 22 (:TYPE-PRESCRIPTION MOD-TYPE . 1)) (10 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 3)) (10 1 (:REWRITE LOGHEAD-IDENTITY)) (9 2 (:REWRITE MOD-X-Y-=-X-FOR-RATIONALS . 2)) (9 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 2)) (8 2 (:REWRITE MOD-X-Y-=-X+Y-FOR-RATIONALS . 3)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE THIS-NEEDS-TO-BE-ADDED-TO-QUOTIENT-REMAINDER-LEMMAS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE MOD-WHEN-Y-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE MOD-WHEN-X-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:META META-RULE-ERIC))) (LOGHEAD8-PLUS-TIMES-256 (116 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (99 6 (:REWRITE LOGHEAD-IDENTITY)) (48 2 (:REWRITE LOGBITP-+-SIMPLE)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 12 (:REWRITE USB-TIGHTEN)) (21 2 (:REWRITE LOGBITP-+-USB-V4)) (17 2 (:LINEAR LOGHEAD-LEQ)) (15 2 (:REWRITE LOGBITP-+-USB-V1)) (12 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 12 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 1 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 9 (:REWRITE LOGBITP-SUBST-2)) (9 9 (:REWRITE LOGBITP-SUBST)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGBITP-+-USB-V3)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (7 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGBITP-+-USB-V2)) (7 1 (:REWRITE LOGBITP-+-SIMPLE2)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 2 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 1 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (2 2 (:TYPE-PRESCRIPTION POWER2P)) (2 2 (:REWRITE USB-LINEAR-REWRITE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (2 2 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE EXPT-COMPARE)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META CANCEL_PLUS-LESSP-CORRECT)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-LEMMA (10 5 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE DEFAULT-*-1))) (SIGNED-BYTE-P-OF-MINUS-2-TO-THE-SIZE-MINUS-ONE (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (3 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGEXT-OF-2-TO-THE-SIZE-MINUS-ONE (98 98 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (43 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (30 1 (:REWRITE LOGTAIL-IDENTITY)) (25 25 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (17 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (9 6 (:REWRITE DEFAULT-+-2)) (9 6 (:REWRITE DEFAULT-+-1)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (3 3 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MINUS-OF-LOGEXT (1304 28 (:REWRITE LOGEXT-IDENTITY)) (550 132 (:REWRITE EXPT-COMPARE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (543 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (177 177 (:REWRITE USB-LINEAR-REWRITE)) (177 177 (:META CANCEL_PLUS-LESSP-CORRECT)) (159 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (154 44 (:REWRITE EXPO-OF-NOT-RATIONALP)) (154 9 (:REWRITE LOGHEAD-IDENTITY)) (121 9 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (121 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (121 9 (:REWRITE ASH-AS-LOGTAIL)) (110 11 (:REWRITE LOGEXT--OF--LOGHEAD-WHEN-SIGNED-BYTE-P)) (104 104 (:REWRITE DEFAULT-+-2)) (104 104 (:REWRITE DEFAULT-+-1)) (103 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (94 14 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (89 89 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 30 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (80 62 (:REWRITE DEFAULT-<-1)) (76 76 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (73 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (69 5 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (66 44 (:REWRITE EXPO-EXPT2)) (62 62 (:REWRITE DEFAULT-<-2)) (60 4 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (55 28 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (52 15 (:REWRITE USB-TIGHTEN)) (51 9 (:REWRITE LOGBIT-SUBST)) (47 47 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (47 47 (:REWRITE EXPONENTS-ADD)) (46 46 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (45 5 (:LINEAR LOGHEAD-LEQ)) (44 44 (:TYPE-PRESCRIPTION POWER2P)) (44 44 (:REWRITE POWER2P-EXPT2-I)) (44 44 (:REWRITE EXPO-MINUS-ERIC)) (44 38 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (44 13 (:REWRITE DEFAULT-UNARY-MINUS)) (40 40 (:REWRITE POWER2-INTEGER)) (40 5 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (38 38 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (38 38 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (38 38 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (30 30 (:REWRITE LOGEXT-SUBST2-ALT)) (30 30 (:REWRITE LOGEXT-SUBST2)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (29 1 (:REWRITE EQUAL-LOGEXT---LOGEXT)) (23 20 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (23 5 (:REWRITE LOGBITP-SUBST)) (18 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (17 11 (:REWRITE SBP-LOGHEAD)) (16 16 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 9 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (14 14 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (13 9 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE EXPT-COMPARE-EQUAL)) (11 7 (:LINEAR EXPT-LESS-THAN-1-HACK)) (10 5 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:REWRITE LOGBIT-TOO-BIG)) (9 9 (:REWRITE LOGBIT-SUBST-SIMPLER)) (9 9 (:META META-RULE-ERIC)) (9 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (5 5 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (4 4 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN))) (LOGNOT-OF-LOGEXT) (LOGAPP-OF-SUM-OF-LOGHEAD-ONE (54 5 (:REWRITE LOGHEAD-IDENTITY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (10 10 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (10 7 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (8 7 (:REWRITE DEFAULT-+-2)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE DEFAULT-*-2)) (4 4 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (1 1 (:REWRITE USB-LINEAR-REWRITE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (1 1 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (1 1 (:REWRITE EXPT-COMPARE)) (1 1 (:REWRITE DEFAULT-<-2)) (1 1 (:REWRITE DEFAULT-<-1)) (1 1 (:META CANCEL_PLUS-LESSP-CORRECT))) (LOGAPP-OF-SUM-OF-LOGHEAD-TWO (92 4 (:LINEAR LOGAPP-LINEAR)) (88 8 (:REWRITE LOGHEAD-IDENTITY)) (80 80 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (60 6 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (32 16 (:REWRITE USB-TIGHTEN)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:TYPE-PRESCRIPTION LOGBITP)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (16 16 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (11 9 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE POWER2-INTEGER)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 9 (:REWRITE DEFAULT-+-1)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (8 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 1 (:LINEAR LOGHEAD-LEQ)) (6 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE IFIX-INTEGERP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (4 4 (:REWRITE LOGHEAD-+-REDUCE)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGEXT-OF-LOGEXT (542 6 (:LINEAR LOGEXT-BOUND-UPPER)) (342 27 (:REWRITE LOGEXT-IDENTITY)) (108 108 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (99 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (92 2 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (72 48 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 9 (:REWRITE SIGNED-BYTE-P-LOGEXT-BETTER)) (60 4 (:LINEAR EXPT->-1)) (58 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (54 54 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (53 27 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (48 12 (:REWRITE DEFAULT-UNARY-MINUS)) (45 45 (:REWRITE USB-LINEAR-REWRITE)) (45 45 (:REWRITE EXPT-COMPARE)) (45 45 (:META CANCEL_PLUS-LESSP-CORRECT)) (38 34 (:REWRITE DEFAULT-<-1)) (36 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 34 (:REWRITE DEFAULT-<-2)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (30 30 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (28 28 (:REWRITE DEFAULT-+-2)) (28 28 (:REWRITE DEFAULT-+-1)) (27 27 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (27 27 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (27 27 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (27 27 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (27 27 (:REWRITE LOGEXT-SUBST2-ALT)) (27 27 (:REWRITE LOGEXT-SUBST2)) (27 27 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (27 27 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (24 24 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (24 24 (:REWRITE EXPONENTS-ADD)) (22 22 (:REWRITE POWER2-INTEGER)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (11 2 (:REWRITE LOGHEAD-IDENTITY)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGEXTS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-SPLIT-WHEN-USB-ONE-LONGER (266 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (253 69 (:REWRITE EXPT-COMPARE)) (133 5 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (119 5 (:LINEAR X*Y>1-POSITIVE)) (94 6 (:REWRITE POWER2-INTEGER)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 24 (:REWRITE EXPO-OF-NOT-RATIONALP)) (58 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (57 57 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (52 5 (:LINEAR EXPT->-1)) (50 49 (:REWRITE DEFAULT-<-2)) (49 49 (:REWRITE DEFAULT-<-1)) (47 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (35 35 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (28 28 (:TYPE-PRESCRIPTION POWER2P)) (28 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (26 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 24 (:REWRITE POWER2P-EXPT2-I)) (24 24 (:REWRITE EXPO-MINUS-ERIC)) (24 24 (:REWRITE EXPO-EXPT2)) (24 1 (:REWRITE EQUAL-1-HACK)) (23 10 (:REWRITE DEFAULT-+-2)) (23 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (20 10 (:REWRITE USB-TIGHTEN)) (16 10 (:REWRITE DEFAULT-+-1)) (16 4 (:REWRITE LOGBIT-TOO-BIG)) (14 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (13 5 (:REWRITE DEFAULT-*-1)) (11 5 (:REWRITE DEFAULT-*-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 10 (:REWRITE LOGHEAD-SUBST2)) (10 10 (:REWRITE LOGHEAD-SUBST)) (10 10 (:META META-RULE-ERIC)) (10 10 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (9 9 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE SUM-POWER-OF-TWO)) (6 6 (:REWRITE EXPT-COMPARE-EQUAL)) (6 6 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGBIT-SUBST-SIMPLER)) (4 4 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (1 1 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EQUAL-NEGATION-SAME-SIGN))) (EQUALITY-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (18 18 (:REWRITE USB-LINEAR-REWRITE)) (18 18 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 12 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (12 12 (:REWRITE EXPT-COMPARE)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE DEFAULT-<-2)) (8 8 (:REWRITE DEFAULT-<-1)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE DEFAULT-+-1)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EQUAL-CONSTANT-+-BLAH))) (<-OF-LOGHEADS-REWRITE (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (22 22 (:REWRITE USB-LINEAR-REWRITE)) (20 4 (:REWRITE LOGBITP-TOO-BIG)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (14 1 (:LINEAR EXPT->-1)) (13 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (10 4 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (10 2 (:REWRITE LOGBIT-TOO-BIG)) (8 2 (:REWRITE DEFAULT-UNARY-MINUS)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION IFIX)) (6 6 (:REWRITE IFIX-INTEGERP)) (6 2 (:REWRITE DEFAULT-*-1)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (4 4 (:REWRITE DEFAULT-+-1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE DEFAULT-*-2)) (3 3 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-HACK-YUCK (104 3 (:LINEAR LOGHEAD-LEQ)) (82 10 (:REWRITE LOGHEAD-IDENTITY)) (25 21 (:META META-RULE-ERIC)) (23 23 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (18 10 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (12 1 (:REWRITE MY-LOGAPP-<-0)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (10 10 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (10 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 4 (:REWRITE DEFAULT-<-1)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 1 (:REWRITE LOGAPP-<)) (2 1 (:REWRITE IFIX-INTEGERP)) (2 1 (:DEFINITION IFIX))) (LOGAPP-HACK-YUCK2 (118 118 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (33 6 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (20 5 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (14 6 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 5 (:REWRITE USB-TIGHTEN)) (10 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (9 8 (:META META-RULE-ERIC)) (9 5 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 5 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE DEFAULT-+-1)) (6 3 (:DEFINITION FIX)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE USB-LINEAR-REWRITE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE EXPT-COMPARE)) (5 5 (:REWRITE DEFAULT-<-2)) (5 5 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 3 (:REWRITE FIX-DOES-NOTHING)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (3 2 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-SUBST-IN-FIRST-ARG-2 (119 8 (:REWRITE LOGHEAD-IDENTITY)) (73 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (61 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (52 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (46 46 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (32 32 (:REWRITE POWER2-INTEGER)) (32 24 (:REWRITE DEFAULT-<-1)) (30 24 (:REWRITE DEFAULT-<-2)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (26 26 (:REWRITE USB-LINEAR-REWRITE)) (26 26 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 26 (:REWRITE EXPT-COMPARE)) (26 26 (:META CANCEL_PLUS-LESSP-CORRECT)) (22 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (19 19 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (17 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (16 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (15 15 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (15 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:META META-RULE-ERIC)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 2 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 5 (:REWRITE DEFAULT-+-2)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE INTEGERP-+-MINUS-*-2)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (2 1 (:DEFINITION FIX)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL))) (LOGHEAD-0-HACK (170 11 (:REWRITE LOGHEAD-IDENTITY)) (39 3 (:LINEAR LOGHEAD-LEQ)) (34 17 (:REWRITE USB-TIGHTEN)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (30 3 (:REWRITE DIFFERENCE-UNSIGNED-BYTE-P)) (21 21 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-LHS)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (11 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (9 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (5 1 (:REWRITE COMMUTATIVITY-OF-+)) (4 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-SUBST-WEIRD)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 1 (:REWRITE UNICITY-OF-0)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (1 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-EQUAL-LOGHEAD-LONGER (1746 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1174 62 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (1151 431 (:REWRITE EXPT-COMPARE)) (1147 90 (:REWRITE LOGHEAD-IDENTITY)) (953 7 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (878 174 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (532 55 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (445 431 (:REWRITE USB-LINEAR-REWRITE)) (431 431 (:META CANCEL_PLUS-LESSP-CORRECT)) (392 367 (:REWRITE DEFAULT-<-1)) (388 388 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (378 367 (:REWRITE DEFAULT-<-2)) (359 359 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (348 174 (:REWRITE USB-TIGHTEN)) (286 174 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (260 260 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (237 94 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (225 7 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (216 72 (:REWRITE EXPO-OF-NOT-RATIONALP)) (209 209 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (201 197 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (194 23 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (181 174 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (180 174 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (174 174 (:TYPE-PRESCRIPTION LOGBITP)) (168 168 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 144 (:REWRITE POWER2-INTEGER)) (126 14 (:LINEAR LOGHEAD-LEQ)) (121 121 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (121 121 (:REWRITE LOGHEAD-SUBST2)) (121 121 (:REWRITE LOGHEAD-SUBST)) (121 121 (:REWRITE DEFAULT-+-2)) (121 121 (:REWRITE DEFAULT-+-1)) (121 121 (:META META-RULE-ERIC)) (96 49 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (87 87 (:REWRITE EXPT-COMPARE-EQUAL)) (84 84 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (79 79 (:TYPE-PRESCRIPTION POWER2P)) (72 72 (:REWRITE POWER2P-EXPT2-I)) (72 72 (:REWRITE EXPO-MINUS-ERIC)) (72 72 (:REWRITE EXPO-EXPT2)) (63 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 7 (:REWRITE LOGHEAD-<)) (55 55 (:REWRITE EQUAL-CONSTANT-+)) (55 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (42 6 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (36 18 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (36 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (32 32 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (28 18 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE LOGHEAD-COMPARE-HACK)) (21 21 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (21 21 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (21 21 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (21 21 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (20 20 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (20 20 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (14 14 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (14 14 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 4 (:DEFINITION FIX)) (7 7 (:REWRITE LOGHEAD-NONNEGATIVE-REWRITE)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (7 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (7 7 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGEXT-SPLIT-GEN (274 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (270 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (262 4 (:REWRITE LOGTAIL-LESSP)) (248 4 (:LINEAR LOGTAIL-LEQ)) (128 16 (:LINEAR LOGEXT-BOUNDS-2)) (128 16 (:LINEAR LOGEXT-BOUNDS)) (78 62 (:REWRITE DEFAULT-<-1)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (66 66 (:REWRITE USB-LINEAR-REWRITE)) (66 66 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (66 66 (:REWRITE EXPT-COMPARE)) (66 66 (:META CANCEL_PLUS-LESSP-CORRECT)) (64 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (62 62 (:REWRITE DEFAULT-<-2)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (31 31 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (25 1 (:REWRITE LOGTAIL-IDENTITY)) (21 21 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (13 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (12 3 (:REWRITE LOGEXT-IDENTITY)) (11 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (10 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 2 (:REWRITE USBP-LOGEXT-NARROWER)) (4 4 (:REWRITE TIMES-ZERO)) (4 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 3 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE USB-TIGHTEN)) (3 3 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGEXT-SUBST2-ALT)) (3 3 (:REWRITE LOGEXT-SUBST2)) (3 3 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P))) (LOGTAIL-LOGEXT-EQUAL-0-REWRITE (93 3 (:REWRITE LOGHEAD-IDENTITY)) (53 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (51 2 (:REWRITE LOGTAIL-UNSIGNED-BYTE-P)) (39 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (35 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (25 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (22 2 (:REWRITE LOGEXT-IDENTITY)) (19 2 (:REWRITE LOGTAIL-IDENTITY)) (18 9 (:REWRITE USB-TIGHTEN)) (17 13 (:REWRITE DEFAULT-<-2)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 13 (:REWRITE DEFAULT-<-1)) (11 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (11 1 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (10 9 (:REWRITE DEFAULT-+-2)) (10 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:REWRITE DEFAULT-+-1)) (8 8 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (8 8 (:REWRITE POWER2-INTEGER)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (4 4 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (4 4 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 3 (:REWRITE SIGNED-BYTE-P-OF-LOGTAIL)) (4 2 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META META-RULE-ERIC)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGEXT-SUBST2-ALT)) (2 2 (:REWRITE LOGEXT-SUBST2)) (2 2 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 1 (:REWRITE MINUS-CANCELLATION-ON-RIGHT)) (1 1 (:REWRITE USBP-LOGEXT-NARROWER)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-EQUAL-LOGEXT-LONGER (808 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (477 54 (:REWRITE LOGEXT-IDENTITY)) (424 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (356 8 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (307 6 (:LINEAR LOGHEAD-LEQ)) (187 187 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (181 19 (:REWRITE LOGHEAD-IDENTITY)) (171 171 (:REWRITE USB-LINEAR-REWRITE)) (171 171 (:REWRITE EXPT-COMPARE)) (171 171 (:META CANCEL_PLUS-LESSP-CORRECT)) (168 42 (:REWRITE USBP-LOGEXT-NARROWER)) (167 167 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (163 163 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (144 112 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (144 72 (:REWRITE USB-TIGHTEN)) (144 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (143 130 (:REWRITE DEFAULT-<-1)) (136 72 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE DEFAULT-<-2)) (117 13 (:LINEAR EXPT-LESS-THAN-1-HACK)) (102 102 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE POWER2-INTEGER)) (88 56 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (86 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (80 80 (:TYPE-PRESCRIPTION LOGBITP)) (75 75 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (73 72 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (72 72 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (72 72 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (72 8 (:LINEAR LOGEXT-BOUND-UPPER)) (68 68 (:REWRITE DEFAULT-+-2)) (68 68 (:REWRITE DEFAULT-+-1)) (64 16 (:REWRITE DEFAULT-UNARY-MINUS)) (56 56 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (56 56 (:REWRITE LOGEXT-SUBST2-ALT)) (56 56 (:REWRITE LOGEXT-SUBST2)) (56 56 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (52 52 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (52 52 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (52 52 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (52 52 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (50 5 (:REWRITE LOGHEAD-EQUAL-REWRITE)) (36 19 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (34 25 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (32 32 (:REWRITE EXPONENTS-ADD)) (29 5 (:REWRITE LOGTAIL-LOGEXT-EQUAL-0-REWRITE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (25 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (24 3 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 10 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (19 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 19 (:META META-RULE-ERIC)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (17 17 (:META CANCEL_PLUS-EQUAL-CORRECT)) (16 10 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE EXPT-COMPARE-EQUAL)) (14 14 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (13 13 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (10 10 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (10 10 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 8 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (5 5 (:REWRITE LOGHEAD-COMPARE-HACK)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (3 3 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (1 1 (:REWRITE LOGBIT-TOO-BIG)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (EXPT-WEAKLY-MONOTONIC-LINEAR (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (12 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 11 (:REWRITE USB-LINEAR-REWRITE)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE POWER2-INTEGER)) (10 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 8 (:REWRITE DEFAULT-<-2)) (10 8 (:REWRITE DEFAULT-<-1)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE IFIX-INTEGERP)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT))) (PROD-NON-NEGATIVE-LINEAR) (PROD-LINEAR (7 1 (:LINEAR X*Y>1-POSITIVE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (2 2 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE DEFAULT-*-1)) (2 1 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR))) (PROD-LINEAR-ALT (14 2 (:LINEAR X*Y>1-POSITIVE)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:REWRITE DEFAULT-<-1)) (6 6 (:REWRITE DEFAULT-*-2)) (6 6 (:REWRITE DEFAULT-*-1)) (4 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (1 1 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (USB-OF-LOGAPP-2-GEN (718 14 (:REWRITE LOGHEAD-IDENTITY)) (319 141 (:REWRITE USB-LINEAR-REWRITE)) (265 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (200 130 (:REWRITE DEFAULT-<-2)) (171 21 (:LINEAR EXPT->-1)) (170 130 (:REWRITE DEFAULT-<-1)) (163 6 (:REWRITE LOGHEAD-<)) (143 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (141 141 (:META CANCEL_PLUS-LESSP-CORRECT)) (140 140 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (113 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (112 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 80 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (52 52 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (50 50 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (49 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (42 42 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (42 42 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (42 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (41 10 (:REWRITE EXPT-IS-INCREASING-FOR-BASE>1)) (36 36 (:REWRITE POWER2-INTEGER)) (35 21 (:LINEAR EXPT-LESS-THAN-1-HACK)) (34 17 (:REWRITE USB-TIGHTEN)) (34 17 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 14 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (19 2 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (17 17 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (17 17 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (17 17 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (14 14 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:REWRITE LOGHEAD-SUBST2)) (14 14 (:REWRITE LOGHEAD-SUBST)) (14 14 (:META META-RULE-ERIC)) (10 10 (:REWRITE EXPT-IS-WEAKLY-DECREASING-FOR-POS-BASE<1)) (10 10 (:REWRITE EXPT-IS-DECREASING-FOR-POS-BASE<1)) (10 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (9 3 (:REWRITE DEFAULT-*-2)) (8 5 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-*-1)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT))) (LOGTAIL-OF-SUM-OF-ASH (56 4 (:LINEAR LOGTAIL-LEQ)) (28 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (20 20 (:TYPE-PRESCRIPTION ASH)) (19 14 (:REWRITE DEFAULT-<-1)) (17 2 (:LINEAR EXPT->-1)) (16 14 (:REWRITE DEFAULT-<-2)) (16 8 (:REWRITE USB-TIGHTEN)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 9 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE DEFAULT-+-1)) (9 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (7 7 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (7 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (1 1 (:TYPE-PRESCRIPTION POWER2P)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUM-OF-ASH-ALT (30 30 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (28 2 (:LINEAR LOGTAIL-LEQ)) (13 9 (:REWRITE DEFAULT-<-1)) (13 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (12 12 (:TYPE-PRESCRIPTION ASH)) (12 9 (:REWRITE DEFAULT-<-2)) (10 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 9 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (9 9 (:REWRITE EXPT-COMPARE)) (9 9 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (9 1 (:LINEAR EXPT->-1)) (9 1 (:DEFINITION NATP)) (8 8 (:REWRITE POWER2-INTEGER)) (8 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 1 (:REWRITE ASH-0)) (3 2 (:REWRITE IFIX-INTEGERP)) (3 2 (:REWRITE DEFAULT-+-2)) (3 2 (:REWRITE DEFAULT-+-1)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE NATP-RW)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION NATP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE ASH-GOES-TO-0))) (LOGTAIL-OF-SUB1-OF-ASH (94 2 (:LINEAR LOGTAIL-LEQ)) (72 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (34 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 1 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (21 1 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (18 2 (:REWRITE ASH-BOUND2)) (18 2 (:REWRITE ASH-BOUND1A)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (12 10 (:REWRITE DEFAULT-<-1)) (12 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (12 1 (:REWRITE LOGTAIL-OF-SUM-OF-ASH)) (12 1 (:REWRITE ASH-PLUS-CONSTANT-SUCK-IN)) (10 10 (:REWRITE DEFAULT-<-2)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 7 (:REWRITE DEFAULT-+-2)) (8 4 (:REWRITE USB-TIGHTEN)) (7 7 (:REWRITE DEFAULT-+-1)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 2 (:REWRITE ASH-BOUND4)) (6 2 (:REWRITE ASH-BOUND3A)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (4 4 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (4 1 (:REWRITE ASH-0)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:TYPE-PRESCRIPTION ZIP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (2 2 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE ZIP-OPEN)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META META-RULE-ERIC))) (LOGTAIL-OF-SUB1-OF-LOGAPP (128 2 (:LINEAR LOGTAIL-LEQ)) (64 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (44 4 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (42 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (18 2 (:REWRITE LOGAPP-<)) (16 16 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (12 8 (:LINEAR LOGAPP-LINEAR)) (10 5 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 1 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE DEFAULT-+-2)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (5 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE DEFAULT-+-1)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE DEFAULT-<-1)) (2 2 (:META META-RULE-ERIC)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (2 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (1 1 (:REWRITE USB-OF-LOGAPP-2-GEN)) (1 1 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-SUBST2)) (1 1 (:REWRITE LOGHEAD-SUBST))) (LOGHEAD-IDENTITY-2 (95 95 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (70 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (32 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (27 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (21 13 (:REWRITE DEFAULT-<-2)) (17 17 (:REWRITE POWER2-INTEGER)) (16 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (14 7 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (13 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (11 5 (:REWRITE DEFAULT-+-2)) (9 9 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE USB-TIGHTEN)) (8 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGHEAD-SUBST2)) (7 7 (:REWRITE LOGHEAD-SUBST)) (5 5 (:REWRITE DEFAULT-+-1)) (4 4 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (1 1 (:REWRITE EXPT-2-POSITIVE-RATIONAL-TYPE))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY (46 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (27 11 (:REWRITE USB-LINEAR-REWRITE)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 11 (:REWRITE EXPT-COMPARE)) (11 11 (:REWRITE DEFAULT-<-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 11 (:META CANCEL_PLUS-LESSP-CORRECT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (4 4 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (UNSIGNED-BYTE-P-BECOMES-INEQUALITY-ALT (12 4 (:REWRITE USB-LINEAR-REWRITE)) (4 4 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (4 4 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (4 4 (:REWRITE EXPT-COMPARE)) (4 4 (:REWRITE DEFAULT-<-2)) (4 4 (:REWRITE DEFAULT-<-1)) (4 4 (:META CANCEL_PLUS-LESSP-CORRECT)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (2 1 (:REWRITE USB-TIGHTEN)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (USB-OF-SUM-WITH-TWO-OTHER-ADDENDS-HACK (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (36 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (26 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (24 15 (:REWRITE DEFAULT-<-2)) (24 2 (:LINEAR EXPT->-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (16 15 (:REWRITE DEFAULT-<-1)) (13 13 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (10 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:REWRITE DEFAULT-+-2)) (6 6 (:REWRITE DEFAULT-+-1)) (6 3 (:REWRITE USB-TIGHTEN)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-OF-PROD-LEMMA-ALT-GEN (2748 32 (:LINEAR LOGHEAD-LEQ)) (1612 19 (:REWRITE <-*-0)) (880 52 (:REWRITE LOGHEAD-IDENTITY)) (429 63 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (368 368 (:REWRITE USB-LINEAR-REWRITE)) (368 368 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (368 368 (:REWRITE EXPT-COMPARE)) (368 368 (:META CANCEL_PLUS-LESSP-CORRECT)) (351 343 (:REWRITE DEFAULT-<-1)) (349 343 (:REWRITE DEFAULT-<-2)) (330 19 (:DEFINITION IFF)) (280 280 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (188 188 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (162 19 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (162 19 (:LINEAR PROD-LINEAR)) (162 19 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (161 19 (:LINEAR PROD-LINEAR-ALT)) (161 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (143 19 (:LINEAR X*Y>1-POSITIVE)) (143 19 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (126 63 (:REWRITE USB-TIGHTEN)) (119 119 (:META META-RULE-ERIC)) (106 106 (:REWRITE LOGHEAD-SUBST)) (105 105 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (101 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (93 93 (:META CANCEL_TIMES-EQUAL-CORRECT)) (93 93 (:META CANCEL_PLUS-EQUAL-CORRECT)) (88 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (85 85 (:REWRITE EXPT-COMPARE-EQUAL)) (83 9 (:REWRITE LOGHEAD-<=)) (82 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (79 79 (:TYPE-PRESCRIPTION LOGBITP)) (79 23 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (76 76 (:TYPE-PRESCRIPTION IFIX)) (74 11 (:LINEAR EXPT->-1)) (72 72 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (72 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (63 63 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (63 63 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-OTHER-CASE-CONSTANT-VERSION)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-CONST)) (60 60 (:REWRITE LOGHEAD-OF-*-EXPT-2-SPECIAL-CONST)) (53 47 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (50 6 (:REWRITE <-+-CONSTANT-CONSTANT)) (45 45 (:REWRITE UNSIGNED-BYTE-P-SHIFT-BY-CONSTANT-POWER-OF-2)) (45 45 (:REWRITE POWER2-INTEGER)) (44 36 (:REWRITE DEFAULT-*-2)) (37 36 (:REWRITE DEFAULT-*-1)) (36 36 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (32 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (30 28 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 2 (:REWRITE NORMALIZE-EQUAL-0)) (26 26 (:REWRITE DEFAULT-+-2)) (26 26 (:REWRITE DEFAULT-+-1)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (20 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (18 2 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (14 14 (:REWRITE LOGHEAD-COMPARE-HACK)) (14 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (10 2 (:REWRITE SUM-POWER-OF-TWO)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:REWRITE LOGBITP-OF-*-EXPT-2-SPECIAL-CONST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS))) (LOGHEAD-TIMES-16-OF-LOGAPP (268 6 (:REWRITE 0-<-*)) (235 7 (:REWRITE LOGHEAD-IDENTITY)) (183 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (124 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (119 3 (:LINEAR LOGHEAD-LEQ)) (88 5 (:REWRITE NORMALIZE-EQUAL-0)) (57 57 (:REWRITE USB-LINEAR-REWRITE)) (57 57 (:REWRITE EXPT-COMPARE)) (57 57 (:META CANCEL_PLUS-LESSP-CORRECT)) (55 55 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (53 5 (:REWRITE EQUAL-MINUS-MINUS)) (48 6 (:REWRITE <-Y-*-Y-X)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (33 28 (:REWRITE DEFAULT-<-1)) (33 6 (:LINEAR LOGAPP-LINEAR)) (28 28 (:REWRITE DEFAULT-<-2)) (28 10 (:REWRITE EQUAL-1-HACK)) (27 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (25 25 (:REWRITE EXPT-COMPARE-EQUAL)) (25 25 (:META CANCEL_TIMES-EQUAL-CORRECT)) (25 25 (:META CANCEL_PLUS-EQUAL-CORRECT)) (25 5 (:REWRITE SUM-POWER-OF-TWO)) (24 3 (:REWRITE <-*-Y-X-Y)) (24 2 (:REWRITE MY-LOGAPP-<-0)) (21 21 (:REWRITE POWER2-INTEGER)) (21 21 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 1 (:REWRITE <-*-0)) (18 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (18 9 (:REWRITE USB-TIGHTEN)) (18 3 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:META META-RULE-ERIC)) (14 7 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (13 7 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 7 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (8 8 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (8 6 (:REWRITE DEFAULT-*-2)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (7 7 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (7 7 (:DEFINITION IFF)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (5 5 (:TYPE-PRESCRIPTION INTEGER-LENGTH)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:REWRITE FIX-DOES-NOTHING)) (5 5 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (5 5 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGAPP-<)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:DEFINITION IFIX)) (1 1 (:REWRITE ZP-OPEN))) (LOGHEAD-OF-MINUS-COMPARE-WHEN-USB (231 231 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (29 15 (:REWRITE DEFAULT-<-1)) (21 15 (:REWRITE DEFAULT-<-2)) (20 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (20 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE POWER2-INTEGER)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (15 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 6 (:REWRITE DEFAULT-+-2)) (10 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (8 6 (:REWRITE DEFAULT-+-1)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE USB-TIGHTEN)) (4 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (4 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:REWRITE DEFAULT-UNARY-MINUS)) (3 3 (:META META-RULE-ERIC)) (2 2 (:TYPE-PRESCRIPTION LOGBITP)) (2 2 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (2 2 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (2 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP))) (LOGBIT-TOO-BIG-NO-FREE-VARS (111 1 (:REWRITE FLOOR-=-X/Y . 3)) (90 11 (:LINEAR EXPT->-1)) (87 32 (:REWRITE EXPT-COMPARE)) (85 1 (:REWRITE FLOOR-TYPE-3 . 2)) (51 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (48 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (45 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (43 30 (:REWRITE DEFAULT-<-2)) (34 1 (:REWRITE RTL1)) (34 1 (:REWRITE FLOOR-DETERMINED-1)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 30 (:REWRITE DEFAULT-<-1)) (30 30 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (26 6 (:REWRITE EXPT-COMPARE-EQUAL)) (25 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (22 22 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (22 1 (:REWRITE FLOOR-=-X/Y . 2)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 6 (:REWRITE EXPO-OF-NOT-RATIONALP)) (18 6 (:REWRITE DEFAULT-*-2)) (15 1 (:REWRITE EXPO-SHIFT-CONSTANT)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 1 (:REWRITE LOGBIT-TOO-BIG)) (12 12 (:REWRITE POWER2-INTEGER)) (12 1 (:REWRITE LOGBITP-TOO-BIG)) (11 11 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (11 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (9 9 (:TYPE-PRESCRIPTION POWER2P)) (9 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 6 (:REWRITE EXPO-EXPT2)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (6 6 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 6 (:REWRITE POWER2P-EXPT2-I)) (6 6 (:REWRITE EXPO-MINUS-ERIC)) (6 6 (:REWRITE DEFAULT-*-1)) (6 6 (:META CANCEL_TIMES-EQUAL-CORRECT)) (6 6 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE USB-TIGHTEN)) (6 2 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (4 2 (:DEFINITION IFIX)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 1 (:REWRITE POWER2P-SHIFT-2)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (2 2 (:TYPE-PRESCRIPTION IFIX)) (2 2 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBIT-SUBST-SIMPLER)) (1 1 (:REWRITE LOGBIT-SUBST)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT (1127 71 (:REWRITE LOGHEAD-IDENTITY)) (570 2 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (472 4 (:REWRITE UNSIGNED-BYTE-P-OF-ONE-LESS-THAN-X)) (261 127 (:REWRITE DEFAULT-+-2)) (231 139 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (227 127 (:REWRITE DEFAULT-+-1)) (179 179 (:REWRITE POWER2-INTEGER)) (167 17 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 116 (:REWRITE DEFAULT-<-2)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (143 143 (:REWRITE EXPT-COMPARE)) (141 141 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (139 139 (:META META-RULE-ERIC)) (139 127 (:REWRITE LOGHEAD-SUBST)) (139 17 (:LINEAR EXPT->-1)) (135 116 (:REWRITE DEFAULT-<-1)) (127 127 (:REWRITE LOGHEAD-SUBST2)) (119 82 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (116 20 (:REWRITE <-+-CONSTANT-CONSTANT)) (86 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (84 42 (:REWRITE USB-TIGHTEN)) (82 82 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (79 17 (:REWRITE EXPT-COMPARE-EQUAL)) (77 71 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (76 2 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT)) (72 2 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (69 17 (:LINEAR EXPT-LESS-THAN-1-HACK)) (66 66 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (64 24 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (62 2 (:REWRITE LOGHEAD-<)) (57 8 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (56 2 (:REWRITE <-OF-LOGHEADS-REWRITE)) (53 53 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (42 42 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (35 21 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (34 34 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (34 34 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (32 32 (:REWRITE FOLD-CONSTS-IN-+)) (28 22 (:REWRITE DEFAULT-UNARY-MINUS)) (23 23 (:META CANCEL_TIMES-EQUAL-CORRECT)) (22 4 (:REWRITE EXPO-EXPT2)) (21 21 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (19 19 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 12 (:REWRITE INTEGERP-+-MINUS-*-2)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (17 17 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (12 12 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (8 8 (:REWRITE LOGHEAD-COMPARE-HACK)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (8 4 (:DEFINITION FIX)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (4 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD))) (LOGHEAD-OF-1 (125 8 (:REWRITE LOGHEAD-IDENTITY)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (38 27 (:REWRITE DEFAULT-<-2)) (31 27 (:REWRITE DEFAULT-<-1)) (27 27 (:REWRITE USB-LINEAR-REWRITE)) (27 27 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE EXPT-COMPARE)) (27 27 (:META CANCEL_PLUS-LESSP-CORRECT)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE POWER2-INTEGER)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 9 (:REWRITE USB-TIGHTEN)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (13 13 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-X+1)) (9 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ZP-OPEN)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-OF-ONE-LESS-THAN-X-ALT-NON-SPLITTING (185 15 (:REWRITE LOGHEAD-IDENTITY)) (105 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (90 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (58 3 (:LINEAR LOGHEAD-LEQ)) (48 34 (:REWRITE DEFAULT-<-2)) (47 24 (:REWRITE DEFAULT-+-2)) (46 24 (:REWRITE DEFAULT-+-1)) (44 34 (:REWRITE DEFAULT-<-1)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (33 33 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE POWER2-INTEGER)) (31 24 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (25 15 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (22 22 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (22 22 (:META META-RULE-ERIC)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (19 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:TYPE-PRESCRIPTION LOGBITP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR EXPT->-1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE ZP-OPEN)) (6 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 4 (:REWRITE DEFAULT-UNARY-MINUS)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (3 3 (:REWRITE <-+-CONSTANT-CONSTANT)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT (54 3 (:REWRITE LOGHEAD-IDENTITY)) (49 49 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (30 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (27 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 14 (:REWRITE DEFAULT-<-2)) (18 14 (:REWRITE DEFAULT-<-1)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (10 10 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (10 10 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (10 10 (:REWRITE POWER2-INTEGER)) (9 1 (:REWRITE LOGHEAD-<=)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 8 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 3 (:REWRITE USB-TIGHTEN)) (6 3 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 3 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGBITP)) (3 3 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (3 3 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (3 3 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (3 3 (:REWRITE LOGHEAD-SUBST2)) (3 3 (:REWRITE LOGHEAD-SUBST)) (3 3 (:META META-RULE-ERIC))) (LOGHEAD-SUM-SUBST-HELPER-BETTER (519 16 (:REWRITE LOGHEAD-IDENTITY)) (263 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (232 8 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (172 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (74 53 (:REWRITE DEFAULT-<-2)) (68 12 (:REWRITE <-+-CONSTANT-CONSTANT)) (61 61 (:REWRITE USB-LINEAR-REWRITE)) (61 61 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (61 61 (:REWRITE EXPT-COMPARE)) (61 61 (:META CANCEL_PLUS-LESSP-CORRECT)) (57 53 (:REWRITE DEFAULT-<-1)) (53 53 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (52 6 (:LINEAR LOGHEAD-LEQ)) (46 46 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (46 23 (:REWRITE USB-TIGHTEN)) (43 43 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (43 43 (:REWRITE POWER2-INTEGER)) (43 43 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 19 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 4 (:LINEAR EXPT->-1)) (32 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (24 15 (:REWRITE DEFAULT-+-2)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (19 19 (:REWRITE LOGHEAD-SUBST2)) (19 19 (:REWRITE LOGHEAD-SUBST)) (18 12 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 3 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (16 16 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (12 12 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (12 6 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (11 11 (:REWRITE LOGHEAD-SUM-SUBST)) (11 11 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (11 11 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (11 11 (:REWRITE LOGHEAD-+-REDUCE)) (11 11 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (8 8 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (6 3 (:REWRITE INTEGERP-+-MINUS-*-2)) (6 3 (:DEFINITION FIX)) (3 3 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (1 1 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-ONE-MORE-WRAPS-AROUND (327 24 (:REWRITE LOGHEAD-IDENTITY)) (119 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (90 52 (:REWRITE USB-LINEAR-REWRITE)) (79 9 (:LINEAR LOGHEAD-LEQ)) (78 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (71 50 (:REWRITE DEFAULT-<-1)) (60 50 (:REWRITE DEFAULT-<-2)) (52 52 (:REWRITE EXPT-COMPARE)) (52 52 (:META CANCEL_PLUS-LESSP-CORRECT)) (49 23 (:REWRITE DEFAULT-+-2)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (46 46 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (46 23 (:REWRITE USB-TIGHTEN)) (42 23 (:REWRITE DEFAULT-+-1)) (39 9 (:REWRITE EXPT-COMPARE-EQUAL)) (35 35 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (35 35 (:REWRITE LOGHEAD-SUBST2)) (35 35 (:REWRITE LOGHEAD-SUBST)) (35 35 (:META META-RULE-ERIC)) (32 32 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (29 29 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (23 23 (:TYPE-PRESCRIPTION LOGBITP)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (23 23 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (14 2 (:REWRITE LOGHEAD-<)) (13 5 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 4 (:REWRITE DEFAULT-UNARY-MINUS)) (10 10 (:REWRITE ZP-OPEN)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS))) (LOGHEAD-IDENTITY-2-ALT (89 1 (:LINEAR LOGHEAD-LEQ)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (20 20 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (20 20 (:REWRITE LOGHEAD-SUBST2)) (20 20 (:REWRITE LOGHEAD-SUBST)) (20 20 (:META META-RULE-ERIC)) (18 9 (:REWRITE USB-TIGHTEN)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (15 15 (:REWRITE USB-LINEAR-REWRITE)) (15 15 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (15 15 (:REWRITE EXPT-COMPARE)) (15 15 (:META CANCEL_PLUS-LESSP-CORRECT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 9 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (4 4 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (4 4 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (4 4 (:REWRITE LOGHEAD-SUBST-WEIRD)) (4 4 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:REWRITE DEFAULT-<-1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE POWER2-INTEGER)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (LOGHEAD-SUM-SPLIT-INTO-2-CASES-FORCED (502 36 (:REWRITE LOGHEAD-IDENTITY)) (297 297 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (198 30 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (153 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (116 4 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (67 42 (:REWRITE DEFAULT-<-2)) (61 32 (:REWRITE DEFAULT-+-1)) (60 60 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (60 30 (:REWRITE USB-TIGHTEN)) (59 32 (:REWRITE DEFAULT-+-2)) (50 42 (:REWRITE DEFAULT-<-1)) (47 47 (:REWRITE USB-LINEAR-REWRITE)) (47 47 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE EXPT-COMPARE)) (47 47 (:META CANCEL_PLUS-LESSP-CORRECT)) (42 42 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (41 41 (:REWRITE LOGHEAD-SUBST2)) (41 41 (:REWRITE LOGHEAD-SUBST)) (39 1 (:REWRITE LOGHEAD-<)) (38 38 (:REWRITE POWER2-INTEGER)) (38 10 (:REWRITE <-+-CONSTANT-CONSTANT)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (32 32 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (30 30 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (30 30 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (28 20 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (21 21 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (18 2 (:LINEAR EXPT->-1)) (16 2 (:LINEAR LOGHEAD-LEQ)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (5 5 (:REWRITE LOGHEAD-SUM-SUBST)) (5 5 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (5 5 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (5 5 (:REWRITE LOGHEAD-+-REDUCE)) (5 5 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (4 4 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGHEAD-PLUS-CONSTANT-EQUAL-CONSTANT)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK-2)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:REWRITE DEFAULT-*-1))) (LOGHEAD-EQUALITY-IMPOSSIBLE (300 6 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (157 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (96 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (69 67 (:REWRITE DEFAULT-+-2)) (67 67 (:REWRITE DEFAULT-+-1)) (66 6 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-2-ON-RHS)) (42 42 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (42 42 (:REWRITE LOGHEAD-SUBST2)) (42 42 (:REWRITE LOGHEAD-SUBST)) (42 42 (:META META-RULE-ERIC)) (37 37 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (36 36 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (36 36 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (31 31 (:REWRITE EXPT-COMPARE)) (19 19 (:REWRITE DEFAULT-<-2)) (19 19 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE USB-TIGHTEN)) (13 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (12 12 (:REWRITE FOLD-CONSTS-IN-+)) (12 12 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:TYPE-PRESCRIPTION LOGBITP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (8 8 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (6 6 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (6 6 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (6 6 (:REWRITE LOGHEAD-SUBST-WEIRD)) (6 6 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EQUAL-CONSTANT-+))) (NOT-UNSIGNED-BYTE-P-WHEN-J-IS-NEGATIVE (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE (151 151 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (104 4 (:REWRITE LOGHEAD-IDENTITY)) (69 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (68 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (33 33 (:REWRITE USB-LINEAR-REWRITE)) (32 32 (:REWRITE EXPT-COMPARE)) (32 32 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 4 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (27 27 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (20 20 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE DEFAULT-+-1)) (20 18 (:REWRITE DEFAULT-<-2)) (18 18 (:REWRITE DEFAULT-<-1)) (18 2 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (17 1 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (16 8 (:REWRITE USB-TIGHTEN)) (15 1 (:REWRITE EQUAL-1-HACK)) (13 13 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (13 2 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (12 4 (:REWRITE COMMUTATIVITY-OF-+)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (9 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (8 8 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 2 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 7 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (7 1 (:REWRITE LOGHEAD-<)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (5 5 (:META META-RULE-ERIC)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (5 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBIT-TOO-BIG)) (2 2 (:REWRITE LOGBIT-SUBST-SIMPLER)) (2 2 (:REWRITE LOGBIT-SUBST)) (2 1 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (1 1 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DUMB)) (1 1 (:LINEAR LOGAPP-NEGATIVE-LINEAR))) (LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE (143 143 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (133 8 (:REWRITE LOGHEAD-IDENTITY)) (103 13 (:REWRITE <-+-CONSTANT-CONSTANT)) (88 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (86 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (40 5 (:REWRITE EQUAL-CONSTANT-+-BLAH)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (31 31 (:REWRITE USB-LINEAR-REWRITE)) (31 31 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (31 31 (:REWRITE EXPT-COMPARE)) (31 31 (:META CANCEL_PLUS-LESSP-CORRECT)) (29 3 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 28 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (24 24 (:REWRITE DEFAULT-+-2)) (24 24 (:REWRITE DEFAULT-+-1)) (22 1 (:REWRITE LOGHEAD-<)) (20 17 (:REWRITE DEFAULT-<-2)) (18 6 (:REWRITE FOLD-CONSTS-IN-+)) (17 17 (:REWRITE DEFAULT-<-1)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 5 (:REWRITE COMMUTATIVITY-OF-+)) (14 14 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (12 10 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 6 (:REWRITE USB-TIGHTEN)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (10 1 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (7 5 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (2 2 (:REWRITE POWER2-INTEGER)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG))) (UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE (340 340 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (265 17 (:REWRITE LOGHEAD-IDENTITY)) (206 27 (:REWRITE <-+-CONSTANT-CONSTANT)) (129 129 (:REWRITE POWER2-INTEGER)) (123 4 (:REWRITE LOGHEAD-<)) (118 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (108 46 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (102 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (97 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (82 17 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (78 28 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (73 45 (:REWRITE DEFAULT-<-2)) (72 72 (:REWRITE USB-LINEAR-REWRITE)) (72 72 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (72 72 (:REWRITE EXPT-COMPARE)) (72 72 (:META CANCEL_PLUS-LESSP-CORRECT)) (72 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (70 14 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (69 25 (:REWRITE USB-TIGHTEN)) (61 9 (:LINEAR EXPT-LESS-THAN-1-HACK)) (49 45 (:REWRITE DEFAULT-<-1)) (48 48 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 23 (:REWRITE INTEGERP-+-MINUS-*-2)) (32 4 (:LINEAR LOGHEAD-LEQ)) (28 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 24 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (24 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (23 23 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (23 23 (:REWRITE FIX-DOES-NOTHING)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (18 18 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (17 17 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (17 17 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (17 17 (:REWRITE LOGHEAD-SUBST2)) (17 17 (:REWRITE LOGHEAD-SUBST)) (17 17 (:META META-RULE-ERIC)) (16 16 (:REWRITE DEFAULT-+-2)) (16 16 (:REWRITE DEFAULT-+-1)) (10 5 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (7 7 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (7 7 (:REWRITE EXPONENTS-ADD)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGAPP-REASSEMBLE (37 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (29 3 (:REWRITE LOGTAIL-IDENTITY)) (22 6 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (22 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (12 6 (:REWRITE USB-TIGHTEN)) (11 8 (:REWRITE DEFAULT-<-2)) (11 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (9 1 (:REWRITE ASH-AS-LOGTAIL)) (8 8 (:REWRITE USB-LINEAR-REWRITE)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE POWER2-INTEGER)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:REWRITE DEFAULT-<-1)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (7 7 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:TYPE-PRESCRIPTION LOGBITP)) (6 6 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (6 6 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (6 6 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:META META-RULE-ERIC)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEAD-PLUS-LOGTAIL-REASSEMBLE (142 8 (:REWRITE LOGTAIL-LESSP)) (98 2 (:LINEAR PROD-LINEAR)) (78 50 (:REWRITE EXPT-COMPARE)) (74 2 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (72 8 (:LINEAR LOGTAIL-LEQ)) (68 2 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (64 4 (:REWRITE LOGHEAD-IDENTITY)) (64 2 (:LINEAR PROD-LINEAR-ALT)) (58 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (54 37 (:REWRITE DEFAULT-<-1)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (50 50 (:REWRITE USB-LINEAR-REWRITE)) (50 50 (:META CANCEL_PLUS-LESSP-CORRECT)) (50 2 (:LINEAR X*Y>1-POSITIVE)) (48 48 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (41 37 (:REWRITE DEFAULT-<-2)) (36 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 2 (:REWRITE LOGTAIL-IDENTITY)) (27 10 (:REWRITE USB-TIGHTEN)) (24 2 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (22 22 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (18 18 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (14 14 (:TYPE-PRESCRIPTION LOGBITP)) (13 5 (:REWRITE DEFAULT-*-2)) (12 6 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 5 (:REWRITE DEFAULT-*-1)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 6 (:REWRITE DEFAULT-+-1)) (8 2 (:REWRITE UNICITY-OF-1)) (8 1 (:LINEAR EXPT->-1)) (7 7 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE TIMES-ZERO)) (6 2 (:REWRITE FIX-DOES-NOTHING)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (6 2 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (X-EQUAL-SUM-OF-LOGHEAD-CANCEL (216 12 (:REWRITE LOGHEAD-IDENTITY)) (204 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (196 28 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (189 12 (:REWRITE LOGTAIL-LESSP)) (184 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (172 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (151 109 (:REWRITE EXPT-COMPARE)) (138 3 (:LINEAR PROD-LINEAR)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (109 109 (:REWRITE USB-LINEAR-REWRITE)) (109 109 (:META CANCEL_PLUS-LESSP-CORRECT)) (108 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 3 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (96 12 (:LINEAR LOGTAIL-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (93 3 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (92 86 (:REWRITE DEFAULT-<-2)) (87 3 (:LINEAR PROD-LINEAR-ALT)) (86 86 (:REWRITE DEFAULT-<-1)) (84 28 (:REWRITE USB-TIGHTEN)) (75 3 (:LINEAR X*Y>1-POSITIVE)) (64 8 (:REWRITE <-+-CONSTANT-CONSTANT)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (48 4 (:REWRITE LOGTAIL-IDENTITY)) (44 44 (:TYPE-PRESCRIPTION LOGBITP)) (40 40 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (36 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (32 4 (:LINEAR LOGHEAD-LEQ)) (32 4 (:LINEAR EXPT->-1)) (28 28 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (28 28 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (28 28 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (24 24 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (24 16 (:REWRITE DEFAULT-+-2)) (20 20 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE DEFAULT-+-1)) (17 7 (:REWRITE DEFAULT-*-2)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 7 (:REWRITE DEFAULT-*-1)) (12 12 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (12 12 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGHEAD-SUBST2)) (12 12 (:REWRITE LOGHEAD-SUBST)) (12 12 (:META META-RULE-ERIC)) (12 3 (:REWRITE UNICITY-OF-1)) (9 9 (:REWRITE TIMES-ZERO)) (9 3 (:REWRITE FIX-DOES-NOTHING)) (9 3 (:REWRITE EXPO-OF-NOT-RATIONALP)) (9 3 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 8 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (7 7 (:REWRITE EXPT-COMPARE-EQUAL)) (7 7 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (4 4 (:REWRITE SUM-POWER-OF-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE EQUAL-CONSTANT-+)) (4 4 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE POWER2P-EXPT2-I)) (3 3 (:REWRITE EXPO-MINUS-ERIC)) (3 3 (:REWRITE EXPO-EXPT2)) (3 3 (:REWRITE COMBINE-CONSTANTS-IN-EQUAL-OF-TIMES))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION (55 4 (:REWRITE LOGHEAD-IDENTITY)) (51 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (47 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (45 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (43 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (28 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (17 17 (:REWRITE USB-LINEAR-REWRITE)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (17 17 (:REWRITE EXPT-COMPARE)) (17 17 (:META CANCEL_PLUS-LESSP-CORRECT)) (17 5 (:REWRITE USB-TIGHTEN)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (15 14 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE DEFAULT-<-2)) (12 12 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (9 9 (:TYPE-PRESCRIPTION LOGBITP)) (9 1 (:LINEAR LOGHEAD-LEQ)) (8 1 (:LINEAR EXPT->-1)) (7 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 4 (:REWRITE DEFAULT-+-2)) (7 4 (:REWRITE DEFAULT-+-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (5 5 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (3 1 (:REWRITE DEFAULT-*-2)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE DEFAULT-*-1)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (SIGNED-BYTE-P-OF-X-MINUS-2-TO-THEN-MINUS-ONE-WHEN-USB (115 1 (:REWRITE SIGNED-BYTE-P-+)) (58 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (39 39 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (27 3 (:LINEAR EXPT->-1)) (24 24 (:REWRITE USB-LINEAR-REWRITE)) (23 23 (:REWRITE EXPT-COMPARE)) (20 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (19 11 (:REWRITE DEFAULT-<-2)) (17 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (16 16 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (16 12 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE DEFAULT-*-2)) (13 9 (:REWRITE DEFAULT-+-2)) (11 11 (:REWRITE DEFAULT-<-1)) (11 9 (:REWRITE DEFAULT-+-1)) (9 3 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:REWRITE DEFAULT-*-1)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (4 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-UPPER)) (3 3 (:REWRITE INTEGER-RANGE-P-EXTEND-LOWER)) (3 1 (:REWRITE FOLD-CONSTS-IN-+)) (2 2 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (1 1 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (1 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-OF-X-PLUS-2-TO-THE-N-MINUS-ONE-CONSTANT-VERSION (224 89 (:REWRITE USB-LINEAR-REWRITE)) (124 12 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (89 89 (:META CANCEL_PLUS-LESSP-CORRECT)) (88 68 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (85 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (70 20 (:REWRITE EXPO-OF-NOT-RATIONALP)) (60 60 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (54 34 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (53 53 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (53 26 (:REWRITE DEFAULT-+-2)) (51 35 (:REWRITE DEFAULT-<-2)) (41 7 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (38 26 (:REWRITE DEFAULT-+-1)) (38 14 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (36 35 (:REWRITE DEFAULT-<-1)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (33 7 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (28 14 (:REWRITE USB-TIGHTEN)) (27 27 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (20 20 (:REWRITE EXPONENTS-ADD)) (20 20 (:REWRITE EXPO-MINUS-ERIC)) (17 11 (:LINEAR EXPT-LESS-THAN-1-HACK)) (16 4 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (15 3 (:REWRITE LOGBITP-TOO-BIG)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 14 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (12 12 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 4 (:REWRITE IFIX-INTEGERP)) (7 5 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (5 5 (:REWRITE POWER2-INTEGER)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (4 4 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (4 4 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 1 (:REWRITE DEFAULT-UNARY-MINUS)) (4 1 (:REWRITE DEFAULT-*-1)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (2 2 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (2 1 (:REWRITE DEFAULT-*-2)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-+-EXPT-N-REWRITE)) (1 1 (:REWRITE LOGAPP-OF-MINUS-ONE-PLUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (HALF-CANCEL) (LOGEXT-PLUS-EXPT2N-REWRITE (504 6 (:REWRITE LOGHEAD-IDENTITY)) (393 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (329 59 (:REWRITE EXPT-COMPARE)) (167 79 (:REWRITE USB-LINEAR-REWRITE)) (123 11 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (102 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (95 3 (:REWRITE LOGBIT-TOO-BIG-NO-FREE-VARS)) (79 79 (:META CANCEL_PLUS-LESSP-CORRECT)) (60 25 (:REWRITE DEFAULT-*-2)) (57 19 (:REWRITE EXPO-OF-NOT-RATIONALP)) (54 54 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (53 40 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (50 50 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (47 47 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (39 11 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (38 23 (:REWRITE DEFAULT-+-2)) (36 27 (:REWRITE DEFAULT-<-2)) (36 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 3 (:REWRITE LOGBIT-WHEN-I-IS-NON-POSITIVE)) (34 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (30 23 (:REWRITE DEFAULT-+-1)) (29 25 (:REWRITE DEFAULT-*-1)) (28 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 27 (:REWRITE DEFAULT-<-1)) (22 11 (:REWRITE USB-TIGHTEN)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (19 19 (:REWRITE EXPO-MINUS-ERIC)) (15 3 (:REWRITE LOGBIT-TOO-BIG)) (15 1 (:REWRITE EQUAL-1-HACK)) (14 2 (:REWRITE LOGBITP-TOO-BIG)) (12 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (11 11 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (11 11 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (8 4 (:REWRITE IFIX-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGHEAD-OF-SUM-INTEGER-AND-NON-INTEGER)) (6 6 (:META META-RULE-ERIC)) (6 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (6 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 2 (:REWRITE FOLD-CONSTS-IN-+)) (4 4 (:TYPE-PRESCRIPTION IFIX)) (4 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBITP-SUBST-2)) (3 3 (:REWRITE LOGBITP-SUBST)) (3 3 (:REWRITE LOGBIT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGBIT-SUBST-SIMPLER)) (3 3 (:REWRITE LOGBIT-SUBST)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EQUAL-CONSTANT-+))) (LOGEXT-PLUS-EXPT2N-REWRITE-CONSTANT-VERSION (26 26 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (4 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (LOGEXT-EQUAL-REWRITE (488 34 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (482 17 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (438 8 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (371 16 (:REWRITE LOGHEAD-IDENTITY)) (371 8 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (258 6 (:LINEAR LOGHEAD-LEQ)) (239 15 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (237 39 (:REWRITE USB-TIGHTEN)) (208 208 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (205 86 (:REWRITE EXPT-COMPARE)) (201 19 (:REWRITE LOGBITP-SUBST-2)) (166 21 (:REWRITE <-+-CONSTANT-CONSTANT)) (90 26 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (88 88 (:REWRITE USB-LINEAR-REWRITE)) (88 88 (:META CANCEL_PLUS-LESSP-CORRECT)) (78 78 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (77 64 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (77 2 (:REWRITE LOGBITP-LOGEXT)) (73 73 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (68 68 (:TYPE-PRESCRIPTION LOGBITP)) (63 56 (:REWRITE DEFAULT-<-1)) (56 56 (:REWRITE DEFAULT-<-2)) (49 14 (:REWRITE EXPO-OF-NOT-RATIONALP)) (45 32 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (39 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (38 1 (:REWRITE SIGN-LOGEXT-AS-LOGBITP)) (35 35 (:REWRITE DEFAULT-+-2)) (35 35 (:REWRITE DEFAULT-+-1)) (34 34 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (34 34 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (33 33 (:REWRITE POWER2-INTEGER)) (30 15 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 2 (:REWRITE USBP-LOGEXT-NARROWER)) (27 16 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (27 3 (:LINEAR LOGEXT-BOUND-UPPER)) (26 26 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (25 25 (:REWRITE LOGEXT-SUBST-WITH-LOGHEAD)) (25 25 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (24 6 (:REWRITE DEFAULT-UNARY-MINUS)) (23 16 (:REWRITE LOGEXT-WHEN-I-IS-NOT-AN-INTEGERP)) (23 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (21 21 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (21 14 (:REWRITE EXPO-EXPT2)) (18 18 (:META META-RULE-ERIC)) (17 17 (:REWRITE LOGBITP-SUBST)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGEXT-WHEN-SIZE-IS-NON-POSITIVE)) (16 16 (:REWRITE LOGEXT-SUBST2)) (16 9 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (14 14 (:TYPE-PRESCRIPTION POWER2P)) (14 14 (:REWRITE POWER2P-EXPT2-I)) (14 14 (:REWRITE EXPO-MINUS-ERIC)) (13 13 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (13 13 (:REWRITE EXPONENTS-ADD)) (12 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (10 10 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (9 9 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (9 1 (:REWRITE FALSIFY-SIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (8 8 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (8 8 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (7 5 (:LINEAR EXPT-LESS-THAN-1-HACK)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (5 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-OF-LOGEXT-SAME-SIZE)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE LOGEXT-EQUAL-MIN-VALUE-HACK-GEN-CONSTANT-VERSION)) (1 1 (:REWRITE DUMB))) (UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (5 4 (:REWRITE DEFAULT-<-1)) (5 2 (:REWRITE DEFAULT-UNARY-MINUS)) (5 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-<-2)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (2 1 (:REWRITE USB-TIGHTEN)) (2 1 (:REWRITE FIX-DOES-NOTHING)) (1 1 (:TYPE-PRESCRIPTION LOGBITP)) (1 1 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (MOVE-NEGATED-TERM-HACK (43 43 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (7 7 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (6 3 (:REWRITE DEFAULT-UNARY-MINUS)) (5 4 (:REWRITE DEFAULT-+-1)) (4 4 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (2 2 (:REWRITE EQUAL-CONSTANT-+)) (2 2 (:META CANCEL_TIMES-EQUAL-CORRECT)) (2 2 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGIOR-HACK (4 1 (:REWRITE LOGIOR-OF-SUM-WITH-NEGATIVE-OF-EXPT-CONST-VERSION)) (2 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (2 1 (:REWRITE LOGIOR-AS-B-IOR)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)) (1 1 (:TYPE-PRESCRIPTION EXPO-OF-INTEGER-TYPE)) (1 1 (:REWRITE LOGIOR-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGIOR-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE LOGBITP-SUBST-2)) (1 1 (:REWRITE LOGBITP-SUBST))) (LOGBITP-BOUND (86 1 (:REWRITE FLOOR-=-X/Y . 3)) (36 2 (:REWRITE INTEGERP-+-MINUS-*-4)) (33 4 (:REWRITE /R-WHEN-ABS-NUMERATOR=1)) (30 1 (:REWRITE INTEGERP-OF-UNARY-/-WHEN-INTEGER-P)) (27 1 (:REWRITE FLOOR-=-X/Y . 2)) (25 13 (:REWRITE DEFAULT-<-2)) (25 5 (:REWRITE EXPT-COMPARE-EQUAL)) (19 1 (:REWRITE RTL1)) (19 1 (:REWRITE FLOOR-SIMPLE-CASES)) (19 1 (:REWRITE FLOOR-DETERMINED-1)) (17 7 (:REWRITE DEFAULT-*-2)) (17 1 (:REWRITE FLOOR-TYPE-3 . 2)) (15 13 (:REWRITE DEFAULT-<-1)) (14 14 (:REWRITE USB-LINEAR-REWRITE)) (14 14 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (14 14 (:REWRITE EXPT-COMPARE)) (14 14 (:META CANCEL_PLUS-LESSP-CORRECT)) (11 7 (:REWRITE DEFAULT-*-1)) (10 2 (:REWRITE DEFAULT-UNARY-/)) (10 2 (:REWRITE COMMUTATIVITY-OF-*)) (9 1 (:REWRITE FLOOR-TYPE-3 . 3)) (8 1 (:REWRITE FLOOR-TYPE-4 . 2)) (8 1 (:LINEAR EXPT->-1)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 2 (:REWRITE EXPO-OF-NOT-RATIONALP)) (5 5 (:META CANCEL_TIMES-EQUAL-CORRECT)) (5 5 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:TYPE-PRESCRIPTION POWER2P)) (3 3 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (3 3 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 1 (:REWRITE NUMERATOR-WHEN-INTEGERP)) (3 1 (:REWRITE FLOOR-WHEN-J-IS-NOT-AN-ACL2-NUMBERP)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE POWER2P-EXPT2-I)) (2 2 (:REWRITE EXPO-MINUS-ERIC)) (2 2 (:REWRITE EXPO-EXPT2)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (2 1 (:REWRITE IFIX-INTEGERP)) (1 1 (:REWRITE FLOOR-WHEN-I-IS-NOT-AN-ACL2-NUMBERP)) (1 1 (:REWRITE FLOOR-TYPE-4 . 3)) (1 1 (:LINEAR EXPT-LESS-THAN-1-HACK))) (ASH-EQUAL-REWRITE (530 10 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (461 9 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (450 9 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (318 180 (:REWRITE USB-LINEAR-REWRITE)) (243 3 (:REWRITE ASH-BOUND4)) (237 3 (:REWRITE ASH-BOUND3A)) (215 177 (:REWRITE EXPT-COMPARE)) (182 142 (:REWRITE DEFAULT-<-1)) (180 180 (:META CANCEL_PLUS-LESSP-CORRECT)) (170 170 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (166 142 (:REWRITE DEFAULT-<-2)) (155 27 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (147 137 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (118 10 (:REWRITE LOGBITP-SUBST)) (108 10 (:LINEAR EXPT->-1)) (83 28 (:REWRITE USB-TIGHTEN)) (74 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (73 73 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (66 6 (:LINEAR PROD-LINEAR-ALT)) (62 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (54 6 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (54 6 (:REWRITE ASH-AS-LOGTAIL)) (54 6 (:LINEAR PROD-NON-NEGATIVE-LINEAR)) (54 6 (:LINEAR PROD-LINEAR)) (54 6 (:LINEAR MULTIPLY-BY-POSITIVE-INTEGER-LINEAR)) (54 3 (:REWRITE LOGTAIL-IDENTITY)) (50 4 (:REWRITE ASH-0)) (49 47 (:REWRITE DEFAULT-+-2)) (48 6 (:LINEAR X*Y>1-POSITIVE)) (48 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (47 47 (:REWRITE DEFAULT-+-1)) (45 45 (:TYPE-PRESCRIPTION LOGBITP)) (45 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (40 40 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (37 4 (:REWRITE ZIP-OPEN)) (36 34 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (32 2 (:REWRITE LOGBITP-ASH)) (29 27 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (27 27 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (27 27 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (27 5 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (27 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (27 3 (:REWRITE ASH-BOUND2)) (27 3 (:REWRITE ASH-BOUND1A)) (24 24 (:REWRITE POWER2-INTEGER)) (23 4 (:REWRITE UNSIGNED-BYTE-P-ASH)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 20 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (20 5 (:REWRITE <=-0-ASH)) (20 4 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (19 17 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (18 16 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (18 6 (:REWRITE DEFAULT-*-2)) (17 17 (:META CANCEL_TIMES-EQUAL-CORRECT)) (16 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (16 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (14 4 (:REWRITE EXPO-OF-NOT-RATIONALP)) (11 5 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE LOGBITP-SUBST-2)) (9 6 (:REWRITE DEFAULT-*-1)) (9 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 8 (:REWRITE EXPT-COMPARE-EQUAL)) (8 8 (:META META-RULE-ERIC)) (7 7 (:TYPE-PRESCRIPTION ZIP)) (7 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE COMMUTATIVITY-2-OF-+)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE <-*-0)) (6 6 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (6 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (6 4 (:REWRITE EXPO-EXPT2)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE POWER2P-EXPT2-I)) (4 4 (:REWRITE EXPO-MINUS-ERIC)) (4 4 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE ASH-GOES-TO-0)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE EXPONENTS-ADD-FOR-NONNEG-EXPONENTS)) (2 2 (:REWRITE EXPONENTS-ADD)) (2 2 (:REWRITE ASH-EQUAL-MINUS-EXPT2N-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE INVERSE-OF-+)) (1 1 (:REWRITE FOLD-CONSTS-IN-+)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS))) (ASSOCIATIVITY-OF-LOGAPP-BETTER-BACK (126 126 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (114 6 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (110 6 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (47 47 (:TYPE-PRESCRIPTION |x < y => 0 < y-x|)) (46 4 (:REWRITE MY-LOGAPP-<-0)) (25 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (24 16 (:REWRITE DEFAULT-<-1)) (21 21 (:REWRITE USB-LINEAR-REWRITE)) (21 21 (:REWRITE EXPT-COMPARE)) (21 21 (:META CANCEL_PLUS-LESSP-CORRECT)) (18 18 (:REWRITE POWER2-INTEGER)) (17 17 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (16 16 (:REWRITE DEFAULT-<-2)) (13 5 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 4 (:REWRITE LOGAPP-<)) (8 8 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (8 8 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (8 4 (:REWRITE IFIX-INTEGERP)) (8 4 (:DEFINITION IFIX)) (7 5 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE <-+-NEGATIVE-0-1)) (6 6 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (6 6 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (6 6 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (6 5 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE DEFAULT-+-2)) (2 2 (:REWRITE DEFAULT-+-1)) (1 1 (:REWRITE DEFAULT-UNARY-MINUS)) (1 1 (:REWRITE <-+-CONSTANT-CONSTANT))) (EXPT-EXECUTE (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (5 5 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (EXPT-EXECUTE-REWRITE (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-RATIONALP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-POSITIVE)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-NONZERO)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP))) (LOGAPP-EQUAL-CONSTANT (132 22 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (128 8 (:REWRITE LOGHEAD-IDENTITY)) (102 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (72 4 (:REWRITE LOGTAIL-IDENTITY)) (60 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (56 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (48 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (44 22 (:REWRITE USB-TIGHTEN)) (42 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (39 33 (:REWRITE DEFAULT-<-2)) (38 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (37 37 (:REWRITE USB-LINEAR-REWRITE)) (37 37 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (37 37 (:REWRITE EXPT-COMPARE)) (37 37 (:META CANCEL_PLUS-LESSP-CORRECT)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (34 34 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (34 33 (:REWRITE DEFAULT-<-1)) (34 4 (:REWRITE <-+-CONSTANT-CONSTANT)) (33 33 (:REWRITE POWER2-INTEGER)) (32 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (30 30 (:TYPE-PRESCRIPTION LOGBITP)) (30 30 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (22 22 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (22 22 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (22 22 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (19 15 (:META CANCEL_PLUS-EQUAL-CORRECT)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (18 18 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (18 2 (:REWRITE ASH-AS-LOGTAIL)) (17 17 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (16 14 (:REWRITE DEFAULT-+-2)) (16 4 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (15 15 (:META CANCEL_TIMES-EQUAL-CORRECT)) (14 14 (:REWRITE DEFAULT-+-1)) (12 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (12 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (11 11 (:REWRITE EXPT-COMPARE-EQUAL)) (11 11 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (10 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 2 (:REWRITE ASH-0)) (8 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 4 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (4 4 (:TYPE-PRESCRIPTION ZIP)) (4 4 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE INTEGERP-+-MINUS-*-2)) (4 2 (:REWRITE IFIX-INTEGERP)) (4 2 (:REWRITE FIX-DOES-NOTHING)) (4 2 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (4 2 (:DEFINITION FIX)) (2 2 (:REWRITE ZIP-OPEN)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (2 2 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE ASH-GOES-TO-0)) (2 2 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (2 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS))) (LOGHEAD-COMPARE-TO-MAX) (LOGHEAD-EQUAL-MAX-PLUS-SOMETHING-ELSE (60 6 (:REWRITE LOGHEAD-IDENTITY)) (20 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (20 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (18 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:TYPE-PRESCRIPTION LOGBITP)) (14 7 (:REWRITE USB-TIGHTEN)) (14 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (12 6 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (10 1 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (9 9 (:REWRITE POWER2-INTEGER)) (7 7 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (7 7 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:META META-RULE-ERIC)) (5 3 (:REWRITE DEFAULT-<-1)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 2 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE USB-LINEAR-REWRITE)) (3 3 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE EXPT-COMPARE-EQUAL)) (3 3 (:REWRITE EXPT-COMPARE)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:REWRITE DEFAULT-<-2)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-LESSP-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (2 2 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (2 2 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE SUM-POWER-OF-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (1 1 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (1 1 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (1 1 (:REWRITE EQUAL-CONSTANT-+)) (1 1 (:REWRITE DEFAULT-+-2)) (1 1 (:REWRITE DEFAULT-+-1))) (LOGHEAD-PLUS-EXPT-AS-THIRD-ADDEND (1072 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (848 194 (:REWRITE POWER2-INTEGER)) (790 104 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (700 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (624 58 (:REWRITE INTEGERP-+-MINUS-*-2)) (622 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (464 16 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (432 12 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER-3)) (424 32 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (400 8 (:REWRITE LOGHEAD-IDENTITY)) (350 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (220 16 (:REWRITE LOGBITP-+-SIMPLE)) (204 28 (:REWRITE <-+-CONSTANT-CONSTANT)) (148 148 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (142 142 (:REWRITE USB-LINEAR-REWRITE)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (142 142 (:REWRITE EXPT-COMPARE)) (142 142 (:META CANCEL_PLUS-LESSP-CORRECT)) (137 118 (:REWRITE DEFAULT-<-2)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (130 130 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (128 128 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (125 118 (:REWRITE DEFAULT-<-1)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 58 (:REWRITE FIX-DOES-NOTHING)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (90 30 (:REWRITE EXPO-OF-NOT-RATIONALP)) (86 86 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (80 40 (:DEFINITION FIX)) (80 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (77 4 (:LINEAR LOGHEAD-LEQ)) (68 32 (:REWRITE USB-TIGHTEN)) (64 64 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (62 34 (:REWRITE DEFAULT-+-2)) (60 30 (:REWRITE EXPO-EXPT2)) (58 58 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (52 4 (:REWRITE SIGNED-BYTE-P-+)) (51 51 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (48 48 (:TYPE-PRESCRIPTION LOGBITP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (40 40 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (32 32 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (32 32 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (30 30 (:TYPE-PRESCRIPTION POWER2P)) (30 30 (:REWRITE POWER2P-EXPT2-I)) (30 30 (:REWRITE EXPO-MINUS-ERIC)) (27 3 (:LINEAR EXPT->-1)) (24 3 (:LINEAR EXPT-LESS-THAN-1-HACK)) (20 20 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (20 20 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (20 20 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (20 20 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 16 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (16 16 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (16 16 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (16 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (12 4 (:REWRITE FOLD-CONSTS-IN-+)) (8 8 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST2)) (8 8 (:REWRITE LOGHEAD-SUBST)) (8 8 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (8 8 (:REWRITE LOGHEAD-+-REDUCE)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 8 (:META META-RULE-ERIC)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (6 6 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (6 6 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-SUBTRACTING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE SIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (4 4 (:REWRITE LOGBITP-TOO-BIG))) (LOGHEAD-OF-DIFFERENCE (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (242 161 (:REWRITE DEFAULT-+-2)) (204 161 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (174 18 (:LINEAR LOGHEAD-LEQ)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (108 86 (:REWRITE DEFAULT-<-1)) (107 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (102 102 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (102 102 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 11 (:REWRITE <-+-CONSTANT-CONSTANT)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (19 19 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (LOGHEAD-OF-DIFFERENCE-ALT (1304 152 (:REWRITE LOGHEAD-IDENTITY)) (710 43 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (651 37 (:REWRITE LOGHEAD-COMPARE-HACK)) (595 37 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (472 8 (:REWRITE LOGBITP-+-SIMPLE)) (407 18 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (358 179 (:REWRITE USB-TIGHTEN)) (308 4 (:REWRITE UNSIGNED-BYTE-P--OF-MINUS)) (255 170 (:REWRITE DEFAULT-+-2)) (247 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (223 170 (:REWRITE DEFAULT-+-1)) (189 189 (:META META-RULE-ERIC)) (184 184 (:REWRITE LOGHEAD-SUBST)) (179 179 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (175 175 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (175 175 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (171 171 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (168 18 (:LINEAR LOGHEAD-LEQ)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (152 152 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (152 152 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (148 8 (:REWRITE LOGHEAD-<=)) (141 8 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (108 86 (:REWRITE DEFAULT-<-1)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (86 86 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (86 86 (:REWRITE DEFAULT-<-2)) (80 80 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (78 68 (:REWRITE LOGBITP-SUBST-2)) (67 54 (:REWRITE DEFAULT-UNARY-MINUS)) (60 8 (:REWRITE LOGHEAD-<)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (58 58 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (56 8 (:REWRITE LOGBITP-+-USB-V1)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (55 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (49 14 (:REWRITE <-+-CONSTANT-CONSTANT)) (48 48 (:REWRITE EXPT-COMPARE-EQUAL)) (48 48 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (48 48 (:META CANCEL_TIMES-EQUAL-CORRECT)) (48 48 (:META CANCEL_PLUS-EQUAL-CORRECT)) (43 43 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (43 43 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (43 43 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (40 8 (:REWRITE EQUAL-NEGATION-SAME-SIGN)) (40 4 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (40 4 (:REWRITE <-OF-LOGHEADS-REWRITE)) (38 15 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (36 4 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (36 4 (:REWRITE LOGBITP-+-USB-V4)) (32 4 (:REWRITE UNSIGNED-BYTE-P-OF-MINUS-OF-POSITIVE)) (30 28 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (28 28 (:REWRITE LOGBITP-TOO-BIG)) (28 4 (:REWRITE LOGBITP-+-USB-V2)) (28 4 (:REWRITE LOGBITP-+-SIMPLE2)) (21 21 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (18 2 (:REWRITE LOGBITP-+-USB-V3)) (16 16 (:REWRITE POWER2-INTEGER)) (16 8 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (15 15 (:TYPE-PRESCRIPTION QUOTEP)) (8 8 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (8 8 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (8 8 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (8 8 (:REWRITE LOGHEAD-SUBST-WEIRD)) (8 8 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (8 8 (:DEFINITION QUOTEP)) (4 4 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (4 4 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER))) (HACK<) (LOGAPP-LOGHEAD-HACK-16-31 (64 64 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (54 5 (:REWRITE LOGHEAD-IDENTITY)) (48 4 (:LINEAR LOGAPP-LINEAR)) (30 3 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (19 1 (:LINEAR LOGHEAD-UPPER-BOUND)) (19 1 (:LINEAR LOGHEAD-NONNEGATIVE-LINEAR)) (18 9 (:REWRITE USB-TIGHTEN)) (18 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:TYPE-PRESCRIPTION LOGBITP)) (10 6 (:REWRITE DEFAULT-<-1)) (9 9 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (9 9 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (9 9 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (9 3 (:REWRITE LOGHEAD-IDENTITY-2-ALT)) (9 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (8 1 (:REWRITE HACK<)) (8 1 (:LINEAR LOGHEAD-LEQ)) (7 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE POWER2-INTEGER)) (6 6 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (5 5 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (5 5 (:REWRITE LOGHEAD-SUBST2)) (5 5 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (4 3 (:REWRITE DEFAULT-+-2)) (3 3 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (3 3 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (3 3 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE DEFAULT-+-1)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST)) (2 2 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (2 2 (:REWRITE LOGHEAD-SUBST-WEIRD)) (2 2 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (2 2 (:REWRITE LOGHEAD-+-REDUCE)) (2 2 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (2 2 (:REWRITE LOGBITP-SUBST-2)) (2 2 (:REWRITE LOGBITP-SUBST)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (2 2 (:REWRITE LOGAPP-SUM-NORMALIZE-LEADING-CONSTANT)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGBITP-TOO-BIG)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (1 1 (:META CANCEL_TIMES-EQUAL-CORRECT)) (1 1 (:META CANCEL_PLUS-EQUAL-CORRECT))) (LOGHEADS-OF-SUM-ALMOST-EQUAL (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 15 (:REWRITE DEFAULT-+-2)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (15 15 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEADS-OF-SUM-ALMOST-EQUAL-ALT (151 8 (:REWRITE LOGHEAD-IDENTITY)) (135 2 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (133 2 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (130 15 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (98 6 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (86 6 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (70 6 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (62 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (57 7 (:REWRITE <-+-CONSTANT-CONSTANT)) (52 14 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (51 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (41 41 (:REWRITE POWER2-INTEGER)) (38 27 (:REWRITE DEFAULT-<-2)) (38 6 (:REWRITE LOGBITP-SUBST-2)) (34 34 (:REWRITE USB-LINEAR-REWRITE)) (34 34 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (34 34 (:REWRITE EXPT-COMPARE)) (34 34 (:META CANCEL_PLUS-LESSP-CORRECT)) (32 32 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (32 32 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (32 15 (:REWRITE USB-TIGHTEN)) (30 30 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (30 30 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (29 1 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (28 27 (:REWRITE DEFAULT-<-1)) (28 1 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (24 24 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (21 1 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (20 14 (:REWRITE DEFAULT-+-2)) (16 2 (:LINEAR LOGHEAD-LEQ)) (15 15 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (15 15 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (15 15 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (14 14 (:REWRITE DEFAULT-+-1)) (14 8 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (14 7 (:DEFINITION FIX)) (12 7 (:REWRITE INTEGERP-+-MINUS-*-2)) (12 7 (:REWRITE FIX-DOES-NOTHING)) (11 9 (:REWRITE LOGHEAD-SUBST2)) (9 9 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (9 9 (:REWRITE LOGHEAD-SUBST)) (9 9 (:META META-RULE-ERIC)) (9 1 (:LINEAR EXPT->-1)) (8 8 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 1 (:LINEAR EXPT-LESS-THAN-1-HACK)) (7 7 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 4 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (6 1 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (5 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 2 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (3 3 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (3 3 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (3 3 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (3 3 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (3 3 (:REWRITE LOGHEAD-+-REDUCE)) (3 3 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 1 (:REWRITE HACK<)) (2 2 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (2 2 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (2 2 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (1 1 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (1 1 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (1 1 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-LHS)) (1 1 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (1 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB))) (LOGHEAD-OF-SUM-OF-LOGAPP (726 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (616 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (545 20 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (504 13 (:REWRITE LOGHEAD-IDENTITY)) (482 42 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (404 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (256 80 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (224 34 (:REWRITE <-+-CONSTANT-CONSTANT)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (148 148 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (121 121 (:REWRITE POWER2-INTEGER)) (108 8 (:REWRITE LOGBITP-+-USB-V2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (102 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE USB-LINEAR-REWRITE)) (99 99 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (99 99 (:REWRITE EXPT-COMPARE)) (99 99 (:META CANCEL_PLUS-LESSP-CORRECT)) (97 73 (:REWRITE DEFAULT-<-2)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (88 88 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (88 88 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (88 42 (:REWRITE USB-TIGHTEN)) (84 84 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (82 73 (:REWRITE DEFAULT-<-1)) (80 40 (:DEFINITION FIX)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (64 8 (:REWRITE LOGBITP-+-USB-V4)) (58 58 (:TYPE-PRESCRIPTION LOGBITP)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 34 (:REWRITE DEFAULT-+-2)) (48 40 (:REWRITE INTEGERP-+-MINUS-*-2)) (48 40 (:REWRITE FIX-DOES-NOTHING)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (42 42 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (42 42 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (42 42 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (40 40 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (34 34 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (28 13 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (22 13 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (20 20 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (20 20 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (20 20 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (19 19 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 14 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (14 14 (:META META-RULE-ERIC)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (13 13 (:REWRITE LOGHEAD-SUBST2)) (13 13 (:REWRITE LOGHEAD-SUBST)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 1 (:REWRITE LOGHEAD-LOGAPP-2)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGHEAD-OF-SUM-OF-LOGAPP-1 (780 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (773 19 (:REWRITE UNSIGNED-BYTE-P-+-EASY)) (670 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (589 11 (:REWRITE LOGHEAD-IDENTITY)) (524 8 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (479 39 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (312 96 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (232 42 (:REWRITE <-+-CONSTANT-CONSTANT)) (212 212 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (208 16 (:REWRITE LOGBITP-+-SIMPLE)) (145 145 (:REWRITE POWER2-INTEGER)) (136 8 (:REWRITE USB-OF-LOGAPP-2-GEN)) (136 8 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (106 106 (:REWRITE USB-LINEAR-REWRITE)) (106 106 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (106 106 (:REWRITE EXPT-COMPARE)) (106 106 (:META CANCEL_PLUS-LESSP-CORRECT)) (104 80 (:REWRITE DEFAULT-<-2)) (104 16 (:REWRITE LOGBITP-+-USB-V1)) (104 8 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (102 8 (:REWRITE LOGBITP-+-USB-V2)) (100 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (99 99 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (96 80 (:REWRITE DEFAULT-<-1)) (96 48 (:DEFINITION FIX)) (96 8 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (96 8 (:REWRITE LOGBITP-+-SIMPLE2)) (96 4 (:LINEAR LOGHEAD-LEQ)) (95 95 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (82 39 (:REWRITE USB-TIGHTEN)) (78 78 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (77 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN-GEN2)) (60 48 (:REWRITE INTEGERP-+-MINUS-*-2)) (60 48 (:REWRITE FIX-DOES-NOTHING)) (58 8 (:REWRITE LOGBITP-+-USB-V4)) (57 36 (:REWRITE DEFAULT-+-2)) (56 56 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (55 55 (:TYPE-PRESCRIPTION LOGBITP)) (48 48 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (48 4 (:REWRITE SIGNED-BYTE-P-OF-LOGAPP)) (48 4 (:REWRITE LOGBITP-+-USB-V3)) (39 39 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (39 39 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (39 39 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (39 36 (:REWRITE DEFAULT-+-1)) (32 32 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (30 1 (:REWRITE PLUS-OF-LOGAPP-SUCK-IN)) (23 11 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (20 20 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (20 11 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (19 19 (:REWRITE UNSIGNED-BYTE-P-WHEN-ADDING-BIG-POWER-OF-2-CONSTANT-VERSION)) (19 19 (:REWRITE UNSIGNED-BYTE-P-PLUS-LIMIT)) (19 19 (:REWRITE UNSIGNED-BYTE-P-OF-SUM-WITH-CONSTANT)) (18 2 (:LINEAR EXPT->-1)) (16 16 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (16 16 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (16 16 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (16 16 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (16 2 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (16 2 (:LINEAR EXPT-LESS-THAN-1-HACK)) (14 2 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (12 8 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (11 11 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (11 11 (:REWRITE LOGHEAD-SUBST2)) (11 11 (:REWRITE LOGHEAD-SUBST)) (11 11 (:META META-RULE-ERIC)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER-BETTER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-HELPER)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST-ALT)) (10 10 (:REWRITE LOGHEAD-SUM-SUBST)) (10 10 (:REWRITE LOGHEAD-SUM-SPLIT-INTO-2-WHEN-I-IS-A-CONSTANT)) (10 10 (:REWRITE LOGHEAD-SUM-CHOP-FIRST-ARG-WHEN-CONSTANT-ALT)) (10 10 (:REWRITE LOGHEAD-OF-SUM-WITH-CONSTANT)) (10 10 (:REWRITE LOGHEAD-+-REDUCE)) (10 10 (:REWRITE LOGHEAD-+-EXPT-CONSTANT-VERSION)) (10 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 8 (:REWRITE LOGBITP-SUBST-2)) (8 8 (:REWRITE LOGBITP-SUBST)) (8 4 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (7 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (6 6 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (4 4 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG))) (LOGAPP-OF-ASH (569 5 (:REWRITE LOGAPP-<)) (352 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (314 2 (:REWRITE LOGBITP-LOGAPP-BETTER)) (164 1 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (162 1 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (156 112 (:REWRITE DEFAULT-<-1)) (154 84 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (147 147 (:REWRITE USB-LINEAR-REWRITE)) (145 145 (:REWRITE EXPT-COMPARE)) (145 145 (:META CANCEL_PLUS-LESSP-CORRECT)) (142 142 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (119 112 (:REWRITE DEFAULT-<-2)) (81 9 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (81 9 (:REWRITE ASH-AS-LOGTAIL)) (79 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (79 9 (:LINEAR LOGAPP-NON-NEGATIVE-LINEAR)) (70 9 (:LINEAR LOGAPP-NEGATIVE-LINEAR)) (64 8 (:LINEAR EXPT->-1)) (62 2 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (57 9 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE)) (56 56 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (50 2 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (48 1 (:LINEAR LOGHEAD-LEQ)) (46 23 (:REWRITE USB-TIGHTEN)) (44 28 (:REWRITE DEFAULT-+-2)) (43 43 (:REWRITE POWER2-INTEGER)) (37 37 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (36 9 (:REWRITE ASH-0)) (30 28 (:REWRITE DEFAULT-+-1)) (29 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (29 1 (:REWRITE LOGTAIL-IDENTITY)) (28 2 (:REWRITE LOGBITP-ASH)) (28 1 (:REWRITE LOGHEAD-IDENTITY)) (27 27 (:TYPE-PRESCRIPTION LOGBITP)) (26 26 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (24 24 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (24 2 (:REWRITE <-0-+-NEGATIVE-1)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (21 6 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (20 2 (:REWRITE UNSIGNED-BYTE-P-ASH)) (18 18 (:TYPE-PRESCRIPTION ZIP)) (18 9 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (18 2 (:REWRITE UNSIGNED-BYTE-P-ASH-NEG)) (16 16 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (16 16 (:LINEAR EXPT-IS-INCREASING-FOR-BASE>1)) (15 15 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (15 15 (:META META-RULE-ERIC)) (13 13 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (12 5 (:REWRITE HACK<)) (11 11 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (11 11 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (9 9 (:REWRITE ZIP-OPEN)) (9 9 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE ASH-GOES-TO-0)) (9 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (8 8 (:REWRITE DEFAULT-UNARY-MINUS)) (8 8 (:LINEAR EXPT-LESS-THAN-1-HACK)) (8 6 (:REWRITE USB-OF-LOGAPP-2-GEN)) (8 2 (:REWRITE COMMUTATIVITY-OF-+)) (8 1 (:REWRITE LOGHEAD-LOGAPP-BETTER)) (8 1 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (6 6 (:TYPE-PRESCRIPTION POWER2P)) (6 6 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (6 6 (:REWRITE LOGHEAD-SUBST2)) (6 6 (:REWRITE LOGHEAD-SUBST)) (6 6 (:REWRITE LOGBITP-SUBST-2)) (6 6 (:REWRITE LOGBITP-SUBST)) (6 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (6 2 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (5 1 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE EXPT-COMPARE-EQUAL)) (4 4 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (4 4 (:META CANCEL_TIMES-EQUAL-CORRECT)) (4 4 (:META CANCEL_PLUS-EQUAL-CORRECT)) (4 2 (:REWRITE UNSIGNED-BYTE-P-ASH-POS)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-0)) (2 2 (:REWRITE LOGBITP-TOO-BIG)) (2 1 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGHEAD-COMPARE-HACK))) (EQUAL-LOGAPP-WITH-LOGTAIL-OF-SELF-REWRITE (121 13 (:REWRITE LOGHEAD-IDENTITY)) (46 46 (:TYPE-PRESCRIPTION LOGBITP)) (46 23 (:REWRITE USB-TIGHTEN)) (42 6 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (38 1 (:REWRITE ASH-0)) (37 4 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (35 4 (:LINEAR LOGHEAD-LEQ)) (34 1 (:REWRITE ZIP-OPEN)) (30 3 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (30 3 (:REWRITE LOGTAIL-IDENTITY)) (28 4 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (27 9 (:REWRITE HACK<)) (23 23 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (23 23 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (23 23 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (20 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 2 (:REWRITE BACKCHAIN-SIGNED-BYTE-P-TO-UNSIGNED-BYTE-P)) (19 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (18 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (17 17 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (16 16 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (16 16 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (16 16 (:REWRITE LOGHEAD-SUBST2)) (16 16 (:REWRITE LOGHEAD-SUBST)) (16 16 (:META META-RULE-ERIC)) (16 2 (:LINEAR LOGTAIL-LEQ)) (15 15 (:REWRITE POWER2-INTEGER)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (12 12 (:REWRITE LOGBITP-SUBST-2)) (12 12 (:REWRITE LOGBITP-SUBST)) (11 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (9 9 (:REWRITE EXPT-COMPARE-EQUAL)) (9 9 (:META CANCEL_TIMES-EQUAL-CORRECT)) (9 9 (:META CANCEL_PLUS-EQUAL-CORRECT)) (9 6 (:REWRITE DEFAULT-<-1)) (9 1 (:REWRITE LOGTAIL-EQUAL-0)) (8 8 (:REWRITE LOGBITP-TOO-BIG)) (8 8 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (6 6 (:REWRITE USB-LINEAR-REWRITE)) (6 6 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (6 6 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (6 6 (:REWRITE LOGHEAD-COMPARE-HACK)) (6 6 (:REWRITE EXPT-COMPARE)) (6 6 (:REWRITE DEFAULT-<-2)) (6 6 (:META CANCEL_PLUS-LESSP-CORRECT)) (4 4 (:TYPE-PRESCRIPTION SIGNED-BYTE-P)) (4 3 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-POSITIVE)) (3 3 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE SIGNED-BYTE-P-UNSIGNED-BYTE-P)) (2 2 (:REWRITE SIGNED-BYTE-P-SUBTYPE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-TWO)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-THREE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-ONE)) (2 2 (:REWRITE SIGNED-BYTE-P-FROM-BOUNDS-FREE-FOUR)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (2 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (2 1 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (2 1 (:REWRITE ASH-WHEN-I-IS-NOT-AN-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION ZIP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (1 1 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (1 1 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (1 1 (:REWRITE EQUAL-LOGAPP-X-Y-Z-CONSTANTS)) (1 1 (:REWRITE ASH-WHEN-C-IS-NOT-AN-INTEGERP)) (1 1 (:REWRITE ASH-LEAVES-ONE-BIT-LEFT)) (1 1 (:REWRITE ASH-GOES-TO-0)) (1 1 (:REWRITE ASH-AS-LOGTAIL)) (1 1 (:REWRITE *ARK*-ASH-NEG-OF-UNSIGNED-BYTE-P-BRIDGE))) (LOGAPP-EQUAL-LOGAPP-REWRITE-SPECIAL (78 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS-ALT)) (56 4 (:REWRITE LOGHEAD-IDENTITY)) (46 2 (:REWRITE LOGHEAD-DIFFER-WHEN-BIT-DIFFERS)) (40 4 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (36 4 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (26 26 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (26 10 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (24 2 (:REWRITE EQUALITY-OF-LOGHEADS-REWRITE)) (20 20 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (20 10 (:REWRITE USB-TIGHTEN)) (20 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (18 18 (:TYPE-PRESCRIPTION LOGBITP)) (17 17 (:REWRITE POWER2-INTEGER)) (16 2 (:REWRITE <-+-CONSTANT-CONSTANT)) (13 13 (:REWRITE USB-LINEAR-REWRITE)) (13 13 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (13 13 (:REWRITE EXPT-COMPARE)) (13 13 (:META CANCEL_PLUS-LESSP-CORRECT)) (13 3 (:REWRITE HACK<)) (12 12 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (12 11 (:REWRITE DEFAULT-<-1)) (11 11 (:REWRITE DEFAULT-<-2)) (10 10 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (10 10 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (10 10 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (10 10 (:REWRITE DEFAULT-+-2)) (10 10 (:REWRITE DEFAULT-+-1)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER-ALT)) (10 2 (:REWRITE EQUAL-OF-LOGHEADS-OF-WHEN-ONE-IS-ONE-LONGER)) (9 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (8 8 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (8 4 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (8 4 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (7 7 (:META CANCEL_TIMES-EQUAL-CORRECT)) (7 7 (:META CANCEL_PLUS-EQUAL-CORRECT)) (6 6 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (4 4 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (4 4 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (4 4 (:REWRITE LOGHEAD-SUBST2)) (4 4 (:REWRITE LOGHEAD-SUBST)) (4 4 (:REWRITE LOGBITP-TOO-BIG)) (4 4 (:REWRITE LOGBITP-SUBST-2)) (4 4 (:REWRITE LOGBITP-SUBST)) (4 4 (:META META-RULE-ERIC)) (4 2 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 2 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 2 (:REWRITE IFIX-INTEGERP)) (2 2 (:REWRITE LOGHEAD-EQUAL-WHEN-ALMOST-EQUAL)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (2 2 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (2 2 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (1 1 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP))) (LARGER-LOGHEAD-ISNT-LESS (879 24 (:REWRITE LOGTAIL-IDENTITY)) (818 96 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (715 360 (:REWRITE EXPT-COMPARE)) (632 94 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (622 12 (:LINEAR LOGHEAD-LOWER-BOUND-WHEN-TOP-BIT-ONE)) (615 37 (:REWRITE LOGHEAD-IDENTITY)) (614 360 (:REWRITE USB-LINEAR-REWRITE)) (605 12 (:LINEAR LOGHEAD-UPPER-BOUND-WHEN-TOP-BIT-ONE)) (499 25 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (476 6 (:LINEAR X*Y>1-POSITIVE)) (448 24 (:REWRITE LOGBITP-WHEN-I-IS-NON-POSITIVE)) (447 24 (:REWRITE LOGBITP-TO-BOUND-WHEN-USB)) (395 299 (:REWRITE DEFAULT-<-2)) (390 299 (:REWRITE DEFAULT-<-1)) (360 360 (:META CANCEL_PLUS-LESSP-CORRECT)) (348 326 (:REWRITE POWER2-INTEGER)) (335 335 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (329 6 (:LINEAR MULTIPLY-BY-NEGATIVE-INTEGER-LINEAR)) (312 24 (:REWRITE LOGTAIL-OF-LOGHEAD-BECOMES-LOGBIT)) (287 287 (:REWRITE REMOVE-REDUNDANT-<=-HYPS)) (273 108 (:REWRITE USB-TIGHTEN)) (216 20 (:REWRITE LOGHEAD-<)) (176 176 (:REWRITE RATIONALP-IMPLIES-ACL2-NUMBERP)) (171 171 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (154 154 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (148 148 (:TYPE-PRESCRIPTION LOGBITP)) (147 114 (:REWRITE EXPT-WITH-VIOLATED-GUARDS)) (145 18 (:REWRITE <-+-CONSTANT-CONSTANT)) (118 107 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (110 16 (:REWRITE LOGBITP-WHEN-I-IS-NOT-AN-INTEGERP)) (108 12 (:LINEAR LOGHEAD-LEQ)) (105 35 (:REWRITE EXPO-OF-NOT-RATIONALP)) (99 4 (:REWRITE LOGHEAD-<=)) (97 96 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (94 94 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (93 76 (:REWRITE DEFAULT-+-2)) (90 57 (:REWRITE EXPT-WHEN-I-IS-NOT-AN-INTEGERP)) (83 76 (:REWRITE DEFAULT-+-1)) (79 20 (:REWRITE LOGHEAD-COMPARE-TO-MAX)) (70 18 (:REWRITE INTEGERP-SUM-TAKE-OUT-KNOWN-INTEGER)) (67 37 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (59 24 (:REWRITE DEFAULT-*-2)) (57 56 (:META META-RULE-ERIC)) (56 56 (:REWRITE LOGHEAD-SUBST2)) (56 24 (:REWRITE LOGBITP-SUBST)) (54 24 (:REWRITE DEFAULT-*-1)) (53 24 (:REWRITE MOVE-NEGATED-TERM-HACK)) (51 35 (:REWRITE EXPO-EXPT2)) (49 49 (:REWRITE EXPT-COMPARE-EQUAL)) (49 49 (:META CANCEL_TIMES-EQUAL-CORRECT)) (49 49 (:META CANCEL_PLUS-EQUAL-CORRECT)) (49 25 (:REWRITE LOGTAIL-WHEN-POS-IS-NOT-AN-INTEGERP)) (48 24 (:REWRITE LOGTAIL-WHEN-I-IS-NOT-AN-INTEGERP)) (45 37 (:REWRITE UNSIGNED-BYTE-P-LOGHEAD-BETTER)) (40 8 (:REWRITE LOGCAR-EVENP)) (39 12 (:DEFINITION QUOTEP)) (39 10 (:LINEAR EXPT-LESS-THAN-1-HACK)) (36 36 (:TYPE-PRESCRIPTION POWER2P)) (35 35 (:REWRITE POWER2P-EXPT2-I)) (35 35 (:REWRITE EXPO-MINUS-ERIC)) (33 1 (:REWRITE UNSIGNED-BYTE-P-BASE-CASE)) (32 8 (:REWRITE LOGCAR-0-REWRITE)) (28 10 (:REWRITE HACK<)) (26 26 (:REWRITE EQUAL-CONSTANT-+)) (24 24 (:TYPE-PRESCRIPTION EVENP)) (24 24 (:REWRITE LOGBITP-SUBST-2)) (24 16 (:REWRITE EVENP-WHEN-NOT-INTEGERP)) (20 20 (:TYPE-PRESCRIPTION QUOTEP)) (20 20 (:LINEAR EXPT-WEAKLY-MONOTONIC-LINEAR)) (20 10 (:REWRITE <-OF-LOGTAIL)) (18 9 (:DEFINITION FIX)) (17 9 (:REWRITE INTEGERP-+-MINUS-*-2)) (16 16 (:TYPE-PRESCRIPTION LOGCAR-TYPE)) (16 8 (:REWRITE LOGCAR-WHEN-I-IS-NOT-AN-INTEGERP)) (16 8 (:REWRITE LOGBITP-WHEN-J-IS-NOT-AN-INTEGERP)) (12 12 (:REWRITE LOGBITP-TOO-BIG)) (10 10 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (9 9 (:REWRITE INTEGERP-SUM-OF-ODDS-OVER-2-LEADING-CONSTANT)) (6 4 (:REWRITE LOGHEAD-NOT-GREATER-THAN-BIG-CONSTANT)) (3 3 (:REWRITE DEFAULT-CAR)) (2 2 (:REWRITE SUM-POWER-OF-TWO)) (2 2 (:REWRITE MOVE-NEGATED-TERM-TO-OTHER-SIDE-OF-<-TERM-1-ON-RHS)) (2 2 (:REWRITE LOGHEAD-EQUAL-REWRITE-CONSTANT-CASE)) (2 2 (:REWRITE LOGHEAD-COMPARE-HACK)) (1 1 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION))) (LOGAPP-<-NO-SAME-X (71 71 (:TYPE-PRESCRIPTION LOGAPP-NON-NEGATIVE-TYPE-PRESCRIPTION)) (71 71 (:TYPE-PRESCRIPTION LOGAPP-NEGATIVE-TYPE-PRESCRIPTION)) (51 4 (:REWRITE LOGTAIL-LEAVES-SINGLE-BIT)) (19 2 (:REWRITE LOGHEAD-IDENTITY)) (13 5 (:REWRITE UNSIGNED-BYTE-P-WHEN-N-IS-NON-POSITIVE)) (10 10 (:TYPE-PRESCRIPTION UNSIGNED-BYTE-P)) (10 5 (:REWRITE USB-TIGHTEN)) (10 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-POSITIVE)) (9 9 (:REWRITE USB-LINEAR-REWRITE)) (9 3 (:REWRITE HACK<)) (8 8 (:REWRITE REMOVE-REDUNDANT-LESS-THANS)) (8 8 (:REWRITE EXPT-COMPARE)) (8 8 (:META CANCEL_PLUS-LESSP-CORRECT)) (8 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-ONE)) (7 7 (:REWRITE DEFAULT-<-2)) (7 7 (:REWRITE DEFAULT-<-1)) (5 5 (:TYPE-PRESCRIPTION LOGBITP)) (5 5 (:REWRITE UNSIGNED-BYTE-P-SUBTYPE)) (5 5 (:REWRITE UNSIGNED-BYTE-P-REWRITES-TO-LOWER-BOUND-WHEN-WE-KNOW-UPPER-BOUND-TWO)) (5 5 (:REWRITE UNSIGNED-BYTE-P-OF-EXPT-CONST-VERSION)) (4 4 (:REWRITE POWER2-INTEGER)) (4 4 (:REWRITE DEFAULT-+-2)) (4 4 (:REWRITE DEFAULT-+-1)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-SIZE-IS-NEGATIVE)) (3 3 (:REWRITE LOGAPP-WHEN-J-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-WHEN-I-IS-NOT-AN-INTEGERP)) (3 3 (:REWRITE LOGAPP-SUBST-IN-FIRST-ARG-2)) (3 3 (:REWRITE LOGAPP-NORMALIZE-CONSTANT-ARG)) (3 3 (:REWRITE EQUAL-CONSTANT-FALSE-FROM-USB)) (3 3 (:META CANCEL_TIMES-EQUAL-CORRECT)) (3 3 (:META CANCEL_PLUS-EQUAL-CORRECT)) (3 1 (:TYPE-PRESCRIPTION |x < y => 0 < -x+y|)) (2 2 (:REWRITE USB-OF-LOGAPP-2-GEN)) (2 2 (:REWRITE UNSIGNED-BYTE-P-LOGAPP-BETTER)) (2 2 (:REWRITE LOGHEAD-WHEN-SIZE-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-WHEN-MOSTLY-0)) (2 2 (:REWRITE LOGHEAD-WHEN-I-IS-NOT-AN-INTEGERP)) (2 2 (:REWRITE LOGHEAD-SUBST2)) (2 2 (:REWRITE LOGHEAD-SUBST)) (2 2 (:REWRITE LOGBITP-TEST-OF-TOP-BIT-ALT)) (2 2 (:REWRITE EXPT-COMPARE-EQUAL)) (2 2 (:REWRITE DEFAULT-UNARY-MINUS)) (2 2 (:META META-RULE-ERIC)) (1 1 (:TYPE-PRESCRIPTION EXPT-TYPE-PRESCRIPTION-INTEGERP)) (1 1 (:TYPE-PRESCRIPTION EXPT-2-POSITIVE-RATIONAL-TYPE)))
[ { "context": " core knowledge base.\n;;;\n;;; Author & Maintainer: Scott E. Fahlman\n;;; *********************************************", "end": 244, "score": 0.9998822808265686, "start": 228, "tag": "NAME", "value": "Scott E. Fahlman" } ]
kb/core-components/simple-biology.lisp
nondejus/scone
60
;;; -*- Mode:Lisp -*- ;;; *************************************************************************** ;;; Minimal intuitive knowledge of biology and medicine for the ;;; Scone's core knowledge base. ;;; ;;; Author & Maintainer: Scott E. Fahlman ;;; *************************************************************************** ;;; Copyright (C) 2003-2014, Carnegie Mellon University. ;;; ;;; The Scone software is made available to the public under the ;;; Apache 2.0 open source license. A copy of this license is ;;; distributed with the software. The license can also be found at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0. ;;; ;;; Unless required by applicable law or agreed to in writing, ;;; software distributed under the License is distributed on an "AS ;;; IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ;;; express or implied. See the License for the specific language ;;; governing permissions and limitations under the License. ;;; ;;; Development since February 2013 has been supported in part by the ;;; U.S. Office of Naval Research under award number N000141310224. ;;; ;;; Development of Scone from January, 2012, through August 2013 was ;;; supported in part by the Intelligence Advanced Research Projects ;;; Activity (IARPA) via Department of Defense US Army Research ;;; Laboratory contract number W911NF-12-C-0020. ;;; ;;; Development of Scone from 2003 through 2008 was supported in part ;;; by the Defense Advanced Research Projects Agency (DARPA) under ;;; contract numbers NBCHD030010 and FA8750-07-D-0185. ;;; ;;; Additional support for Scone development has been provided by ;;; research grants from Cisco Systems Inc. and from Google Inc. ;;; ;;; The U.S. Government is authorized to reproduce and distribute ;;; reprints for Governmental purposes notwithstanding any copyright ;;; annotation thereon. ;;; ;;; Disclaimer: The views and conclusions contained herein are those ;;; of the authors and should not be interpreted as necessarily ;;; representing the official policies or endorsements, either ;;; expressed or implied, of IARPA, DoD/ARL, ONR, DARPA, the ;;; U.S. Government, or any of our other sponsors. ;;; ************************************************************* ;;; NOTE: This is meant to be the stuff that you will usually want around for ;;; any "common sense" application. It knows about animals, plants, gender, ;;; sickness, etc. For more specialized scientific/medical applictions you ;;; would load a much more detailed file on top of this one. ;;; Sex and Gender (new-complete-split-subtypes {animate} '(({sexually reproducing} :adj) ({asexually reproducing} :adj))) (new-complete-split-subtypes {sexually reproducing} '(({male} :adj-noun) ({female} :adj-noun))) (new-type-role {parent} {sexually reproducing} {sexually reproducing} :n 2) (new-indv-role {mother} {sexually reproducing} {parent}) (new-is-a {mother} {female}) (new-indv-role {father} {sexually reproducing} {parent}) (new-is-a {father} {male}) (new-type-role {offspring} {sexually reproducing} {sexually reproducing} :may-have t) (new-type-role {son} {sexually reproducing} {offspring} :may-have t) (new-is-a {son} {male}) (new-type-role {daughter} {sexually reproducing} {offspring} :may-have t) (new-is-a {daughter} {female}) ;;; Habitat (new-complete-split-subtypes {animal} '(({flying} :adj) ({non-flying} :adj ))) (new-complete-split-subtypes {animal} '(({water-dwelling} :adj "aquatic") ({land-dwelling} :adj "terrestrial") ({amphibious} :adj))) (new-complete-split-subtypes {animal} '(({air-breathing} :adj) ({water-breathing} :adj))) (new-is-a {land-dwelling} {air-breathing}) (new-is-a {water-dwelling} {water-breathing}) ;;; Taxonomy. (new-complete-split-subtypes {animal} '({vertebrate} {invertebrate})) (new-is-a {vertebrate} {sexually reproducing}) (new-complete-split-subtypes {vertebrate} '({fish} {amphibian} {reptile} {bird} {mammal})) (new-is-a {fish} {water-dwelling}) (new-is-a {amphibian} {amphibious}) (new-is-a {reptile} {land-dwelling}) (new-is-a {bird} {land-dwelling}) (new-is-a {mammal} {land-dwelling}) (new-type {water-dwelling mammal} {mammal}) (new-is-not-a {water-dwelling mammal} {land-dwelling}) (new-is-a {water-dwelling mammal} {water-dwelling}) (new-is-not-a {water-dwelling mammal} {water-breathing}) (new-is-a {water-dwelling mammal} {air-breathing}) (new-is-a {fish} {non-flying}) (new-is-a {amphibian} {non-flying}) (new-is-a {reptile} {non-flying}) (new-is-a {bird} {flying}) (new-is-a {mammal} {non-flying}) ;;; Define a few animal types, just as an example. (new-split-subtypes {mammal} '({elephant} {lion} {tiger} {bat} {monkey} {person} {pig} {horse} {cow} {donkey} {dog} {cat} {whale})) (new-is-not-a {bat} {non-flying}) (new-is-a {bat} {flying}) ;; Got to say explicitly that whale is not land-dwelling. That's implied by ;; {water-dwelling mammal}, but we lose the race because of the direct parent ;; link to {mammal}. (new-is-not-a {whale} {land-dwelling}) (new-is-a {whale} {water-dwelling mammal}) (new-split-subtypes {bird} '({canary} {eagle} {crow} {penguin})) (new-is-not-a {penguin} {flying}) (new-is-a {penguin} {non-flying}) (new-split-subtypes {fish} '({shark} {tuna} {perch} {goldfish} {flying-fish})) (new-is-not-a {flying-fish} {non-flying}) (new-is-a {flying-fish} {flying}) ;;; Diseases (new-type {disease} {intangible}) (new-complete-split-subtypes {disease} '(({infectious} :adj) ({non-infectious} :adj))) (new-indv-role {pathogen} {infectious} {animate}) ;;; Define a few diseases. (new-members {infectious} '({influenza} {smallpox} {anthrax})) (new-members {non-infectious} '({scurvy} {cystic fibrosis} {melanoma})) (new-complete-split-subtypes {animate} '(({sick} :adj "ill" "diseased") ({healthy} :adj))) (new-is-a {sick} {bad health condition}) (new-is-a {healthy} {good health condition}) (new-indv-role {affliction} {sick} {disease} :english '(:role "malady"))
24486
;;; -*- Mode:Lisp -*- ;;; *************************************************************************** ;;; Minimal intuitive knowledge of biology and medicine for the ;;; Scone's core knowledge base. ;;; ;;; Author & Maintainer: <NAME> ;;; *************************************************************************** ;;; Copyright (C) 2003-2014, Carnegie Mellon University. ;;; ;;; The Scone software is made available to the public under the ;;; Apache 2.0 open source license. A copy of this license is ;;; distributed with the software. The license can also be found at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0. ;;; ;;; Unless required by applicable law or agreed to in writing, ;;; software distributed under the License is distributed on an "AS ;;; IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ;;; express or implied. See the License for the specific language ;;; governing permissions and limitations under the License. ;;; ;;; Development since February 2013 has been supported in part by the ;;; U.S. Office of Naval Research under award number N000141310224. ;;; ;;; Development of Scone from January, 2012, through August 2013 was ;;; supported in part by the Intelligence Advanced Research Projects ;;; Activity (IARPA) via Department of Defense US Army Research ;;; Laboratory contract number W911NF-12-C-0020. ;;; ;;; Development of Scone from 2003 through 2008 was supported in part ;;; by the Defense Advanced Research Projects Agency (DARPA) under ;;; contract numbers NBCHD030010 and FA8750-07-D-0185. ;;; ;;; Additional support for Scone development has been provided by ;;; research grants from Cisco Systems Inc. and from Google Inc. ;;; ;;; The U.S. Government is authorized to reproduce and distribute ;;; reprints for Governmental purposes notwithstanding any copyright ;;; annotation thereon. ;;; ;;; Disclaimer: The views and conclusions contained herein are those ;;; of the authors and should not be interpreted as necessarily ;;; representing the official policies or endorsements, either ;;; expressed or implied, of IARPA, DoD/ARL, ONR, DARPA, the ;;; U.S. Government, or any of our other sponsors. ;;; ************************************************************* ;;; NOTE: This is meant to be the stuff that you will usually want around for ;;; any "common sense" application. It knows about animals, plants, gender, ;;; sickness, etc. For more specialized scientific/medical applictions you ;;; would load a much more detailed file on top of this one. ;;; Sex and Gender (new-complete-split-subtypes {animate} '(({sexually reproducing} :adj) ({asexually reproducing} :adj))) (new-complete-split-subtypes {sexually reproducing} '(({male} :adj-noun) ({female} :adj-noun))) (new-type-role {parent} {sexually reproducing} {sexually reproducing} :n 2) (new-indv-role {mother} {sexually reproducing} {parent}) (new-is-a {mother} {female}) (new-indv-role {father} {sexually reproducing} {parent}) (new-is-a {father} {male}) (new-type-role {offspring} {sexually reproducing} {sexually reproducing} :may-have t) (new-type-role {son} {sexually reproducing} {offspring} :may-have t) (new-is-a {son} {male}) (new-type-role {daughter} {sexually reproducing} {offspring} :may-have t) (new-is-a {daughter} {female}) ;;; Habitat (new-complete-split-subtypes {animal} '(({flying} :adj) ({non-flying} :adj ))) (new-complete-split-subtypes {animal} '(({water-dwelling} :adj "aquatic") ({land-dwelling} :adj "terrestrial") ({amphibious} :adj))) (new-complete-split-subtypes {animal} '(({air-breathing} :adj) ({water-breathing} :adj))) (new-is-a {land-dwelling} {air-breathing}) (new-is-a {water-dwelling} {water-breathing}) ;;; Taxonomy. (new-complete-split-subtypes {animal} '({vertebrate} {invertebrate})) (new-is-a {vertebrate} {sexually reproducing}) (new-complete-split-subtypes {vertebrate} '({fish} {amphibian} {reptile} {bird} {mammal})) (new-is-a {fish} {water-dwelling}) (new-is-a {amphibian} {amphibious}) (new-is-a {reptile} {land-dwelling}) (new-is-a {bird} {land-dwelling}) (new-is-a {mammal} {land-dwelling}) (new-type {water-dwelling mammal} {mammal}) (new-is-not-a {water-dwelling mammal} {land-dwelling}) (new-is-a {water-dwelling mammal} {water-dwelling}) (new-is-not-a {water-dwelling mammal} {water-breathing}) (new-is-a {water-dwelling mammal} {air-breathing}) (new-is-a {fish} {non-flying}) (new-is-a {amphibian} {non-flying}) (new-is-a {reptile} {non-flying}) (new-is-a {bird} {flying}) (new-is-a {mammal} {non-flying}) ;;; Define a few animal types, just as an example. (new-split-subtypes {mammal} '({elephant} {lion} {tiger} {bat} {monkey} {person} {pig} {horse} {cow} {donkey} {dog} {cat} {whale})) (new-is-not-a {bat} {non-flying}) (new-is-a {bat} {flying}) ;; Got to say explicitly that whale is not land-dwelling. That's implied by ;; {water-dwelling mammal}, but we lose the race because of the direct parent ;; link to {mammal}. (new-is-not-a {whale} {land-dwelling}) (new-is-a {whale} {water-dwelling mammal}) (new-split-subtypes {bird} '({canary} {eagle} {crow} {penguin})) (new-is-not-a {penguin} {flying}) (new-is-a {penguin} {non-flying}) (new-split-subtypes {fish} '({shark} {tuna} {perch} {goldfish} {flying-fish})) (new-is-not-a {flying-fish} {non-flying}) (new-is-a {flying-fish} {flying}) ;;; Diseases (new-type {disease} {intangible}) (new-complete-split-subtypes {disease} '(({infectious} :adj) ({non-infectious} :adj))) (new-indv-role {pathogen} {infectious} {animate}) ;;; Define a few diseases. (new-members {infectious} '({influenza} {smallpox} {anthrax})) (new-members {non-infectious} '({scurvy} {cystic fibrosis} {melanoma})) (new-complete-split-subtypes {animate} '(({sick} :adj "ill" "diseased") ({healthy} :adj))) (new-is-a {sick} {bad health condition}) (new-is-a {healthy} {good health condition}) (new-indv-role {affliction} {sick} {disease} :english '(:role "malady"))
true
;;; -*- Mode:Lisp -*- ;;; *************************************************************************** ;;; Minimal intuitive knowledge of biology and medicine for the ;;; Scone's core knowledge base. ;;; ;;; Author & Maintainer: PI:NAME:<NAME>END_PI ;;; *************************************************************************** ;;; Copyright (C) 2003-2014, Carnegie Mellon University. ;;; ;;; The Scone software is made available to the public under the ;;; Apache 2.0 open source license. A copy of this license is ;;; distributed with the software. The license can also be found at ;;; ;;; http://www.apache.org/licenses/LICENSE-2.0. ;;; ;;; Unless required by applicable law or agreed to in writing, ;;; software distributed under the License is distributed on an "AS ;;; IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ;;; express or implied. See the License for the specific language ;;; governing permissions and limitations under the License. ;;; ;;; Development since February 2013 has been supported in part by the ;;; U.S. Office of Naval Research under award number N000141310224. ;;; ;;; Development of Scone from January, 2012, through August 2013 was ;;; supported in part by the Intelligence Advanced Research Projects ;;; Activity (IARPA) via Department of Defense US Army Research ;;; Laboratory contract number W911NF-12-C-0020. ;;; ;;; Development of Scone from 2003 through 2008 was supported in part ;;; by the Defense Advanced Research Projects Agency (DARPA) under ;;; contract numbers NBCHD030010 and FA8750-07-D-0185. ;;; ;;; Additional support for Scone development has been provided by ;;; research grants from Cisco Systems Inc. and from Google Inc. ;;; ;;; The U.S. Government is authorized to reproduce and distribute ;;; reprints for Governmental purposes notwithstanding any copyright ;;; annotation thereon. ;;; ;;; Disclaimer: The views and conclusions contained herein are those ;;; of the authors and should not be interpreted as necessarily ;;; representing the official policies or endorsements, either ;;; expressed or implied, of IARPA, DoD/ARL, ONR, DARPA, the ;;; U.S. Government, or any of our other sponsors. ;;; ************************************************************* ;;; NOTE: This is meant to be the stuff that you will usually want around for ;;; any "common sense" application. It knows about animals, plants, gender, ;;; sickness, etc. For more specialized scientific/medical applictions you ;;; would load a much more detailed file on top of this one. ;;; Sex and Gender (new-complete-split-subtypes {animate} '(({sexually reproducing} :adj) ({asexually reproducing} :adj))) (new-complete-split-subtypes {sexually reproducing} '(({male} :adj-noun) ({female} :adj-noun))) (new-type-role {parent} {sexually reproducing} {sexually reproducing} :n 2) (new-indv-role {mother} {sexually reproducing} {parent}) (new-is-a {mother} {female}) (new-indv-role {father} {sexually reproducing} {parent}) (new-is-a {father} {male}) (new-type-role {offspring} {sexually reproducing} {sexually reproducing} :may-have t) (new-type-role {son} {sexually reproducing} {offspring} :may-have t) (new-is-a {son} {male}) (new-type-role {daughter} {sexually reproducing} {offspring} :may-have t) (new-is-a {daughter} {female}) ;;; Habitat (new-complete-split-subtypes {animal} '(({flying} :adj) ({non-flying} :adj ))) (new-complete-split-subtypes {animal} '(({water-dwelling} :adj "aquatic") ({land-dwelling} :adj "terrestrial") ({amphibious} :adj))) (new-complete-split-subtypes {animal} '(({air-breathing} :adj) ({water-breathing} :adj))) (new-is-a {land-dwelling} {air-breathing}) (new-is-a {water-dwelling} {water-breathing}) ;;; Taxonomy. (new-complete-split-subtypes {animal} '({vertebrate} {invertebrate})) (new-is-a {vertebrate} {sexually reproducing}) (new-complete-split-subtypes {vertebrate} '({fish} {amphibian} {reptile} {bird} {mammal})) (new-is-a {fish} {water-dwelling}) (new-is-a {amphibian} {amphibious}) (new-is-a {reptile} {land-dwelling}) (new-is-a {bird} {land-dwelling}) (new-is-a {mammal} {land-dwelling}) (new-type {water-dwelling mammal} {mammal}) (new-is-not-a {water-dwelling mammal} {land-dwelling}) (new-is-a {water-dwelling mammal} {water-dwelling}) (new-is-not-a {water-dwelling mammal} {water-breathing}) (new-is-a {water-dwelling mammal} {air-breathing}) (new-is-a {fish} {non-flying}) (new-is-a {amphibian} {non-flying}) (new-is-a {reptile} {non-flying}) (new-is-a {bird} {flying}) (new-is-a {mammal} {non-flying}) ;;; Define a few animal types, just as an example. (new-split-subtypes {mammal} '({elephant} {lion} {tiger} {bat} {monkey} {person} {pig} {horse} {cow} {donkey} {dog} {cat} {whale})) (new-is-not-a {bat} {non-flying}) (new-is-a {bat} {flying}) ;; Got to say explicitly that whale is not land-dwelling. That's implied by ;; {water-dwelling mammal}, but we lose the race because of the direct parent ;; link to {mammal}. (new-is-not-a {whale} {land-dwelling}) (new-is-a {whale} {water-dwelling mammal}) (new-split-subtypes {bird} '({canary} {eagle} {crow} {penguin})) (new-is-not-a {penguin} {flying}) (new-is-a {penguin} {non-flying}) (new-split-subtypes {fish} '({shark} {tuna} {perch} {goldfish} {flying-fish})) (new-is-not-a {flying-fish} {non-flying}) (new-is-a {flying-fish} {flying}) ;;; Diseases (new-type {disease} {intangible}) (new-complete-split-subtypes {disease} '(({infectious} :adj) ({non-infectious} :adj))) (new-indv-role {pathogen} {infectious} {animate}) ;;; Define a few diseases. (new-members {infectious} '({influenza} {smallpox} {anthrax})) (new-members {non-infectious} '({scurvy} {cystic fibrosis} {melanoma})) (new-complete-split-subtypes {animate} '(({sick} :adj "ill" "diseased") ({healthy} :adj))) (new-is-a {sick} {bad health condition}) (new-is-a {healthy} {good health condition}) (new-indv-role {affliction} {sick} {disease} :english '(:role "malady"))
[ { "context": "l2\n :description \"SDL2 host for cepl\"\n :author \"Chris Bagley (Baggers) <[email protected]>\"\n :license \"BS", "end": 107, "score": 0.9998959302902222, "start": 95, "tag": "NAME", "value": "Chris Bagley" }, { "context": "ion \"SDL2 host for cepl\"\n :author \"Chris Bagley (Baggers) <[email protected]>\"\n :license \"BSD 2 Claus", "end": 116, "score": 0.9114958047866821, "start": 109, "tag": "NAME", "value": "Baggers" }, { "context": "host for cepl\"\n :author \"Chris Bagley (Baggers) <[email protected]>\"\n :license \"BSD 2 Clause\"\n :depends-on (#:cepl", "end": 140, "score": 0.9999276399612427, "start": 119, "tag": "EMAIL", "value": "[email protected]" } ]
cepl.sdl2.asd
metayan/cepl.sdl2
11
;;;; cepl.sdl2.asd (asdf:defsystem #:cepl.sdl2 :description "SDL2 host for cepl" :author "Chris Bagley (Baggers) <[email protected]>" :license "BSD 2 Clause" :depends-on (#:cepl #:sdl2) :serial t :components ((:file "package") (:file "cepl.sdl2")))
40826
;;;; cepl.sdl2.asd (asdf:defsystem #:cepl.sdl2 :description "SDL2 host for cepl" :author "<NAME> (<NAME>) <<EMAIL>>" :license "BSD 2 Clause" :depends-on (#:cepl #:sdl2) :serial t :components ((:file "package") (:file "cepl.sdl2")))
true
;;;; cepl.sdl2.asd (asdf:defsystem #:cepl.sdl2 :description "SDL2 host for cepl" :author "PI:NAME:<NAME>END_PI (PI:NAME:<NAME>END_PI) <PI:EMAIL:<EMAIL>END_PI>" :license "BSD 2 Clause" :depends-on (#:cepl #:sdl2) :serial t :components ((:file "package") (:file "cepl.sdl2")))
[ { "context": "4, Regents of the University of Texas\n; Written by Matt Kaufmann (original date February, 2014)\n; License: A 3-cla", "end": 83, "score": 0.9998622536659241, "start": 70, "tag": "NAME", "value": "Matt Kaufmann" }, { "context": "ription:\n\n; This file formerly connected xdoc with David Russinoff's online rtl manual.\n; That manual has been repla", "end": 268, "score": 0.972674548625946, "start": 253, "tag": "NAME", "value": "David Russinoff" }, { "context": "int Hardware Design: A Mathematical Approach\" by\n; David M. Russinoff, at:\n; https://www.springer.com/us/book/978331995", "end": 439, "score": 0.9998607635498047, "start": 421, "tag": "NAME", "value": "David M. Russinoff" }, { "context": "ames that ACL2 prints using vertical bars.\n; Also, Jared Davis points out that the std libraries use \"/\" as a se", "end": 924, "score": 0.9670898914337158, "start": 913, "tag": "NAME", "value": "Jared Davis" }, { "context": " Hardware Design: A Mathematical Approach\\\"</a> by David\n M. Russinoff. See file @('rtl/README') for additional informa", "end": 7183, "score": 0.9993892908096313, "start": 7163, "tag": "NAME", "value": "David\n M. Russinoff" } ]
books/rtl/rel11/lib/doc.lisp
MattKaufmann/acl2
305
; Copyright (C) 2014, Regents of the University of Texas ; Written by Matt Kaufmann (original date February, 2014) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; Description: ; This file formerly connected xdoc with David Russinoff's online rtl manual. ; That manual has been replaced by a book, "Formal Verification of ; Floating-Point Hardware Design: A Mathematical Approach" by ; David M. Russinoff, at: ; https://www.springer.com/us/book/9783319955124 (in-package "RTL") (defconst *rtl-node-tree* ; Nodes from mousing over topics at (the now defunct) ; http://russinoff.com/libman/top.html, with spaces replaced by underscores and ; commas deleted. These are organized to match the hierarchy on that page. ; We use "/" rather than ":" as a separator so that ACL2-Doc can include the ; node, since ACL2-Doc ignores names that ACL2 prints using vertical bars. ; Also, Jared Davis points out that the std libraries use "/" as a separator, ; so we follow that convention. '((|Register-Transfer Logic| (|Basic Arithmetic Functions| ; basic.lisp |Floor and Ceiling| |Modulus| |Chop|) (|Bit Vectors| ; bits.lisp |Recognizing Bit Vectors| |Bit Slices| |Bit Extraction| |Concatenation| |Signed Integer Formats|) (|Logical Operations| ; log.lisp |Binary Operations| |Complementation| |Algebraic Properties|)) (|Floating-Point Arithmetic| (|Floating-Point Numbers| ; float.lisp |Floating-Point Decomposition| |Exactness|) (|Floating-Point Formats| ; reps.lisp |Classification of Formats| |Normal Encodings| |Denormals and Zeroes| |Infinities and NaNs| |Rebiasing Exponents|) (|Rounding| ; round.lisp |Truncation| |Rounding Away from Zero| |Unbiased Rounding| |Odd Rounding| |IEEE Rounding| |Denormal Rounding|)) (|Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| ; exps.lisp (|IEEE-Compliant Square Root| ; sqrt.lisp |Truncated Square Root| |Odd-Rounded Square Root| |IEEE-Rounded Square Root|) |SSE Floating-Point Instructions| |x87 Instructions| |ARM AArch32 Floating-Point Instructions|) (|Implementation of Elementary Operations| (|Addition| ; add.lisp |Bit Vector Addition| |Leading One Prediction| |Trailing One Prediction|) (|Multiplication| ; mult.lisp |Radix-4 Booth Encoding| |Statically Encoded Multiplier Arrays| |Encoding Redundant Representations| |Radix-8 Booth Encoding|) (|FMA-Based Division| ; div.lisp |Quotient Refinement| |Reciprocal Refinement| |Examples|) (|SRT Division and Square Root| ; srt.lisp |SRT Division and Quotient Digit Selection| |SRT Square Root Extraction|)) |Modeling Algorithms in C++ and ACL2| ; rac.lisp |Bibliography|)) (defun rtl-node-name-basic (sym) sym) (defun rtl-node-alist1 (sym global-index) (list sym (rtl-node-name-basic sym) (concatenate 'string "http://russinoff.com/libman/text/node" (coerce (explode-nonnegative-integer global-index 10 nil) 'string) ".html"))) (defun rtl-node-alist (flg tree global-index) ; Return a list of entries (original-name doc-topic-name url). Flg is nil for ; a single tree, t for a list of trees. (declare (xargs :mode :program)) (cond (flg ; list of child trees (assert$ (true-listp tree) (cond ((atom tree) nil) (t (let* ((alist (rtl-node-alist nil (car tree) global-index)) (len-alist (length alist))) (append alist (rtl-node-alist t (cdr tree) (+ global-index len-alist)))))))) ((atom tree) (assert$ (symbolp tree) (list (rtl-node-alist1 tree global-index)))) (t (assert$ (and (true-listp tree) tree (symbolp (car tree))) (cons (rtl-node-alist1 (car tree) global-index) (rtl-node-alist t (cdr tree) (1+ global-index))))))) (defconst *rtl-node-alist* (rtl-node-alist t *rtl-node-tree* 4)) (defun defsection-rtl-defs1 (events acc) (declare (xargs :mode :program)) (cond ((endp events) (reverse acc)) (t (defsection-rtl-defs1 (cdr events) (let ((ev (car events))) (case-match ev ((& name . &) ; Based on the definition of formula-info-to-defs1 from xdoc/top.lisp. (cond ((symbolp name) (cons (concatenate 'string "@(def " (xdoc::full-escape-symbol name) ")") acc)) (t acc))) (& acc))))))) (defun defsection-rtl-defs (events) (declare (xargs :mode :program)) (cond ((endp events) "") (t (concatenate 'string ; Based on formula-info-to-defs in xdoc/top.lisp: "<h3>Definitions and Theorems</h3>" (string-append-lst (defsection-rtl-defs1 events nil)))))) (defun rtl-node-entry (name) (or (assoc-eq name *rtl-node-alist*) (er hard 'defsection-rtl "Unknown rtl node name, ~x0" name))) (defmacro defsection-rtl (name parent &rest events) (let* ((entry (rtl-node-entry name)) (section-name (cadr entry)) ;; (url (caddr entry)) ; no longer used ) `(defsection ,section-name :parents (,(if (eq parent 'rtl) 'rtl (cadr (rtl-node-entry parent)))) :short ,(symbol-name name) :long ,(defsection-rtl-defs events) (deflabel ,(intern-in-package-of-symbol (concatenate 'string (symbol-name name) "$SECTION") name)) ,@events))) (defun rtl-node-name (name) (cond ((eq name 'rtl) name) ((consp name) (rtl-node-name (car name))) (t (cadr (rtl-node-entry name))))) (defun rtl-node-name-lst (trees) (cond ((endp trees) nil) (t (cons (rtl-node-name (car trees)) (rtl-node-name-lst (cdr trees)))))) (defmacro rtl-order-subtopics (parent children) `(xdoc::order-subtopics ,(rtl-node-name parent) ,(rtl-node-name-lst children))) (defxdoc rtl :parents (acl2::bit-vectors acl2::hardware-verification) :short "A library of register-transfer logic and computer arithmetic" :long "<p>This @(see documentation) is based on the directory @('rtl') of the ACL2 @(see community-books). For a more thorough treatment, see <a href='https://www.springer.com/us/book/9783319955124'>\"Formal Verification of Floating-Point Hardware Design: A Mathematical Approach\"</a> by David M. Russinoff. See file @('rtl/README') for additional information about this library and its connection to this book.</p>") (rtl-order-subtopics rtl (|Register-Transfer Logic| |Floating-Point Arithmetic| |Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| |Implementation of Elementary Operations| |Modeling Algorithms in C++ and ACL2| |Bibliography|)) (defun defsection-rtl-list-for-tree (parent trees) ; Trees is a tail of the children of parent in *rtl-node-tree*. (declare (xargs :mode :program)) (cond ((endp trees) nil) ((atom (car trees)) ; Then defsection-rtl will be given explicitly for each tree in trees. nil) (t ; (car trees) is (topic . children) (list* `(defsection-rtl ,(caar trees) ,parent) `(rtl-order-subtopics ,(caar trees) ,(cdar trees)) (append (defsection-rtl-list-for-tree (caar trees) (cdar trees)) (defsection-rtl-list-for-tree parent (cdr trees))))))) (defmacro defsection-rtl-list () (cons 'progn (defsection-rtl-list-for-tree 'rtl *rtl-node-tree*))) (defsection-rtl-list) ; Handle top-level leaves: (defsection-rtl |Bibliography| rtl) (defsection-rtl |Modeling Algorithms in C++ and ACL2| rtl)
18353
; Copyright (C) 2014, Regents of the University of Texas ; Written by <NAME> (original date February, 2014) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; Description: ; This file formerly connected xdoc with <NAME>'s online rtl manual. ; That manual has been replaced by a book, "Formal Verification of ; Floating-Point Hardware Design: A Mathematical Approach" by ; <NAME>, at: ; https://www.springer.com/us/book/9783319955124 (in-package "RTL") (defconst *rtl-node-tree* ; Nodes from mousing over topics at (the now defunct) ; http://russinoff.com/libman/top.html, with spaces replaced by underscores and ; commas deleted. These are organized to match the hierarchy on that page. ; We use "/" rather than ":" as a separator so that ACL2-Doc can include the ; node, since ACL2-Doc ignores names that ACL2 prints using vertical bars. ; Also, <NAME> points out that the std libraries use "/" as a separator, ; so we follow that convention. '((|Register-Transfer Logic| (|Basic Arithmetic Functions| ; basic.lisp |Floor and Ceiling| |Modulus| |Chop|) (|Bit Vectors| ; bits.lisp |Recognizing Bit Vectors| |Bit Slices| |Bit Extraction| |Concatenation| |Signed Integer Formats|) (|Logical Operations| ; log.lisp |Binary Operations| |Complementation| |Algebraic Properties|)) (|Floating-Point Arithmetic| (|Floating-Point Numbers| ; float.lisp |Floating-Point Decomposition| |Exactness|) (|Floating-Point Formats| ; reps.lisp |Classification of Formats| |Normal Encodings| |Denormals and Zeroes| |Infinities and NaNs| |Rebiasing Exponents|) (|Rounding| ; round.lisp |Truncation| |Rounding Away from Zero| |Unbiased Rounding| |Odd Rounding| |IEEE Rounding| |Denormal Rounding|)) (|Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| ; exps.lisp (|IEEE-Compliant Square Root| ; sqrt.lisp |Truncated Square Root| |Odd-Rounded Square Root| |IEEE-Rounded Square Root|) |SSE Floating-Point Instructions| |x87 Instructions| |ARM AArch32 Floating-Point Instructions|) (|Implementation of Elementary Operations| (|Addition| ; add.lisp |Bit Vector Addition| |Leading One Prediction| |Trailing One Prediction|) (|Multiplication| ; mult.lisp |Radix-4 Booth Encoding| |Statically Encoded Multiplier Arrays| |Encoding Redundant Representations| |Radix-8 Booth Encoding|) (|FMA-Based Division| ; div.lisp |Quotient Refinement| |Reciprocal Refinement| |Examples|) (|SRT Division and Square Root| ; srt.lisp |SRT Division and Quotient Digit Selection| |SRT Square Root Extraction|)) |Modeling Algorithms in C++ and ACL2| ; rac.lisp |Bibliography|)) (defun rtl-node-name-basic (sym) sym) (defun rtl-node-alist1 (sym global-index) (list sym (rtl-node-name-basic sym) (concatenate 'string "http://russinoff.com/libman/text/node" (coerce (explode-nonnegative-integer global-index 10 nil) 'string) ".html"))) (defun rtl-node-alist (flg tree global-index) ; Return a list of entries (original-name doc-topic-name url). Flg is nil for ; a single tree, t for a list of trees. (declare (xargs :mode :program)) (cond (flg ; list of child trees (assert$ (true-listp tree) (cond ((atom tree) nil) (t (let* ((alist (rtl-node-alist nil (car tree) global-index)) (len-alist (length alist))) (append alist (rtl-node-alist t (cdr tree) (+ global-index len-alist)))))))) ((atom tree) (assert$ (symbolp tree) (list (rtl-node-alist1 tree global-index)))) (t (assert$ (and (true-listp tree) tree (symbolp (car tree))) (cons (rtl-node-alist1 (car tree) global-index) (rtl-node-alist t (cdr tree) (1+ global-index))))))) (defconst *rtl-node-alist* (rtl-node-alist t *rtl-node-tree* 4)) (defun defsection-rtl-defs1 (events acc) (declare (xargs :mode :program)) (cond ((endp events) (reverse acc)) (t (defsection-rtl-defs1 (cdr events) (let ((ev (car events))) (case-match ev ((& name . &) ; Based on the definition of formula-info-to-defs1 from xdoc/top.lisp. (cond ((symbolp name) (cons (concatenate 'string "@(def " (xdoc::full-escape-symbol name) ")") acc)) (t acc))) (& acc))))))) (defun defsection-rtl-defs (events) (declare (xargs :mode :program)) (cond ((endp events) "") (t (concatenate 'string ; Based on formula-info-to-defs in xdoc/top.lisp: "<h3>Definitions and Theorems</h3>" (string-append-lst (defsection-rtl-defs1 events nil)))))) (defun rtl-node-entry (name) (or (assoc-eq name *rtl-node-alist*) (er hard 'defsection-rtl "Unknown rtl node name, ~x0" name))) (defmacro defsection-rtl (name parent &rest events) (let* ((entry (rtl-node-entry name)) (section-name (cadr entry)) ;; (url (caddr entry)) ; no longer used ) `(defsection ,section-name :parents (,(if (eq parent 'rtl) 'rtl (cadr (rtl-node-entry parent)))) :short ,(symbol-name name) :long ,(defsection-rtl-defs events) (deflabel ,(intern-in-package-of-symbol (concatenate 'string (symbol-name name) "$SECTION") name)) ,@events))) (defun rtl-node-name (name) (cond ((eq name 'rtl) name) ((consp name) (rtl-node-name (car name))) (t (cadr (rtl-node-entry name))))) (defun rtl-node-name-lst (trees) (cond ((endp trees) nil) (t (cons (rtl-node-name (car trees)) (rtl-node-name-lst (cdr trees)))))) (defmacro rtl-order-subtopics (parent children) `(xdoc::order-subtopics ,(rtl-node-name parent) ,(rtl-node-name-lst children))) (defxdoc rtl :parents (acl2::bit-vectors acl2::hardware-verification) :short "A library of register-transfer logic and computer arithmetic" :long "<p>This @(see documentation) is based on the directory @('rtl') of the ACL2 @(see community-books). For a more thorough treatment, see <a href='https://www.springer.com/us/book/9783319955124'>\"Formal Verification of Floating-Point Hardware Design: A Mathematical Approach\"</a> by <NAME>. See file @('rtl/README') for additional information about this library and its connection to this book.</p>") (rtl-order-subtopics rtl (|Register-Transfer Logic| |Floating-Point Arithmetic| |Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| |Implementation of Elementary Operations| |Modeling Algorithms in C++ and ACL2| |Bibliography|)) (defun defsection-rtl-list-for-tree (parent trees) ; Trees is a tail of the children of parent in *rtl-node-tree*. (declare (xargs :mode :program)) (cond ((endp trees) nil) ((atom (car trees)) ; Then defsection-rtl will be given explicitly for each tree in trees. nil) (t ; (car trees) is (topic . children) (list* `(defsection-rtl ,(caar trees) ,parent) `(rtl-order-subtopics ,(caar trees) ,(cdar trees)) (append (defsection-rtl-list-for-tree (caar trees) (cdar trees)) (defsection-rtl-list-for-tree parent (cdr trees))))))) (defmacro defsection-rtl-list () (cons 'progn (defsection-rtl-list-for-tree 'rtl *rtl-node-tree*))) (defsection-rtl-list) ; Handle top-level leaves: (defsection-rtl |Bibliography| rtl) (defsection-rtl |Modeling Algorithms in C++ and ACL2| rtl)
true
; Copyright (C) 2014, Regents of the University of Texas ; Written by PI:NAME:<NAME>END_PI (original date February, 2014) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; Description: ; This file formerly connected xdoc with PI:NAME:<NAME>END_PI's online rtl manual. ; That manual has been replaced by a book, "Formal Verification of ; Floating-Point Hardware Design: A Mathematical Approach" by ; PI:NAME:<NAME>END_PI, at: ; https://www.springer.com/us/book/9783319955124 (in-package "RTL") (defconst *rtl-node-tree* ; Nodes from mousing over topics at (the now defunct) ; http://russinoff.com/libman/top.html, with spaces replaced by underscores and ; commas deleted. These are organized to match the hierarchy on that page. ; We use "/" rather than ":" as a separator so that ACL2-Doc can include the ; node, since ACL2-Doc ignores names that ACL2 prints using vertical bars. ; Also, PI:NAME:<NAME>END_PI points out that the std libraries use "/" as a separator, ; so we follow that convention. '((|Register-Transfer Logic| (|Basic Arithmetic Functions| ; basic.lisp |Floor and Ceiling| |Modulus| |Chop|) (|Bit Vectors| ; bits.lisp |Recognizing Bit Vectors| |Bit Slices| |Bit Extraction| |Concatenation| |Signed Integer Formats|) (|Logical Operations| ; log.lisp |Binary Operations| |Complementation| |Algebraic Properties|)) (|Floating-Point Arithmetic| (|Floating-Point Numbers| ; float.lisp |Floating-Point Decomposition| |Exactness|) (|Floating-Point Formats| ; reps.lisp |Classification of Formats| |Normal Encodings| |Denormals and Zeroes| |Infinities and NaNs| |Rebiasing Exponents|) (|Rounding| ; round.lisp |Truncation| |Rounding Away from Zero| |Unbiased Rounding| |Odd Rounding| |IEEE Rounding| |Denormal Rounding|)) (|Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| ; exps.lisp (|IEEE-Compliant Square Root| ; sqrt.lisp |Truncated Square Root| |Odd-Rounded Square Root| |IEEE-Rounded Square Root|) |SSE Floating-Point Instructions| |x87 Instructions| |ARM AArch32 Floating-Point Instructions|) (|Implementation of Elementary Operations| (|Addition| ; add.lisp |Bit Vector Addition| |Leading One Prediction| |Trailing One Prediction|) (|Multiplication| ; mult.lisp |Radix-4 Booth Encoding| |Statically Encoded Multiplier Arrays| |Encoding Redundant Representations| |Radix-8 Booth Encoding|) (|FMA-Based Division| ; div.lisp |Quotient Refinement| |Reciprocal Refinement| |Examples|) (|SRT Division and Square Root| ; srt.lisp |SRT Division and Quotient Digit Selection| |SRT Square Root Extraction|)) |Modeling Algorithms in C++ and ACL2| ; rac.lisp |Bibliography|)) (defun rtl-node-name-basic (sym) sym) (defun rtl-node-alist1 (sym global-index) (list sym (rtl-node-name-basic sym) (concatenate 'string "http://russinoff.com/libman/text/node" (coerce (explode-nonnegative-integer global-index 10 nil) 'string) ".html"))) (defun rtl-node-alist (flg tree global-index) ; Return a list of entries (original-name doc-topic-name url). Flg is nil for ; a single tree, t for a list of trees. (declare (xargs :mode :program)) (cond (flg ; list of child trees (assert$ (true-listp tree) (cond ((atom tree) nil) (t (let* ((alist (rtl-node-alist nil (car tree) global-index)) (len-alist (length alist))) (append alist (rtl-node-alist t (cdr tree) (+ global-index len-alist)))))))) ((atom tree) (assert$ (symbolp tree) (list (rtl-node-alist1 tree global-index)))) (t (assert$ (and (true-listp tree) tree (symbolp (car tree))) (cons (rtl-node-alist1 (car tree) global-index) (rtl-node-alist t (cdr tree) (1+ global-index))))))) (defconst *rtl-node-alist* (rtl-node-alist t *rtl-node-tree* 4)) (defun defsection-rtl-defs1 (events acc) (declare (xargs :mode :program)) (cond ((endp events) (reverse acc)) (t (defsection-rtl-defs1 (cdr events) (let ((ev (car events))) (case-match ev ((& name . &) ; Based on the definition of formula-info-to-defs1 from xdoc/top.lisp. (cond ((symbolp name) (cons (concatenate 'string "@(def " (xdoc::full-escape-symbol name) ")") acc)) (t acc))) (& acc))))))) (defun defsection-rtl-defs (events) (declare (xargs :mode :program)) (cond ((endp events) "") (t (concatenate 'string ; Based on formula-info-to-defs in xdoc/top.lisp: "<h3>Definitions and Theorems</h3>" (string-append-lst (defsection-rtl-defs1 events nil)))))) (defun rtl-node-entry (name) (or (assoc-eq name *rtl-node-alist*) (er hard 'defsection-rtl "Unknown rtl node name, ~x0" name))) (defmacro defsection-rtl (name parent &rest events) (let* ((entry (rtl-node-entry name)) (section-name (cadr entry)) ;; (url (caddr entry)) ; no longer used ) `(defsection ,section-name :parents (,(if (eq parent 'rtl) 'rtl (cadr (rtl-node-entry parent)))) :short ,(symbol-name name) :long ,(defsection-rtl-defs events) (deflabel ,(intern-in-package-of-symbol (concatenate 'string (symbol-name name) "$SECTION") name)) ,@events))) (defun rtl-node-name (name) (cond ((eq name 'rtl) name) ((consp name) (rtl-node-name (car name))) (t (cadr (rtl-node-entry name))))) (defun rtl-node-name-lst (trees) (cond ((endp trees) nil) (t (cons (rtl-node-name (car trees)) (rtl-node-name-lst (cdr trees)))))) (defmacro rtl-order-subtopics (parent children) `(xdoc::order-subtopics ,(rtl-node-name parent) ,(rtl-node-name-lst children))) (defxdoc rtl :parents (acl2::bit-vectors acl2::hardware-verification) :short "A library of register-transfer logic and computer arithmetic" :long "<p>This @(see documentation) is based on the directory @('rtl') of the ACL2 @(see community-books). For a more thorough treatment, see <a href='https://www.springer.com/us/book/9783319955124'>\"Formal Verification of Floating-Point Hardware Design: A Mathematical Approach\"</a> by PI:NAME:<NAME>END_PI. See file @('rtl/README') for additional information about this library and its connection to this book.</p>") (rtl-order-subtopics rtl (|Register-Transfer Logic| |Floating-Point Arithmetic| |Floating-Point Exceptions and Specification of Elementary Arithmetic Instructions| |Implementation of Elementary Operations| |Modeling Algorithms in C++ and ACL2| |Bibliography|)) (defun defsection-rtl-list-for-tree (parent trees) ; Trees is a tail of the children of parent in *rtl-node-tree*. (declare (xargs :mode :program)) (cond ((endp trees) nil) ((atom (car trees)) ; Then defsection-rtl will be given explicitly for each tree in trees. nil) (t ; (car trees) is (topic . children) (list* `(defsection-rtl ,(caar trees) ,parent) `(rtl-order-subtopics ,(caar trees) ,(cdar trees)) (append (defsection-rtl-list-for-tree (caar trees) (cdar trees)) (defsection-rtl-list-for-tree parent (cdr trees))))))) (defmacro defsection-rtl-list () (cons 'progn (defsection-rtl-list-for-tree 'rtl *rtl-node-tree*))) (defsection-rtl-list) ; Handle top-level leaves: (defsection-rtl |Bibliography| rtl) (defsection-rtl |Modeling Algorithms in C++ and ACL2| rtl)
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"GL\")\n\n;; Obs", "end": 1416, "score": 0.9998733997344971, "start": 1406, "tag": "NAME", "value": "Sol Swords" }, { "context": "IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"GL\")\n\n;; Obsolete\n(include-book \"g", "end": 1438, "score": 0.9999307990074158, "start": 1418, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/gl/gobjectp-thms.lisp
solswords/acl2
0
; GL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Sol Swords <[email protected]> (in-package "GL") ;; Obsolete (include-book "gobjectp") ;; (encapsulate ;; nil ;; (local (defthm nth-open1 ;; (equal (nth n x) ;; (and (consp x) ;; (if (zp n) ;; (car x) ;; (nth (1- n) (cdr x))))))) ;; (local (defthm equal-len-0 ;; (equal (equal (len x) 0) ;; (not (consp x))))) ;; (defthm wf-g-numberp-simpler-def ;; (equal (wf-g-numberp x) ;; (and (true-listp x) ;; (consp x) ;; (<= (len x) 4) ;; (bfr-listp (nth 0 x)) ;; (bfr-listp (nth 1 x)) ;; (bfr-listp (nth 2 x)) ;; (bfr-listp (nth 3 x)))) ;; :hints (("goal" :do-not-induct t ;; :in-theory (enable wf-g-numberp))) ;; :rule-classes :definition)) ;; (defthm wf-g-numberp-true-listp ;; (implies (wf-g-numberp x) ;; (true-listp x)) ;; :rule-classes :compound-recognizer) ;; (in-theory (disable wf-g-numberp-simpler-def)) ;; (defthmd gobject-hierarchy-impl-not-g-keyword-symbolp ;; (implies (gobject-hierarchy x) ;; (not (g-keyword-symbolp x))) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy)))) ;; (defthm gobjectp-def ;; (equal (gobjectp x) ;; (if (atom x) ;; (not (g-keyword-symbolp x)) ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x) (bfr-p (g-boolean->bool x))) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x)))) ;; ((g-apply-p x) (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (and (gobjectp (car x)) ;; (gobjectp (cdr x))))))) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy))) ;; :rule-classes :definition) ;; (defun gobjectp-ind (x) ;; (if (atom x) ;; x ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x)) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (list (gobjectp-ind (g-ite->test x)) ;; (gobjectp-ind (g-ite->then x)) ;; (gobjectp-ind (g-ite->else x)))) ;; ((g-apply-p x) (list (symbolp (g-apply->fn x)) ;; (gobjectp-ind (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (list (gobjectp-ind (car x)) ;; (gobjectp-ind (cdr x))))))) ;; (defthm gobjectp-induct ;; t ;; :rule-classes ((:induction ;; :pattern (gobjectp x) ;; :scheme (gobjectp-ind x)))) ;; (defthm gobjectp-tag-rw-to-types ;; (implies (gobjectp x) ;; (and (equal (equal (tag x) :g-concrete) ;; (g-concrete-p x)) ;; (equal (equal (tag x) :g-boolean) ;; (g-boolean-p x)) ;; (equal (equal (tag x) :g-number) ;; (g-number-p x)) ;; (equal (equal (tag x) :g-ite) ;; (g-ite-p x)) ;; (equal (equal (tag x) :g-apply) ;; (g-apply-p x)) ;; (equal (equal (tag x) :g-var) ;; (g-var-p x)))) ;; :hints (("goal" :expand ((gobjectp x)) ;; :do-not-induct t) ;; (and stable-under-simplificationp ;; '(:in-theory (enable tag g-keyword-symbolp-def)))) ;; :otf-flg t) ;; (defthm gobjectp-ite-case ;; (implies (and (gobjectp x) ;; (g-ite-p x)) ;; (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x))))) ;; (defthm gobjectp-number-case ;; (implies (and (gobjectp x) ;; (g-number-p x)) ;; (wf-g-numberp (g-number->num x)))) ;; (defthm gobjectp-boolean-case ;; (implies (and (gobjectp x) ;; (g-boolean-p x)) ;; (bfr-p (g-boolean->bool x)))) ;; (defthm gobjectp-apply-case ;; (implies (and (gobjectp x) ;; (g-apply-p x)) ;; (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x))))) ;; (defthm gobjectp-cons-case ;; (implies (and (gobjectp x) ;; (consp x) ;; (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x))) ;; (and (gobjectp (car x)) ;; (gobjectp (cdr x))))) ;; (defthm gobjectp-gobj-fix ;; (gobjectp (gobj-fix x)) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy gobj-fix)))) ;; (defthm gobj-fix-when-gobjectp ;; (implies (gobjectp x) ;; (equal (gobj-fix x) x)) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-fix-when-not-gobjectp ;; (implies (not (gobjectp x)) ;; (equal (gobj-fix x) ;; (g-concrete x))) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-equiv-gobj-fix ;; (gobj-equiv (gobj-fix x) x)) ;; (table prove-congruence-theory-table ;; 'gobj-equiv '(gobjectp-gobj-fix gobj-fix-when-gobjectp)) ;; (defthmd gobjectp-car-impl-not-g-types ;; (implies (gobjectp (car x)) ;; (and (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x)))) ;; :hints(("Goal" :in-theory (enable g-boolean-p ;; g-number-p ;; g-concrete-p ;; g-ite-p ;; g-apply-p ;; g-var-p)))) ;; (defthmd gobject-listp-impl-gobjectp ;; (implies (gobject-listp x) ;; (gobjectp x)) ;; :hints(("Goal" :in-theory ;; (enable gobjectp-car-impl-not-g-types ;; gobjectp-def gobject-listp)))) ;; (defthmd gobject-hierarchy-possibilities ;; (implies (and (gobject-hierarchy x) ;; (not (equal (gobject-hierarchy x) 'gobject)) ;; (not (equal (gobject-hierarchy x) 'general))) ;; (equal (equal (gobject-hierarchy x) 'concrete) t)) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy))) ;; :rule-classes ((:rewrite :backchain-limit-lst 0))) ;; (in-theory (disable gobjectp-def))
27688
; GL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "GL") ;; Obsolete (include-book "gobjectp") ;; (encapsulate ;; nil ;; (local (defthm nth-open1 ;; (equal (nth n x) ;; (and (consp x) ;; (if (zp n) ;; (car x) ;; (nth (1- n) (cdr x))))))) ;; (local (defthm equal-len-0 ;; (equal (equal (len x) 0) ;; (not (consp x))))) ;; (defthm wf-g-numberp-simpler-def ;; (equal (wf-g-numberp x) ;; (and (true-listp x) ;; (consp x) ;; (<= (len x) 4) ;; (bfr-listp (nth 0 x)) ;; (bfr-listp (nth 1 x)) ;; (bfr-listp (nth 2 x)) ;; (bfr-listp (nth 3 x)))) ;; :hints (("goal" :do-not-induct t ;; :in-theory (enable wf-g-numberp))) ;; :rule-classes :definition)) ;; (defthm wf-g-numberp-true-listp ;; (implies (wf-g-numberp x) ;; (true-listp x)) ;; :rule-classes :compound-recognizer) ;; (in-theory (disable wf-g-numberp-simpler-def)) ;; (defthmd gobject-hierarchy-impl-not-g-keyword-symbolp ;; (implies (gobject-hierarchy x) ;; (not (g-keyword-symbolp x))) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy)))) ;; (defthm gobjectp-def ;; (equal (gobjectp x) ;; (if (atom x) ;; (not (g-keyword-symbolp x)) ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x) (bfr-p (g-boolean->bool x))) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x)))) ;; ((g-apply-p x) (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (and (gobjectp (car x)) ;; (gobjectp (cdr x))))))) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy))) ;; :rule-classes :definition) ;; (defun gobjectp-ind (x) ;; (if (atom x) ;; x ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x)) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (list (gobjectp-ind (g-ite->test x)) ;; (gobjectp-ind (g-ite->then x)) ;; (gobjectp-ind (g-ite->else x)))) ;; ((g-apply-p x) (list (symbolp (g-apply->fn x)) ;; (gobjectp-ind (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (list (gobjectp-ind (car x)) ;; (gobjectp-ind (cdr x))))))) ;; (defthm gobjectp-induct ;; t ;; :rule-classes ((:induction ;; :pattern (gobjectp x) ;; :scheme (gobjectp-ind x)))) ;; (defthm gobjectp-tag-rw-to-types ;; (implies (gobjectp x) ;; (and (equal (equal (tag x) :g-concrete) ;; (g-concrete-p x)) ;; (equal (equal (tag x) :g-boolean) ;; (g-boolean-p x)) ;; (equal (equal (tag x) :g-number) ;; (g-number-p x)) ;; (equal (equal (tag x) :g-ite) ;; (g-ite-p x)) ;; (equal (equal (tag x) :g-apply) ;; (g-apply-p x)) ;; (equal (equal (tag x) :g-var) ;; (g-var-p x)))) ;; :hints (("goal" :expand ((gobjectp x)) ;; :do-not-induct t) ;; (and stable-under-simplificationp ;; '(:in-theory (enable tag g-keyword-symbolp-def)))) ;; :otf-flg t) ;; (defthm gobjectp-ite-case ;; (implies (and (gobjectp x) ;; (g-ite-p x)) ;; (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x))))) ;; (defthm gobjectp-number-case ;; (implies (and (gobjectp x) ;; (g-number-p x)) ;; (wf-g-numberp (g-number->num x)))) ;; (defthm gobjectp-boolean-case ;; (implies (and (gobjectp x) ;; (g-boolean-p x)) ;; (bfr-p (g-boolean->bool x)))) ;; (defthm gobjectp-apply-case ;; (implies (and (gobjectp x) ;; (g-apply-p x)) ;; (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x))))) ;; (defthm gobjectp-cons-case ;; (implies (and (gobjectp x) ;; (consp x) ;; (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x))) ;; (and (gobjectp (car x)) ;; (gobjectp (cdr x))))) ;; (defthm gobjectp-gobj-fix ;; (gobjectp (gobj-fix x)) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy gobj-fix)))) ;; (defthm gobj-fix-when-gobjectp ;; (implies (gobjectp x) ;; (equal (gobj-fix x) x)) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-fix-when-not-gobjectp ;; (implies (not (gobjectp x)) ;; (equal (gobj-fix x) ;; (g-concrete x))) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-equiv-gobj-fix ;; (gobj-equiv (gobj-fix x) x)) ;; (table prove-congruence-theory-table ;; 'gobj-equiv '(gobjectp-gobj-fix gobj-fix-when-gobjectp)) ;; (defthmd gobjectp-car-impl-not-g-types ;; (implies (gobjectp (car x)) ;; (and (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x)))) ;; :hints(("Goal" :in-theory (enable g-boolean-p ;; g-number-p ;; g-concrete-p ;; g-ite-p ;; g-apply-p ;; g-var-p)))) ;; (defthmd gobject-listp-impl-gobjectp ;; (implies (gobject-listp x) ;; (gobjectp x)) ;; :hints(("Goal" :in-theory ;; (enable gobjectp-car-impl-not-g-types ;; gobjectp-def gobject-listp)))) ;; (defthmd gobject-hierarchy-possibilities ;; (implies (and (gobject-hierarchy x) ;; (not (equal (gobject-hierarchy x) 'gobject)) ;; (not (equal (gobject-hierarchy x) 'general))) ;; (equal (equal (gobject-hierarchy x) 'concrete) t)) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy))) ;; :rule-classes ((:rewrite :backchain-limit-lst 0))) ;; (in-theory (disable gobjectp-def))
true
; GL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2008-2013 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "GL") ;; Obsolete (include-book "gobjectp") ;; (encapsulate ;; nil ;; (local (defthm nth-open1 ;; (equal (nth n x) ;; (and (consp x) ;; (if (zp n) ;; (car x) ;; (nth (1- n) (cdr x))))))) ;; (local (defthm equal-len-0 ;; (equal (equal (len x) 0) ;; (not (consp x))))) ;; (defthm wf-g-numberp-simpler-def ;; (equal (wf-g-numberp x) ;; (and (true-listp x) ;; (consp x) ;; (<= (len x) 4) ;; (bfr-listp (nth 0 x)) ;; (bfr-listp (nth 1 x)) ;; (bfr-listp (nth 2 x)) ;; (bfr-listp (nth 3 x)))) ;; :hints (("goal" :do-not-induct t ;; :in-theory (enable wf-g-numberp))) ;; :rule-classes :definition)) ;; (defthm wf-g-numberp-true-listp ;; (implies (wf-g-numberp x) ;; (true-listp x)) ;; :rule-classes :compound-recognizer) ;; (in-theory (disable wf-g-numberp-simpler-def)) ;; (defthmd gobject-hierarchy-impl-not-g-keyword-symbolp ;; (implies (gobject-hierarchy x) ;; (not (g-keyword-symbolp x))) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy)))) ;; (defthm gobjectp-def ;; (equal (gobjectp x) ;; (if (atom x) ;; (not (g-keyword-symbolp x)) ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x) (bfr-p (g-boolean->bool x))) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x)))) ;; ((g-apply-p x) (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (and (gobjectp (car x)) ;; (gobjectp (cdr x))))))) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy))) ;; :rule-classes :definition) ;; (defun gobjectp-ind (x) ;; (if (atom x) ;; x ;; (cond ;; ((g-concrete-p x)) ;; ((g-boolean-p x)) ;; ((g-number-p x) (wf-g-numberp (g-number->num x))) ;; ((g-ite-p x) (list (gobjectp-ind (g-ite->test x)) ;; (gobjectp-ind (g-ite->then x)) ;; (gobjectp-ind (g-ite->else x)))) ;; ((g-apply-p x) (list (symbolp (g-apply->fn x)) ;; (gobjectp-ind (g-apply->args x)))) ;; ((g-var-p x)) ;; (t (list (gobjectp-ind (car x)) ;; (gobjectp-ind (cdr x))))))) ;; (defthm gobjectp-induct ;; t ;; :rule-classes ((:induction ;; :pattern (gobjectp x) ;; :scheme (gobjectp-ind x)))) ;; (defthm gobjectp-tag-rw-to-types ;; (implies (gobjectp x) ;; (and (equal (equal (tag x) :g-concrete) ;; (g-concrete-p x)) ;; (equal (equal (tag x) :g-boolean) ;; (g-boolean-p x)) ;; (equal (equal (tag x) :g-number) ;; (g-number-p x)) ;; (equal (equal (tag x) :g-ite) ;; (g-ite-p x)) ;; (equal (equal (tag x) :g-apply) ;; (g-apply-p x)) ;; (equal (equal (tag x) :g-var) ;; (g-var-p x)))) ;; :hints (("goal" :expand ((gobjectp x)) ;; :do-not-induct t) ;; (and stable-under-simplificationp ;; '(:in-theory (enable tag g-keyword-symbolp-def)))) ;; :otf-flg t) ;; (defthm gobjectp-ite-case ;; (implies (and (gobjectp x) ;; (g-ite-p x)) ;; (and (gobjectp (g-ite->test x)) ;; (gobjectp (g-ite->then x)) ;; (gobjectp (g-ite->else x))))) ;; (defthm gobjectp-number-case ;; (implies (and (gobjectp x) ;; (g-number-p x)) ;; (wf-g-numberp (g-number->num x)))) ;; (defthm gobjectp-boolean-case ;; (implies (and (gobjectp x) ;; (g-boolean-p x)) ;; (bfr-p (g-boolean->bool x)))) ;; (defthm gobjectp-apply-case ;; (implies (and (gobjectp x) ;; (g-apply-p x)) ;; (and (symbolp (g-apply->fn x)) ;; (gobjectp (g-apply->args x))))) ;; (defthm gobjectp-cons-case ;; (implies (and (gobjectp x) ;; (consp x) ;; (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x))) ;; (and (gobjectp (car x)) ;; (gobjectp (cdr x))))) ;; (defthm gobjectp-gobj-fix ;; (gobjectp (gobj-fix x)) ;; :hints(("Goal" :in-theory (enable gobjectp gobject-hierarchy gobj-fix)))) ;; (defthm gobj-fix-when-gobjectp ;; (implies (gobjectp x) ;; (equal (gobj-fix x) x)) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-fix-when-not-gobjectp ;; (implies (not (gobjectp x)) ;; (equal (gobj-fix x) ;; (g-concrete x))) ;; :hints(("Goal" :in-theory (enable gobj-fix)))) ;; (defthm gobj-equiv-gobj-fix ;; (gobj-equiv (gobj-fix x) x)) ;; (table prove-congruence-theory-table ;; 'gobj-equiv '(gobjectp-gobj-fix gobj-fix-when-gobjectp)) ;; (defthmd gobjectp-car-impl-not-g-types ;; (implies (gobjectp (car x)) ;; (and (not (g-boolean-p x)) ;; (not (g-number-p x)) ;; (not (g-concrete-p x)) ;; (not (g-ite-p x)) ;; (not (g-apply-p x)) ;; (not (g-var-p x)))) ;; :hints(("Goal" :in-theory (enable g-boolean-p ;; g-number-p ;; g-concrete-p ;; g-ite-p ;; g-apply-p ;; g-var-p)))) ;; (defthmd gobject-listp-impl-gobjectp ;; (implies (gobject-listp x) ;; (gobjectp x)) ;; :hints(("Goal" :in-theory ;; (enable gobjectp-car-impl-not-g-types ;; gobjectp-def gobject-listp)))) ;; (defthmd gobject-hierarchy-possibilities ;; (implies (and (gobject-hierarchy x) ;; (not (equal (gobject-hierarchy x) 'gobject)) ;; (not (equal (gobject-hierarchy x) 'general))) ;; (equal (equal (gobject-hierarchy x) 'concrete) t)) ;; :hints(("Goal" :in-theory (enable gobject-hierarchy))) ;; :rule-classes ((:rewrite :backchain-limit-lst 0))) ;; (in-theory (disable gobjectp-def))
[ { "context": "ccup, Clojure's HTML-building library\"\n :author \"Duncan McGreggor <[email protected]>\"\n :license \"BSD\"\n :version ", "end": 339, "score": 0.9998904466629028, "start": 323, "tag": "NAME", "value": "Duncan McGreggor" }, { "context": "ML-building library\"\n :author \"Duncan McGreggor <[email protected]>\"\n :license \"BSD\"\n :version \"0.1\"\n :components", "end": 358, "score": 0.9999317526817322, "start": 341, "tag": "EMAIL", "value": "[email protected]" } ]
spasm.asd
windchime/cl-spasm
4
(ql:quickload 'asdf) (ql:quickload 'cl-ppcre) (ql:quickload 'lift) (ql:quickload 'html-entities) (defpackage #:spasm-system (:use #:cl #:asdf #:cl-ppcre #:html-entities)) (in-package #:spasm-system) (defsystem spasm :serial t :description "A Common Lisp port of Hiccup, Clojure's HTML-building library" :author "Duncan McGreggor <[email protected]>" :license "BSD" :version "0.1" :components ( (:module "src" :components ( (:file "package") (:file "core") (:file "macro") (:file "element") (:file "form") (:file "middleware") (:file "page") (:file "util"))))) (defsystem spasm-tests :depends-on (#:spasm) :components ( (:module "tests" :components ( (:file "core") (:file "element") (:file "util")))))
31900
(ql:quickload 'asdf) (ql:quickload 'cl-ppcre) (ql:quickload 'lift) (ql:quickload 'html-entities) (defpackage #:spasm-system (:use #:cl #:asdf #:cl-ppcre #:html-entities)) (in-package #:spasm-system) (defsystem spasm :serial t :description "A Common Lisp port of Hiccup, Clojure's HTML-building library" :author "<NAME> <<EMAIL>>" :license "BSD" :version "0.1" :components ( (:module "src" :components ( (:file "package") (:file "core") (:file "macro") (:file "element") (:file "form") (:file "middleware") (:file "page") (:file "util"))))) (defsystem spasm-tests :depends-on (#:spasm) :components ( (:module "tests" :components ( (:file "core") (:file "element") (:file "util")))))
true
(ql:quickload 'asdf) (ql:quickload 'cl-ppcre) (ql:quickload 'lift) (ql:quickload 'html-entities) (defpackage #:spasm-system (:use #:cl #:asdf #:cl-ppcre #:html-entities)) (in-package #:spasm-system) (defsystem spasm :serial t :description "A Common Lisp port of Hiccup, Clojure's HTML-building library" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "BSD" :version "0.1" :components ( (:module "src" :components ( (:file "package") (:file "core") (:file "macro") (:file "element") (:file "form") (:file "middleware") (:file "page") (:file "util"))))) (defsystem spasm-tests :depends-on (#:spasm) :components ( (:module "tests" :components ( (:file "core") (:file "element") (:file "util")))))
[ { "context": "5, Regents of the University of Texas\n; Written by Matt Kaufmann (October, 2015)\n; License: A 3-clause BSD license", "end": 83, "score": 0.9997379183769226, "start": 70, "tag": "NAME", "value": "Matt Kaufmann" } ]
books/misc/install-not-normalized-tests.lisp
nzt/acl2
1
; Copyright (C) 2015, Regents of the University of Texas ; Written by Matt Kaufmann (October, 2015) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; See install-not-normalized.lisp. (in-package "ACL2") (include-book "install-not-normalized") (local (include-book "std/testing/eval" :dir :system)) (defmacro my-test (&rest forms) `(local (encapsulate () (local (in-theory (current-theory :here))) ; avoid redundancy (local (progn ,@forms))))) ; Example (challenge supplied by Eric Smith): (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (must-fail (fn-is-body foo :hints (("Goal" :in-theory '(foo))))) (must-fail (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized foo) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo$not-normalized) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo-is-unnormalized-body) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo-is-unnormalized-body))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; Recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (must-fail (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm))))) (must-fail (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f-norm) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm$not-normalized) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm-alt-def) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm-alt-def))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm))))) (must-fail (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f1-norm) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with one default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm$not-normalized) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm-new-def) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with both names supplied explicitly that are not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name '((f1-norm f1-norm-new-def) (f2-norm f2-norm-new-def))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm-new-def))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example, but handling only one function in the nest: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm))))) (must-fail (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f3-norm :allp nil) ; "nil" for "not the entire nest (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm$not-normalized))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f3-norm :allp nil ; "nil" for "not the entire nest :defthm-name 'f3-norm-new) (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm-new))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) )
49050
; Copyright (C) 2015, Regents of the University of Texas ; Written by <NAME> (October, 2015) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; See install-not-normalized.lisp. (in-package "ACL2") (include-book "install-not-normalized") (local (include-book "std/testing/eval" :dir :system)) (defmacro my-test (&rest forms) `(local (encapsulate () (local (in-theory (current-theory :here))) ; avoid redundancy (local (progn ,@forms))))) ; Example (challenge supplied by Eric Smith): (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (must-fail (fn-is-body foo :hints (("Goal" :in-theory '(foo))))) (must-fail (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized foo) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo$not-normalized) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo-is-unnormalized-body) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo-is-unnormalized-body))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; Recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (must-fail (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm))))) (must-fail (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f-norm) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm$not-normalized) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm-alt-def) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm-alt-def))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm))))) (must-fail (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f1-norm) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with one default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm$not-normalized) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm-new-def) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with both names supplied explicitly that are not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name '((f1-norm f1-norm-new-def) (f2-norm f2-norm-new-def))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm-new-def))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example, but handling only one function in the nest: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm))))) (must-fail (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f3-norm :allp nil) ; "nil" for "not the entire nest (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm$not-normalized))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f3-norm :allp nil ; "nil" for "not the entire nest :defthm-name 'f3-norm-new) (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm-new))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) )
true
; Copyright (C) 2015, Regents of the University of Texas ; Written by PI:NAME:<NAME>END_PI (October, 2015) ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; See install-not-normalized.lisp. (in-package "ACL2") (include-book "install-not-normalized") (local (include-book "std/testing/eval" :dir :system)) (defmacro my-test (&rest forms) `(local (encapsulate () (local (in-theory (current-theory :here))) ; avoid redundancy (local (progn ,@forms))))) ; Example (challenge supplied by Eric Smith): (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (must-fail (fn-is-body foo :hints (("Goal" :in-theory '(foo))))) (must-fail (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized foo) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo$not-normalized) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo$not-normalized))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun return-nil (x) (declare (ignore x)) nil) (defun foo (x) (return-nil x)) (install-not-normalized foo :defthm-name 'foo-is-unnormalized-body) (must-succeed (fn-is-body foo :hints (("Goal" :in-theory '(foo-is-unnormalized-body))))) (must-succeed (fn-is-body foo :hints (("Goal" :expand ((foo x)) :in-theory (theory 'minimal-theory))))) ) ; Recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (must-fail (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm))))) (must-fail (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f-norm) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with the default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm$not-normalized) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm$not-normalized))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (defun f-norm (x) (if (my-t) (if (consp x) (cons (car x) (f-norm (cdr x))) (my-zero)) (my-nil))) (install-not-normalized f-norm :defthm-name 'f-norm-alt-def) (must-succeed (fn-is-body f-norm :hints (("Goal" :in-theory '(f-norm-alt-def))))) (must-succeed (fn-is-body f-norm :hints (("Goal" :expand ((f-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm))))) (must-fail (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f1-norm) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with one default name supplied explicitly. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm$not-normalized) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm$not-normalized))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name 'f1-norm-new-def) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm$not-normalized))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with both names supplied explicitly that are not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f1-norm (x) (if (my-t) (if (consp x) (cons (car x) (f2-norm (cdr x))) (my-zero)) (my-nil))) (defun f2-norm (x) (if (my-t) (if (consp x) (cons (car x) (f1-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f1-norm :defthm-name '((f1-norm f1-norm-new-def) (f2-norm f2-norm-new-def))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :in-theory '(f1-norm-new-def))))) (must-succeed (fn-is-body f1-norm :hints (("Goal" :expand ((f1-norm x)) :in-theory (theory 'minimal-theory))))) ; f2 is handled too: (must-succeed (fn-is-body f2-norm :hints (("Goal" :in-theory '(f2-norm-new-def))))) (must-succeed (fn-is-body f2-norm :hints (("Goal" :expand ((f2-norm x)) :in-theory (theory 'minimal-theory))))) ) ; Mutual-recursion example, but handling only one function in the nest: (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (must-fail (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm))))) (must-fail (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) (install-not-normalized f3-norm :allp nil) ; "nil" for "not the entire nest (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm$not-normalized))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) ) ; As above, but with a name supplied explicitly that is not the default. (my-test (defun my-t () t) (defun my-nil () nil) (defun my-zero () 0) (mutual-recursion (defun f3-norm (x) (if (my-t) (if (consp x) (cons (car x) (f4-norm (cdr x))) (my-zero)) (my-nil))) (defun f4-norm (x) (if (my-t) (if (consp x) (cons (car x) (f3-norm (cdr x))) (my-zero)) (my-nil))) ) (install-not-normalized f3-norm :allp nil ; "nil" for "not the entire nest :defthm-name 'f3-norm-new) (must-succeed (fn-is-body f3-norm :hints (("Goal" :in-theory '(f3-norm-new))))) (must-succeed (fn-is-body f3-norm :hints (("Goal" :expand ((f3-norm x)) :in-theory (theory 'minimal-theory))))) ; F4 is not handled, since we gave nestp = nil in the call above of ; install-not-normalized. (must-fail (fn-is-body f4-norm :hints (("Goal" :in-theory '(f4-norm$not-normalized))))) (must-fail (fn-is-body f4-norm :hints (("Goal" :expand ((f4-norm x)) :in-theory (theory 'minimal-theory))))) )
[ { "context": ";; Copyright (c) 2014 Akamai Technologies, Inc. (MIT License)\n\n(in-package :cl-http2-protoc", "end": 41, "score": 0.7216876745223999, "start": 22, "tag": "NAME", "value": "Akamai Technologies" } ]
server.lisp
Symbolics/cl-http2-protocol
70
;; Copyright (c) 2014 Akamai Technologies, Inc. (MIT License) (in-package :cl-http2-protocol) ;; HTTP/2 server connection class that implements appropriate header ;; compression / decompression algorithms and stream management logic. ;; ;; Your code is responsible for feeding request data to the server object, ;; which in turn performs all of the necessary HTTP/2 decoding / encoding, ;; state management, and the rest. See README.md for an example. (defclass server (connection) ((stream-id :initform 2) (state :initform :new) (compressor :accessor compressor :initarg :compressor :initform (make-instance 'compressor :type :response)) (decompressor :accessor decompressor :initarg :decompressor :initform (make-instance 'decompressor :type :request)) (push-enabled :reader push-enabled :initform t :type (member t nil))) (:documentation "HTTP/2 server object")) ;; Technically HTTP/2 as a protocol does not differentiate push ;; between client/server, and the protocol can do it either way; but ;; HTTP semantics applied to the protocol dictate that only a server ;; pushes (it makes no sense for a client to push). ;; a SERVER knows what to do with SETTINGS_ENABLE_PUSH so define a method (defmethod connection-setting ((connection server) (key (eql :settings-enable-push)) value) (with-slots (push-enabled) connection (setf push-enabled (if (= value 1) t nil)))) (defmethod server-promise ((server server) &rest args &aux (callback (shift args))) "Handle locally initiated server-push event emitted by the stream." (destructuring-bind (parent headers flags) args (when (with-simple-restart (abort-promise "Abort the promise") (unless (push-enabled server) (raise :http2-push-disabled "Push disabled, cannot promise: ~A" headers)) t) (let ((promise (new-stream server *default-priority* parent))) (send promise (list :type :push-promise :flags flags :stream (stream-id parent) :promise-stream (stream-id promise) :payload headers)) (funcall callback promise))))) ;; Again, it only makes sense for a server to emit an ALTSVC frame in ;; normal HTTP operations: (defmethod altsvc ((server server) max-age port protocol-identifier host origin) "Issue ALTSVC frame to peer." (send server (list :type :altsvc :max-age max-age :port port :protocol-identifier protocol-identifier :host host :origin origin)))
47039
;; Copyright (c) 2014 <NAME>, Inc. (MIT License) (in-package :cl-http2-protocol) ;; HTTP/2 server connection class that implements appropriate header ;; compression / decompression algorithms and stream management logic. ;; ;; Your code is responsible for feeding request data to the server object, ;; which in turn performs all of the necessary HTTP/2 decoding / encoding, ;; state management, and the rest. See README.md for an example. (defclass server (connection) ((stream-id :initform 2) (state :initform :new) (compressor :accessor compressor :initarg :compressor :initform (make-instance 'compressor :type :response)) (decompressor :accessor decompressor :initarg :decompressor :initform (make-instance 'decompressor :type :request)) (push-enabled :reader push-enabled :initform t :type (member t nil))) (:documentation "HTTP/2 server object")) ;; Technically HTTP/2 as a protocol does not differentiate push ;; between client/server, and the protocol can do it either way; but ;; HTTP semantics applied to the protocol dictate that only a server ;; pushes (it makes no sense for a client to push). ;; a SERVER knows what to do with SETTINGS_ENABLE_PUSH so define a method (defmethod connection-setting ((connection server) (key (eql :settings-enable-push)) value) (with-slots (push-enabled) connection (setf push-enabled (if (= value 1) t nil)))) (defmethod server-promise ((server server) &rest args &aux (callback (shift args))) "Handle locally initiated server-push event emitted by the stream." (destructuring-bind (parent headers flags) args (when (with-simple-restart (abort-promise "Abort the promise") (unless (push-enabled server) (raise :http2-push-disabled "Push disabled, cannot promise: ~A" headers)) t) (let ((promise (new-stream server *default-priority* parent))) (send promise (list :type :push-promise :flags flags :stream (stream-id parent) :promise-stream (stream-id promise) :payload headers)) (funcall callback promise))))) ;; Again, it only makes sense for a server to emit an ALTSVC frame in ;; normal HTTP operations: (defmethod altsvc ((server server) max-age port protocol-identifier host origin) "Issue ALTSVC frame to peer." (send server (list :type :altsvc :max-age max-age :port port :protocol-identifier protocol-identifier :host host :origin origin)))
true
;; Copyright (c) 2014 PI:NAME:<NAME>END_PI, Inc. (MIT License) (in-package :cl-http2-protocol) ;; HTTP/2 server connection class that implements appropriate header ;; compression / decompression algorithms and stream management logic. ;; ;; Your code is responsible for feeding request data to the server object, ;; which in turn performs all of the necessary HTTP/2 decoding / encoding, ;; state management, and the rest. See README.md for an example. (defclass server (connection) ((stream-id :initform 2) (state :initform :new) (compressor :accessor compressor :initarg :compressor :initform (make-instance 'compressor :type :response)) (decompressor :accessor decompressor :initarg :decompressor :initform (make-instance 'decompressor :type :request)) (push-enabled :reader push-enabled :initform t :type (member t nil))) (:documentation "HTTP/2 server object")) ;; Technically HTTP/2 as a protocol does not differentiate push ;; between client/server, and the protocol can do it either way; but ;; HTTP semantics applied to the protocol dictate that only a server ;; pushes (it makes no sense for a client to push). ;; a SERVER knows what to do with SETTINGS_ENABLE_PUSH so define a method (defmethod connection-setting ((connection server) (key (eql :settings-enable-push)) value) (with-slots (push-enabled) connection (setf push-enabled (if (= value 1) t nil)))) (defmethod server-promise ((server server) &rest args &aux (callback (shift args))) "Handle locally initiated server-push event emitted by the stream." (destructuring-bind (parent headers flags) args (when (with-simple-restart (abort-promise "Abort the promise") (unless (push-enabled server) (raise :http2-push-disabled "Push disabled, cannot promise: ~A" headers)) t) (let ((promise (new-stream server *default-priority* parent))) (send promise (list :type :push-promise :flags flags :stream (stream-id parent) :promise-stream (stream-id promise) :payload headers)) (funcall callback promise))))) ;; Again, it only makes sense for a server to emit an ALTSVC frame in ;; normal HTTP operations: (defmethod altsvc ((server server) max-age port protocol-identifier host origin) "Issue ALTSVC frame to peer." (send server (list :type :altsvc :max-age max-age :port port :protocol-identifier protocol-identifier :host host :origin origin)))
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(%in", "end": 1356, "score": 0.9995550513267517, "start": 1345, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"MILAWA\")\n(%interactive)\n\n\n(%defpro", "end": 1377, "score": 0.9999353885650635, "start": 1358, "tag": "EMAIL", "value": "[email protected]" } ]
books/projects/milawa/ACL2/bootstrap/level11/partition.lisp
mayankmanj/acl2
305
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "MILAWA") (%interactive) (%defprojection :list (rev-lists x) :element (rev x) :nil-preservingp t) (%autoprove rev-lists-of-rev-lists (%cdr-induction x)) (%autoadmit fast-app-lists$) (%autoadmit app-lists) (%autoadmit slow-app-lists) (%autoprove slow-app-lists-when-not-consp (%restrict default slow-app-lists (equal x 'x))) (%autoprove slow-app-lists-of-cons (%restrict default slow-app-lists (equal x '(cons a x)))) (%autoprove true-listp-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-fix (%cdr-induction x)) (%autoprove slow-app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-list-fix (%cdr-induction x)) (ACL2::skip-proofs ;; BOZO unlocalize/rename ;; Damn theory invariants -- I'll just skip it. It's locally proved there. (defthmd lemma1-for-definition-of-app-lists (implies (true-listp acc) (equal (fast-app-lists$ x acc) (app (slow-app-lists (rev (rev-lists x))) acc))) :hints(("Goal" :in-theory (enable fast-app-lists$))))) (ACL2::skip-proofs (defthmd lemma2-for-definition-of-app-lists (equal (app-lists x) (slow-app-lists x)) :hints(("Goal" :in-theory (enable app-lists))))) ;; BOZO def of app-lists is screwed up in tactics/partition. ;; Should say app-lists in recursive case, says slow-app-lists. (defthmd definition-of-app-lists-alt (equal (app-lists x) (if (consp x) (app (car x) (app-lists (cdr x))) nil)) :rule-classes :definition) (%autoprove lemma1-for-definition-of-app-lists (%autoinduct fast-app-lists$) (%restrict default fast-app-lists$ (equal x 'x))) (%autoprove lemma2-for-definition-of-app-lists (%enable default lemma1-for-definition-of-app-lists) (%restrict default app-lists (equal x 'x))) (%autoprove definition-of-app-lists-alt (%enable default lemma2-for-definition-of-app-lists)) (%autoprove app-lists-when-not-consp (%restrict default definition-of-app-lists-alt (equal x 'x))) (%autoprove app-lists-of-cons (%restrict default definition-of-app-lists-alt (equal x '(cons a x)))) (%autoprove true-listp-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-fix (%cdr-induction x)) (%autoprove app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-list-fix (%cdr-induction x)) (%autoadmit fast-sum-list) (%autoadmit sum-list) (%autoadmit slow-sum-list) (ACL2::skip-proofs ;; BOZO unlocalize/rename (defthm lemma-for-definition-of-sum-list (implies (force (natp acc)) (equal (fast-sum-list x acc) (+ (slow-sum-list x) acc))) :hints(("Goal" :in-theory (enable fast-sum-list slow-sum-list))))) (%autoprove lemma-for-definition-of-sum-list (%autoinduct fast-sum-list) (%restrict default fast-sum-list (equal x 'x)) (%restrict default slow-sum-list (equal x 'x))) (%autoprove definition-of-sum-list (%restrict default slow-sum-list (equal x 'x)) (%enable default sum-list)) (%autoprove sum-list-when-not-consp (%restrict default definition-of-sum-list (equal x 'x))) (%autoprove sum-list-of-cons (%restrict default definition-of-sum-list (equal x '(cons a x)))) (%autoprove natp-of-sum-list (%cdr-induction x)) (%autoprove sum-list-of-list-fix (%cdr-induction x)) (%autoprove sum-list-of-app (%cdr-induction x)) (%autoprove sum-list-of-rev (%cdr-induction x)) (%autoprove len-of-restn ;; BOZO move to utilities (%autoinduct restn) (%restrict default restn (equal n 'n))) ;; Hrmn, we already have len-of-firstn?? I wonder where that got defined... (%autoadmit partition) (%autoprove partition-when-not-consp (%restrict default partition (equal lens 'lens))) (%autoprove partition-of-cons (%restrict default partition (equal lens '(cons len lens)))) (%autoprove partition-of-list-fix-one (%autoinduct partition)) (%autoprove partition-of-list-fix-two (%autoinduct partition)) (%autoprove true-listp-of-partition (%autoinduct partition)) ;; BOZO we don't seem to need the arith lemma that is here in tactics/partition (%autoprove forcing-app-lists-of-partition (%autoinduct partition)) (%autoprove partition-of-strip-lens-of-app-lists (%cdr-induction x)) (%autoprove partition-of-strip-lens-of-app-lists-free) (%autoprove partition-of-simple-flatten (%cdr-induction x)) (%ensure-exactly-these-rules-are-missing "../../tactics/partition" ;; BOZO fix this; it's broken, see above, we used -alt. definition-of-app-lists)
53173
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "MILAWA") (%interactive) (%defprojection :list (rev-lists x) :element (rev x) :nil-preservingp t) (%autoprove rev-lists-of-rev-lists (%cdr-induction x)) (%autoadmit fast-app-lists$) (%autoadmit app-lists) (%autoadmit slow-app-lists) (%autoprove slow-app-lists-when-not-consp (%restrict default slow-app-lists (equal x 'x))) (%autoprove slow-app-lists-of-cons (%restrict default slow-app-lists (equal x '(cons a x)))) (%autoprove true-listp-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-fix (%cdr-induction x)) (%autoprove slow-app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-list-fix (%cdr-induction x)) (ACL2::skip-proofs ;; BOZO unlocalize/rename ;; Damn theory invariants -- I'll just skip it. It's locally proved there. (defthmd lemma1-for-definition-of-app-lists (implies (true-listp acc) (equal (fast-app-lists$ x acc) (app (slow-app-lists (rev (rev-lists x))) acc))) :hints(("Goal" :in-theory (enable fast-app-lists$))))) (ACL2::skip-proofs (defthmd lemma2-for-definition-of-app-lists (equal (app-lists x) (slow-app-lists x)) :hints(("Goal" :in-theory (enable app-lists))))) ;; BOZO def of app-lists is screwed up in tactics/partition. ;; Should say app-lists in recursive case, says slow-app-lists. (defthmd definition-of-app-lists-alt (equal (app-lists x) (if (consp x) (app (car x) (app-lists (cdr x))) nil)) :rule-classes :definition) (%autoprove lemma1-for-definition-of-app-lists (%autoinduct fast-app-lists$) (%restrict default fast-app-lists$ (equal x 'x))) (%autoprove lemma2-for-definition-of-app-lists (%enable default lemma1-for-definition-of-app-lists) (%restrict default app-lists (equal x 'x))) (%autoprove definition-of-app-lists-alt (%enable default lemma2-for-definition-of-app-lists)) (%autoprove app-lists-when-not-consp (%restrict default definition-of-app-lists-alt (equal x 'x))) (%autoprove app-lists-of-cons (%restrict default definition-of-app-lists-alt (equal x '(cons a x)))) (%autoprove true-listp-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-fix (%cdr-induction x)) (%autoprove app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-list-fix (%cdr-induction x)) (%autoadmit fast-sum-list) (%autoadmit sum-list) (%autoadmit slow-sum-list) (ACL2::skip-proofs ;; BOZO unlocalize/rename (defthm lemma-for-definition-of-sum-list (implies (force (natp acc)) (equal (fast-sum-list x acc) (+ (slow-sum-list x) acc))) :hints(("Goal" :in-theory (enable fast-sum-list slow-sum-list))))) (%autoprove lemma-for-definition-of-sum-list (%autoinduct fast-sum-list) (%restrict default fast-sum-list (equal x 'x)) (%restrict default slow-sum-list (equal x 'x))) (%autoprove definition-of-sum-list (%restrict default slow-sum-list (equal x 'x)) (%enable default sum-list)) (%autoprove sum-list-when-not-consp (%restrict default definition-of-sum-list (equal x 'x))) (%autoprove sum-list-of-cons (%restrict default definition-of-sum-list (equal x '(cons a x)))) (%autoprove natp-of-sum-list (%cdr-induction x)) (%autoprove sum-list-of-list-fix (%cdr-induction x)) (%autoprove sum-list-of-app (%cdr-induction x)) (%autoprove sum-list-of-rev (%cdr-induction x)) (%autoprove len-of-restn ;; BOZO move to utilities (%autoinduct restn) (%restrict default restn (equal n 'n))) ;; Hrmn, we already have len-of-firstn?? I wonder where that got defined... (%autoadmit partition) (%autoprove partition-when-not-consp (%restrict default partition (equal lens 'lens))) (%autoprove partition-of-cons (%restrict default partition (equal lens '(cons len lens)))) (%autoprove partition-of-list-fix-one (%autoinduct partition)) (%autoprove partition-of-list-fix-two (%autoinduct partition)) (%autoprove true-listp-of-partition (%autoinduct partition)) ;; BOZO we don't seem to need the arith lemma that is here in tactics/partition (%autoprove forcing-app-lists-of-partition (%autoinduct partition)) (%autoprove partition-of-strip-lens-of-app-lists (%cdr-induction x)) (%autoprove partition-of-strip-lens-of-app-lists-free) (%autoprove partition-of-simple-flatten (%cdr-induction x)) (%ensure-exactly-these-rules-are-missing "../../tactics/partition" ;; BOZO fix this; it's broken, see above, we used -alt. definition-of-app-lists)
true
; Milawa - A Reflective Theorem Prover ; Copyright (C) 2005-2009 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "MILAWA") (%interactive) (%defprojection :list (rev-lists x) :element (rev x) :nil-preservingp t) (%autoprove rev-lists-of-rev-lists (%cdr-induction x)) (%autoadmit fast-app-lists$) (%autoadmit app-lists) (%autoadmit slow-app-lists) (%autoprove slow-app-lists-when-not-consp (%restrict default slow-app-lists (equal x 'x))) (%autoprove slow-app-lists-of-cons (%restrict default slow-app-lists (equal x '(cons a x)))) (%autoprove true-listp-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-fix (%cdr-induction x)) (%autoprove slow-app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-slow-app-lists (%cdr-induction x)) (%autoprove slow-app-lists-of-list-list-fix (%cdr-induction x)) (ACL2::skip-proofs ;; BOZO unlocalize/rename ;; Damn theory invariants -- I'll just skip it. It's locally proved there. (defthmd lemma1-for-definition-of-app-lists (implies (true-listp acc) (equal (fast-app-lists$ x acc) (app (slow-app-lists (rev (rev-lists x))) acc))) :hints(("Goal" :in-theory (enable fast-app-lists$))))) (ACL2::skip-proofs (defthmd lemma2-for-definition-of-app-lists (equal (app-lists x) (slow-app-lists x)) :hints(("Goal" :in-theory (enable app-lists))))) ;; BOZO def of app-lists is screwed up in tactics/partition. ;; Should say app-lists in recursive case, says slow-app-lists. (defthmd definition-of-app-lists-alt (equal (app-lists x) (if (consp x) (app (car x) (app-lists (cdr x))) nil)) :rule-classes :definition) (%autoprove lemma1-for-definition-of-app-lists (%autoinduct fast-app-lists$) (%restrict default fast-app-lists$ (equal x 'x))) (%autoprove lemma2-for-definition-of-app-lists (%enable default lemma1-for-definition-of-app-lists) (%restrict default app-lists (equal x 'x))) (%autoprove definition-of-app-lists-alt (%enable default lemma2-for-definition-of-app-lists)) (%autoprove app-lists-when-not-consp (%restrict default definition-of-app-lists-alt (equal x 'x))) (%autoprove app-lists-of-cons (%restrict default definition-of-app-lists-alt (equal x '(cons a x)))) (%autoprove true-listp-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-fix (%cdr-induction x)) (%autoprove app-lists-of-app (%cdr-induction x)) (%autoprove rev-of-app-lists (%cdr-induction x)) (%autoprove app-lists-of-list-list-fix (%cdr-induction x)) (%autoadmit fast-sum-list) (%autoadmit sum-list) (%autoadmit slow-sum-list) (ACL2::skip-proofs ;; BOZO unlocalize/rename (defthm lemma-for-definition-of-sum-list (implies (force (natp acc)) (equal (fast-sum-list x acc) (+ (slow-sum-list x) acc))) :hints(("Goal" :in-theory (enable fast-sum-list slow-sum-list))))) (%autoprove lemma-for-definition-of-sum-list (%autoinduct fast-sum-list) (%restrict default fast-sum-list (equal x 'x)) (%restrict default slow-sum-list (equal x 'x))) (%autoprove definition-of-sum-list (%restrict default slow-sum-list (equal x 'x)) (%enable default sum-list)) (%autoprove sum-list-when-not-consp (%restrict default definition-of-sum-list (equal x 'x))) (%autoprove sum-list-of-cons (%restrict default definition-of-sum-list (equal x '(cons a x)))) (%autoprove natp-of-sum-list (%cdr-induction x)) (%autoprove sum-list-of-list-fix (%cdr-induction x)) (%autoprove sum-list-of-app (%cdr-induction x)) (%autoprove sum-list-of-rev (%cdr-induction x)) (%autoprove len-of-restn ;; BOZO move to utilities (%autoinduct restn) (%restrict default restn (equal n 'n))) ;; Hrmn, we already have len-of-firstn?? I wonder where that got defined... (%autoadmit partition) (%autoprove partition-when-not-consp (%restrict default partition (equal lens 'lens))) (%autoprove partition-of-cons (%restrict default partition (equal lens '(cons len lens)))) (%autoprove partition-of-list-fix-one (%autoinduct partition)) (%autoprove partition-of-list-fix-two (%autoinduct partition)) (%autoprove true-listp-of-partition (%autoinduct partition)) ;; BOZO we don't seem to need the arith lemma that is here in tactics/partition (%autoprove forcing-app-lists-of-partition (%autoinduct partition)) (%autoprove partition-of-strip-lens-of-app-lists (%cdr-induction x)) (%autoprove partition-of-strip-lens-of-app-lists-free) (%autoprove partition-of-simple-flatten (%cdr-induction x)) (%ensure-exactly-these-rules-are-missing "../../tactics/partition" ;; BOZO fix this; it's broken, see above, we used -alt. definition-of-app-lists)
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"FGL\")\n\n(incl", "end": 1412, "score": 0.9998602867126465, "start": 1402, "tag": "NAME", "value": "Sol Swords" }, { "context": "IN THE SOFTWARE.\n;\n; Original author: Sol Swords <[email protected]>\n\n(in-package \"FGL\")\n\n(include-book \"std/util/def", "end": 1434, "score": 0.9999316334724426, "start": 1414, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/fgl/nat-var-aig.lisp
mayankmanj/acl2
305
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Sol Swords <[email protected]> (in-package "FGL") (include-book "std/util/deflist" :dir :system) (include-book "centaur/fty/deftypes" :dir :system) (include-book "centaur/fty/basetypes" :dir :system) (include-book "centaur/aig/aig-vars" :dir :system) ;; (include-book "centaur/misc/fast-alist-pop" :dir :system) (include-book "std/stobjs/absstobjs" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (std::add-default-post-define-hook :fix)) (define bounded-natp (x (bound natp)) (and (natp x) (< x (nfix bound))) /// (defthm bounded-natp-implies-bound (implies (bounded-natp x bound) (< x (nfix bound))) :rule-classes :forward-chaining) (defthm bounded-natp-implies-natp (implies (bounded-natp x bound) (natp x)) :rule-classes :forward-chaining) (defthm bounded-natp-of-nil (not (bounded-natp nil bound))) (defthm bounded-natp-when-bounded-by-less (implies (and (bounded-natp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-natp x bound)))) (define bounded-nat-listp (x (bound natp)) (if (atom x) t (and (bounded-natp (car x) bound) (bounded-nat-listp (cdr x) bound))) /// (defthm bounded-nat-listp-when-bounded-by-lesser (implies (and (bounded-nat-listp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-nat-listp x bound))) (defthmd not-bounded-nat-listp-by-member (implies (and (member k x) (not (bounded-natp k bound))) (not (bounded-nat-listp x bound)))) (defthmd bounded-nat-listp-implies-not-member (implies (and (bounded-nat-listp x bound) (not (bounded-natp k bound))) (not (member k x)))) (defthm bounded-nat-listp-of-append (iff (bounded-nat-listp (append a b) bound) (and (bounded-nat-listp a bound) (bounded-nat-listp b bound)))) (defthm bounded-nat-listp-of-nil (bounded-nat-listp nil bound)) (defthm bounded-nat-listp-of-cons (iff (bounded-nat-listp (cons a b) bound) (and (bounded-natp a bound) (bounded-nat-listp b bound))))) (local (define bounded-nat-listp-badguy (x bound) :verify-guards nil (if (atom x) nil (if (bounded-natp (car x) bound) (bounded-nat-listp-badguy (cdr x) bound) (car x))) /// (defthm bounded-nat-listp-badguy-is-bad (not (bounded-natp (bounded-nat-listp-badguy x bound) bound))) (defthmd bounded-nat-listp-when-nat-listp-badguy-not-member (implies (acl2::rewriting-positive-literal `(bounded-nat-listp ,x ,bound)) (iff (bounded-nat-listp x bound) (not (member (bounded-nat-listp-badguy x bound) x)))) :hints(("Goal" :in-theory (enable bounded-nat-listp)))) (defcong set-equiv equal (bounded-nat-listp x bound) 1 :hints(("Goal" :in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member) :cases ((bounded-nat-listp x bound)) :use ((:instance not-bounded-nat-listp-by-member (x x-equiv) (k (bounded-nat-listp-badguy x bound))) (:instance not-bounded-nat-listp-by-member (x x) (k (bounded-nat-listp-badguy x-equiv bound))))))))) (define aig-p (x (var-bound natp)) (cond ((atom x) (or (booleanp x) ;; const (bounded-natp x var-bound))) ;; var ((eq (cdr x) 'nil) (aig-p (car x) var-bound)) ;; this is weird because (nil . nil) is a valid aig but it makes it so ;; nat-listp-aig-vars-when-aig-p holds ((eq (car x) 'nil) nil) (t (and (aig-p (car x) var-bound) (aig-p (cdr x) var-bound)))) /// (local (defthm aig-p-is-bounded-nat-listp-aig-vars (iff (aig-p x var-bound) (bounded-nat-listp (acl2::aig-vars x) var-bound)))) (defthm bounded-nat-listp-aig-vars-when-aig-p (iff (bounded-nat-listp (acl2::aig-vars x) var-bound) (aig-p x var-bound)) :hints(("Goal" :in-theory (enable acl2::aig-atom-p)))) (local (in-theory (disable bounded-nat-listp-aig-vars-when-aig-p))) (defthm aig-p-when-lesser-bound (implies (and (aig-p x bound1) (<= (nfix bound1) (nfix bound))) (aig-p x bound))) (local (defthm member-aig-vars-aig-and (implies (and (not (member v (acl2::aig-vars x))) (not (member v (acl2::aig-vars y)))) (not (member v (acl2::aig-vars (acl2::aig-and x y))))) :hints (("goal" :use ((:instance acl2::member-aig-vars-aig-and (v v) (x x))) :in-theory (e/d (set::in-to-member) (acl2::member-aig-vars-aig-and)))))) (defthm aig-p-of-aig-not (implies (aig-p x bound) (aig-p (acl2::aig-not x) bound))) (local (in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member bounded-nat-listp-implies-not-member))) (defthm aig-p-of-aig-and (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-and x y) bound))) (local (in-theory (disable aig-p-is-bounded-nat-listp-aig-vars))) (defthm aig-p-of-aig-or (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-or x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-or)))) (defthm aig-p-of-aig-xor (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-xor x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-xor)))) (defthm aig-p-of-aig-iff (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-iff x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-iff)))) (defthm aig-p-of-aig-ite (implies (and (aig-p x bound) (aig-p y bound) (aig-p z bound)) (aig-p (acl2::aig-ite x y z) bound)) :hints(("Goal" :in-theory (enable acl2::aig-ite)))) (defthm aig-p-of-car (implies (aig-p x bound) (aig-p (car x) bound))) (defthm aig-p-of-cdr (implies (aig-p x bound) (aig-p (cdr x) bound))) (defthm aig-atom-p-when-aig-p (implies (aig-p x bound) (equal (acl2::aig-atom-p x) (atom x)))) (defthm aig-p-of-var (implies (natp x) (equal (aig-p x var-bound) (< x (nfix var-bound)))) :hints(("Goal" :in-theory (enable bounded-natp))))) (define aig-fix ((x (aig-p x var-bound)) (var-bound natp)) :returns (new-x (aig-p new-x var-bound) :hints(("Goal" :in-theory (enable aig-p)))) :verify-guards nil (mbe :logic (cond ((atom x) (and (or (booleanp x) (bounded-natp x var-bound)) x)) ((eq (cdr x) nil) (cons (aig-fix (car x) var-bound) nil)) ((eq (car x) nil) nil) (t (b* ((car (aig-fix (car x) var-bound)) (cdr (aig-fix (cdr x) var-bound))) (and car cdr (cons car cdr))))) :exec x) /// (defthm aig-fix-when-aig-p (implies (aig-p x bound) (equal (aig-fix x bound) x)) :hints(("Goal" :in-theory (enable aig-p)))) (verify-guards aig-fix :hints(("Goal" :in-theory (enable aig-p))))) ;; (define aig-listp (x (var-bound natp)) ;; (if (atom x) ;; (eq x nil) ;; (and (aig-p (car x) var-bound) ;; (aig-listp (cdr x) var-bound))))
75606
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "FGL") (include-book "std/util/deflist" :dir :system) (include-book "centaur/fty/deftypes" :dir :system) (include-book "centaur/fty/basetypes" :dir :system) (include-book "centaur/aig/aig-vars" :dir :system) ;; (include-book "centaur/misc/fast-alist-pop" :dir :system) (include-book "std/stobjs/absstobjs" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (std::add-default-post-define-hook :fix)) (define bounded-natp (x (bound natp)) (and (natp x) (< x (nfix bound))) /// (defthm bounded-natp-implies-bound (implies (bounded-natp x bound) (< x (nfix bound))) :rule-classes :forward-chaining) (defthm bounded-natp-implies-natp (implies (bounded-natp x bound) (natp x)) :rule-classes :forward-chaining) (defthm bounded-natp-of-nil (not (bounded-natp nil bound))) (defthm bounded-natp-when-bounded-by-less (implies (and (bounded-natp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-natp x bound)))) (define bounded-nat-listp (x (bound natp)) (if (atom x) t (and (bounded-natp (car x) bound) (bounded-nat-listp (cdr x) bound))) /// (defthm bounded-nat-listp-when-bounded-by-lesser (implies (and (bounded-nat-listp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-nat-listp x bound))) (defthmd not-bounded-nat-listp-by-member (implies (and (member k x) (not (bounded-natp k bound))) (not (bounded-nat-listp x bound)))) (defthmd bounded-nat-listp-implies-not-member (implies (and (bounded-nat-listp x bound) (not (bounded-natp k bound))) (not (member k x)))) (defthm bounded-nat-listp-of-append (iff (bounded-nat-listp (append a b) bound) (and (bounded-nat-listp a bound) (bounded-nat-listp b bound)))) (defthm bounded-nat-listp-of-nil (bounded-nat-listp nil bound)) (defthm bounded-nat-listp-of-cons (iff (bounded-nat-listp (cons a b) bound) (and (bounded-natp a bound) (bounded-nat-listp b bound))))) (local (define bounded-nat-listp-badguy (x bound) :verify-guards nil (if (atom x) nil (if (bounded-natp (car x) bound) (bounded-nat-listp-badguy (cdr x) bound) (car x))) /// (defthm bounded-nat-listp-badguy-is-bad (not (bounded-natp (bounded-nat-listp-badguy x bound) bound))) (defthmd bounded-nat-listp-when-nat-listp-badguy-not-member (implies (acl2::rewriting-positive-literal `(bounded-nat-listp ,x ,bound)) (iff (bounded-nat-listp x bound) (not (member (bounded-nat-listp-badguy x bound) x)))) :hints(("Goal" :in-theory (enable bounded-nat-listp)))) (defcong set-equiv equal (bounded-nat-listp x bound) 1 :hints(("Goal" :in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member) :cases ((bounded-nat-listp x bound)) :use ((:instance not-bounded-nat-listp-by-member (x x-equiv) (k (bounded-nat-listp-badguy x bound))) (:instance not-bounded-nat-listp-by-member (x x) (k (bounded-nat-listp-badguy x-equiv bound))))))))) (define aig-p (x (var-bound natp)) (cond ((atom x) (or (booleanp x) ;; const (bounded-natp x var-bound))) ;; var ((eq (cdr x) 'nil) (aig-p (car x) var-bound)) ;; this is weird because (nil . nil) is a valid aig but it makes it so ;; nat-listp-aig-vars-when-aig-p holds ((eq (car x) 'nil) nil) (t (and (aig-p (car x) var-bound) (aig-p (cdr x) var-bound)))) /// (local (defthm aig-p-is-bounded-nat-listp-aig-vars (iff (aig-p x var-bound) (bounded-nat-listp (acl2::aig-vars x) var-bound)))) (defthm bounded-nat-listp-aig-vars-when-aig-p (iff (bounded-nat-listp (acl2::aig-vars x) var-bound) (aig-p x var-bound)) :hints(("Goal" :in-theory (enable acl2::aig-atom-p)))) (local (in-theory (disable bounded-nat-listp-aig-vars-when-aig-p))) (defthm aig-p-when-lesser-bound (implies (and (aig-p x bound1) (<= (nfix bound1) (nfix bound))) (aig-p x bound))) (local (defthm member-aig-vars-aig-and (implies (and (not (member v (acl2::aig-vars x))) (not (member v (acl2::aig-vars y)))) (not (member v (acl2::aig-vars (acl2::aig-and x y))))) :hints (("goal" :use ((:instance acl2::member-aig-vars-aig-and (v v) (x x))) :in-theory (e/d (set::in-to-member) (acl2::member-aig-vars-aig-and)))))) (defthm aig-p-of-aig-not (implies (aig-p x bound) (aig-p (acl2::aig-not x) bound))) (local (in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member bounded-nat-listp-implies-not-member))) (defthm aig-p-of-aig-and (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-and x y) bound))) (local (in-theory (disable aig-p-is-bounded-nat-listp-aig-vars))) (defthm aig-p-of-aig-or (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-or x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-or)))) (defthm aig-p-of-aig-xor (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-xor x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-xor)))) (defthm aig-p-of-aig-iff (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-iff x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-iff)))) (defthm aig-p-of-aig-ite (implies (and (aig-p x bound) (aig-p y bound) (aig-p z bound)) (aig-p (acl2::aig-ite x y z) bound)) :hints(("Goal" :in-theory (enable acl2::aig-ite)))) (defthm aig-p-of-car (implies (aig-p x bound) (aig-p (car x) bound))) (defthm aig-p-of-cdr (implies (aig-p x bound) (aig-p (cdr x) bound))) (defthm aig-atom-p-when-aig-p (implies (aig-p x bound) (equal (acl2::aig-atom-p x) (atom x)))) (defthm aig-p-of-var (implies (natp x) (equal (aig-p x var-bound) (< x (nfix var-bound)))) :hints(("Goal" :in-theory (enable bounded-natp))))) (define aig-fix ((x (aig-p x var-bound)) (var-bound natp)) :returns (new-x (aig-p new-x var-bound) :hints(("Goal" :in-theory (enable aig-p)))) :verify-guards nil (mbe :logic (cond ((atom x) (and (or (booleanp x) (bounded-natp x var-bound)) x)) ((eq (cdr x) nil) (cons (aig-fix (car x) var-bound) nil)) ((eq (car x) nil) nil) (t (b* ((car (aig-fix (car x) var-bound)) (cdr (aig-fix (cdr x) var-bound))) (and car cdr (cons car cdr))))) :exec x) /// (defthm aig-fix-when-aig-p (implies (aig-p x bound) (equal (aig-fix x bound) x)) :hints(("Goal" :in-theory (enable aig-p)))) (verify-guards aig-fix :hints(("Goal" :in-theory (enable aig-p))))) ;; (define aig-listp (x (var-bound natp)) ;; (if (atom x) ;; (eq x nil) ;; (and (aig-p (car x) var-bound) ;; (aig-listp (cdr x) var-bound))))
true
; FGL - A Symbolic Simulation Framework for ACL2 ; Copyright (C) 2018 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "FGL") (include-book "std/util/deflist" :dir :system) (include-book "centaur/fty/deftypes" :dir :system) (include-book "centaur/fty/basetypes" :dir :system) (include-book "centaur/aig/aig-vars" :dir :system) ;; (include-book "centaur/misc/fast-alist-pop" :dir :system) (include-book "std/stobjs/absstobjs" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (std::add-default-post-define-hook :fix)) (define bounded-natp (x (bound natp)) (and (natp x) (< x (nfix bound))) /// (defthm bounded-natp-implies-bound (implies (bounded-natp x bound) (< x (nfix bound))) :rule-classes :forward-chaining) (defthm bounded-natp-implies-natp (implies (bounded-natp x bound) (natp x)) :rule-classes :forward-chaining) (defthm bounded-natp-of-nil (not (bounded-natp nil bound))) (defthm bounded-natp-when-bounded-by-less (implies (and (bounded-natp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-natp x bound)))) (define bounded-nat-listp (x (bound natp)) (if (atom x) t (and (bounded-natp (car x) bound) (bounded-nat-listp (cdr x) bound))) /// (defthm bounded-nat-listp-when-bounded-by-lesser (implies (and (bounded-nat-listp x bound1) (<= (nfix bound1) (nfix bound))) (bounded-nat-listp x bound))) (defthmd not-bounded-nat-listp-by-member (implies (and (member k x) (not (bounded-natp k bound))) (not (bounded-nat-listp x bound)))) (defthmd bounded-nat-listp-implies-not-member (implies (and (bounded-nat-listp x bound) (not (bounded-natp k bound))) (not (member k x)))) (defthm bounded-nat-listp-of-append (iff (bounded-nat-listp (append a b) bound) (and (bounded-nat-listp a bound) (bounded-nat-listp b bound)))) (defthm bounded-nat-listp-of-nil (bounded-nat-listp nil bound)) (defthm bounded-nat-listp-of-cons (iff (bounded-nat-listp (cons a b) bound) (and (bounded-natp a bound) (bounded-nat-listp b bound))))) (local (define bounded-nat-listp-badguy (x bound) :verify-guards nil (if (atom x) nil (if (bounded-natp (car x) bound) (bounded-nat-listp-badguy (cdr x) bound) (car x))) /// (defthm bounded-nat-listp-badguy-is-bad (not (bounded-natp (bounded-nat-listp-badguy x bound) bound))) (defthmd bounded-nat-listp-when-nat-listp-badguy-not-member (implies (acl2::rewriting-positive-literal `(bounded-nat-listp ,x ,bound)) (iff (bounded-nat-listp x bound) (not (member (bounded-nat-listp-badguy x bound) x)))) :hints(("Goal" :in-theory (enable bounded-nat-listp)))) (defcong set-equiv equal (bounded-nat-listp x bound) 1 :hints(("Goal" :in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member) :cases ((bounded-nat-listp x bound)) :use ((:instance not-bounded-nat-listp-by-member (x x-equiv) (k (bounded-nat-listp-badguy x bound))) (:instance not-bounded-nat-listp-by-member (x x) (k (bounded-nat-listp-badguy x-equiv bound))))))))) (define aig-p (x (var-bound natp)) (cond ((atom x) (or (booleanp x) ;; const (bounded-natp x var-bound))) ;; var ((eq (cdr x) 'nil) (aig-p (car x) var-bound)) ;; this is weird because (nil . nil) is a valid aig but it makes it so ;; nat-listp-aig-vars-when-aig-p holds ((eq (car x) 'nil) nil) (t (and (aig-p (car x) var-bound) (aig-p (cdr x) var-bound)))) /// (local (defthm aig-p-is-bounded-nat-listp-aig-vars (iff (aig-p x var-bound) (bounded-nat-listp (acl2::aig-vars x) var-bound)))) (defthm bounded-nat-listp-aig-vars-when-aig-p (iff (bounded-nat-listp (acl2::aig-vars x) var-bound) (aig-p x var-bound)) :hints(("Goal" :in-theory (enable acl2::aig-atom-p)))) (local (in-theory (disable bounded-nat-listp-aig-vars-when-aig-p))) (defthm aig-p-when-lesser-bound (implies (and (aig-p x bound1) (<= (nfix bound1) (nfix bound))) (aig-p x bound))) (local (defthm member-aig-vars-aig-and (implies (and (not (member v (acl2::aig-vars x))) (not (member v (acl2::aig-vars y)))) (not (member v (acl2::aig-vars (acl2::aig-and x y))))) :hints (("goal" :use ((:instance acl2::member-aig-vars-aig-and (v v) (x x))) :in-theory (e/d (set::in-to-member) (acl2::member-aig-vars-aig-and)))))) (defthm aig-p-of-aig-not (implies (aig-p x bound) (aig-p (acl2::aig-not x) bound))) (local (in-theory (enable bounded-nat-listp-when-nat-listp-badguy-not-member bounded-nat-listp-implies-not-member))) (defthm aig-p-of-aig-and (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-and x y) bound))) (local (in-theory (disable aig-p-is-bounded-nat-listp-aig-vars))) (defthm aig-p-of-aig-or (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-or x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-or)))) (defthm aig-p-of-aig-xor (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-xor x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-xor)))) (defthm aig-p-of-aig-iff (implies (and (aig-p x bound) (aig-p y bound)) (aig-p (acl2::aig-iff x y) bound)) :hints(("Goal" :in-theory (enable acl2::aig-iff)))) (defthm aig-p-of-aig-ite (implies (and (aig-p x bound) (aig-p y bound) (aig-p z bound)) (aig-p (acl2::aig-ite x y z) bound)) :hints(("Goal" :in-theory (enable acl2::aig-ite)))) (defthm aig-p-of-car (implies (aig-p x bound) (aig-p (car x) bound))) (defthm aig-p-of-cdr (implies (aig-p x bound) (aig-p (cdr x) bound))) (defthm aig-atom-p-when-aig-p (implies (aig-p x bound) (equal (acl2::aig-atom-p x) (atom x)))) (defthm aig-p-of-var (implies (natp x) (equal (aig-p x var-bound) (< x (nfix var-bound)))) :hints(("Goal" :in-theory (enable bounded-natp))))) (define aig-fix ((x (aig-p x var-bound)) (var-bound natp)) :returns (new-x (aig-p new-x var-bound) :hints(("Goal" :in-theory (enable aig-p)))) :verify-guards nil (mbe :logic (cond ((atom x) (and (or (booleanp x) (bounded-natp x var-bound)) x)) ((eq (cdr x) nil) (cons (aig-fix (car x) var-bound) nil)) ((eq (car x) nil) nil) (t (b* ((car (aig-fix (car x) var-bound)) (cdr (aig-fix (cdr x) var-bound))) (and car cdr (cons car cdr))))) :exec x) /// (defthm aig-fix-when-aig-p (implies (aig-p x bound) (equal (aig-fix x bound) x)) :hints(("Goal" :in-theory (enable aig-p)))) (verify-guards aig-fix :hints(("Goal" :in-theory (enable aig-p))))) ;; (define aig-listp (x (var-bound natp)) ;; (if (atom x) ;; (eq x nil) ;; (and (aig-p (car x) var-bound) ;; (aig-listp (cdr x) var-bound))))
[ { "context": " (:use :cl :parenscript)\n (:import-from :alexandria\n :with-gensyms\n ", "end": 224, "score": 0.8539919853210449, "start": 214, "tag": "NAME", "value": "alexandria" } ]
src/application.lisp
breakds/realispic2
1
(in-package :cl-user) (eval-when (:compile-toplevel :load-toplevel :execute) (unless (find-package :realispic.application) (defpackage realispic.application (:use :cl :parenscript) (:import-from :alexandria :with-gensyms :symbolicate) (:import-from :realispic.widget :compile-psx :*realispic-widget-table*) (:import-from :realispic.css :compile-css) (:import-from :realispic.rpc :rpc-middleware) (:export :def-app :*template-path*)))) (in-package :realispic.application) (eval-when (:compile-toplevel :load-toplevel :execute) (defun widget-dependency-closure (initial-set) (labels ((bfs (candidates closure) (if (null candidates) closure (let ((new-candidates (cdr candidates)) (new-closure closure)) (loop for dep in (cdr (gethash (car candidates) *realispic-widget-table*)) unless (member dep closure :test #'string-equal) do (push dep new-closure) (push dep new-candidates)) (bfs new-candidates new-closure))))) (bfs initial-set initial-set))) (defun is-external (url) (let ((prefix "http")) (and (> (length url) (length prefix)) (string-equal (subseq url 0 (length prefix)) prefix)))) (defun match-file-type (url &rest types) (some (lambda (x) (string-equal (pathname-type url) x)) types))) (defvar *template-path* (merge-pathnames "template/realispic-template.html" (asdf:system-source-directory 'realispic)) "The path to the html template file used in realispic, shadow this to use customized templates.") (defun preprocess-includes (includes static-path static-root) "Find all the files from the local source, and copy it to static-root. Quantify those files with static-path." (mapcar (lambda (file) (handler-case (etypecase file (string file) (cons (ecase (car file) (:local (let ((source (merge-pathnames (third file) (asdf:system-source-directory (second file)))) (target (merge-pathnames (third file) static-root))) (ensure-directories-exist target) (cl-fad:copy-file source target :overwrite t) ;; Return the reconstructed static ;; path. (merge-pathnames (third file) static-path)))))) (t (e) (error "Bad include: ~a due to ~a" file e)))) includes)) (defun compile-app (&key (title "Undefined Name") (path "/asset/") (root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil)) "Compile the javascript, css and html of the app. Return a string containing the generated html." (let ((js-file-path (merge-pathnames js-file-name root)) (includes (preprocess-includes includes path root))) (ensure-directories-exist js-file-path) (multiple-value-bind (body referenced-widgets body-css) (compile-psx widget :psx-only t) (let ((all-dependencies (widget-dependency-closure referenced-widgets))) ;; Check for the existence of dependencies. (loop for widget-name in all-dependencies unless (gethash widget-name *realispic-widget-table*) do (error "Compile app failed: undefined widget :~a." widget-name)) ;; Write the javascript file (with-ps-gensyms (app-var) (with-open-file (output js-file-path :direction :output :if-exists :supersede :if-does-not-exist :create) (write-string (ps* `(progn ,@(loop for widget-name in all-dependencies collect (funcall (car (gethash widget-name *realispic-widget-table*)) :javascript)) (let ((,app-var ,body)) ((@ *react render) ,app-var ((@ document get-element-by-id) "content"))))) output))) ;; Generate the html text (let ((html-template:*string-modifier* #'identity)) (with-output-to-string (html-template:*default-template-output*) (html-template:fill-and-print-template *template-path* (list :title title :icon icon ;; Note(breakds): currently we treat everything ;; included that is not javascript as css. :css-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (or (match-file-type path "css") (not (match-file-type path "js")))) includes))) :external-js `((:url "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js") (:url "https://fb.me/react-with-addons-0.13.3.js") (:url "https://fb.me/JSXTransformer-0.13.3.js") ,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (is-external path))) includes))) :js-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (not (is-external path)))) includes))) :js (format nil "~a" (merge-pathnames js-file-name path)) :inline-css (compile-css (append body-css (loop for widget-name in all-dependencies append (funcall (car (gethash widget-name *realispic-widget-table*)) :css)))))))))))) (defmacro def-app (app-name args &key (server :hunchentoot) (title "Undefined Name") (port 5000) (static-path "/assets/") (static-root "/tmp/") (generated-path "/main/") (generated-root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil) (system nil)) ;; TODO(breakds): ensure that static-path and static-root are ;; directory like (tailing slash). (with-gensyms (env html-text) (let ((app-function-name (symbolicate '* app-name '-app*)) (app-handler-name (symbolicate '* app-name '-handler '*))) `(eval-when (:compile-toplevel :load-toplevel :execute) ;; 2. Assemble the application (defparameter ,app-function-name (lack:builder :session (:static :path ,static-path :root ,static-root) (:static :path ,generated-path :root ,generated-root) #'rpc-middleware (let ((,html-text (compile-app :title ,title :path ,generated-path :root ,generated-root :js-file-name ,js-file-name :icon ,icon :includes ',includes :widget ',widget))) (lambda (,env) (declare (ignore ,env)) `(200 (:content-type "text/html") (,,html-text))))) "The global variable that holds the application function.") ;; 3. Create the app controller (defvar ,app-handler-name nil "The global variable that holds the application handler.") (defun ,app-name (&optional (command :start)) (labels ((try-stop () (when ,app-handler-name (clack:stop ,app-handler-name)))) (ecase command (:start (try-stop) ,@(if system `((ql:quickload ,system)) nil) (setf ,app-handler-name (clack:clackup ,app-function-name :port ,port :server ,server))) (:stop (try-stop)))))))))
62906
(in-package :cl-user) (eval-when (:compile-toplevel :load-toplevel :execute) (unless (find-package :realispic.application) (defpackage realispic.application (:use :cl :parenscript) (:import-from :<NAME> :with-gensyms :symbolicate) (:import-from :realispic.widget :compile-psx :*realispic-widget-table*) (:import-from :realispic.css :compile-css) (:import-from :realispic.rpc :rpc-middleware) (:export :def-app :*template-path*)))) (in-package :realispic.application) (eval-when (:compile-toplevel :load-toplevel :execute) (defun widget-dependency-closure (initial-set) (labels ((bfs (candidates closure) (if (null candidates) closure (let ((new-candidates (cdr candidates)) (new-closure closure)) (loop for dep in (cdr (gethash (car candidates) *realispic-widget-table*)) unless (member dep closure :test #'string-equal) do (push dep new-closure) (push dep new-candidates)) (bfs new-candidates new-closure))))) (bfs initial-set initial-set))) (defun is-external (url) (let ((prefix "http")) (and (> (length url) (length prefix)) (string-equal (subseq url 0 (length prefix)) prefix)))) (defun match-file-type (url &rest types) (some (lambda (x) (string-equal (pathname-type url) x)) types))) (defvar *template-path* (merge-pathnames "template/realispic-template.html" (asdf:system-source-directory 'realispic)) "The path to the html template file used in realispic, shadow this to use customized templates.") (defun preprocess-includes (includes static-path static-root) "Find all the files from the local source, and copy it to static-root. Quantify those files with static-path." (mapcar (lambda (file) (handler-case (etypecase file (string file) (cons (ecase (car file) (:local (let ((source (merge-pathnames (third file) (asdf:system-source-directory (second file)))) (target (merge-pathnames (third file) static-root))) (ensure-directories-exist target) (cl-fad:copy-file source target :overwrite t) ;; Return the reconstructed static ;; path. (merge-pathnames (third file) static-path)))))) (t (e) (error "Bad include: ~a due to ~a" file e)))) includes)) (defun compile-app (&key (title "Undefined Name") (path "/asset/") (root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil)) "Compile the javascript, css and html of the app. Return a string containing the generated html." (let ((js-file-path (merge-pathnames js-file-name root)) (includes (preprocess-includes includes path root))) (ensure-directories-exist js-file-path) (multiple-value-bind (body referenced-widgets body-css) (compile-psx widget :psx-only t) (let ((all-dependencies (widget-dependency-closure referenced-widgets))) ;; Check for the existence of dependencies. (loop for widget-name in all-dependencies unless (gethash widget-name *realispic-widget-table*) do (error "Compile app failed: undefined widget :~a." widget-name)) ;; Write the javascript file (with-ps-gensyms (app-var) (with-open-file (output js-file-path :direction :output :if-exists :supersede :if-does-not-exist :create) (write-string (ps* `(progn ,@(loop for widget-name in all-dependencies collect (funcall (car (gethash widget-name *realispic-widget-table*)) :javascript)) (let ((,app-var ,body)) ((@ *react render) ,app-var ((@ document get-element-by-id) "content"))))) output))) ;; Generate the html text (let ((html-template:*string-modifier* #'identity)) (with-output-to-string (html-template:*default-template-output*) (html-template:fill-and-print-template *template-path* (list :title title :icon icon ;; Note(breakds): currently we treat everything ;; included that is not javascript as css. :css-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (or (match-file-type path "css") (not (match-file-type path "js")))) includes))) :external-js `((:url "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js") (:url "https://fb.me/react-with-addons-0.13.3.js") (:url "https://fb.me/JSXTransformer-0.13.3.js") ,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (is-external path))) includes))) :js-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (not (is-external path)))) includes))) :js (format nil "~a" (merge-pathnames js-file-name path)) :inline-css (compile-css (append body-css (loop for widget-name in all-dependencies append (funcall (car (gethash widget-name *realispic-widget-table*)) :css)))))))))))) (defmacro def-app (app-name args &key (server :hunchentoot) (title "Undefined Name") (port 5000) (static-path "/assets/") (static-root "/tmp/") (generated-path "/main/") (generated-root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil) (system nil)) ;; TODO(breakds): ensure that static-path and static-root are ;; directory like (tailing slash). (with-gensyms (env html-text) (let ((app-function-name (symbolicate '* app-name '-app*)) (app-handler-name (symbolicate '* app-name '-handler '*))) `(eval-when (:compile-toplevel :load-toplevel :execute) ;; 2. Assemble the application (defparameter ,app-function-name (lack:builder :session (:static :path ,static-path :root ,static-root) (:static :path ,generated-path :root ,generated-root) #'rpc-middleware (let ((,html-text (compile-app :title ,title :path ,generated-path :root ,generated-root :js-file-name ,js-file-name :icon ,icon :includes ',includes :widget ',widget))) (lambda (,env) (declare (ignore ,env)) `(200 (:content-type "text/html") (,,html-text))))) "The global variable that holds the application function.") ;; 3. Create the app controller (defvar ,app-handler-name nil "The global variable that holds the application handler.") (defun ,app-name (&optional (command :start)) (labels ((try-stop () (when ,app-handler-name (clack:stop ,app-handler-name)))) (ecase command (:start (try-stop) ,@(if system `((ql:quickload ,system)) nil) (setf ,app-handler-name (clack:clackup ,app-function-name :port ,port :server ,server))) (:stop (try-stop)))))))))
true
(in-package :cl-user) (eval-when (:compile-toplevel :load-toplevel :execute) (unless (find-package :realispic.application) (defpackage realispic.application (:use :cl :parenscript) (:import-from :PI:NAME:<NAME>END_PI :with-gensyms :symbolicate) (:import-from :realispic.widget :compile-psx :*realispic-widget-table*) (:import-from :realispic.css :compile-css) (:import-from :realispic.rpc :rpc-middleware) (:export :def-app :*template-path*)))) (in-package :realispic.application) (eval-when (:compile-toplevel :load-toplevel :execute) (defun widget-dependency-closure (initial-set) (labels ((bfs (candidates closure) (if (null candidates) closure (let ((new-candidates (cdr candidates)) (new-closure closure)) (loop for dep in (cdr (gethash (car candidates) *realispic-widget-table*)) unless (member dep closure :test #'string-equal) do (push dep new-closure) (push dep new-candidates)) (bfs new-candidates new-closure))))) (bfs initial-set initial-set))) (defun is-external (url) (let ((prefix "http")) (and (> (length url) (length prefix)) (string-equal (subseq url 0 (length prefix)) prefix)))) (defun match-file-type (url &rest types) (some (lambda (x) (string-equal (pathname-type url) x)) types))) (defvar *template-path* (merge-pathnames "template/realispic-template.html" (asdf:system-source-directory 'realispic)) "The path to the html template file used in realispic, shadow this to use customized templates.") (defun preprocess-includes (includes static-path static-root) "Find all the files from the local source, and copy it to static-root. Quantify those files with static-path." (mapcar (lambda (file) (handler-case (etypecase file (string file) (cons (ecase (car file) (:local (let ((source (merge-pathnames (third file) (asdf:system-source-directory (second file)))) (target (merge-pathnames (third file) static-root))) (ensure-directories-exist target) (cl-fad:copy-file source target :overwrite t) ;; Return the reconstructed static ;; path. (merge-pathnames (third file) static-path)))))) (t (e) (error "Bad include: ~a due to ~a" file e)))) includes)) (defun compile-app (&key (title "Undefined Name") (path "/asset/") (root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil)) "Compile the javascript, css and html of the app. Return a string containing the generated html." (let ((js-file-path (merge-pathnames js-file-name root)) (includes (preprocess-includes includes path root))) (ensure-directories-exist js-file-path) (multiple-value-bind (body referenced-widgets body-css) (compile-psx widget :psx-only t) (let ((all-dependencies (widget-dependency-closure referenced-widgets))) ;; Check for the existence of dependencies. (loop for widget-name in all-dependencies unless (gethash widget-name *realispic-widget-table*) do (error "Compile app failed: undefined widget :~a." widget-name)) ;; Write the javascript file (with-ps-gensyms (app-var) (with-open-file (output js-file-path :direction :output :if-exists :supersede :if-does-not-exist :create) (write-string (ps* `(progn ,@(loop for widget-name in all-dependencies collect (funcall (car (gethash widget-name *realispic-widget-table*)) :javascript)) (let ((,app-var ,body)) ((@ *react render) ,app-var ((@ document get-element-by-id) "content"))))) output))) ;; Generate the html text (let ((html-template:*string-modifier* #'identity)) (with-output-to-string (html-template:*default-template-output*) (html-template:fill-and-print-template *template-path* (list :title title :icon icon ;; Note(breakds): currently we treat everything ;; included that is not javascript as css. :css-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (or (match-file-type path "css") (not (match-file-type path "js")))) includes))) :external-js `((:url "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js") (:url "https://fb.me/react-with-addons-0.13.3.js") (:url "https://fb.me/JSXTransformer-0.13.3.js") ,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (is-external path))) includes))) :js-include `(,@(mapcar (lambda (x) `(:url ,x)) (remove-if-not (lambda (path) (and (match-file-type path "js") (not (is-external path)))) includes))) :js (format nil "~a" (merge-pathnames js-file-name path)) :inline-css (compile-css (append body-css (loop for widget-name in all-dependencies append (funcall (car (gethash widget-name *realispic-widget-table*)) :css)))))))))))) (defmacro def-app (app-name args &key (server :hunchentoot) (title "Undefined Name") (port 5000) (static-path "/assets/") (static-root "/tmp/") (generated-path "/main/") (generated-root "/tmp/") (js-file-name "realispic-app.js") (icon "") (includes nil) (widget nil) (system nil)) ;; TODO(breakds): ensure that static-path and static-root are ;; directory like (tailing slash). (with-gensyms (env html-text) (let ((app-function-name (symbolicate '* app-name '-app*)) (app-handler-name (symbolicate '* app-name '-handler '*))) `(eval-when (:compile-toplevel :load-toplevel :execute) ;; 2. Assemble the application (defparameter ,app-function-name (lack:builder :session (:static :path ,static-path :root ,static-root) (:static :path ,generated-path :root ,generated-root) #'rpc-middleware (let ((,html-text (compile-app :title ,title :path ,generated-path :root ,generated-root :js-file-name ,js-file-name :icon ,icon :includes ',includes :widget ',widget))) (lambda (,env) (declare (ignore ,env)) `(200 (:content-type "text/html") (,,html-text))))) "The global variable that holds the application function.") ;; 3. Create the app controller (defvar ,app-handler-name nil "The global variable that holds the application handler.") (defun ,app-name (&optional (command :start)) (labels ((try-stop () (when ,app-handler-name (clack:stop ,app-handler-name)))) (ecase command (:start (try-stop) ,@(if system `((ql:quickload ,system)) nil) (setf ,app-handler-name (clack:clackup ,app-function-name :port ,port :server ,server))) (:stop (try-stop)))))))))
[ { "context": ")\n\n ; v0.0 - 2017.08.02 - First issue\n ; Author: David Torralba\n ; Last revision: 2017.08.02\n)\n(defun c:ManholeS", "end": 188, "score": 0.9998640418052673, "start": 174, "tag": "NAME", "value": "David Torralba" }, { "context": ")\n\n ; v0.0 - 2017.08.02 - First issue\n ; Author: David Torralba\n ; Last revision: 2017.08.02\n)\n(defun DT:Manhole", "end": 1124, "score": 0.9998656511306763, "start": 1110, "tag": "NAME", "value": "David Torralba" }, { "context": ")\n\n ; v0.0 - 2017.08.02 - First issue\n ; Author: David Torralba\n ; Last revision: 2017.08.02\n)\n", "end": 3103, "score": 0.99979168176651, "start": 3089, "tag": "NAME", "value": "David Torralba" } ]
Dump folder/ManholeScheduleChecker.lsp
dtgoitia/autolisp
30
(defun c:xx () ; Trigger (DT:AutoLoadFileFromCivilTemp "ManholeScheduleChecker.lsp") (c:ManholeScheduleCheckerCommand) ; v0.0 - 2017.08.02 - First issue ; Author: David Torralba ; Last revision: 2017.08.02 ) (defun c:ManholeScheduleCheckerCommand ( / ss result wrongEntityList ) ; Command (if (setq ss (ssget '(( 0 . "INSERT")))) (foreach a (ssnamex ss) (if (= 'ename (type (cadr a))) (progn (setq result (DT:ManholeScheduleChecker (cadr a))) (if (= 'list (type result)) (setq wrongEntityList (append wrongEntityList (list result))) );END if );END progn );END if );END foreach );END if (if wrongEntityList (foreach wrongBlock wrongEntityList (setq msg (strcat "\n" (nth 1 wrongBlock) ": zero value(s) found at ")) (setq tail (cddr wrongBlock)) (foreach wrong tail (setq msg (strcat msg wrong " ")) );END foreach (setq msg (strcat msg "\n")) (princ msg) (setq msg nil) );END foreach );END if (princ) ; v0.0 - 2017.08.02 - First issue ; Author: David Torralba ; Last revision: 2017.08.02 ) (defun DT:ManholeScheduleChecker ( ename / return object attributeList visibilityState attributeTagsToCheck ) ; Return T if the manhole schedule block passed (ename) doesn't show ; any zero pipe size (DN000) or any zero IL (0.000). ; If any wrong, return a list containing the entity name and all the incorrect attribute tags (if (DT:Arg 'DT:ManholeScheduleChecker '((ename 'ename))) (progn (setq object (vlax-ename->vla-object ename)) (setq return (list ename (LM:vl-getattributevalue object "ID"))) (setq attributeList (LM:vl-getattributes object)) (setq visibilityState (LM:GetVisibilityState object)) (cond ((= "0" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0"))) ((= "1" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1"))) ((= "2" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2"))) ((= "3" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3"))) ((= "4" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3" "P4" "IL4"))) );END cond (if attributeTagsToCheck (foreach attributeTag attributeTagsToCheck ; Check pipe sizes (if (= "P" (substr attributeTag 1 1) ) (if (= "DN000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if ; Check IL (if (= "IL" (substr attributeTag 1 2) ) (if (= "0.000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if );END foreach );END subcond );END progn );END if (if (< 2 (length return)) return) ; v0.0 - 2017.08.02 - First issue ; Author: David Torralba ; Last revision: 2017.08.02 )
96837
(defun c:xx () ; Trigger (DT:AutoLoadFileFromCivilTemp "ManholeScheduleChecker.lsp") (c:ManholeScheduleCheckerCommand) ; v0.0 - 2017.08.02 - First issue ; Author: <NAME> ; Last revision: 2017.08.02 ) (defun c:ManholeScheduleCheckerCommand ( / ss result wrongEntityList ) ; Command (if (setq ss (ssget '(( 0 . "INSERT")))) (foreach a (ssnamex ss) (if (= 'ename (type (cadr a))) (progn (setq result (DT:ManholeScheduleChecker (cadr a))) (if (= 'list (type result)) (setq wrongEntityList (append wrongEntityList (list result))) );END if );END progn );END if );END foreach );END if (if wrongEntityList (foreach wrongBlock wrongEntityList (setq msg (strcat "\n" (nth 1 wrongBlock) ": zero value(s) found at ")) (setq tail (cddr wrongBlock)) (foreach wrong tail (setq msg (strcat msg wrong " ")) );END foreach (setq msg (strcat msg "\n")) (princ msg) (setq msg nil) );END foreach );END if (princ) ; v0.0 - 2017.08.02 - First issue ; Author: <NAME> ; Last revision: 2017.08.02 ) (defun DT:ManholeScheduleChecker ( ename / return object attributeList visibilityState attributeTagsToCheck ) ; Return T if the manhole schedule block passed (ename) doesn't show ; any zero pipe size (DN000) or any zero IL (0.000). ; If any wrong, return a list containing the entity name and all the incorrect attribute tags (if (DT:Arg 'DT:ManholeScheduleChecker '((ename 'ename))) (progn (setq object (vlax-ename->vla-object ename)) (setq return (list ename (LM:vl-getattributevalue object "ID"))) (setq attributeList (LM:vl-getattributes object)) (setq visibilityState (LM:GetVisibilityState object)) (cond ((= "0" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0"))) ((= "1" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1"))) ((= "2" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2"))) ((= "3" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3"))) ((= "4" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3" "P4" "IL4"))) );END cond (if attributeTagsToCheck (foreach attributeTag attributeTagsToCheck ; Check pipe sizes (if (= "P" (substr attributeTag 1 1) ) (if (= "DN000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if ; Check IL (if (= "IL" (substr attributeTag 1 2) ) (if (= "0.000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if );END foreach );END subcond );END progn );END if (if (< 2 (length return)) return) ; v0.0 - 2017.08.02 - First issue ; Author: <NAME> ; Last revision: 2017.08.02 )
true
(defun c:xx () ; Trigger (DT:AutoLoadFileFromCivilTemp "ManholeScheduleChecker.lsp") (c:ManholeScheduleCheckerCommand) ; v0.0 - 2017.08.02 - First issue ; Author: PI:NAME:<NAME>END_PI ; Last revision: 2017.08.02 ) (defun c:ManholeScheduleCheckerCommand ( / ss result wrongEntityList ) ; Command (if (setq ss (ssget '(( 0 . "INSERT")))) (foreach a (ssnamex ss) (if (= 'ename (type (cadr a))) (progn (setq result (DT:ManholeScheduleChecker (cadr a))) (if (= 'list (type result)) (setq wrongEntityList (append wrongEntityList (list result))) );END if );END progn );END if );END foreach );END if (if wrongEntityList (foreach wrongBlock wrongEntityList (setq msg (strcat "\n" (nth 1 wrongBlock) ": zero value(s) found at ")) (setq tail (cddr wrongBlock)) (foreach wrong tail (setq msg (strcat msg wrong " ")) );END foreach (setq msg (strcat msg "\n")) (princ msg) (setq msg nil) );END foreach );END if (princ) ; v0.0 - 2017.08.02 - First issue ; Author: PI:NAME:<NAME>END_PI ; Last revision: 2017.08.02 ) (defun DT:ManholeScheduleChecker ( ename / return object attributeList visibilityState attributeTagsToCheck ) ; Return T if the manhole schedule block passed (ename) doesn't show ; any zero pipe size (DN000) or any zero IL (0.000). ; If any wrong, return a list containing the entity name and all the incorrect attribute tags (if (DT:Arg 'DT:ManholeScheduleChecker '((ename 'ename))) (progn (setq object (vlax-ename->vla-object ename)) (setq return (list ename (LM:vl-getattributevalue object "ID"))) (setq attributeList (LM:vl-getattributes object)) (setq visibilityState (LM:GetVisibilityState object)) (cond ((= "0" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0"))) ((= "1" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1"))) ((= "2" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2"))) ((= "3" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3"))) ((= "4" visibilityState) (setq attributeTagsToCheck (list "P0" "IL0" "P1" "IL1" "P2" "IL2" "P3" "IL3" "P4" "IL4"))) );END cond (if attributeTagsToCheck (foreach attributeTag attributeTagsToCheck ; Check pipe sizes (if (= "P" (substr attributeTag 1 1) ) (if (= "DN000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if ; Check IL (if (= "IL" (substr attributeTag 1 2) ) (if (= "0.000" (setq kk (cdr (assoc attributeTag attributeList)))) (setq return (append return (list attributeTag))) );END if );END if );END foreach );END subcond );END progn );END if (if (< 2 (length return)) return) ; v0.0 - 2017.08.02 - First issue ; Author: PI:NAME:<NAME>END_PI ; Last revision: 2017.08.02 )
[ { "context": "system of cl-bodge\"\n :version \"1.0.0\"\n :author \"Pavel Korolev\"\n :license \"MIT\"\n :mailto \"[email protected]\"\n ", "end": 133, "score": 0.9998898506164551, "start": 120, "tag": "NAME", "value": "Pavel Korolev" }, { "context": "uthor \"Pavel Korolev\"\n :license \"MIT\"\n :mailto \"[email protected]\"\n :depends-on (cl-bodge/physics cl-bodge/physics", "end": 179, "score": 0.9999251961708069, "start": 163, "tag": "EMAIL", "value": "[email protected]" }, { "context": "r cl-bodge/physics\"\n :version \"1.0.0\"\n :author \"Pavel Korolev\"\n :license \"MIT\"\n :mailto \"[email protected]\"\n ", "end": 436, "score": 0.9998939633369446, "start": 423, "tag": "NAME", "value": "Pavel Korolev" }, { "context": "uthor \"Pavel Korolev\"\n :license \"MIT\"\n :mailto \"[email protected]\"\n :depends-on (hello-bodge-physics)\n :pathname ", "end": 482, "score": 0.9999268651008606, "start": 466, "tag": "EMAIL", "value": "[email protected]" } ]
hello-bodge-physics.asd
borodust/hello-bodge-physics
1
(asdf:defsystem :hello-bodge-physics :description "Guide to physics system of cl-bodge" :version "1.0.0" :author "Pavel Korolev" :license "MIT" :mailto "[email protected]" :depends-on (cl-bodge/physics cl-bodge/physics/3d cl-bodge/physics/2d) :pathname "src" :serial t) (asdf:defsystem :hello-bodge-physics/basic :description "Simplest possible example for cl-bodge/physics" :version "1.0.0" :author "Pavel Korolev" :license "MIT" :mailto "[email protected]" :depends-on (hello-bodge-physics) :pathname "src/basic/" :serial t :components ((:file "example")))
8682
(asdf:defsystem :hello-bodge-physics :description "Guide to physics system of cl-bodge" :version "1.0.0" :author "<NAME>" :license "MIT" :mailto "<EMAIL>" :depends-on (cl-bodge/physics cl-bodge/physics/3d cl-bodge/physics/2d) :pathname "src" :serial t) (asdf:defsystem :hello-bodge-physics/basic :description "Simplest possible example for cl-bodge/physics" :version "1.0.0" :author "<NAME>" :license "MIT" :mailto "<EMAIL>" :depends-on (hello-bodge-physics) :pathname "src/basic/" :serial t :components ((:file "example")))
true
(asdf:defsystem :hello-bodge-physics :description "Guide to physics system of cl-bodge" :version "1.0.0" :author "PI:NAME:<NAME>END_PI" :license "MIT" :mailto "PI:EMAIL:<EMAIL>END_PI" :depends-on (cl-bodge/physics cl-bodge/physics/3d cl-bodge/physics/2d) :pathname "src" :serial t) (asdf:defsystem :hello-bodge-physics/basic :description "Simplest possible example for cl-bodge/physics" :version "1.0.0" :author "PI:NAME:<NAME>END_PI" :license "MIT" :mailto "PI:EMAIL:<EMAIL>END_PI" :depends-on (hello-bodge-physics) :pathname "src/basic/" :serial t :components ((:file "example")))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 263, "score": 0.9998686909675598, "start": 246, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 283, "score": 0.9999326467514038, "start": 265, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/c/atc/static-semantics.lisp
ayazhafiz/acl2
0
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "abstract-syntax-operations") (include-book "portable-ascii-identifiers") (include-book "types") (include-book "errors") (include-book "kestrel/fty/defomap" :dir :system) (include-book "kestrel/fty/defunit" :dir :system) (include-book "kestrel/fty/sbyte32" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ atc-static-semantics :parents (atc-implementation) :short "A static semantics of C for ATC." :long (xdoc::topstring (xdoc::p "In order to support the generation of proofs for the C code generated by ATC, we need a static semantics (as well as a dynamic semantics) of (the needed portion of) C. The static semantics serves to prove that the generated C code compiles. Here we provide an initial formal static semantics, which should support the generation of proofs for an initial version of ATC.") (xdoc::p "This preliminary static semantics may be extended in the future, and may be replaced by a more comprehensive model that we will be developing as part of the " (xdoc::seetopic "language" "language formalization") ".") (xdoc::p "The static semantics is defined over the C abstract syntax, but for now it rejects some valid constructs just because ATC does not generate those constructs for now. This way, we keep the static semantics simpler. Being more restrictive is adequate here: if a program generated by ATC passes the constraints of this excessively strict static semantics, it is a valid C program, regardless of the fact that many valid C programs (not generated by ATC) are rejected by this static semantics.") (xdoc::p "This static semantics includes functions that check whether the abstract syntactic entities satisfy the needed constraints. If the constraints are satisfied, additional information (e.g. types) may be returned, used to check constraints on enclosing abstract syntactic entities.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap var-table-scope :short "Fixtype of scopes of variable tables." :long (xdoc::topstring (xdoc::p "A variable table is a symbol table for variables. The table (see @(tsee var-table)) is organized as a sequence with one element for each nested block scope [C:6.2.1]. This fixtype contains information about such a block scope. The information is organized as a finite map from identifiers (variable names) to types. Using a map is adequate because the variables declared in a block must all have different names [C:6.2.1/2].")) :key-type ident :val-type type :pred var-table-scopep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist var-table :short "Fixtype of variable tables, i.e. symbol tables for variables." :long (xdoc::topstring (xdoc::p "This keeps track of all the variables in scope [C:6.2.1], organized according to block scopes. The list has one element for each nested block, where the first element (the @(tsee car)), if present, corresponds to the innermost block: this order is natural, as blocks are added via @(tsee cons). The list is never empty: we always initialize the variable table one (empty) block.") (xdoc::p "Currently we do not support variables with file scope. Thus, all the scopes here are block scopes.") (xdoc::p "It is possible for two scopes in the list to have overlapping domains, when a variable in an inner block hides one in an outer block [C:6.2.1/4].")) :elt-type var-table-scope :true-listp t :non-emptyp t :elementp-of-nil t :pred var-tablep /// (defrule var-tablep-of-cons-alt (iff (var-tablep (cons a x)) (and (var-table-scopep a) (or (var-tablep x) (eq x nil)))) :enable var-tablep)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult var-table "variable tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define irr-var-table () :returns (vartab var-tablep) :short "An irrelevant variable table, usable as a dummy return value." (with-guard-checking :none (ec-call (var-table-fix :irrelevant))) /// (in-theory (disable (:e irr-var-table)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-lookup ((var identp) (vartab var-tablep)) :returns (type type-optionp) :short "Look up a variable in a variable table." :long (xdoc::topstring (xdoc::p "If the variable is found, we return its type; otherwise, we return @('nil'). We search for the variable in the sequence of scopes in order, i.e. from innermost to outermost block.")) (b* (((unless (mbt (not (endp vartab)))) nil) (varscope (var-table-scope-fix (car vartab))) (pair (omap::in (ident-fix var) varscope)) ((when (consp pair)) (cdr pair)) (vartab (cdr vartab)) ((when (endp vartab)) nil)) (var-table-lookup var vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-init () :returns (vartab var-tablep) :short "Create an initial variable table." :long (xdoc::topstring (xdoc::p "This contains a single block with no variables.")) (list nil)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-block ((vartab var-tablep)) :returns (new-table var-tablep) :short "Add a block scope to a variable table." :long (xdoc::topstring (xdoc::p "We add the empty set (of variables) to the front of the sequence. This is used when a block is entered.")) (cons nil (var-table-fix vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-var ((var identp) (type typep) (vartab var-tablep)) :returns (new-vartab var-table-resultp :hints (("Goal" :in-theory (enable var-table-resultp)))) :short "Add a variable to (the innermost block of) a variable table." :long (xdoc::topstring (xdoc::p "If the block already has a variable with that name, it is an error. Otherwise, we add the variable and return the variable table.")) (b* ((var (ident-fix var)) (type (type-fix type)) (vartab (var-table-fix vartab)) (varscope (car vartab)) ((when (omap::in var varscope)) (error (list :duplicate-var var))) (new-varscope (omap::update var type varscope))) (cons new-varscope (cdr vartab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod fun-type :short "Fixtype of function types." :long (xdoc::topstring (xdoc::p "Function types are described in [C:6.2.5/20]. Eventually these may be integrated into a broader formalized notion of C types, but for now we introduce this fixtype here, in order to use in in function tables. A function type consists of zero or more input types and an output type.")) ((inputs type-list) (output type)) :pred fun-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption fun-type-option fun-type :short "Fixtype of optional function types." :pred fun-type-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap fun-table :short "Fixtype of function tables, i.e. symbol tables for functions." :long (xdoc::topstring (xdoc::p "We associate a function type to the function name, in a finite map.")) :key-type ident :val-type fun-type :pred fun-tablep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult fun-table "function tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-lookup ((fun identp) (funtab fun-tablep)) :returns (fun-type fun-type-optionp :hints (("Goal" :in-theory (enable fun-type-optionp)))) :short "Look up a function in a function table." :long (xdoc::topstring (xdoc::p "We return the type of the function, if the function is present. Otherwise, we return @('nil').")) (cdr (omap::in (ident-fix fun) (fun-table-fix funtab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-init () :returns (funtab fun-tablep) :short "Create an initial function table." :long (xdoc::topstring (xdoc::p "This is just the empty map.")) nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-add-fun ((fun identp) (type fun-typep) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Add a function with a function type to a function table." :long (xdoc::topstring (xdoc::p "If the table already has a function with that name, it is an error. Otherwise, we add the function and return the function table.")) (b* ((fun (ident-fix fun)) (type (fun-type-fix type)) (funtab (fun-table-fix funtab)) ((when (set::in fun funtab)) (error (list :duplicate-fun fun)))) (omap::update fun type funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defunit wellformed :short "Fixtype of the well-formedness indicator." :long (xdoc::topstring (xdoc::p "This is returned by the ACL2 static semantic checking functions when an abstract syntactic entity passes the static semantic checks and there is no additional information to return. When the static semantic checks fail, those functions return error instead; see @(tsee wellformed-result).")) :value :wellformed :pred wellformedp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult wellformed "the @(tsee wellformed) indicator") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ident-check ((id identp)) :returns (wf? wellformed-resultp) :short "Check an identifier." :long (xdoc::topstring (xdoc::p "We check whether the underlying ACL2 string satisfies the conditions described in Section `C identifiers' of @(tsee atc). As noted there, [C:6.4.2] allows a possibly broader range of valid identifiers, but ATC only generates this kind of portable identifiers.")) (if (atc-ident-stringp (ident->name id)) :wellformed (error (list :illegal/unsupported-ident (ident-fix id)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define iconst-check ((ic iconstp)) :returns (type type-resultp) :short "Check an integer constant." :long (xdoc::topstring (xdoc::p "For now we require the integer constant to be decimal (not octal or hexadecimal), to be signed, and to have no type suffixes. This means that the integer constant must have type @('int'), and therefore that its numberic value must in that type's range. Given our current definition of @(tsee sintp), the value must fit in 32 bits (with the sign bit being 0).") (xdoc::p "If all the constraints are satisfied, we return the type of the constant. This is always @('int') for now, but eventually this will be generalized.")) (b* ((ic (iconst-fix ic)) ((iconst ic) ic) ((unless (acl2::sbyte32p ic.value)) (error (list :iconst-out-of-range ic))) ((unless (equal ic.base (iconst-base-dec))) (error (list :unsupported-iconst-base ic))) ((unless (not ic.unsignedp)) (error (list :unsupported-iconst-suffix ic))) ((unless (equal ic.type (iconst-tysuffix-none))) (error (list :unsupported-iconst-suffix ic)))) (type-sint)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define const-check ((c constp)) :returns (type type-resultp) :short "Check a constant." :long (xdoc::topstring (xdoc::p "For now we only accept integer constants. The other kinds of constants are placeholders in our abstract syntax, anyhow.")) (const-case c :int (iconst-check c.get) :float (error (list :unsupported-float-const (const-fix c))) :enum (error (list :unsupported-enum-const (const-fix c))) :char (error (list :unsupported-char-const (const-fix c)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define unary-check ((op unopp) (arg-expr exprp) (arg-type typep)) :returns (type type-resultp) :short "Check the application of a unary operator to an expression." :long (xdoc::topstring (xdoc::p "We check @('arg-type') against @('op'); @('arg-expr') is used just for errors. We return the type of the unary expression.") (xdoc::p "For now we only support the @('int') type, so the argument type must be that, and the result type is that too. This will be extended in the future.")) (if (type-equiv arg-type (type-sint)) (type-sint) (error (list ::unary-mistype (unop-fix op) (expr-fix arg-expr) :required (type-sint) :supplied (type-fix arg-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define binary-pure-check ((op binopp) (arg1-expr exprp) (arg1-type typep) (arg2-expr exprp) (arg2-type typep)) :guard (binop-purep op) :returns (type type-resultp) :short "Check the application of a pure binary operator to two expressions." :long (xdoc::topstring (xdoc::p "We check @('arg1-type') and @('arg2-type') against @('op'); @('arg1-expr') and @('arg2-expr') are used just for errors. We return the type of the binary expression.") (xdoc::p "For now we only support the @('int') type, so the argument types must be that, and the result type is that too. This will be extended in the future.")) (if (and (type-equiv arg1-type (type-sint)) (type-equiv arg2-type (type-sint))) (type-sint) (error (list :binary-mistype (binop-fix op) (expr-fix arg1-expr) (expr-fix arg2-expr) :required (type-sint) (type-sint) :supplied (type-fix arg1-type) (type-fix arg2-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-check ((e exprp) (vartab var-tablep)) :returns (type type-resultp) :short "Check a pure expression." :long (xdoc::topstring (xdoc::p "More precisely, we check whether an expression is pure and well-formed. If all the checks are satisfied, we return the type of the expression.") (xdoc::p "For now we only support the @('int') type, so everything has to be @('int'). In particular, the operands of the unary, binary, and ternary operators.")) (b* ((e (expr-fix e))) (expr-case e :ident (b* ((type (var-table-lookup e.get vartab)) ((unless type) (error (list :var-not-found e.get)))) type) :const (const-check e.get) :call (error (list :expr-non-pure e)) :postinc (error (list :expr-non-pure e)) :postdec (error (list :expr-non-pure e)) :preinc (error (list :expr-non-pure e)) :predec (error (list :expr-non-pure e)) :unary (b* ((arg-type (expr-pure-check e.arg vartab)) ((when (errorp arg-type)) (error (list :unary-error arg-type)))) (unary-check e.op e.arg arg-type)) :cast (error (list :unsupported-cast e.type e.arg)) :binary (b* (((unless (binop-purep e.op)) (error (list :binary-non-pure e))) (arg1-type (expr-pure-check e.arg1 vartab)) ((when (errorp arg1-type)) (error (list :binary-left-error arg1-type))) (arg2-type (expr-pure-check e.arg2 vartab)) ((when (errorp arg2-type)) (error (list :binary-right-error arg2-type)))) (binary-pure-check e.op e.arg1 arg1-type e.arg2 arg2-type)) :cond (b* ((test-type (expr-pure-check e.test vartab)) ((when (errorp test-type)) (error (list :cond-test-error test-type))) (then-type (expr-pure-check e.then vartab)) ((when (errorp then-type)) (error (list :cond-then-error then-type))) (else-type (expr-pure-check e.else vartab)) ((when (errorp else-type)) (error (list :cond-else-error else-type))) ((unless (and (equal test-type (type-sint)) (equal then-type (type-sint)) (equal else-type (type-sint)))) (error (list :cond-mistype e.test e.then e.else :required (type-sint) (type-sint) (type-sint) :supplied test-type then-type else-type)))) (type-sint)))) :measure (expr-count e) :verify-guards :after-returns :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-list-check ((es expr-listp) (vartab var-tablep)) :returns (types type-list-resultp :hints ('(:cases ((type-listp (expr-pure-list-check (cdr es) vartab)))))) :short "Check a list of pure expressions." :long (xdoc::topstring (xdoc::p "This lifts @(tsee expr-pure-check) to lists.")) (b* (((when (endp es)) nil) (type (expr-pure-check (car es) vartab)) ((when (errorp type)) type) ((unless (mbt (typep type))) (error :impossible)) (types (expr-pure-list-check (cdr es) vartab)) ((when (errorp types)) types) ((unless (mbt (type-listp types))) (error :impossible))) (cons type types)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-call-or-pure-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (type type-resultp) :short "Check an expression that must be a function call or a pure expression." :long (xdoc::topstring (xdoc::p "If the expression is a function call, we check the argument expressions, which must be pure (beacuse we restrict them to be so). We retrieve the function types from the function table and we compare the input types with the argument types. We return the output type.") (xdoc::p "If the expression is not a function call, it must be a pure expression, which we resort to check it as such.")) (if (expr-case e :call) (b* ((e.args (expr-call->args e)) (e.fun (expr-call->fun e)) (types (expr-pure-list-check e.args vartab)) ((when (errorp types)) (error (list :call-args-error e.fun e.args types))) (ftype (fun-table-lookup e.fun funtab)) ((unless ftype) (error (list :fun-not-found e.fun))) ((unless (equal (fun-type->inputs ftype) types)) (error (list :call-args-mistype e.fun e.args :required (fun-type->inputs ftype) :supplied types)))) (fun-type->output ftype)) (expr-pure-check e vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-asg-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (wf? wellformed-resultp) :short "Check an expression that must be an assignment exrpression." :long (xdoc::topstring (xdoc::p "This is used for the expression of an expression statement. For now, we only allow simple assignment expressions as expressions of expression statements, with a left-hand side consisting of a variable in scope and a right-hand side consisting of a function call or pure expression. The two sides must have the same type. We do not return any type information because an expression statement throws away the expression's value; indeed, we are only interested in the side effects of assignment here.")) (b* (((unless (expr-case e :binary)) (error (list :expr-asg-not-binary (expr-fix e)))) (op (expr-binary->op e)) (left (expr-binary->arg1 e)) (right (expr-binary->arg2 e)) ((unless (binop-case op :asg)) (error (list :expr-asg-not-asg op))) ((unless (expr-case left :ident)) (error (list :expr-asg-left-not-var left))) (var (expr-ident->get left)) (ltype (var-table-lookup var vartab)) ((when (not ltype)) (error (list :expr-asg-var-not-found var))) (rtype (expr-call-or-pure-check right funtab vartab)) ((when (errorp rtype)) rtype) ((unless (equal ltype rtype)) (error (list :asg-mistype left right :required ltype :supplied rtype)))) :wellformed) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod stmt-type :short "Fixtype of statement types." :long (xdoc::topstring (xdoc::p "Here we use the word ``type'' in a broad sense, namely to describe the information inferred by the static semantics about a statement (or block item or block). The information consists of:") (xdoc::ul (xdoc::li "A non-empty set of optional types that describe the possible values returned by the statement. These are determined by the @('return') statements; in the presence of conditionals, the possible types in the two branches are merged (i.e. unioned). The non-type @('nil') is used to describe statements that do not return a value, but instead transfer control to the next statement (if any). It may be appropriate to use the C type @('void') instead of @('nil') to describe this situation, but for now our model of @(see types) does not include @('void').") (xdoc::li "A possibly updated variable table. This is updated by block items that are declarations. We actually only need to return possibly updated variable tables from the ACL2 function @(tsee block-item-check); the ACL2 functions @(tsee stmt-check) and @(tsee block-item-list-check) could just return a set of optional types (see above). However, for uniformity we have all three functions return also a possibly updated variable table."))) ((return-types type-option-set :reqfix (if (set::empty return-types) (set::insert nil nil) return-types)) (variables var-table)) :require (not (set::empty return-types)) :pred stmt-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult stmt-type "statement types") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defines stmt-check :short "Check a statement." :long (xdoc::topstring (xdoc::p "For now we only allow @('return') statements with expressions, conditional statements, compound statements, and expression statements.") (xdoc::p "These functions return a statement type or an error; see @(tsee stmt-type).") (xdoc::p "We only allow simple assignments to variables as expression statements.") (xdoc::p "For a compound statement, we add a block scope to the variable table and then we process the list of block items. There is no need to explicitly remove the scope when exiting the block, because we only use the extended variable table to check the items of the block. Anything that follows the block is checked with the variable table prior to the extension. In fact, a compound statement does not update the variable table: we return the original variable table.") (xdoc::p "For a conditional statement with both branches, after ensuring that the test expression has type @('int'), we check the two branches, and take the union of their return types. We return the initial variable table, unchanged; any change in the branches would be local to the branches.") (xdoc::p "We treat a conditional statement with just one branch as one whose @('else') branch returns nothing.") (xdoc::p "For a return statement, we return the singleton set with the type of the expression.") (xdoc::p "For a block item that is a declaration, we ensure that the initializer has the same type as the variable, and we extend and return the variable table with the variable. We also return the singleton set with @('nil'), because a declaration never returns a value and proceeds with the next block item; note that we do not return the empty set of return types.") (xdoc::p "For a block item that is a statement, we check the statement.") (xdoc::p "If a list of block items is empty, we return the singleton set with @('nil') (because execution then continues after the block) and the variable table unchanged. If the list is not empty, we check the first item. If @('nil') is not among the return types, it means that the rest of the block is dead code: execution never proceeds past the first block item; thus, we do not even check the rest of the block and we return the result of checking the first block item as the result of checking the whole block. If @('nil') is among the return types of the first block item, we check the rest of the block, and we combine (i.e. take the union of) all the return types, after removing @('nil') from the types of the first block item.")) (define stmt-check ((s stmtp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (stmt-case s :labeled (error (list :unsupported-labeled s.label s.body)) :compound (b* ((ext-vartab (var-table-add-block vartab)) (stype (block-item-list-check s.items funtab ext-vartab)) ((when (errorp stype)) (error (list :stmt-compound-error stype)))) (change-stmt-type stype :variables vartab)) :expr (b* ((wf (expr-asg-check s.get funtab vartab)) ((when (not wf)) wf)) (make-stmt-type :return-types (set::insert nil nil) :variables (var-table-fix vartab))) :null (error :unsupported-null-stmt) :if (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then :noelse :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (set::insert nil nil)) :variables vartab)) :ifelse (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then s.else :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then))) (stype-else (stmt-check s.else funtab vartab)) ((when (errorp stype-else)) (error (list :if-else-error stype-else)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (stmt-type->return-types stype-else)) :variables vartab)) :switch (error (list :unsupported-switch s.ctrl s.body)) :while (error (list :unsupported-while s.test s.body)) :dowhile (error (list :unsupported-dowhile s.body s.test)) :for (error (list :unsupported-for s.init s.test s.next s.body)) :goto (error (list :unsupported-goto s.target)) :continue (error :unsupported-continue) :break (error :unsupported-break) :return (b* (((unless s.value) (error (list :unsupported-return-void))) (type (expr-call-or-pure-check s.value funtab vartab)) ((when (errorp type)) (error (list :return-error type)))) (make-stmt-type :return-types (set::insert type nil) :variables vartab))) :measure (stmt-count s)) (define block-item-check ((item block-itemp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (block-item-case item :decl (b* (((decl decl) item.get) (wf (ident-check decl.name)) ((when (errorp wf)) (error (list :decl-error-var wf))) (type (type-name-to-type (tyname decl.type))) (init-type (expr-call-or-pure-check decl.init funtab vartab)) ((when (errorp init-type)) (error (list :decl-error-init init-type))) ((unless (equal init-type type)) (error (list :decl-mistype decl.type decl.name decl.init :required type :supplied init-type))) (vartab (var-table-add-var decl.name type vartab)) ((when (errorp vartab)) (error (list :decl-error vartab)))) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) :stmt (stmt-check item.get funtab vartab)) :measure (block-item-count item)) (define block-item-list-check ((items block-item-listp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (b* (((when (endp items)) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) (stype (block-item-check (car items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-error stype))) ((unless (set::in nil (stmt-type->return-types stype))) stype) (rtypes1 (set::delete nil (stmt-type->return-types stype))) (vartab (stmt-type->variables stype)) (stype (block-item-list-check (cdr items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-list-error stype))) (rtypes2 (stmt-type->return-types stype)) (vartab (stmt-type->variables stype))) (make-stmt-type :return-types (set::union rtypes1 rtypes2) :variables vartab)) :measure (block-item-list-count items)) :verify-guards nil ; done below /// (verify-guards stmt-check) (fty::deffixequiv-mutual stmt-check)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-check ((param param-declp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a parameter declaration." :long (xdoc::topstring (xdoc::p "The variable table passed as input is the one engendered by the parameter declarations that precede this one. We check the components of the parameter declaration and that the parameter can be added to the variable table; the latter check fails if there is a duplicate parameter. If all checks succeed, we return the variable table updated with the parameter.")) (b* (((param-decl param) param) (wf (ident-check param.name)) ((when (errorp wf)) (error (list :param-error wf)))) (var-table-add-var param.name (type-name-to-type (tyname param.type)) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-list-check ((params param-decl-listp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a list of parameter declaration." :long (xdoc::topstring (xdoc::p "We go through each element of the list, calling @(tsee param-decl-check) and threading the variable table through.")) (b* (((when (endp params)) (var-table-fix vartab)) (vartab (param-decl-check (car params) vartab)) ((when (errorp vartab)) (error (list :param-error vartab)))) (param-decl-list-check (cdr params) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fundef-check ((fundef fundefp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a function definition." :long (xdoc::topstring (xdoc::p "Starting with an initial variable table, we process the parameter declarations and obtain the variable table in which the function body must be checked statically. We ensure that the return types of the body match the return types of the function: currently, this means that the set of return types must be a singleton with the function's return type; this may be relaxed in the future.") (xdoc::p "We also extend the function table with the new function. It is an error if a function with the same name is already in the table. In general, this must be done before checking the body: the function is in scope, in its own body.") (xdoc::p "The scope of a function identifier goes from its declaration to the end of the translation unit [C:6.2.1/4]. Thus, as we go through the function definitions in the translation unit in order, we extend the function table.")) (b* (((fundef fundef) fundef) (in-types (type-name-list-to-type-list (tyname-list (param-decl-list->type-list fundef.params)))) (out-type (type-name-to-type (tyname fundef.result))) (ftype (make-fun-type :inputs in-types :output out-type)) (funtab (fun-table-add-fun fundef.name ftype funtab)) ((when (errorp funtab)) (error (list :fundef funtab))) (wf (ident-check fundef.name)) ((when (errorp wf)) (error (list :fundef-name-error wf))) (vartab (var-table-init)) (vartab (param-decl-list-check fundef.params vartab)) ((when (errorp vartab)) (error (list :fundef-param-error vartab))) (stype (stmt-check fundef.body funtab vartab)) ((when (errorp stype)) (error (list :fundef-body-error stype))) ((unless (equal (stmt-type->return-types stype) (set::insert out-type nil))) (error (list :fundef-return-mistype fundef.name :required out-type :inferred (stmt-type->return-types stype))))) funtab) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-check ((ext ext-declp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check an external declaration." :long (xdoc::topstring (xdoc::p "For now we only allow function definitions.")) (ext-decl-case ext :fundef (fundef-check ext.get funtab) :decl (fun-table-fix funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-list-check ((exts ext-decl-listp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a list of external declarations." :long (xdoc::topstring (xdoc::p "We thread the function table through.")) (b* (((when (endp exts)) (fun-table-fix funtab)) (funtab (ext-decl-check (car exts) funtab)) ((when (errorp funtab)) (error (list :ext-decl-error funtab)))) (ext-decl-list-check (cdr exts) funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define transunit-check ((tunit transunitp)) :returns (wf wellformed-resultp) :short "Check a translation unit." :long (xdoc::topstring (xdoc::p "Starting from the initial (empty) function table, we check all the external declarations, threading the function table through, and discarding the final one (it served its pupose).")) (b* (((transunit tunit) tunit) (funtab (fun-table-init)) (funtab (ext-decl-list-check tunit.decls funtab)) ((when (errorp funtab)) (error (list :transunit-error funtab)))) :wellformed) :hooks (:fix))
93374
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "abstract-syntax-operations") (include-book "portable-ascii-identifiers") (include-book "types") (include-book "errors") (include-book "kestrel/fty/defomap" :dir :system) (include-book "kestrel/fty/defunit" :dir :system) (include-book "kestrel/fty/sbyte32" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ atc-static-semantics :parents (atc-implementation) :short "A static semantics of C for ATC." :long (xdoc::topstring (xdoc::p "In order to support the generation of proofs for the C code generated by ATC, we need a static semantics (as well as a dynamic semantics) of (the needed portion of) C. The static semantics serves to prove that the generated C code compiles. Here we provide an initial formal static semantics, which should support the generation of proofs for an initial version of ATC.") (xdoc::p "This preliminary static semantics may be extended in the future, and may be replaced by a more comprehensive model that we will be developing as part of the " (xdoc::seetopic "language" "language formalization") ".") (xdoc::p "The static semantics is defined over the C abstract syntax, but for now it rejects some valid constructs just because ATC does not generate those constructs for now. This way, we keep the static semantics simpler. Being more restrictive is adequate here: if a program generated by ATC passes the constraints of this excessively strict static semantics, it is a valid C program, regardless of the fact that many valid C programs (not generated by ATC) are rejected by this static semantics.") (xdoc::p "This static semantics includes functions that check whether the abstract syntactic entities satisfy the needed constraints. If the constraints are satisfied, additional information (e.g. types) may be returned, used to check constraints on enclosing abstract syntactic entities.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap var-table-scope :short "Fixtype of scopes of variable tables." :long (xdoc::topstring (xdoc::p "A variable table is a symbol table for variables. The table (see @(tsee var-table)) is organized as a sequence with one element for each nested block scope [C:6.2.1]. This fixtype contains information about such a block scope. The information is organized as a finite map from identifiers (variable names) to types. Using a map is adequate because the variables declared in a block must all have different names [C:6.2.1/2].")) :key-type ident :val-type type :pred var-table-scopep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist var-table :short "Fixtype of variable tables, i.e. symbol tables for variables." :long (xdoc::topstring (xdoc::p "This keeps track of all the variables in scope [C:6.2.1], organized according to block scopes. The list has one element for each nested block, where the first element (the @(tsee car)), if present, corresponds to the innermost block: this order is natural, as blocks are added via @(tsee cons). The list is never empty: we always initialize the variable table one (empty) block.") (xdoc::p "Currently we do not support variables with file scope. Thus, all the scopes here are block scopes.") (xdoc::p "It is possible for two scopes in the list to have overlapping domains, when a variable in an inner block hides one in an outer block [C:6.2.1/4].")) :elt-type var-table-scope :true-listp t :non-emptyp t :elementp-of-nil t :pred var-tablep /// (defrule var-tablep-of-cons-alt (iff (var-tablep (cons a x)) (and (var-table-scopep a) (or (var-tablep x) (eq x nil)))) :enable var-tablep)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult var-table "variable tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define irr-var-table () :returns (vartab var-tablep) :short "An irrelevant variable table, usable as a dummy return value." (with-guard-checking :none (ec-call (var-table-fix :irrelevant))) /// (in-theory (disable (:e irr-var-table)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-lookup ((var identp) (vartab var-tablep)) :returns (type type-optionp) :short "Look up a variable in a variable table." :long (xdoc::topstring (xdoc::p "If the variable is found, we return its type; otherwise, we return @('nil'). We search for the variable in the sequence of scopes in order, i.e. from innermost to outermost block.")) (b* (((unless (mbt (not (endp vartab)))) nil) (varscope (var-table-scope-fix (car vartab))) (pair (omap::in (ident-fix var) varscope)) ((when (consp pair)) (cdr pair)) (vartab (cdr vartab)) ((when (endp vartab)) nil)) (var-table-lookup var vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-init () :returns (vartab var-tablep) :short "Create an initial variable table." :long (xdoc::topstring (xdoc::p "This contains a single block with no variables.")) (list nil)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-block ((vartab var-tablep)) :returns (new-table var-tablep) :short "Add a block scope to a variable table." :long (xdoc::topstring (xdoc::p "We add the empty set (of variables) to the front of the sequence. This is used when a block is entered.")) (cons nil (var-table-fix vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-var ((var identp) (type typep) (vartab var-tablep)) :returns (new-vartab var-table-resultp :hints (("Goal" :in-theory (enable var-table-resultp)))) :short "Add a variable to (the innermost block of) a variable table." :long (xdoc::topstring (xdoc::p "If the block already has a variable with that name, it is an error. Otherwise, we add the variable and return the variable table.")) (b* ((var (ident-fix var)) (type (type-fix type)) (vartab (var-table-fix vartab)) (varscope (car vartab)) ((when (omap::in var varscope)) (error (list :duplicate-var var))) (new-varscope (omap::update var type varscope))) (cons new-varscope (cdr vartab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod fun-type :short "Fixtype of function types." :long (xdoc::topstring (xdoc::p "Function types are described in [C:6.2.5/20]. Eventually these may be integrated into a broader formalized notion of C types, but for now we introduce this fixtype here, in order to use in in function tables. A function type consists of zero or more input types and an output type.")) ((inputs type-list) (output type)) :pred fun-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption fun-type-option fun-type :short "Fixtype of optional function types." :pred fun-type-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap fun-table :short "Fixtype of function tables, i.e. symbol tables for functions." :long (xdoc::topstring (xdoc::p "We associate a function type to the function name, in a finite map.")) :key-type ident :val-type fun-type :pred fun-tablep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult fun-table "function tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-lookup ((fun identp) (funtab fun-tablep)) :returns (fun-type fun-type-optionp :hints (("Goal" :in-theory (enable fun-type-optionp)))) :short "Look up a function in a function table." :long (xdoc::topstring (xdoc::p "We return the type of the function, if the function is present. Otherwise, we return @('nil').")) (cdr (omap::in (ident-fix fun) (fun-table-fix funtab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-init () :returns (funtab fun-tablep) :short "Create an initial function table." :long (xdoc::topstring (xdoc::p "This is just the empty map.")) nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-add-fun ((fun identp) (type fun-typep) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Add a function with a function type to a function table." :long (xdoc::topstring (xdoc::p "If the table already has a function with that name, it is an error. Otherwise, we add the function and return the function table.")) (b* ((fun (ident-fix fun)) (type (fun-type-fix type)) (funtab (fun-table-fix funtab)) ((when (set::in fun funtab)) (error (list :duplicate-fun fun)))) (omap::update fun type funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defunit wellformed :short "Fixtype of the well-formedness indicator." :long (xdoc::topstring (xdoc::p "This is returned by the ACL2 static semantic checking functions when an abstract syntactic entity passes the static semantic checks and there is no additional information to return. When the static semantic checks fail, those functions return error instead; see @(tsee wellformed-result).")) :value :wellformed :pred wellformedp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult wellformed "the @(tsee wellformed) indicator") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ident-check ((id identp)) :returns (wf? wellformed-resultp) :short "Check an identifier." :long (xdoc::topstring (xdoc::p "We check whether the underlying ACL2 string satisfies the conditions described in Section `C identifiers' of @(tsee atc). As noted there, [C:6.4.2] allows a possibly broader range of valid identifiers, but ATC only generates this kind of portable identifiers.")) (if (atc-ident-stringp (ident->name id)) :wellformed (error (list :illegal/unsupported-ident (ident-fix id)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define iconst-check ((ic iconstp)) :returns (type type-resultp) :short "Check an integer constant." :long (xdoc::topstring (xdoc::p "For now we require the integer constant to be decimal (not octal or hexadecimal), to be signed, and to have no type suffixes. This means that the integer constant must have type @('int'), and therefore that its numberic value must in that type's range. Given our current definition of @(tsee sintp), the value must fit in 32 bits (with the sign bit being 0).") (xdoc::p "If all the constraints are satisfied, we return the type of the constant. This is always @('int') for now, but eventually this will be generalized.")) (b* ((ic (iconst-fix ic)) ((iconst ic) ic) ((unless (acl2::sbyte32p ic.value)) (error (list :iconst-out-of-range ic))) ((unless (equal ic.base (iconst-base-dec))) (error (list :unsupported-iconst-base ic))) ((unless (not ic.unsignedp)) (error (list :unsupported-iconst-suffix ic))) ((unless (equal ic.type (iconst-tysuffix-none))) (error (list :unsupported-iconst-suffix ic)))) (type-sint)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define const-check ((c constp)) :returns (type type-resultp) :short "Check a constant." :long (xdoc::topstring (xdoc::p "For now we only accept integer constants. The other kinds of constants are placeholders in our abstract syntax, anyhow.")) (const-case c :int (iconst-check c.get) :float (error (list :unsupported-float-const (const-fix c))) :enum (error (list :unsupported-enum-const (const-fix c))) :char (error (list :unsupported-char-const (const-fix c)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define unary-check ((op unopp) (arg-expr exprp) (arg-type typep)) :returns (type type-resultp) :short "Check the application of a unary operator to an expression." :long (xdoc::topstring (xdoc::p "We check @('arg-type') against @('op'); @('arg-expr') is used just for errors. We return the type of the unary expression.") (xdoc::p "For now we only support the @('int') type, so the argument type must be that, and the result type is that too. This will be extended in the future.")) (if (type-equiv arg-type (type-sint)) (type-sint) (error (list ::unary-mistype (unop-fix op) (expr-fix arg-expr) :required (type-sint) :supplied (type-fix arg-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define binary-pure-check ((op binopp) (arg1-expr exprp) (arg1-type typep) (arg2-expr exprp) (arg2-type typep)) :guard (binop-purep op) :returns (type type-resultp) :short "Check the application of a pure binary operator to two expressions." :long (xdoc::topstring (xdoc::p "We check @('arg1-type') and @('arg2-type') against @('op'); @('arg1-expr') and @('arg2-expr') are used just for errors. We return the type of the binary expression.") (xdoc::p "For now we only support the @('int') type, so the argument types must be that, and the result type is that too. This will be extended in the future.")) (if (and (type-equiv arg1-type (type-sint)) (type-equiv arg2-type (type-sint))) (type-sint) (error (list :binary-mistype (binop-fix op) (expr-fix arg1-expr) (expr-fix arg2-expr) :required (type-sint) (type-sint) :supplied (type-fix arg1-type) (type-fix arg2-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-check ((e exprp) (vartab var-tablep)) :returns (type type-resultp) :short "Check a pure expression." :long (xdoc::topstring (xdoc::p "More precisely, we check whether an expression is pure and well-formed. If all the checks are satisfied, we return the type of the expression.") (xdoc::p "For now we only support the @('int') type, so everything has to be @('int'). In particular, the operands of the unary, binary, and ternary operators.")) (b* ((e (expr-fix e))) (expr-case e :ident (b* ((type (var-table-lookup e.get vartab)) ((unless type) (error (list :var-not-found e.get)))) type) :const (const-check e.get) :call (error (list :expr-non-pure e)) :postinc (error (list :expr-non-pure e)) :postdec (error (list :expr-non-pure e)) :preinc (error (list :expr-non-pure e)) :predec (error (list :expr-non-pure e)) :unary (b* ((arg-type (expr-pure-check e.arg vartab)) ((when (errorp arg-type)) (error (list :unary-error arg-type)))) (unary-check e.op e.arg arg-type)) :cast (error (list :unsupported-cast e.type e.arg)) :binary (b* (((unless (binop-purep e.op)) (error (list :binary-non-pure e))) (arg1-type (expr-pure-check e.arg1 vartab)) ((when (errorp arg1-type)) (error (list :binary-left-error arg1-type))) (arg2-type (expr-pure-check e.arg2 vartab)) ((when (errorp arg2-type)) (error (list :binary-right-error arg2-type)))) (binary-pure-check e.op e.arg1 arg1-type e.arg2 arg2-type)) :cond (b* ((test-type (expr-pure-check e.test vartab)) ((when (errorp test-type)) (error (list :cond-test-error test-type))) (then-type (expr-pure-check e.then vartab)) ((when (errorp then-type)) (error (list :cond-then-error then-type))) (else-type (expr-pure-check e.else vartab)) ((when (errorp else-type)) (error (list :cond-else-error else-type))) ((unless (and (equal test-type (type-sint)) (equal then-type (type-sint)) (equal else-type (type-sint)))) (error (list :cond-mistype e.test e.then e.else :required (type-sint) (type-sint) (type-sint) :supplied test-type then-type else-type)))) (type-sint)))) :measure (expr-count e) :verify-guards :after-returns :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-list-check ((es expr-listp) (vartab var-tablep)) :returns (types type-list-resultp :hints ('(:cases ((type-listp (expr-pure-list-check (cdr es) vartab)))))) :short "Check a list of pure expressions." :long (xdoc::topstring (xdoc::p "This lifts @(tsee expr-pure-check) to lists.")) (b* (((when (endp es)) nil) (type (expr-pure-check (car es) vartab)) ((when (errorp type)) type) ((unless (mbt (typep type))) (error :impossible)) (types (expr-pure-list-check (cdr es) vartab)) ((when (errorp types)) types) ((unless (mbt (type-listp types))) (error :impossible))) (cons type types)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-call-or-pure-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (type type-resultp) :short "Check an expression that must be a function call or a pure expression." :long (xdoc::topstring (xdoc::p "If the expression is a function call, we check the argument expressions, which must be pure (beacuse we restrict them to be so). We retrieve the function types from the function table and we compare the input types with the argument types. We return the output type.") (xdoc::p "If the expression is not a function call, it must be a pure expression, which we resort to check it as such.")) (if (expr-case e :call) (b* ((e.args (expr-call->args e)) (e.fun (expr-call->fun e)) (types (expr-pure-list-check e.args vartab)) ((when (errorp types)) (error (list :call-args-error e.fun e.args types))) (ftype (fun-table-lookup e.fun funtab)) ((unless ftype) (error (list :fun-not-found e.fun))) ((unless (equal (fun-type->inputs ftype) types)) (error (list :call-args-mistype e.fun e.args :required (fun-type->inputs ftype) :supplied types)))) (fun-type->output ftype)) (expr-pure-check e vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-asg-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (wf? wellformed-resultp) :short "Check an expression that must be an assignment exrpression." :long (xdoc::topstring (xdoc::p "This is used for the expression of an expression statement. For now, we only allow simple assignment expressions as expressions of expression statements, with a left-hand side consisting of a variable in scope and a right-hand side consisting of a function call or pure expression. The two sides must have the same type. We do not return any type information because an expression statement throws away the expression's value; indeed, we are only interested in the side effects of assignment here.")) (b* (((unless (expr-case e :binary)) (error (list :expr-asg-not-binary (expr-fix e)))) (op (expr-binary->op e)) (left (expr-binary->arg1 e)) (right (expr-binary->arg2 e)) ((unless (binop-case op :asg)) (error (list :expr-asg-not-asg op))) ((unless (expr-case left :ident)) (error (list :expr-asg-left-not-var left))) (var (expr-ident->get left)) (ltype (var-table-lookup var vartab)) ((when (not ltype)) (error (list :expr-asg-var-not-found var))) (rtype (expr-call-or-pure-check right funtab vartab)) ((when (errorp rtype)) rtype) ((unless (equal ltype rtype)) (error (list :asg-mistype left right :required ltype :supplied rtype)))) :wellformed) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod stmt-type :short "Fixtype of statement types." :long (xdoc::topstring (xdoc::p "Here we use the word ``type'' in a broad sense, namely to describe the information inferred by the static semantics about a statement (or block item or block). The information consists of:") (xdoc::ul (xdoc::li "A non-empty set of optional types that describe the possible values returned by the statement. These are determined by the @('return') statements; in the presence of conditionals, the possible types in the two branches are merged (i.e. unioned). The non-type @('nil') is used to describe statements that do not return a value, but instead transfer control to the next statement (if any). It may be appropriate to use the C type @('void') instead of @('nil') to describe this situation, but for now our model of @(see types) does not include @('void').") (xdoc::li "A possibly updated variable table. This is updated by block items that are declarations. We actually only need to return possibly updated variable tables from the ACL2 function @(tsee block-item-check); the ACL2 functions @(tsee stmt-check) and @(tsee block-item-list-check) could just return a set of optional types (see above). However, for uniformity we have all three functions return also a possibly updated variable table."))) ((return-types type-option-set :reqfix (if (set::empty return-types) (set::insert nil nil) return-types)) (variables var-table)) :require (not (set::empty return-types)) :pred stmt-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult stmt-type "statement types") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defines stmt-check :short "Check a statement." :long (xdoc::topstring (xdoc::p "For now we only allow @('return') statements with expressions, conditional statements, compound statements, and expression statements.") (xdoc::p "These functions return a statement type or an error; see @(tsee stmt-type).") (xdoc::p "We only allow simple assignments to variables as expression statements.") (xdoc::p "For a compound statement, we add a block scope to the variable table and then we process the list of block items. There is no need to explicitly remove the scope when exiting the block, because we only use the extended variable table to check the items of the block. Anything that follows the block is checked with the variable table prior to the extension. In fact, a compound statement does not update the variable table: we return the original variable table.") (xdoc::p "For a conditional statement with both branches, after ensuring that the test expression has type @('int'), we check the two branches, and take the union of their return types. We return the initial variable table, unchanged; any change in the branches would be local to the branches.") (xdoc::p "We treat a conditional statement with just one branch as one whose @('else') branch returns nothing.") (xdoc::p "For a return statement, we return the singleton set with the type of the expression.") (xdoc::p "For a block item that is a declaration, we ensure that the initializer has the same type as the variable, and we extend and return the variable table with the variable. We also return the singleton set with @('nil'), because a declaration never returns a value and proceeds with the next block item; note that we do not return the empty set of return types.") (xdoc::p "For a block item that is a statement, we check the statement.") (xdoc::p "If a list of block items is empty, we return the singleton set with @('nil') (because execution then continues after the block) and the variable table unchanged. If the list is not empty, we check the first item. If @('nil') is not among the return types, it means that the rest of the block is dead code: execution never proceeds past the first block item; thus, we do not even check the rest of the block and we return the result of checking the first block item as the result of checking the whole block. If @('nil') is among the return types of the first block item, we check the rest of the block, and we combine (i.e. take the union of) all the return types, after removing @('nil') from the types of the first block item.")) (define stmt-check ((s stmtp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (stmt-case s :labeled (error (list :unsupported-labeled s.label s.body)) :compound (b* ((ext-vartab (var-table-add-block vartab)) (stype (block-item-list-check s.items funtab ext-vartab)) ((when (errorp stype)) (error (list :stmt-compound-error stype)))) (change-stmt-type stype :variables vartab)) :expr (b* ((wf (expr-asg-check s.get funtab vartab)) ((when (not wf)) wf)) (make-stmt-type :return-types (set::insert nil nil) :variables (var-table-fix vartab))) :null (error :unsupported-null-stmt) :if (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then :noelse :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (set::insert nil nil)) :variables vartab)) :ifelse (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then s.else :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then))) (stype-else (stmt-check s.else funtab vartab)) ((when (errorp stype-else)) (error (list :if-else-error stype-else)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (stmt-type->return-types stype-else)) :variables vartab)) :switch (error (list :unsupported-switch s.ctrl s.body)) :while (error (list :unsupported-while s.test s.body)) :dowhile (error (list :unsupported-dowhile s.body s.test)) :for (error (list :unsupported-for s.init s.test s.next s.body)) :goto (error (list :unsupported-goto s.target)) :continue (error :unsupported-continue) :break (error :unsupported-break) :return (b* (((unless s.value) (error (list :unsupported-return-void))) (type (expr-call-or-pure-check s.value funtab vartab)) ((when (errorp type)) (error (list :return-error type)))) (make-stmt-type :return-types (set::insert type nil) :variables vartab))) :measure (stmt-count s)) (define block-item-check ((item block-itemp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (block-item-case item :decl (b* (((decl decl) item.get) (wf (ident-check decl.name)) ((when (errorp wf)) (error (list :decl-error-var wf))) (type (type-name-to-type (tyname decl.type))) (init-type (expr-call-or-pure-check decl.init funtab vartab)) ((when (errorp init-type)) (error (list :decl-error-init init-type))) ((unless (equal init-type type)) (error (list :decl-mistype decl.type decl.name decl.init :required type :supplied init-type))) (vartab (var-table-add-var decl.name type vartab)) ((when (errorp vartab)) (error (list :decl-error vartab)))) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) :stmt (stmt-check item.get funtab vartab)) :measure (block-item-count item)) (define block-item-list-check ((items block-item-listp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (b* (((when (endp items)) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) (stype (block-item-check (car items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-error stype))) ((unless (set::in nil (stmt-type->return-types stype))) stype) (rtypes1 (set::delete nil (stmt-type->return-types stype))) (vartab (stmt-type->variables stype)) (stype (block-item-list-check (cdr items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-list-error stype))) (rtypes2 (stmt-type->return-types stype)) (vartab (stmt-type->variables stype))) (make-stmt-type :return-types (set::union rtypes1 rtypes2) :variables vartab)) :measure (block-item-list-count items)) :verify-guards nil ; done below /// (verify-guards stmt-check) (fty::deffixequiv-mutual stmt-check)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-check ((param param-declp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a parameter declaration." :long (xdoc::topstring (xdoc::p "The variable table passed as input is the one engendered by the parameter declarations that precede this one. We check the components of the parameter declaration and that the parameter can be added to the variable table; the latter check fails if there is a duplicate parameter. If all checks succeed, we return the variable table updated with the parameter.")) (b* (((param-decl param) param) (wf (ident-check param.name)) ((when (errorp wf)) (error (list :param-error wf)))) (var-table-add-var param.name (type-name-to-type (tyname param.type)) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-list-check ((params param-decl-listp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a list of parameter declaration." :long (xdoc::topstring (xdoc::p "We go through each element of the list, calling @(tsee param-decl-check) and threading the variable table through.")) (b* (((when (endp params)) (var-table-fix vartab)) (vartab (param-decl-check (car params) vartab)) ((when (errorp vartab)) (error (list :param-error vartab)))) (param-decl-list-check (cdr params) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fundef-check ((fundef fundefp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a function definition." :long (xdoc::topstring (xdoc::p "Starting with an initial variable table, we process the parameter declarations and obtain the variable table in which the function body must be checked statically. We ensure that the return types of the body match the return types of the function: currently, this means that the set of return types must be a singleton with the function's return type; this may be relaxed in the future.") (xdoc::p "We also extend the function table with the new function. It is an error if a function with the same name is already in the table. In general, this must be done before checking the body: the function is in scope, in its own body.") (xdoc::p "The scope of a function identifier goes from its declaration to the end of the translation unit [C:6.2.1/4]. Thus, as we go through the function definitions in the translation unit in order, we extend the function table.")) (b* (((fundef fundef) fundef) (in-types (type-name-list-to-type-list (tyname-list (param-decl-list->type-list fundef.params)))) (out-type (type-name-to-type (tyname fundef.result))) (ftype (make-fun-type :inputs in-types :output out-type)) (funtab (fun-table-add-fun fundef.name ftype funtab)) ((when (errorp funtab)) (error (list :fundef funtab))) (wf (ident-check fundef.name)) ((when (errorp wf)) (error (list :fundef-name-error wf))) (vartab (var-table-init)) (vartab (param-decl-list-check fundef.params vartab)) ((when (errorp vartab)) (error (list :fundef-param-error vartab))) (stype (stmt-check fundef.body funtab vartab)) ((when (errorp stype)) (error (list :fundef-body-error stype))) ((unless (equal (stmt-type->return-types stype) (set::insert out-type nil))) (error (list :fundef-return-mistype fundef.name :required out-type :inferred (stmt-type->return-types stype))))) funtab) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-check ((ext ext-declp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check an external declaration." :long (xdoc::topstring (xdoc::p "For now we only allow function definitions.")) (ext-decl-case ext :fundef (fundef-check ext.get funtab) :decl (fun-table-fix funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-list-check ((exts ext-decl-listp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a list of external declarations." :long (xdoc::topstring (xdoc::p "We thread the function table through.")) (b* (((when (endp exts)) (fun-table-fix funtab)) (funtab (ext-decl-check (car exts) funtab)) ((when (errorp funtab)) (error (list :ext-decl-error funtab)))) (ext-decl-list-check (cdr exts) funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define transunit-check ((tunit transunitp)) :returns (wf wellformed-resultp) :short "Check a translation unit." :long (xdoc::topstring (xdoc::p "Starting from the initial (empty) function table, we check all the external declarations, threading the function table through, and discarding the final one (it served its pupose).")) (b* (((transunit tunit) tunit) (funtab (fun-table-init)) (funtab (ext-decl-list-check tunit.decls funtab)) ((when (errorp funtab)) (error (list :transunit-error funtab)))) :wellformed) :hooks (:fix))
true
; C Library ; ; Copyright (C) 2021 Kestrel Institute (http://www.kestrel.edu) ; Copyright (C) 2021 Kestrel Technology LLC (http://kestreltechnology.com) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "C") (include-book "abstract-syntax-operations") (include-book "portable-ascii-identifiers") (include-book "types") (include-book "errors") (include-book "kestrel/fty/defomap" :dir :system) (include-book "kestrel/fty/defunit" :dir :system) (include-book "kestrel/fty/sbyte32" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ atc-static-semantics :parents (atc-implementation) :short "A static semantics of C for ATC." :long (xdoc::topstring (xdoc::p "In order to support the generation of proofs for the C code generated by ATC, we need a static semantics (as well as a dynamic semantics) of (the needed portion of) C. The static semantics serves to prove that the generated C code compiles. Here we provide an initial formal static semantics, which should support the generation of proofs for an initial version of ATC.") (xdoc::p "This preliminary static semantics may be extended in the future, and may be replaced by a more comprehensive model that we will be developing as part of the " (xdoc::seetopic "language" "language formalization") ".") (xdoc::p "The static semantics is defined over the C abstract syntax, but for now it rejects some valid constructs just because ATC does not generate those constructs for now. This way, we keep the static semantics simpler. Being more restrictive is adequate here: if a program generated by ATC passes the constraints of this excessively strict static semantics, it is a valid C program, regardless of the fact that many valid C programs (not generated by ATC) are rejected by this static semantics.") (xdoc::p "This static semantics includes functions that check whether the abstract syntactic entities satisfy the needed constraints. If the constraints are satisfied, additional information (e.g. types) may be returned, used to check constraints on enclosing abstract syntactic entities.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap var-table-scope :short "Fixtype of scopes of variable tables." :long (xdoc::topstring (xdoc::p "A variable table is a symbol table for variables. The table (see @(tsee var-table)) is organized as a sequence with one element for each nested block scope [C:6.2.1]. This fixtype contains information about such a block scope. The information is organized as a finite map from identifiers (variable names) to types. Using a map is adequate because the variables declared in a block must all have different names [C:6.2.1/2].")) :key-type ident :val-type type :pred var-table-scopep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist var-table :short "Fixtype of variable tables, i.e. symbol tables for variables." :long (xdoc::topstring (xdoc::p "This keeps track of all the variables in scope [C:6.2.1], organized according to block scopes. The list has one element for each nested block, where the first element (the @(tsee car)), if present, corresponds to the innermost block: this order is natural, as blocks are added via @(tsee cons). The list is never empty: we always initialize the variable table one (empty) block.") (xdoc::p "Currently we do not support variables with file scope. Thus, all the scopes here are block scopes.") (xdoc::p "It is possible for two scopes in the list to have overlapping domains, when a variable in an inner block hides one in an outer block [C:6.2.1/4].")) :elt-type var-table-scope :true-listp t :non-emptyp t :elementp-of-nil t :pred var-tablep /// (defrule var-tablep-of-cons-alt (iff (var-tablep (cons a x)) (and (var-table-scopep a) (or (var-tablep x) (eq x nil)))) :enable var-tablep)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult var-table "variable tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define irr-var-table () :returns (vartab var-tablep) :short "An irrelevant variable table, usable as a dummy return value." (with-guard-checking :none (ec-call (var-table-fix :irrelevant))) /// (in-theory (disable (:e irr-var-table)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-lookup ((var identp) (vartab var-tablep)) :returns (type type-optionp) :short "Look up a variable in a variable table." :long (xdoc::topstring (xdoc::p "If the variable is found, we return its type; otherwise, we return @('nil'). We search for the variable in the sequence of scopes in order, i.e. from innermost to outermost block.")) (b* (((unless (mbt (not (endp vartab)))) nil) (varscope (var-table-scope-fix (car vartab))) (pair (omap::in (ident-fix var) varscope)) ((when (consp pair)) (cdr pair)) (vartab (cdr vartab)) ((when (endp vartab)) nil)) (var-table-lookup var vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-init () :returns (vartab var-tablep) :short "Create an initial variable table." :long (xdoc::topstring (xdoc::p "This contains a single block with no variables.")) (list nil)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-block ((vartab var-tablep)) :returns (new-table var-tablep) :short "Add a block scope to a variable table." :long (xdoc::topstring (xdoc::p "We add the empty set (of variables) to the front of the sequence. This is used when a block is entered.")) (cons nil (var-table-fix vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define var-table-add-var ((var identp) (type typep) (vartab var-tablep)) :returns (new-vartab var-table-resultp :hints (("Goal" :in-theory (enable var-table-resultp)))) :short "Add a variable to (the innermost block of) a variable table." :long (xdoc::topstring (xdoc::p "If the block already has a variable with that name, it is an error. Otherwise, we add the variable and return the variable table.")) (b* ((var (ident-fix var)) (type (type-fix type)) (vartab (var-table-fix vartab)) (varscope (car vartab)) ((when (omap::in var varscope)) (error (list :duplicate-var var))) (new-varscope (omap::update var type varscope))) (cons new-varscope (cdr vartab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod fun-type :short "Fixtype of function types." :long (xdoc::topstring (xdoc::p "Function types are described in [C:6.2.5/20]. Eventually these may be integrated into a broader formalized notion of C types, but for now we introduce this fixtype here, in order to use in in function tables. A function type consists of zero or more input types and an output type.")) ((inputs type-list) (output type)) :pred fun-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption fun-type-option fun-type :short "Fixtype of optional function types." :pred fun-type-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap fun-table :short "Fixtype of function tables, i.e. symbol tables for functions." :long (xdoc::topstring (xdoc::p "We associate a function type to the function name, in a finite map.")) :key-type ident :val-type fun-type :pred fun-tablep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult fun-table "function tables") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-lookup ((fun identp) (funtab fun-tablep)) :returns (fun-type fun-type-optionp :hints (("Goal" :in-theory (enable fun-type-optionp)))) :short "Look up a function in a function table." :long (xdoc::topstring (xdoc::p "We return the type of the function, if the function is present. Otherwise, we return @('nil').")) (cdr (omap::in (ident-fix fun) (fun-table-fix funtab))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-init () :returns (funtab fun-tablep) :short "Create an initial function table." :long (xdoc::topstring (xdoc::p "This is just the empty map.")) nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fun-table-add-fun ((fun identp) (type fun-typep) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Add a function with a function type to a function table." :long (xdoc::topstring (xdoc::p "If the table already has a function with that name, it is an error. Otherwise, we add the function and return the function table.")) (b* ((fun (ident-fix fun)) (type (fun-type-fix type)) (funtab (fun-table-fix funtab)) ((when (set::in fun funtab)) (error (list :duplicate-fun fun)))) (omap::update fun type funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defunit wellformed :short "Fixtype of the well-formedness indicator." :long (xdoc::topstring (xdoc::p "This is returned by the ACL2 static semantic checking functions when an abstract syntactic entity passes the static semantic checks and there is no additional information to return. When the static semantic checks fail, those functions return error instead; see @(tsee wellformed-result).")) :value :wellformed :pred wellformedp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult wellformed "the @(tsee wellformed) indicator") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ident-check ((id identp)) :returns (wf? wellformed-resultp) :short "Check an identifier." :long (xdoc::topstring (xdoc::p "We check whether the underlying ACL2 string satisfies the conditions described in Section `C identifiers' of @(tsee atc). As noted there, [C:6.4.2] allows a possibly broader range of valid identifiers, but ATC only generates this kind of portable identifiers.")) (if (atc-ident-stringp (ident->name id)) :wellformed (error (list :illegal/unsupported-ident (ident-fix id)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define iconst-check ((ic iconstp)) :returns (type type-resultp) :short "Check an integer constant." :long (xdoc::topstring (xdoc::p "For now we require the integer constant to be decimal (not octal or hexadecimal), to be signed, and to have no type suffixes. This means that the integer constant must have type @('int'), and therefore that its numberic value must in that type's range. Given our current definition of @(tsee sintp), the value must fit in 32 bits (with the sign bit being 0).") (xdoc::p "If all the constraints are satisfied, we return the type of the constant. This is always @('int') for now, but eventually this will be generalized.")) (b* ((ic (iconst-fix ic)) ((iconst ic) ic) ((unless (acl2::sbyte32p ic.value)) (error (list :iconst-out-of-range ic))) ((unless (equal ic.base (iconst-base-dec))) (error (list :unsupported-iconst-base ic))) ((unless (not ic.unsignedp)) (error (list :unsupported-iconst-suffix ic))) ((unless (equal ic.type (iconst-tysuffix-none))) (error (list :unsupported-iconst-suffix ic)))) (type-sint)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define const-check ((c constp)) :returns (type type-resultp) :short "Check a constant." :long (xdoc::topstring (xdoc::p "For now we only accept integer constants. The other kinds of constants are placeholders in our abstract syntax, anyhow.")) (const-case c :int (iconst-check c.get) :float (error (list :unsupported-float-const (const-fix c))) :enum (error (list :unsupported-enum-const (const-fix c))) :char (error (list :unsupported-char-const (const-fix c)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define unary-check ((op unopp) (arg-expr exprp) (arg-type typep)) :returns (type type-resultp) :short "Check the application of a unary operator to an expression." :long (xdoc::topstring (xdoc::p "We check @('arg-type') against @('op'); @('arg-expr') is used just for errors. We return the type of the unary expression.") (xdoc::p "For now we only support the @('int') type, so the argument type must be that, and the result type is that too. This will be extended in the future.")) (if (type-equiv arg-type (type-sint)) (type-sint) (error (list ::unary-mistype (unop-fix op) (expr-fix arg-expr) :required (type-sint) :supplied (type-fix arg-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define binary-pure-check ((op binopp) (arg1-expr exprp) (arg1-type typep) (arg2-expr exprp) (arg2-type typep)) :guard (binop-purep op) :returns (type type-resultp) :short "Check the application of a pure binary operator to two expressions." :long (xdoc::topstring (xdoc::p "We check @('arg1-type') and @('arg2-type') against @('op'); @('arg1-expr') and @('arg2-expr') are used just for errors. We return the type of the binary expression.") (xdoc::p "For now we only support the @('int') type, so the argument types must be that, and the result type is that too. This will be extended in the future.")) (if (and (type-equiv arg1-type (type-sint)) (type-equiv arg2-type (type-sint))) (type-sint) (error (list :binary-mistype (binop-fix op) (expr-fix arg1-expr) (expr-fix arg2-expr) :required (type-sint) (type-sint) :supplied (type-fix arg1-type) (type-fix arg2-type)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-check ((e exprp) (vartab var-tablep)) :returns (type type-resultp) :short "Check a pure expression." :long (xdoc::topstring (xdoc::p "More precisely, we check whether an expression is pure and well-formed. If all the checks are satisfied, we return the type of the expression.") (xdoc::p "For now we only support the @('int') type, so everything has to be @('int'). In particular, the operands of the unary, binary, and ternary operators.")) (b* ((e (expr-fix e))) (expr-case e :ident (b* ((type (var-table-lookup e.get vartab)) ((unless type) (error (list :var-not-found e.get)))) type) :const (const-check e.get) :call (error (list :expr-non-pure e)) :postinc (error (list :expr-non-pure e)) :postdec (error (list :expr-non-pure e)) :preinc (error (list :expr-non-pure e)) :predec (error (list :expr-non-pure e)) :unary (b* ((arg-type (expr-pure-check e.arg vartab)) ((when (errorp arg-type)) (error (list :unary-error arg-type)))) (unary-check e.op e.arg arg-type)) :cast (error (list :unsupported-cast e.type e.arg)) :binary (b* (((unless (binop-purep e.op)) (error (list :binary-non-pure e))) (arg1-type (expr-pure-check e.arg1 vartab)) ((when (errorp arg1-type)) (error (list :binary-left-error arg1-type))) (arg2-type (expr-pure-check e.arg2 vartab)) ((when (errorp arg2-type)) (error (list :binary-right-error arg2-type)))) (binary-pure-check e.op e.arg1 arg1-type e.arg2 arg2-type)) :cond (b* ((test-type (expr-pure-check e.test vartab)) ((when (errorp test-type)) (error (list :cond-test-error test-type))) (then-type (expr-pure-check e.then vartab)) ((when (errorp then-type)) (error (list :cond-then-error then-type))) (else-type (expr-pure-check e.else vartab)) ((when (errorp else-type)) (error (list :cond-else-error else-type))) ((unless (and (equal test-type (type-sint)) (equal then-type (type-sint)) (equal else-type (type-sint)))) (error (list :cond-mistype e.test e.then e.else :required (type-sint) (type-sint) (type-sint) :supplied test-type then-type else-type)))) (type-sint)))) :measure (expr-count e) :verify-guards :after-returns :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-pure-list-check ((es expr-listp) (vartab var-tablep)) :returns (types type-list-resultp :hints ('(:cases ((type-listp (expr-pure-list-check (cdr es) vartab)))))) :short "Check a list of pure expressions." :long (xdoc::topstring (xdoc::p "This lifts @(tsee expr-pure-check) to lists.")) (b* (((when (endp es)) nil) (type (expr-pure-check (car es) vartab)) ((when (errorp type)) type) ((unless (mbt (typep type))) (error :impossible)) (types (expr-pure-list-check (cdr es) vartab)) ((when (errorp types)) types) ((unless (mbt (type-listp types))) (error :impossible))) (cons type types)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-call-or-pure-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (type type-resultp) :short "Check an expression that must be a function call or a pure expression." :long (xdoc::topstring (xdoc::p "If the expression is a function call, we check the argument expressions, which must be pure (beacuse we restrict them to be so). We retrieve the function types from the function table and we compare the input types with the argument types. We return the output type.") (xdoc::p "If the expression is not a function call, it must be a pure expression, which we resort to check it as such.")) (if (expr-case e :call) (b* ((e.args (expr-call->args e)) (e.fun (expr-call->fun e)) (types (expr-pure-list-check e.args vartab)) ((when (errorp types)) (error (list :call-args-error e.fun e.args types))) (ftype (fun-table-lookup e.fun funtab)) ((unless ftype) (error (list :fun-not-found e.fun))) ((unless (equal (fun-type->inputs ftype) types)) (error (list :call-args-mistype e.fun e.args :required (fun-type->inputs ftype) :supplied types)))) (fun-type->output ftype)) (expr-pure-check e vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define expr-asg-check ((e exprp) (funtab fun-tablep) (vartab var-tablep)) :returns (wf? wellformed-resultp) :short "Check an expression that must be an assignment exrpression." :long (xdoc::topstring (xdoc::p "This is used for the expression of an expression statement. For now, we only allow simple assignment expressions as expressions of expression statements, with a left-hand side consisting of a variable in scope and a right-hand side consisting of a function call or pure expression. The two sides must have the same type. We do not return any type information because an expression statement throws away the expression's value; indeed, we are only interested in the side effects of assignment here.")) (b* (((unless (expr-case e :binary)) (error (list :expr-asg-not-binary (expr-fix e)))) (op (expr-binary->op e)) (left (expr-binary->arg1 e)) (right (expr-binary->arg2 e)) ((unless (binop-case op :asg)) (error (list :expr-asg-not-asg op))) ((unless (expr-case left :ident)) (error (list :expr-asg-left-not-var left))) (var (expr-ident->get left)) (ltype (var-table-lookup var vartab)) ((when (not ltype)) (error (list :expr-asg-var-not-found var))) (rtype (expr-call-or-pure-check right funtab vartab)) ((when (errorp rtype)) rtype) ((unless (equal ltype rtype)) (error (list :asg-mistype left right :required ltype :supplied rtype)))) :wellformed) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod stmt-type :short "Fixtype of statement types." :long (xdoc::topstring (xdoc::p "Here we use the word ``type'' in a broad sense, namely to describe the information inferred by the static semantics about a statement (or block item or block). The information consists of:") (xdoc::ul (xdoc::li "A non-empty set of optional types that describe the possible values returned by the statement. These are determined by the @('return') statements; in the presence of conditionals, the possible types in the two branches are merged (i.e. unioned). The non-type @('nil') is used to describe statements that do not return a value, but instead transfer control to the next statement (if any). It may be appropriate to use the C type @('void') instead of @('nil') to describe this situation, but for now our model of @(see types) does not include @('void').") (xdoc::li "A possibly updated variable table. This is updated by block items that are declarations. We actually only need to return possibly updated variable tables from the ACL2 function @(tsee block-item-check); the ACL2 functions @(tsee stmt-check) and @(tsee block-item-list-check) could just return a set of optional types (see above). However, for uniformity we have all three functions return also a possibly updated variable table."))) ((return-types type-option-set :reqfix (if (set::empty return-types) (set::insert nil nil) return-types)) (variables var-table)) :require (not (set::empty return-types)) :pred stmt-typep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defresult stmt-type "statement types") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defines stmt-check :short "Check a statement." :long (xdoc::topstring (xdoc::p "For now we only allow @('return') statements with expressions, conditional statements, compound statements, and expression statements.") (xdoc::p "These functions return a statement type or an error; see @(tsee stmt-type).") (xdoc::p "We only allow simple assignments to variables as expression statements.") (xdoc::p "For a compound statement, we add a block scope to the variable table and then we process the list of block items. There is no need to explicitly remove the scope when exiting the block, because we only use the extended variable table to check the items of the block. Anything that follows the block is checked with the variable table prior to the extension. In fact, a compound statement does not update the variable table: we return the original variable table.") (xdoc::p "For a conditional statement with both branches, after ensuring that the test expression has type @('int'), we check the two branches, and take the union of their return types. We return the initial variable table, unchanged; any change in the branches would be local to the branches.") (xdoc::p "We treat a conditional statement with just one branch as one whose @('else') branch returns nothing.") (xdoc::p "For a return statement, we return the singleton set with the type of the expression.") (xdoc::p "For a block item that is a declaration, we ensure that the initializer has the same type as the variable, and we extend and return the variable table with the variable. We also return the singleton set with @('nil'), because a declaration never returns a value and proceeds with the next block item; note that we do not return the empty set of return types.") (xdoc::p "For a block item that is a statement, we check the statement.") (xdoc::p "If a list of block items is empty, we return the singleton set with @('nil') (because execution then continues after the block) and the variable table unchanged. If the list is not empty, we check the first item. If @('nil') is not among the return types, it means that the rest of the block is dead code: execution never proceeds past the first block item; thus, we do not even check the rest of the block and we return the result of checking the first block item as the result of checking the whole block. If @('nil') is among the return types of the first block item, we check the rest of the block, and we combine (i.e. take the union of) all the return types, after removing @('nil') from the types of the first block item.")) (define stmt-check ((s stmtp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (stmt-case s :labeled (error (list :unsupported-labeled s.label s.body)) :compound (b* ((ext-vartab (var-table-add-block vartab)) (stype (block-item-list-check s.items funtab ext-vartab)) ((when (errorp stype)) (error (list :stmt-compound-error stype)))) (change-stmt-type stype :variables vartab)) :expr (b* ((wf (expr-asg-check s.get funtab vartab)) ((when (not wf)) wf)) (make-stmt-type :return-types (set::insert nil nil) :variables (var-table-fix vartab))) :null (error :unsupported-null-stmt) :if (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then :noelse :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (set::insert nil nil)) :variables vartab)) :ifelse (b* ((type (expr-pure-check s.test vartab)) ((when (errorp type)) (error (list :if-test-error type))) ((unless (equal type (type-sint))) (error (list :if-test-mistype s.test s.then s.else :required (type-sint) :supplied type))) (stype-then (stmt-check s.then funtab vartab)) ((when (errorp stype-then)) (error (list :if-then-error stype-then))) (stype-else (stmt-check s.else funtab vartab)) ((when (errorp stype-else)) (error (list :if-else-error stype-else)))) (make-stmt-type :return-types (set::union (stmt-type->return-types stype-then) (stmt-type->return-types stype-else)) :variables vartab)) :switch (error (list :unsupported-switch s.ctrl s.body)) :while (error (list :unsupported-while s.test s.body)) :dowhile (error (list :unsupported-dowhile s.body s.test)) :for (error (list :unsupported-for s.init s.test s.next s.body)) :goto (error (list :unsupported-goto s.target)) :continue (error :unsupported-continue) :break (error :unsupported-break) :return (b* (((unless s.value) (error (list :unsupported-return-void))) (type (expr-call-or-pure-check s.value funtab vartab)) ((when (errorp type)) (error (list :return-error type)))) (make-stmt-type :return-types (set::insert type nil) :variables vartab))) :measure (stmt-count s)) (define block-item-check ((item block-itemp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (block-item-case item :decl (b* (((decl decl) item.get) (wf (ident-check decl.name)) ((when (errorp wf)) (error (list :decl-error-var wf))) (type (type-name-to-type (tyname decl.type))) (init-type (expr-call-or-pure-check decl.init funtab vartab)) ((when (errorp init-type)) (error (list :decl-error-init init-type))) ((unless (equal init-type type)) (error (list :decl-mistype decl.type decl.name decl.init :required type :supplied init-type))) (vartab (var-table-add-var decl.name type vartab)) ((when (errorp vartab)) (error (list :decl-error vartab)))) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) :stmt (stmt-check item.get funtab vartab)) :measure (block-item-count item)) (define block-item-list-check ((items block-item-listp) (funtab fun-tablep) (vartab var-tablep)) :returns (stype stmt-type-resultp) (b* (((when (endp items)) (make-stmt-type :return-types (set::insert nil nil) :variables vartab)) (stype (block-item-check (car items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-error stype))) ((unless (set::in nil (stmt-type->return-types stype))) stype) (rtypes1 (set::delete nil (stmt-type->return-types stype))) (vartab (stmt-type->variables stype)) (stype (block-item-list-check (cdr items) funtab vartab)) ((when (errorp stype)) (error (list :block-item-list-error stype))) (rtypes2 (stmt-type->return-types stype)) (vartab (stmt-type->variables stype))) (make-stmt-type :return-types (set::union rtypes1 rtypes2) :variables vartab)) :measure (block-item-list-count items)) :verify-guards nil ; done below /// (verify-guards stmt-check) (fty::deffixequiv-mutual stmt-check)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-check ((param param-declp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a parameter declaration." :long (xdoc::topstring (xdoc::p "The variable table passed as input is the one engendered by the parameter declarations that precede this one. We check the components of the parameter declaration and that the parameter can be added to the variable table; the latter check fails if there is a duplicate parameter. If all checks succeed, we return the variable table updated with the parameter.")) (b* (((param-decl param) param) (wf (ident-check param.name)) ((when (errorp wf)) (error (list :param-error wf)))) (var-table-add-var param.name (type-name-to-type (tyname param.type)) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define param-decl-list-check ((params param-decl-listp) (vartab var-tablep)) :returns (new-vartab var-table-resultp) :short "Check a list of parameter declaration." :long (xdoc::topstring (xdoc::p "We go through each element of the list, calling @(tsee param-decl-check) and threading the variable table through.")) (b* (((when (endp params)) (var-table-fix vartab)) (vartab (param-decl-check (car params) vartab)) ((when (errorp vartab)) (error (list :param-error vartab)))) (param-decl-list-check (cdr params) vartab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define fundef-check ((fundef fundefp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a function definition." :long (xdoc::topstring (xdoc::p "Starting with an initial variable table, we process the parameter declarations and obtain the variable table in which the function body must be checked statically. We ensure that the return types of the body match the return types of the function: currently, this means that the set of return types must be a singleton with the function's return type; this may be relaxed in the future.") (xdoc::p "We also extend the function table with the new function. It is an error if a function with the same name is already in the table. In general, this must be done before checking the body: the function is in scope, in its own body.") (xdoc::p "The scope of a function identifier goes from its declaration to the end of the translation unit [C:6.2.1/4]. Thus, as we go through the function definitions in the translation unit in order, we extend the function table.")) (b* (((fundef fundef) fundef) (in-types (type-name-list-to-type-list (tyname-list (param-decl-list->type-list fundef.params)))) (out-type (type-name-to-type (tyname fundef.result))) (ftype (make-fun-type :inputs in-types :output out-type)) (funtab (fun-table-add-fun fundef.name ftype funtab)) ((when (errorp funtab)) (error (list :fundef funtab))) (wf (ident-check fundef.name)) ((when (errorp wf)) (error (list :fundef-name-error wf))) (vartab (var-table-init)) (vartab (param-decl-list-check fundef.params vartab)) ((when (errorp vartab)) (error (list :fundef-param-error vartab))) (stype (stmt-check fundef.body funtab vartab)) ((when (errorp stype)) (error (list :fundef-body-error stype))) ((unless (equal (stmt-type->return-types stype) (set::insert out-type nil))) (error (list :fundef-return-mistype fundef.name :required out-type :inferred (stmt-type->return-types stype))))) funtab) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-check ((ext ext-declp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check an external declaration." :long (xdoc::topstring (xdoc::p "For now we only allow function definitions.")) (ext-decl-case ext :fundef (fundef-check ext.get funtab) :decl (fun-table-fix funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define ext-decl-list-check ((exts ext-decl-listp) (funtab fun-tablep)) :returns (new-funtab fun-table-resultp) :short "Check a list of external declarations." :long (xdoc::topstring (xdoc::p "We thread the function table through.")) (b* (((when (endp exts)) (fun-table-fix funtab)) (funtab (ext-decl-check (car exts) funtab)) ((when (errorp funtab)) (error (list :ext-decl-error funtab)))) (ext-decl-list-check (cdr exts) funtab)) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define transunit-check ((tunit transunitp)) :returns (wf wellformed-resultp) :short "Check a translation unit." :long (xdoc::topstring (xdoc::p "Starting from the initial (empty) function table, we check all the external declarations, threading the function table through, and discarding the final one (it served its pupose).")) (b* (((transunit tunit) tunit) (funtab (fun-table-init)) (funtab (ext-decl-list-check tunit.decls funtab)) ((when (errorp funtab)) (error (list :transunit-error funtab)))) :wellformed) :hooks (:fix))
[ { "context": ";;; FIXME: On the CMU CL mailing list 30 Jan 2000, Pierre Mai suggested\n;;; OTOH it probably wouldn't be a ma", "end": 2413, "score": 0.9997127652168274, "start": 2403, "tag": "NAME", "value": "Pierre Mai" } ]
time.lisp
priyadarshan/printv
49
;;;; time printing routines built upon the Common Lisp FORMAT function ;;;; This software is derived from the SBCL system and released under ;;;; public domain. ;;;; ;;;; This software is derived from the CMU CL system, which was ;;;; written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. (in-package :printv) (defparameter *abbrev-weekday-table* #("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")) (defparameter *long-weekday-table* #("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")) (defparameter *abbrev-month-table* #("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) (defparameter *long-month-table* #("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")) ;;; The timezone table is incomplete but workable. (defparameter *timezone-table* #("GMT" "" "" "" "" "EST" "CST" "MST" "PST")) (defparameter *daylight-table* #(nil nil nil nil nil "EDT" "CDT" "MDT" "PDT")) ;;; VALID-DESTINATION-P ensures the destination stream is okay for the ;;; FORMAT function. (defun valid-destination-p (destination) (or (not destination) (eq destination t) (streamp destination) (and (stringp destination) (array-has-fill-pointer-p destination)))) (defun timezone-name (dst tz) (if (and (integerp tz) (or (and dst (= tz 0)) (<= 5 tz 8))) (svref (if dst *daylight-table* *timezone-table*) tz) (multiple-value-bind (rest seconds) (truncate (* tz 60 60) 60) (multiple-value-bind (hours minutes) (truncate rest 60) (format nil "[~C~D~@[~*:~2,'0D~@[~*:~2,'0D~]~]]" (if (minusp tz) #\- #\+) (abs hours) (not (and (zerop minutes) (zerop seconds))) (abs minutes) (not (zerop seconds)) (abs seconds)))))) ;;;CMU CL made the default style :SHORT here. I've changed that to :LONG, on ;;; the theory that since the 8/7/1999 style is hard to decode unambiguously, ;;; you should have to ask for it explicitly. (I prefer YYYYMMDD myself, since ;;; it sorts properly.:-) -- WHN 19990831 ;;; ;;; FIXME: On the CMU CL mailing list 30 Jan 2000, Pierre Mai suggested ;;; OTOH it probably wouldn't be a major problem to change compile-file to ;;; use for example :long, so that the output would be Month DD, YYYY, or ;;; even better to extend format-universal-time with a flag to output ISO ;;; 8601 formats (like e.g. :iso-8601 and :iso-8601-short) and migrate ;;; slowly towards ISO dates in the user code... ;;; The :ISO-8601 and :ISO-8601-SHORT options sound sensible to me. Maybe ;;; someone will do them for CMU CL and we can steal them for SBCL. (defun format-universal-time (destination universal-time &key (timezone nil) (style :long) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "Format-Universal-Time formats a string containing the time and date given by universal-time in a common manner. The destination is any destination which can be accepted by the Format function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), :ABBREVIATED (like :LONG but words are abbreviated), or :GOVERNMENT (of the form \"XX Month XXXX XX:XX:XX\") The &KEY argument :DATE-FIRST, if NIL, will print the time first instead of the date (the default). The PRINT- keywords, if NIL, inhibit the printing of the obvious part of the time/date." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (integerp universal-time) (error "~A: Universal-Time should be an integer." universal-time)) (when timezone (unless (and (rationalp timezone) (<= -24 timezone 24)) (error "~A: Timezone should be a rational between -24 and 24." timezone)) (unless (zerop (rem timezone 1/3600)) (error "~A: Timezone is not a second (1/3600) multiple." timezone))) (multiple-value-bind (secs mins hours day month year dow dst tz) (if timezone (decode-universal-time universal-time timezone) (decode-universal-time universal-time)) (declare (fixnum secs mins hours day month year dow)) (let ((time-string "~2,'0D:~2,'0D") (date-string (case style (:short "~D/~D/~D") ;; MM/DD/Y ((:abbreviated :long) "~A ~D, ~D") ;; Month DD, Y (:government "~2,'0D ~:@(~A~) ~D") ;; DD MON Y (t (error "~A: Unrecognized :style keyword value." style)))) (time-args (list mins (max (mod hours 12) (1+ (mod (1- hours) 12))))) (date-args (case style (:short (list month day year)) (:abbreviated (list (svref *abbrev-month-table* (1- month)) day year)) (:long (list (svref *long-month-table* (1- month)) day year)) (:government (list day (svref *abbrev-month-table* (1- month)) year))))) (declare (simple-string time-string date-string)) (when print-weekday (push (case style ((:short :long) (svref *long-weekday-table* dow)) (:abbreviated (svref *abbrev-weekday-table* dow)) (:government (svref *abbrev-weekday-table* dow))) date-args) (setq date-string (concatenate 'simple-string "~A, " date-string))) (when (or print-seconds (eq style :government)) (push secs time-args) (setq time-string (concatenate 'simple-string time-string ":~2,'0D"))) (when print-meridian (push (signum (floor hours 12)) time-args) (setq time-string (concatenate 'simple-string time-string " ~[AM~;PM~]"))) (apply #'format destination (if date-first (concatenate 'simple-string date-string " " time-string (if print-timezone " ~A")) (concatenate 'simple-string time-string " " date-string (if print-timezone " ~A"))) (if date-first (nconc date-args (nreverse time-args) (if print-timezone (list (timezone-name dst tz)))) (nconc (nreverse time-args) date-args (if print-timezone (list (timezone-name dst tz))))))))) (defun format-decoded-time (destination seconds minutes hours day month year &key (timezone nil) (style :short) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "FORMAT-DECODED-TIME formats a string containing decoded time expressed in a humanly-readable manner. The destination is any destination which can be accepted by the FORMAT function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), or :ABBREVIATED (like :LONG but words are abbreviated). The keyword DATE-FIRST, if NIL, will cause the time to be printed first instead of the date (the default). The PRINT- keywords, if nil, inhibit the printing of certain semi-obvious parts of the string." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (and (integerp seconds) (<= 0 seconds 59)) (error "~A: Seconds should be an integer between 0 and 59." seconds)) (unless (and (integerp minutes) (<= 0 minutes 59)) (error "~A: Minutes should be an integer between 0 and 59." minutes)) (unless (and (integerp hours) (<= 0 hours 23)) (error "~A: Hours should be an integer between 0 and 23." hours)) (unless (and (integerp day) (<= 1 day 31)) (error "~A: Day should be an integer between 1 and 31." day)) (unless (and (integerp month) (<= 1 month 12)) (error "~A: Month should be an integer between 1 and 12." month)) (unless (and (integerp year) (plusp year)) (error "~A: Hours should be an non-negative integer." year)) (when timezone (unless (and (integerp timezone) (<= 0 timezone 32)) (error "~A: Timezone should be an integer between 0 and 32." timezone))) (format-universal-time destination (encode-universal-time seconds minutes hours day month year) :timezone timezone :style style :date-first date-first :print-seconds print-seconds :print-meridian print-meridian :print-timezone print-timezone :print-weekday print-weekday)) (defun format-date-range (start-year start-month start-day end-year end-month end-day) (let ((start-month (and start-month (or (not end-month) (not end-day) (/= start-month end-month) (/= start-year end-year)) (aref *long-month-table* start-month))) (start-year (and (or (/= start-year end-year) (not start-month)) start-year))) (format nil "~@[~a~]~@[ ~a~]~:[~; ~]~@[~a~]~:[-~; - ~]~@[~a ~]~@[~a ~]~a" start-day start-month (and start-month start-year) ; space start-year start-month ; space around - end-day (and end-month (aref *long-month-table* end-month)) end-year))) ;; (format-date-range 2007 8 01 2012 3 14) ;; "1 September 2007 - 14 April 2012"
79602
;;;; time printing routines built upon the Common Lisp FORMAT function ;;;; This software is derived from the SBCL system and released under ;;;; public domain. ;;;; ;;;; This software is derived from the CMU CL system, which was ;;;; written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. (in-package :printv) (defparameter *abbrev-weekday-table* #("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")) (defparameter *long-weekday-table* #("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")) (defparameter *abbrev-month-table* #("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) (defparameter *long-month-table* #("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")) ;;; The timezone table is incomplete but workable. (defparameter *timezone-table* #("GMT" "" "" "" "" "EST" "CST" "MST" "PST")) (defparameter *daylight-table* #(nil nil nil nil nil "EDT" "CDT" "MDT" "PDT")) ;;; VALID-DESTINATION-P ensures the destination stream is okay for the ;;; FORMAT function. (defun valid-destination-p (destination) (or (not destination) (eq destination t) (streamp destination) (and (stringp destination) (array-has-fill-pointer-p destination)))) (defun timezone-name (dst tz) (if (and (integerp tz) (or (and dst (= tz 0)) (<= 5 tz 8))) (svref (if dst *daylight-table* *timezone-table*) tz) (multiple-value-bind (rest seconds) (truncate (* tz 60 60) 60) (multiple-value-bind (hours minutes) (truncate rest 60) (format nil "[~C~D~@[~*:~2,'0D~@[~*:~2,'0D~]~]]" (if (minusp tz) #\- #\+) (abs hours) (not (and (zerop minutes) (zerop seconds))) (abs minutes) (not (zerop seconds)) (abs seconds)))))) ;;;CMU CL made the default style :SHORT here. I've changed that to :LONG, on ;;; the theory that since the 8/7/1999 style is hard to decode unambiguously, ;;; you should have to ask for it explicitly. (I prefer YYYYMMDD myself, since ;;; it sorts properly.:-) -- WHN 19990831 ;;; ;;; FIXME: On the CMU CL mailing list 30 Jan 2000, <NAME> suggested ;;; OTOH it probably wouldn't be a major problem to change compile-file to ;;; use for example :long, so that the output would be Month DD, YYYY, or ;;; even better to extend format-universal-time with a flag to output ISO ;;; 8601 formats (like e.g. :iso-8601 and :iso-8601-short) and migrate ;;; slowly towards ISO dates in the user code... ;;; The :ISO-8601 and :ISO-8601-SHORT options sound sensible to me. Maybe ;;; someone will do them for CMU CL and we can steal them for SBCL. (defun format-universal-time (destination universal-time &key (timezone nil) (style :long) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "Format-Universal-Time formats a string containing the time and date given by universal-time in a common manner. The destination is any destination which can be accepted by the Format function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), :ABBREVIATED (like :LONG but words are abbreviated), or :GOVERNMENT (of the form \"XX Month XXXX XX:XX:XX\") The &KEY argument :DATE-FIRST, if NIL, will print the time first instead of the date (the default). The PRINT- keywords, if NIL, inhibit the printing of the obvious part of the time/date." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (integerp universal-time) (error "~A: Universal-Time should be an integer." universal-time)) (when timezone (unless (and (rationalp timezone) (<= -24 timezone 24)) (error "~A: Timezone should be a rational between -24 and 24." timezone)) (unless (zerop (rem timezone 1/3600)) (error "~A: Timezone is not a second (1/3600) multiple." timezone))) (multiple-value-bind (secs mins hours day month year dow dst tz) (if timezone (decode-universal-time universal-time timezone) (decode-universal-time universal-time)) (declare (fixnum secs mins hours day month year dow)) (let ((time-string "~2,'0D:~2,'0D") (date-string (case style (:short "~D/~D/~D") ;; MM/DD/Y ((:abbreviated :long) "~A ~D, ~D") ;; Month DD, Y (:government "~2,'0D ~:@(~A~) ~D") ;; DD MON Y (t (error "~A: Unrecognized :style keyword value." style)))) (time-args (list mins (max (mod hours 12) (1+ (mod (1- hours) 12))))) (date-args (case style (:short (list month day year)) (:abbreviated (list (svref *abbrev-month-table* (1- month)) day year)) (:long (list (svref *long-month-table* (1- month)) day year)) (:government (list day (svref *abbrev-month-table* (1- month)) year))))) (declare (simple-string time-string date-string)) (when print-weekday (push (case style ((:short :long) (svref *long-weekday-table* dow)) (:abbreviated (svref *abbrev-weekday-table* dow)) (:government (svref *abbrev-weekday-table* dow))) date-args) (setq date-string (concatenate 'simple-string "~A, " date-string))) (when (or print-seconds (eq style :government)) (push secs time-args) (setq time-string (concatenate 'simple-string time-string ":~2,'0D"))) (when print-meridian (push (signum (floor hours 12)) time-args) (setq time-string (concatenate 'simple-string time-string " ~[AM~;PM~]"))) (apply #'format destination (if date-first (concatenate 'simple-string date-string " " time-string (if print-timezone " ~A")) (concatenate 'simple-string time-string " " date-string (if print-timezone " ~A"))) (if date-first (nconc date-args (nreverse time-args) (if print-timezone (list (timezone-name dst tz)))) (nconc (nreverse time-args) date-args (if print-timezone (list (timezone-name dst tz))))))))) (defun format-decoded-time (destination seconds minutes hours day month year &key (timezone nil) (style :short) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "FORMAT-DECODED-TIME formats a string containing decoded time expressed in a humanly-readable manner. The destination is any destination which can be accepted by the FORMAT function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), or :ABBREVIATED (like :LONG but words are abbreviated). The keyword DATE-FIRST, if NIL, will cause the time to be printed first instead of the date (the default). The PRINT- keywords, if nil, inhibit the printing of certain semi-obvious parts of the string." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (and (integerp seconds) (<= 0 seconds 59)) (error "~A: Seconds should be an integer between 0 and 59." seconds)) (unless (and (integerp minutes) (<= 0 minutes 59)) (error "~A: Minutes should be an integer between 0 and 59." minutes)) (unless (and (integerp hours) (<= 0 hours 23)) (error "~A: Hours should be an integer between 0 and 23." hours)) (unless (and (integerp day) (<= 1 day 31)) (error "~A: Day should be an integer between 1 and 31." day)) (unless (and (integerp month) (<= 1 month 12)) (error "~A: Month should be an integer between 1 and 12." month)) (unless (and (integerp year) (plusp year)) (error "~A: Hours should be an non-negative integer." year)) (when timezone (unless (and (integerp timezone) (<= 0 timezone 32)) (error "~A: Timezone should be an integer between 0 and 32." timezone))) (format-universal-time destination (encode-universal-time seconds minutes hours day month year) :timezone timezone :style style :date-first date-first :print-seconds print-seconds :print-meridian print-meridian :print-timezone print-timezone :print-weekday print-weekday)) (defun format-date-range (start-year start-month start-day end-year end-month end-day) (let ((start-month (and start-month (or (not end-month) (not end-day) (/= start-month end-month) (/= start-year end-year)) (aref *long-month-table* start-month))) (start-year (and (or (/= start-year end-year) (not start-month)) start-year))) (format nil "~@[~a~]~@[ ~a~]~:[~; ~]~@[~a~]~:[-~; - ~]~@[~a ~]~@[~a ~]~a" start-day start-month (and start-month start-year) ; space start-year start-month ; space around - end-day (and end-month (aref *long-month-table* end-month)) end-year))) ;; (format-date-range 2007 8 01 2012 3 14) ;; "1 September 2007 - 14 April 2012"
true
;;;; time printing routines built upon the Common Lisp FORMAT function ;;;; This software is derived from the SBCL system and released under ;;;; public domain. ;;;; ;;;; This software is derived from the CMU CL system, which was ;;;; written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. (in-package :printv) (defparameter *abbrev-weekday-table* #("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")) (defparameter *long-weekday-table* #("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")) (defparameter *abbrev-month-table* #("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) (defparameter *long-month-table* #("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")) ;;; The timezone table is incomplete but workable. (defparameter *timezone-table* #("GMT" "" "" "" "" "EST" "CST" "MST" "PST")) (defparameter *daylight-table* #(nil nil nil nil nil "EDT" "CDT" "MDT" "PDT")) ;;; VALID-DESTINATION-P ensures the destination stream is okay for the ;;; FORMAT function. (defun valid-destination-p (destination) (or (not destination) (eq destination t) (streamp destination) (and (stringp destination) (array-has-fill-pointer-p destination)))) (defun timezone-name (dst tz) (if (and (integerp tz) (or (and dst (= tz 0)) (<= 5 tz 8))) (svref (if dst *daylight-table* *timezone-table*) tz) (multiple-value-bind (rest seconds) (truncate (* tz 60 60) 60) (multiple-value-bind (hours minutes) (truncate rest 60) (format nil "[~C~D~@[~*:~2,'0D~@[~*:~2,'0D~]~]]" (if (minusp tz) #\- #\+) (abs hours) (not (and (zerop minutes) (zerop seconds))) (abs minutes) (not (zerop seconds)) (abs seconds)))))) ;;;CMU CL made the default style :SHORT here. I've changed that to :LONG, on ;;; the theory that since the 8/7/1999 style is hard to decode unambiguously, ;;; you should have to ask for it explicitly. (I prefer YYYYMMDD myself, since ;;; it sorts properly.:-) -- WHN 19990831 ;;; ;;; FIXME: On the CMU CL mailing list 30 Jan 2000, PI:NAME:<NAME>END_PI suggested ;;; OTOH it probably wouldn't be a major problem to change compile-file to ;;; use for example :long, so that the output would be Month DD, YYYY, or ;;; even better to extend format-universal-time with a flag to output ISO ;;; 8601 formats (like e.g. :iso-8601 and :iso-8601-short) and migrate ;;; slowly towards ISO dates in the user code... ;;; The :ISO-8601 and :ISO-8601-SHORT options sound sensible to me. Maybe ;;; someone will do them for CMU CL and we can steal them for SBCL. (defun format-universal-time (destination universal-time &key (timezone nil) (style :long) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "Format-Universal-Time formats a string containing the time and date given by universal-time in a common manner. The destination is any destination which can be accepted by the Format function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), :ABBREVIATED (like :LONG but words are abbreviated), or :GOVERNMENT (of the form \"XX Month XXXX XX:XX:XX\") The &KEY argument :DATE-FIRST, if NIL, will print the time first instead of the date (the default). The PRINT- keywords, if NIL, inhibit the printing of the obvious part of the time/date." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (integerp universal-time) (error "~A: Universal-Time should be an integer." universal-time)) (when timezone (unless (and (rationalp timezone) (<= -24 timezone 24)) (error "~A: Timezone should be a rational between -24 and 24." timezone)) (unless (zerop (rem timezone 1/3600)) (error "~A: Timezone is not a second (1/3600) multiple." timezone))) (multiple-value-bind (secs mins hours day month year dow dst tz) (if timezone (decode-universal-time universal-time timezone) (decode-universal-time universal-time)) (declare (fixnum secs mins hours day month year dow)) (let ((time-string "~2,'0D:~2,'0D") (date-string (case style (:short "~D/~D/~D") ;; MM/DD/Y ((:abbreviated :long) "~A ~D, ~D") ;; Month DD, Y (:government "~2,'0D ~:@(~A~) ~D") ;; DD MON Y (t (error "~A: Unrecognized :style keyword value." style)))) (time-args (list mins (max (mod hours 12) (1+ (mod (1- hours) 12))))) (date-args (case style (:short (list month day year)) (:abbreviated (list (svref *abbrev-month-table* (1- month)) day year)) (:long (list (svref *long-month-table* (1- month)) day year)) (:government (list day (svref *abbrev-month-table* (1- month)) year))))) (declare (simple-string time-string date-string)) (when print-weekday (push (case style ((:short :long) (svref *long-weekday-table* dow)) (:abbreviated (svref *abbrev-weekday-table* dow)) (:government (svref *abbrev-weekday-table* dow))) date-args) (setq date-string (concatenate 'simple-string "~A, " date-string))) (when (or print-seconds (eq style :government)) (push secs time-args) (setq time-string (concatenate 'simple-string time-string ":~2,'0D"))) (when print-meridian (push (signum (floor hours 12)) time-args) (setq time-string (concatenate 'simple-string time-string " ~[AM~;PM~]"))) (apply #'format destination (if date-first (concatenate 'simple-string date-string " " time-string (if print-timezone " ~A")) (concatenate 'simple-string time-string " " date-string (if print-timezone " ~A"))) (if date-first (nconc date-args (nreverse time-args) (if print-timezone (list (timezone-name dst tz)))) (nconc (nreverse time-args) date-args (if print-timezone (list (timezone-name dst tz))))))))) (defun format-decoded-time (destination seconds minutes hours day month year &key (timezone nil) (style :short) (date-first t) (print-seconds t) (print-meridian t) (print-timezone t) (print-weekday t)) "FORMAT-DECODED-TIME formats a string containing decoded time expressed in a humanly-readable manner. The destination is any destination which can be accepted by the FORMAT function. The timezone keyword is an integer specifying hours west of Greenwich. The style keyword can be :SHORT (numeric date), :LONG (months and weekdays expressed as words), or :ABBREVIATED (like :LONG but words are abbreviated). The keyword DATE-FIRST, if NIL, will cause the time to be printed first instead of the date (the default). The PRINT- keywords, if nil, inhibit the printing of certain semi-obvious parts of the string." (unless (valid-destination-p destination) (error "~A: Not a valid format destination." destination)) (unless (and (integerp seconds) (<= 0 seconds 59)) (error "~A: Seconds should be an integer between 0 and 59." seconds)) (unless (and (integerp minutes) (<= 0 minutes 59)) (error "~A: Minutes should be an integer between 0 and 59." minutes)) (unless (and (integerp hours) (<= 0 hours 23)) (error "~A: Hours should be an integer between 0 and 23." hours)) (unless (and (integerp day) (<= 1 day 31)) (error "~A: Day should be an integer between 1 and 31." day)) (unless (and (integerp month) (<= 1 month 12)) (error "~A: Month should be an integer between 1 and 12." month)) (unless (and (integerp year) (plusp year)) (error "~A: Hours should be an non-negative integer." year)) (when timezone (unless (and (integerp timezone) (<= 0 timezone 32)) (error "~A: Timezone should be an integer between 0 and 32." timezone))) (format-universal-time destination (encode-universal-time seconds minutes hours day month year) :timezone timezone :style style :date-first date-first :print-seconds print-seconds :print-meridian print-meridian :print-timezone print-timezone :print-weekday print-weekday)) (defun format-date-range (start-year start-month start-day end-year end-month end-day) (let ((start-month (and start-month (or (not end-month) (not end-day) (/= start-month end-month) (/= start-year end-year)) (aref *long-month-table* start-month))) (start-year (and (or (/= start-year end-year) (not start-month)) start-year))) (format nil "~@[~a~]~@[ ~a~]~:[~; ~]~@[~a~]~:[-~; - ~]~@[~a ~]~@[~a ~]~a" start-day start-month (and start-month start-year) ; space start-year start-month ; space around - end-day (and end-month (aref *long-month-table* end-month)) end-year))) ;; (format-date-range 2007 8 01 2012 3 14) ;; "1 September 2007 - 14 April 2012"
[ { "context": "or sampling from Bernoulli processes.\"\n :author \"Paul Khuong\"\n :components\n ((:file \"csm\")))\n", "end": 270, "score": 0.9998876452445984, "start": 259, "tag": "NAME", "value": "Paul Khuong" } ]
confidence-sequence-method.asd
pkhuong/csm
4
(asdf:defsystem #:confidence-sequence-method :version "0.0.1" :licence "3-clause BSD" :license "3-clause BSD" :description "CSM implements the confidence sequence method, a dynamic stopping criterion for sampling from Bernoulli processes." :author "Paul Khuong" :components ((:file "csm")))
82045
(asdf:defsystem #:confidence-sequence-method :version "0.0.1" :licence "3-clause BSD" :license "3-clause BSD" :description "CSM implements the confidence sequence method, a dynamic stopping criterion for sampling from Bernoulli processes." :author "<NAME>" :components ((:file "csm")))
true
(asdf:defsystem #:confidence-sequence-method :version "0.0.1" :licence "3-clause BSD" :license "3-clause BSD" :description "CSM implements the confidence sequence method, a dynamic stopping criterion for sampling from Bernoulli processes." :author "PI:NAME:<NAME>END_PI" :components ((:file "csm")))
[ { "context": "*************************\n;;; Copyright (c) 92, 93 Hallvard Traetteberg. All rights reserved.\n;;; Use and copying of thi", "end": 120, "score": 0.9998787045478821, "start": 100, "tag": "NAME", "value": "Hallvard Traetteberg" }, { "context": "reports are welcome. Please\n;;; address email to: [email protected]\n;;; *********************************************", "end": 559, "score": 0.9998936653137207, "start": 527, "tag": "EMAIL", "value": "[email protected]" } ]
package.lisp
earl-ducaine/clim-ed
4
;;; ********************************************************************** ;;; Copyright (c) 92, 93 Hallvard Traetteberg. All rights reserved. ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted and may be copied as long as ;;; no fees or compensation are charged for use, copying, or accessing ;;; this software and all copies of this software include this copyright ;;; notice. Suggestions, comments and bug reports are welcome. Please ;;; address email to: [email protected] ;;; ********************************************************************** (defpackage :haled (:nicknames :ed) (:use :clim :common-lisp) (:export "EDLIN" "EDLIN-STR" "EDLIN-MODIFIED-AT" "EDLIN-CONSTRUCTOR" "MAKE-MARKER" "MARKER-LINE" "MARKER-COL" "MARKER-VALUES" "MARKER-=" "MARKER-<=" "MARKER-<" "HALED" "ED-MODIFIED-LINES" "ED-LINES" "ED-LINE" "MAKE-STRING-FROM-ED" "MAKE-MARKERS" "MARKERS-MARKER" "MAP-INTO-MARKERS" "ED-MARKERS" "DEFINE-ED-MARKER" "ED-MARKER" "ED-POINT" "ED-MARK" "ED-REPLACED-MARKERS" "ED-READ-ONLY-MARKERS" "ED-STREAM-MARKERS" "INITIAL-MARKER" "ALLOCATE-ED-MARKER" "DEALLOCATE-ED-MARKER" "FORWARD-LINE" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "FOLLOWING-CHAR" "PRECEDING-CHAR" "MAKE-REGION" "REGION-FROM" "REGION-TO" "MARKER-IN-REGION-P" "MARK-REGION-AS-READ-ONLY" "UNMARK-READ-ONLY-REGION" "ED-ERROR" "ED-READ-ONLY-ERROR" "ED-COMMAND-ERROR" "UNKNOWN-ED-COMMAND" "ILLEGAL-ED-COMMAND" "REGION-STRING" "ED-TEXT-AS-STRING" "ED-VALID-FUN" "MARK-AS-MODIFIED" "INSERT" "REPLACE-REGION" "UNDO-REPLACE" "TABULATE" "MOTION-REGION-FUNCALL" "MOTION-DELETE" "MOTION-REPLACE" "*HALED-COMMAND-ALIST*" "INSTALL-ED-COMMAND" "DUPLICATE-ED-COMMAND" "DEFINE-ED-COMMAND" "DEFINE-ED-COMMAND-DUPLICATES" "DEFINE-ED-MOTION" "DEFINE-ED-MOVER" "DEFINE-ED-CHANGER" "ED-COMMAND-LOOKUP" "ED-COMMAND" "PREVIOUS-LINE" "NEXT-LINE" "BACKWARD-CHAR" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "SEARCH-BACKWARD" "SEARCH-FORWARD" "REPLACE-REGION" "TRANSFORM-REGION" "DELETE-REGION" "DELETE-CHAR" "DELETE-CHAR-BACKWARD" "DELETE-TO-BEGINNING" "DELETE-TO-END" "SWAP-POINT-MARK" "SET-MARK" "UNSET-MARK" "YANK" "UNDO" "KNAY" "UNDO-REPLACE" "UNKNOWN-HALED-COMMAND" "ILLEGAL-HALED-COMMAND" "HALED-READ-ONLY-ERROR" "HALED-MARK-NOT-SET-ERROR" "IGNORE-HALED-COMMAND-ERROR-RESTART" "USE-POINT-INSTEAD-OF-MARK-RESTART" ) ) (defpackage :halwed (:nicknames :wed) (:use :common-lisp :haled) (:export "HALWED" "WED-WIN" "LINE-LENGTH" "LAYOUT-WED" "UPDATE-WED-LAYOUT" "REFRESH-WED" "POSITION-MARKER" "POSITION-SET-MARKER" "WED-COMMAND" "REFRESH" "LAYOUT" ) ) (defpackage :haled-stream (:nicknames "EDS") (:use "COMMON-LISP") (:export "HALED-STREAM" "HALED-INPUT-STREAM" "HALED-OUTPUT-STREAM" "ED-STREAM-ED" )) (defpackage :halwed-stream (:nicknames "WEDS") (:use "COMMON-LISP" "HALED-STREAM") (:export "HALWED-STREAM" "HALWED-INPUT-STREAM" "HALWED-OUTPUT-STREAM" )) (defpackage :halwed-frame (:nicknames "WEDF") (:use :clim :common-lisp :halwed :halwed-stream) (:export "TEXT-EDITOR-COMTAB" "LISP-EDITOR-COMTAB" "WED-FRAME" "WED-TOOL" "*HALWED-TOOL-COMMAND-ALIST*" "ACTIVATE-WED-FRAME" "ACTIVATE-WED-FRAME-WITH-INIT-FUN" "ACTIVATE-WED-FRAME-WITH-STREAM-FUN" "ACTIVATE-WED-WITH-PRINT-FUN" )) (defvar clim::+BACKGROUND+ nil) (export 'clim::+BACKGROUND+ :clim)
31266
;;; ********************************************************************** ;;; Copyright (c) 92, 93 <NAME>. All rights reserved. ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted and may be copied as long as ;;; no fees or compensation are charged for use, copying, or accessing ;;; this software and all copies of this software include this copyright ;;; notice. Suggestions, comments and bug reports are welcome. Please ;;; address email to: <EMAIL> ;;; ********************************************************************** (defpackage :haled (:nicknames :ed) (:use :clim :common-lisp) (:export "EDLIN" "EDLIN-STR" "EDLIN-MODIFIED-AT" "EDLIN-CONSTRUCTOR" "MAKE-MARKER" "MARKER-LINE" "MARKER-COL" "MARKER-VALUES" "MARKER-=" "MARKER-<=" "MARKER-<" "HALED" "ED-MODIFIED-LINES" "ED-LINES" "ED-LINE" "MAKE-STRING-FROM-ED" "MAKE-MARKERS" "MARKERS-MARKER" "MAP-INTO-MARKERS" "ED-MARKERS" "DEFINE-ED-MARKER" "ED-MARKER" "ED-POINT" "ED-MARK" "ED-REPLACED-MARKERS" "ED-READ-ONLY-MARKERS" "ED-STREAM-MARKERS" "INITIAL-MARKER" "ALLOCATE-ED-MARKER" "DEALLOCATE-ED-MARKER" "FORWARD-LINE" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "FOLLOWING-CHAR" "PRECEDING-CHAR" "MAKE-REGION" "REGION-FROM" "REGION-TO" "MARKER-IN-REGION-P" "MARK-REGION-AS-READ-ONLY" "UNMARK-READ-ONLY-REGION" "ED-ERROR" "ED-READ-ONLY-ERROR" "ED-COMMAND-ERROR" "UNKNOWN-ED-COMMAND" "ILLEGAL-ED-COMMAND" "REGION-STRING" "ED-TEXT-AS-STRING" "ED-VALID-FUN" "MARK-AS-MODIFIED" "INSERT" "REPLACE-REGION" "UNDO-REPLACE" "TABULATE" "MOTION-REGION-FUNCALL" "MOTION-DELETE" "MOTION-REPLACE" "*HALED-COMMAND-ALIST*" "INSTALL-ED-COMMAND" "DUPLICATE-ED-COMMAND" "DEFINE-ED-COMMAND" "DEFINE-ED-COMMAND-DUPLICATES" "DEFINE-ED-MOTION" "DEFINE-ED-MOVER" "DEFINE-ED-CHANGER" "ED-COMMAND-LOOKUP" "ED-COMMAND" "PREVIOUS-LINE" "NEXT-LINE" "BACKWARD-CHAR" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "SEARCH-BACKWARD" "SEARCH-FORWARD" "REPLACE-REGION" "TRANSFORM-REGION" "DELETE-REGION" "DELETE-CHAR" "DELETE-CHAR-BACKWARD" "DELETE-TO-BEGINNING" "DELETE-TO-END" "SWAP-POINT-MARK" "SET-MARK" "UNSET-MARK" "YANK" "UNDO" "KNAY" "UNDO-REPLACE" "UNKNOWN-HALED-COMMAND" "ILLEGAL-HALED-COMMAND" "HALED-READ-ONLY-ERROR" "HALED-MARK-NOT-SET-ERROR" "IGNORE-HALED-COMMAND-ERROR-RESTART" "USE-POINT-INSTEAD-OF-MARK-RESTART" ) ) (defpackage :halwed (:nicknames :wed) (:use :common-lisp :haled) (:export "HALWED" "WED-WIN" "LINE-LENGTH" "LAYOUT-WED" "UPDATE-WED-LAYOUT" "REFRESH-WED" "POSITION-MARKER" "POSITION-SET-MARKER" "WED-COMMAND" "REFRESH" "LAYOUT" ) ) (defpackage :haled-stream (:nicknames "EDS") (:use "COMMON-LISP") (:export "HALED-STREAM" "HALED-INPUT-STREAM" "HALED-OUTPUT-STREAM" "ED-STREAM-ED" )) (defpackage :halwed-stream (:nicknames "WEDS") (:use "COMMON-LISP" "HALED-STREAM") (:export "HALWED-STREAM" "HALWED-INPUT-STREAM" "HALWED-OUTPUT-STREAM" )) (defpackage :halwed-frame (:nicknames "WEDF") (:use :clim :common-lisp :halwed :halwed-stream) (:export "TEXT-EDITOR-COMTAB" "LISP-EDITOR-COMTAB" "WED-FRAME" "WED-TOOL" "*HALWED-TOOL-COMMAND-ALIST*" "ACTIVATE-WED-FRAME" "ACTIVATE-WED-FRAME-WITH-INIT-FUN" "ACTIVATE-WED-FRAME-WITH-STREAM-FUN" "ACTIVATE-WED-WITH-PRINT-FUN" )) (defvar clim::+BACKGROUND+ nil) (export 'clim::+BACKGROUND+ :clim)
true
;;; ********************************************************************** ;;; Copyright (c) 92, 93 PI:NAME:<NAME>END_PI. All rights reserved. ;;; Use and copying of this software and preparation of derivative works ;;; based upon this software are permitted and may be copied as long as ;;; no fees or compensation are charged for use, copying, or accessing ;;; this software and all copies of this software include this copyright ;;; notice. Suggestions, comments and bug reports are welcome. Please ;;; address email to: PI:EMAIL:<EMAIL>END_PI ;;; ********************************************************************** (defpackage :haled (:nicknames :ed) (:use :clim :common-lisp) (:export "EDLIN" "EDLIN-STR" "EDLIN-MODIFIED-AT" "EDLIN-CONSTRUCTOR" "MAKE-MARKER" "MARKER-LINE" "MARKER-COL" "MARKER-VALUES" "MARKER-=" "MARKER-<=" "MARKER-<" "HALED" "ED-MODIFIED-LINES" "ED-LINES" "ED-LINE" "MAKE-STRING-FROM-ED" "MAKE-MARKERS" "MARKERS-MARKER" "MAP-INTO-MARKERS" "ED-MARKERS" "DEFINE-ED-MARKER" "ED-MARKER" "ED-POINT" "ED-MARK" "ED-REPLACED-MARKERS" "ED-READ-ONLY-MARKERS" "ED-STREAM-MARKERS" "INITIAL-MARKER" "ALLOCATE-ED-MARKER" "DEALLOCATE-ED-MARKER" "FORWARD-LINE" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "FOLLOWING-CHAR" "PRECEDING-CHAR" "MAKE-REGION" "REGION-FROM" "REGION-TO" "MARKER-IN-REGION-P" "MARK-REGION-AS-READ-ONLY" "UNMARK-READ-ONLY-REGION" "ED-ERROR" "ED-READ-ONLY-ERROR" "ED-COMMAND-ERROR" "UNKNOWN-ED-COMMAND" "ILLEGAL-ED-COMMAND" "REGION-STRING" "ED-TEXT-AS-STRING" "ED-VALID-FUN" "MARK-AS-MODIFIED" "INSERT" "REPLACE-REGION" "UNDO-REPLACE" "TABULATE" "MOTION-REGION-FUNCALL" "MOTION-DELETE" "MOTION-REPLACE" "*HALED-COMMAND-ALIST*" "INSTALL-ED-COMMAND" "DUPLICATE-ED-COMMAND" "DEFINE-ED-COMMAND" "DEFINE-ED-COMMAND-DUPLICATES" "DEFINE-ED-MOTION" "DEFINE-ED-MOVER" "DEFINE-ED-CHANGER" "ED-COMMAND-LOOKUP" "ED-COMMAND" "PREVIOUS-LINE" "NEXT-LINE" "BACKWARD-CHAR" "FORWARD-CHAR" "BEGINNING-OF-LINE" "END-OF-LINE" "BEGINNING-OF-TEXT" "END-OF-TEXT" "SEARCH-BACKWARD" "SEARCH-FORWARD" "REPLACE-REGION" "TRANSFORM-REGION" "DELETE-REGION" "DELETE-CHAR" "DELETE-CHAR-BACKWARD" "DELETE-TO-BEGINNING" "DELETE-TO-END" "SWAP-POINT-MARK" "SET-MARK" "UNSET-MARK" "YANK" "UNDO" "KNAY" "UNDO-REPLACE" "UNKNOWN-HALED-COMMAND" "ILLEGAL-HALED-COMMAND" "HALED-READ-ONLY-ERROR" "HALED-MARK-NOT-SET-ERROR" "IGNORE-HALED-COMMAND-ERROR-RESTART" "USE-POINT-INSTEAD-OF-MARK-RESTART" ) ) (defpackage :halwed (:nicknames :wed) (:use :common-lisp :haled) (:export "HALWED" "WED-WIN" "LINE-LENGTH" "LAYOUT-WED" "UPDATE-WED-LAYOUT" "REFRESH-WED" "POSITION-MARKER" "POSITION-SET-MARKER" "WED-COMMAND" "REFRESH" "LAYOUT" ) ) (defpackage :haled-stream (:nicknames "EDS") (:use "COMMON-LISP") (:export "HALED-STREAM" "HALED-INPUT-STREAM" "HALED-OUTPUT-STREAM" "ED-STREAM-ED" )) (defpackage :halwed-stream (:nicknames "WEDS") (:use "COMMON-LISP" "HALED-STREAM") (:export "HALWED-STREAM" "HALWED-INPUT-STREAM" "HALWED-OUTPUT-STREAM" )) (defpackage :halwed-frame (:nicknames "WEDF") (:use :clim :common-lisp :halwed :halwed-stream) (:export "TEXT-EDITOR-COMTAB" "LISP-EDITOR-COMTAB" "WED-FRAME" "WED-TOOL" "*HALWED-TOOL-COMMAND-ALIST*" "ACTIVATE-WED-FRAME" "ACTIVATE-WED-FRAME-WITH-INIT-FUN" "ACTIVATE-WED-FRAME-WITH-STREAM-FUN" "ACTIVATE-WED-WITH-PRINT-FUN" )) (defvar clim::+BACKGROUND+ nil) (export 'clim::+BACKGROUND+ :clim)
[ { "context": "rth in Lisp\"\n :version \"1.0\"\n :author \"D.McClain <[email protected]>\"\n :license \"Copyright (c", "end": 116, "score": 0.9998693466186523, "start": 107, "tag": "NAME", "value": "D.McClain" }, { "context": "\"\n :version \"1.0\"\n :author \"D.McClain <[email protected]>\"\n :license \"Copyright (c) 2011-2012 by Acud", "end": 135, "score": 0.9999298453330994, "start": 118, "tag": "EMAIL", "value": "[email protected]" } ]
forthrpl.asd
dbmcclain/LispRPL
1
(asdf:defsystem "forthrpl" :description "forth: ITC Forth in Lisp" :version "1.0" :author "D.McClain <[email protected]>" :license "Copyright (c) 2011-2012 by Acudora, Inc. All rights reserved." :components ((:file "package") (:file "forth-itc-rpl-clos-lispcode") (:file "forth-itc-rpl-clos-forthcode")) :serial t :depends-on ("useful-macros" "data-objects"))
41598
(asdf:defsystem "forthrpl" :description "forth: ITC Forth in Lisp" :version "1.0" :author "<NAME> <<EMAIL>>" :license "Copyright (c) 2011-2012 by Acudora, Inc. All rights reserved." :components ((:file "package") (:file "forth-itc-rpl-clos-lispcode") (:file "forth-itc-rpl-clos-forthcode")) :serial t :depends-on ("useful-macros" "data-objects"))
true
(asdf:defsystem "forthrpl" :description "forth: ITC Forth in Lisp" :version "1.0" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "Copyright (c) 2011-2012 by Acudora, Inc. All rights reserved." :components ((:file "package") (:file "forth-itc-rpl-clos-lispcode") (:file "forth-itc-rpl-clos-forthcode")) :serial t :depends-on ("useful-macros" "data-objects"))
[ { "context": " DEALINGS IN THE SOFTWARE.\n;\n; Original authors: Sol Swords <[email protected]>\n; Jared ", "end": 1420, "score": 0.9998741149902344, "start": 1410, "tag": "NAME", "value": "Sol Swords" }, { "context": "N THE SOFTWARE.\n;\n; Original authors: Sol Swords <[email protected]>\n; Jared Davis <jared@centtech.", "end": 1442, "score": 0.9999353289604187, "start": 1422, "tag": "EMAIL", "value": "[email protected]" }, { "context": " Swords <[email protected]>\n; Jared Davis <[email protected]>\n\n(in-package \"SV\")\n\n(include", "end": 1475, "score": 0.9998699426651001, "start": 1464, "tag": "NAME", "value": "Jared Davis" }, { "context": "[email protected]>\n; Jared Davis <[email protected]>\n\n(in-package \"SV\")\n\n(include-book \"process\")\n(in", "end": 1495, "score": 0.9999352097511292, "start": 1477, "tag": "EMAIL", "value": "[email protected]" } ]
books/centaur/sv/svtv/debug.lisp
nzt/acl2
1
; SV - Symbolic Vector Hardware Analysis Framework ; Copyright (C) 2014-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original authors: Sol Swords <[email protected]> ; Jared Davis <[email protected]> (in-package "SV") (include-book "process") (include-book "fsm") (include-book "vcd") (include-book "oslib/date" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (include-book "std/io/base" :dir :system)) (local (include-book "std/lists/top" :dir :system)) (local (in-theory (disable nth update-nth acl2::nth-when-zp))) (local (std::add-default-post-define-hook :fix)) (local (in-theory (disable pick-a-point-subset-strategy))) (defxdoc debug.lisp :parents (svtv-debug)) (local (xdoc::set-default-parents debug.lisp)) (define svtv-debug-lhs-eval ((x lhs-p) (bound natp) (wirevals svex-env-p) (vcd-vals)) :guard (< bound (4vecs-length vcd-vals)) :verify-guards nil :measure (len x) :returns (xval 4vec-p) (b* (((mv xf xr) (lhs-decomp x)) ((unless xf) (4vec-z)) ((lhrange xf) xf) (rest (svtv-debug-lhs-eval xr bound wirevals vcd-vals)) ((when (eq (lhatom-kind xf.atom) :z)) (4vec-concat (2vec xf.w) (4vec-z) rest)) ((lhatom-var xf) xf.atom) (idx (and (svar-indexedp xf.name) (svar-index xf.name))) (val (if (and idx (< idx (lnfix bound))) (get-4vec idx vcd-vals) (svex-env-fastlookup xf.name wirevals)))) (4vec-concat (2vec xf.w) (4vec-rsh (2vec xf.rsh) val) rest)) /// (verify-guards svtv-debug-lhs-eval)) (define svtv-debug-eval-aliases ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) ;; Evaluates each of the LHSes in aliases in terms of wirevals, storing the ;; 4vec results in vcd-vals. We count up from 0, so as a shortcut, for each ;; wire that is aliased to an earlier one, we look up the stored value in ;; vcd-vals instead. This saves hash lookups. Svtv-debug-eval-aliases-track ;; is the same, but keeps track of which indices changed values. :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (nfix (- (aliass-length aliases) (nfix n))) :returns (vcd-vals1) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) vcd-vals) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (vcd-vals (set-4vec n val vcd-vals))) (svtv-debug-eval-aliases (1+ (lnfix n)) aliases wirevals vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases (<= (len vcd-vals) (len (svtv-debug-eval-aliases n aliases wirevals vcd-vals))) :rule-classes :linear)) (define svtv-debug-eval-aliases-track ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv (changes nat-listp) (vcd-vals1)) :measure (nfix (- (aliass-length aliases) (nfix n))) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) (mv nil vcd-vals)) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (prev-val (get-4vec n vcd-vals)) (vcd-vals (set-4vec n val vcd-vals)) ((mv rest-changes vcd-vals) (svtv-debug-eval-aliases-track (1+ (lnfix n)) aliases wirevals vcd-vals))) (mv (if (equal prev-val val) rest-changes (cons (lnfix n) rest-changes)) vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases-track (<= (len vcd-vals) (len (mv-nth 1 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals)))) :rule-classes :linear) (defthm nat-list-max-of-svtv-debug-eval-aliases-track (implies (consp (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (< (nat-list-max (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (len aliases))) :hints(("Goal" :in-theory (enable nat-list-max))) :rule-classes :linear)) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) a :hints(("Goal" :in-theory (enable svex-env-fix)))) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) b :hints(("Goal" :in-theory (enable svex-env-fix append)))) #|| (trace$ #!sv (svtv-debug-writephases :entry (list 'svtv-debug-writephases phase nphases inalist ins) :exit (list 'svtv-debug-writephases))) ||# (define svtv-debug-writephases ((phase natp) (nphases natp) (offset natp) (inalist svex-env-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-state svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= phase nphases) (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv vcd-vals1 (p1 vl-printedlist-p) (final-state svex-env-p)) :measure (nfix (- (nfix nphases) (nfix phase))) (b* (((when (mbe :logic (zp (- (nfix nphases) (nfix phase))) :exec (eql nphases phase))) (mv vcd-vals (vl::vl-printedlist-fix p) (svex-env-fix prev-state))) (in-vals (svex-alist-eval (svtv-phase-inputs phase ins ovlines invars) inalist)) (- (clear-memoize-table 'svex-eval)) (eval-alist (append in-vals prev-state)) ((mv wirevals next-state) (with-fast-alist eval-alist (mv (svex-alist-eval updates eval-alist) (svex-alist-eval next-states eval-alist)))) (all-wirevals (append in-vals wirevals)) (full-phase (+ (lnfix phase) (lnfix offset))) ((mv changes vcd-vals) (with-fast-alist all-wirevals ;; evaluate aliases and stick values in vcd-vals, ;; tracking changes if phase > 0 (if (zp full-phase) (let* ((vcd-vals (svtv-debug-eval-aliases 0 aliases all-wirevals vcd-vals))) (mv nil vcd-vals)) (svtv-debug-eval-aliases-track 0 aliases all-wirevals vcd-vals)))) ;; print out changed vals (or all if phase = 0) (p (if (zp full-phase) (vcd-dump-first-snapshot vcd-vals vcd-wiremap p) (vcd-dump-delta (* 10 full-phase) changes vcd-vals vcd-wiremap p)))) (svtv-debug-writephases (1+ (lnfix phase)) nphases offset inalist ins ovlines next-state updates next-states invars aliases vcd-wiremap vcd-vals p)) /// (defret len-of-svtv-debug-writephases-vcd-vals (<= (len vcd-vals) (len vcd-vals1)) :rule-classes :linear)) (define svtv-debug-fsm-writephases ((cycle natp) (nphases-per-cycle natp) (inalists svex-envlist-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-st svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (len inalists) :returns (mv vcd-vals1 (p1 vl-printedlist-p)) (b* ((cycle (lnfix cycle)) (nphases-per-cycle (lnfix nphases-per-cycle)) (phase (* cycle nphases-per-cycle)) ((when (atom inalists)) ;; just print the new time. (mv vcd-vals (vcd-dump-delta (* 10 (lnfix phase)) nil vcd-vals vcd-wiremap p))) (inalist (car inalists)) ((with-fast inalist)) ((mv vcd-vals p next-st) (svtv-debug-writephases 0 nphases-per-cycle phase inalist ins ovlines prev-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (svtv-debug-fsm-writephases (1+ cycle) nphases-per-cycle (cdr inalists) ins ovlines next-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (defthm true-list-listp-of-append (implies (and (true-list-listp a) (true-list-listp b)) (true-list-listp (append a b))) :hints(("Goal" :in-theory (enable true-list-listp)))) (defthm svex-env-p-of-pairlis$ (implies (and (svarlist-p x) (4veclist-p y) (equal (len x) (len y))) (svex-env-p (pairlis$ x y))) :hints(("Goal" :in-theory (enable svex-env-p svarlist-p 4veclist-p pairlis$)))) (defenum debugdata-status-p (:empty :initialized :composed)) (local (defun debugdata-renaming (field-names) (b* (((when (atom field-names)) nil) (field (car field-names)) (new-field (intern$ (cat "DEBUGDATA->" (symbol-name field)) "SV")) (update (intern$ (cat "UPDATE-" (symbol-name field)) "SV")) (new-update (intern$ (cat "SET-DEBUGDATA->" (symbol-name field)) "SV"))) (cons (list field new-field) (cons (list update new-update) (debugdata-renaming (cdr field-names))))))) (make-event (b* ((fields `((design :type (satisfies design-p) :initially ,(make-design :top "")) (modidx :type (integer 0 *) :initially 0) (assigns :type (satisfies svex-alist-p) :initially nil) (delays :type (satisfies svar-map-p) :initially nil) (updates :type (satisfies svex-alist-p) :initially nil) (nextstates :type (satisfies svex-alist-p) :initially nil) (svtv :type (satisfies svtv-p) :initially ,(make-svtv :nphases 0)) (nphases :type (integer 0 *) :initially 0) (ins :type (satisfies svtv-lines-p) :initially nil) (outs :type (satisfies svtv-lines-p) :initially nil) (overrides :type (satisfies svtv-lines-p) :initially nil) (override-assigns :type (satisfies svex-alist-p) :initially nil) (status :type (satisfies debugdata-status-p) :initially :empty))) (field-names (strip-cars fields)) (renaming (debugdata-renaming field-names)) ;; (fns (append '(debugdatap create-debugdata) ;; (acl2::strip-cadrs renaming))) (make-binder (std::da-make-binder 'debugdata field-names))) `(progn (defstobj debugdata ,@fields :renaming ,renaming) (in-theory (disable create-debugdata debugdatap)) ,make-binder))) ;; This is much faster in logic mode (even with the svarlist-addr-p guard ;; check) than program mode, where presumably invariant-risk is killing us. (define svtv-debug-init ((design design-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata)) :guard (svarlist-addr-p (modalist-vars (design->modalist design))) :returns (mv err moddb-out aliases-out debugdata-out) :short "Prepares an SV design for SVTV debugging, to the extent possible without specifying an SVTV." :long "<p>This does the initial compilation of the design, creating the moddb, aliases table, and local wire assignments and delays. See @(see svtv-debug-set-svtv) for the next step, which composes the signals into their nextstate and update functions given a timing diagram.</p> <p>Technical: Erases and recreates the moddb, aliases, and debugdata stobjs.</p>" (b* ((design (design-fix design)) ;; Make a moddb, canonical alias table, and flattened, alias-normalized ;; assignments from the design. :Indexedp nil leaves wires expressed in ;; terms of paths rather than absolute moddb indices. ((mv err assigns delays ?constraints moddb aliases) (svex-design-flatten-and-normalize design :indexedp nil)) ((when err) (raise "~@0~%" err) (mv err moddb aliases debugdata)) ;; get the index of the top-level module within the moddb (modidx (moddb-modname-get-index (design->top design) moddb)) (debugdata (set-debugdata->design design debugdata)) (debugdata (set-debugdata->modidx modidx debugdata)) (debugdata (set-debugdata->assigns assigns debugdata)) (debugdata (set-debugdata->delays delays debugdata)) (debugdata (set-debugdata->updates nil debugdata)) ;; not available yet (debugdata (set-debugdata->nextstates nil debugdata)) (debugdata (set-debugdata->status :initialized debugdata))) (mv nil moddb aliases debugdata)) /// (defret svtv-debug-init-moddb-ok (and (moddb-mods-ok moddb-out) (moddb-basics-ok moddb-out))) (defret svtv-debug-init-modidx-ok (implies (not err) (< (nth *debugdata->modidx* debugdata-out) (nfix (nth *moddb->nmods1* moddb-out))))) (defret svtv-debug-init-totalwires-ok (implies (not err) (<= (moddb-mod-totalwires (nth *debugdata->modidx* debugdata-out) moddb-out) (len aliases-out))))) (define svtv-debug-set-ios-logic (&key ((ins true-list-listp) 'nil) ((outs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (b* (((debugdata debugdata)) ((when (eq debugdata.status :empty)) (raise "Error: Need to do SVTV-DEBUG-INIT before SVTV-DEBUG-SET-IOS~%") debugdata) ;; Process the timing diagram into internal form (outs (append outs internals)) ;; really only doing the outs in case (likely) they contain more phases ;; than ins/overrides, for nphases computation ((mv err ins) (svtv-wires->lhses ins debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving inputs: ~@0" err) debugdata) ((mv err overrides) (svtv-wires->lhses overrides debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving overrides: ~@0" err) debugdata) ((mv err outs) (svtv-wires->lhses outs debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving outputs: ~@0" err) debugdata) ;; get the total number of phases to simulate and extend the ;; inputs/overrides to that length (nphases (max (svtv-max-length ins) (max (svtv-max-length overrides) (svtv-max-length outs)))) (overrides (svtv-expand-lines overrides nphases)) ((mv updates next-states override-assigns) (b* (((when (and (eq debugdata.status :composed) (equal debugdata.overrides overrides))) ;; Presumably we're just updating some inputs or outputs. We ;; don't need to compose assigns/delays again, which is an ;; expensive part of the operation. (mv debugdata.updates debugdata.nextstates nil)) ;; Each override has a unique test variable (determining if the override ;; happens in a given phase) and override value variable. This ;; generates them (as tagged indices) and records them in data ;; structures to associate the LHS for each override with its variables ;; and entries. ((mv ?ovlines ovs) (svtv-lines->overrides overrides 0)) ;; Apply the overrides to the assigns. Each wire that is overridden has ;; its gate-level assignment replaced with something like: ;; (if override-this-phase override-value original-assignment) ;; except that extra care is taken to override only the specified range. (overridden-assigns (svex-apply-overrides ovs (make-fast-alist debugdata.assigns))) ;; Note! In defsvtv-main, we need to keep the original assigns around so ;; that if an output/internal refers to an overridden variable, we can ;; get that variable's value before overriding it. At the moment we ;; don't pay attention to output variables in svtv-debug, so we don't ;; care about this. If this changes, revisit this issue. (- (fast-alist-free overridden-assigns)) ((mv updates next-states ?constraints) ;; Compose together the final (gate-level) assignments to get full ;; update formulas (in terms of PIs and current states), and compose ;; delays with these to get next states. (svex-compose-assigns/delays overridden-assigns debugdata.delays nil :rewrite rewrite))) (mv updates next-states overridden-assigns))) (debugdata (set-debugdata->updates updates debugdata)) (debugdata (set-debugdata->nextstates next-states debugdata)) (debugdata (set-debugdata->nphases nphases debugdata)) (debugdata (set-debugdata->ins ins debugdata)) (debugdata (set-debugdata->outs outs debugdata)) (debugdata (set-debugdata->overrides overrides debugdata)) (debugdata (set-debugdata->override-assigns override-assigns debugdata)) (debugdata (set-debugdata->status :composed debugdata))) debugdata) /// (defret svtv-debug-set-ios-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-set-ios (&key ((inputs true-list-listp) 'nil) ((outputs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :mode :program :hooks nil (svtv-debug-set-ios-logic :ins inputs :outs outputs :internals internals :overrides overrides :rewrite rewrite)) (define svtv-debug-set-svtv ((x svtv-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (svtv-debug-set-ios-logic :ins (svtv->orig-ins x) :outs (svtv->orig-outs x) :internals (svtv->orig-internals x) :overrides (svtv->orig-overrides x) :moddb moddb :aliases aliases :debugdata debugdata :rewrite rewrite) /// (defret svtv-debug-set-svtv-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-run-logic ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) ;; (- (acl2::sneaky-save 'debugdata.updates debugdata.updates)) ;; Compute an initial state of all Xes (states (svex-alist-keys debugdata.nextstates)) (initst (pairlis$ states (replicate (len states) (4vec-x)))) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) ((with-fast inalist)) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases (list inalist) ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-run ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :mode :program :hooks nil (svtv-debug-run-logic inalist :filename filename :moddb moddb :aliases aliases :debugdata debugdata :vcd-wiremap vcd-wiremap :vcd-vals vcd-vals)) (define svtv-debug-run-fsm ((inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) (states (svex-alist-keys debugdata.nextstates)) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases inalists ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-core ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-logic inalist :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug-fsm-core ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-fsm inalists initst :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-core x inalist :filename filename)) /// (defmacro stv-debug (&rest args) (cons 'svtv-debug args))) (define svtv-debug-fsm ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-fsm-core x inalists initst :filename filename)) /// (defmacro stv-debug-fsm (&rest args) (cons 'svtv-debug-fsm args)))
45781
; SV - Symbolic Vector Hardware Analysis Framework ; Copyright (C) 2014-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original authors: <NAME> <<EMAIL>> ; <NAME> <<EMAIL>> (in-package "SV") (include-book "process") (include-book "fsm") (include-book "vcd") (include-book "oslib/date" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (include-book "std/io/base" :dir :system)) (local (include-book "std/lists/top" :dir :system)) (local (in-theory (disable nth update-nth acl2::nth-when-zp))) (local (std::add-default-post-define-hook :fix)) (local (in-theory (disable pick-a-point-subset-strategy))) (defxdoc debug.lisp :parents (svtv-debug)) (local (xdoc::set-default-parents debug.lisp)) (define svtv-debug-lhs-eval ((x lhs-p) (bound natp) (wirevals svex-env-p) (vcd-vals)) :guard (< bound (4vecs-length vcd-vals)) :verify-guards nil :measure (len x) :returns (xval 4vec-p) (b* (((mv xf xr) (lhs-decomp x)) ((unless xf) (4vec-z)) ((lhrange xf) xf) (rest (svtv-debug-lhs-eval xr bound wirevals vcd-vals)) ((when (eq (lhatom-kind xf.atom) :z)) (4vec-concat (2vec xf.w) (4vec-z) rest)) ((lhatom-var xf) xf.atom) (idx (and (svar-indexedp xf.name) (svar-index xf.name))) (val (if (and idx (< idx (lnfix bound))) (get-4vec idx vcd-vals) (svex-env-fastlookup xf.name wirevals)))) (4vec-concat (2vec xf.w) (4vec-rsh (2vec xf.rsh) val) rest)) /// (verify-guards svtv-debug-lhs-eval)) (define svtv-debug-eval-aliases ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) ;; Evaluates each of the LHSes in aliases in terms of wirevals, storing the ;; 4vec results in vcd-vals. We count up from 0, so as a shortcut, for each ;; wire that is aliased to an earlier one, we look up the stored value in ;; vcd-vals instead. This saves hash lookups. Svtv-debug-eval-aliases-track ;; is the same, but keeps track of which indices changed values. :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (nfix (- (aliass-length aliases) (nfix n))) :returns (vcd-vals1) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) vcd-vals) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (vcd-vals (set-4vec n val vcd-vals))) (svtv-debug-eval-aliases (1+ (lnfix n)) aliases wirevals vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases (<= (len vcd-vals) (len (svtv-debug-eval-aliases n aliases wirevals vcd-vals))) :rule-classes :linear)) (define svtv-debug-eval-aliases-track ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv (changes nat-listp) (vcd-vals1)) :measure (nfix (- (aliass-length aliases) (nfix n))) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) (mv nil vcd-vals)) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (prev-val (get-4vec n vcd-vals)) (vcd-vals (set-4vec n val vcd-vals)) ((mv rest-changes vcd-vals) (svtv-debug-eval-aliases-track (1+ (lnfix n)) aliases wirevals vcd-vals))) (mv (if (equal prev-val val) rest-changes (cons (lnfix n) rest-changes)) vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases-track (<= (len vcd-vals) (len (mv-nth 1 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals)))) :rule-classes :linear) (defthm nat-list-max-of-svtv-debug-eval-aliases-track (implies (consp (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (< (nat-list-max (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (len aliases))) :hints(("Goal" :in-theory (enable nat-list-max))) :rule-classes :linear)) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) a :hints(("Goal" :in-theory (enable svex-env-fix)))) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) b :hints(("Goal" :in-theory (enable svex-env-fix append)))) #|| (trace$ #!sv (svtv-debug-writephases :entry (list 'svtv-debug-writephases phase nphases inalist ins) :exit (list 'svtv-debug-writephases))) ||# (define svtv-debug-writephases ((phase natp) (nphases natp) (offset natp) (inalist svex-env-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-state svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= phase nphases) (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv vcd-vals1 (p1 vl-printedlist-p) (final-state svex-env-p)) :measure (nfix (- (nfix nphases) (nfix phase))) (b* (((when (mbe :logic (zp (- (nfix nphases) (nfix phase))) :exec (eql nphases phase))) (mv vcd-vals (vl::vl-printedlist-fix p) (svex-env-fix prev-state))) (in-vals (svex-alist-eval (svtv-phase-inputs phase ins ovlines invars) inalist)) (- (clear-memoize-table 'svex-eval)) (eval-alist (append in-vals prev-state)) ((mv wirevals next-state) (with-fast-alist eval-alist (mv (svex-alist-eval updates eval-alist) (svex-alist-eval next-states eval-alist)))) (all-wirevals (append in-vals wirevals)) (full-phase (+ (lnfix phase) (lnfix offset))) ((mv changes vcd-vals) (with-fast-alist all-wirevals ;; evaluate aliases and stick values in vcd-vals, ;; tracking changes if phase > 0 (if (zp full-phase) (let* ((vcd-vals (svtv-debug-eval-aliases 0 aliases all-wirevals vcd-vals))) (mv nil vcd-vals)) (svtv-debug-eval-aliases-track 0 aliases all-wirevals vcd-vals)))) ;; print out changed vals (or all if phase = 0) (p (if (zp full-phase) (vcd-dump-first-snapshot vcd-vals vcd-wiremap p) (vcd-dump-delta (* 10 full-phase) changes vcd-vals vcd-wiremap p)))) (svtv-debug-writephases (1+ (lnfix phase)) nphases offset inalist ins ovlines next-state updates next-states invars aliases vcd-wiremap vcd-vals p)) /// (defret len-of-svtv-debug-writephases-vcd-vals (<= (len vcd-vals) (len vcd-vals1)) :rule-classes :linear)) (define svtv-debug-fsm-writephases ((cycle natp) (nphases-per-cycle natp) (inalists svex-envlist-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-st svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (len inalists) :returns (mv vcd-vals1 (p1 vl-printedlist-p)) (b* ((cycle (lnfix cycle)) (nphases-per-cycle (lnfix nphases-per-cycle)) (phase (* cycle nphases-per-cycle)) ((when (atom inalists)) ;; just print the new time. (mv vcd-vals (vcd-dump-delta (* 10 (lnfix phase)) nil vcd-vals vcd-wiremap p))) (inalist (car inalists)) ((with-fast inalist)) ((mv vcd-vals p next-st) (svtv-debug-writephases 0 nphases-per-cycle phase inalist ins ovlines prev-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (svtv-debug-fsm-writephases (1+ cycle) nphases-per-cycle (cdr inalists) ins ovlines next-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (defthm true-list-listp-of-append (implies (and (true-list-listp a) (true-list-listp b)) (true-list-listp (append a b))) :hints(("Goal" :in-theory (enable true-list-listp)))) (defthm svex-env-p-of-pairlis$ (implies (and (svarlist-p x) (4veclist-p y) (equal (len x) (len y))) (svex-env-p (pairlis$ x y))) :hints(("Goal" :in-theory (enable svex-env-p svarlist-p 4veclist-p pairlis$)))) (defenum debugdata-status-p (:empty :initialized :composed)) (local (defun debugdata-renaming (field-names) (b* (((when (atom field-names)) nil) (field (car field-names)) (new-field (intern$ (cat "DEBUGDATA->" (symbol-name field)) "SV")) (update (intern$ (cat "UPDATE-" (symbol-name field)) "SV")) (new-update (intern$ (cat "SET-DEBUGDATA->" (symbol-name field)) "SV"))) (cons (list field new-field) (cons (list update new-update) (debugdata-renaming (cdr field-names))))))) (make-event (b* ((fields `((design :type (satisfies design-p) :initially ,(make-design :top "")) (modidx :type (integer 0 *) :initially 0) (assigns :type (satisfies svex-alist-p) :initially nil) (delays :type (satisfies svar-map-p) :initially nil) (updates :type (satisfies svex-alist-p) :initially nil) (nextstates :type (satisfies svex-alist-p) :initially nil) (svtv :type (satisfies svtv-p) :initially ,(make-svtv :nphases 0)) (nphases :type (integer 0 *) :initially 0) (ins :type (satisfies svtv-lines-p) :initially nil) (outs :type (satisfies svtv-lines-p) :initially nil) (overrides :type (satisfies svtv-lines-p) :initially nil) (override-assigns :type (satisfies svex-alist-p) :initially nil) (status :type (satisfies debugdata-status-p) :initially :empty))) (field-names (strip-cars fields)) (renaming (debugdata-renaming field-names)) ;; (fns (append '(debugdatap create-debugdata) ;; (acl2::strip-cadrs renaming))) (make-binder (std::da-make-binder 'debugdata field-names))) `(progn (defstobj debugdata ,@fields :renaming ,renaming) (in-theory (disable create-debugdata debugdatap)) ,make-binder))) ;; This is much faster in logic mode (even with the svarlist-addr-p guard ;; check) than program mode, where presumably invariant-risk is killing us. (define svtv-debug-init ((design design-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata)) :guard (svarlist-addr-p (modalist-vars (design->modalist design))) :returns (mv err moddb-out aliases-out debugdata-out) :short "Prepares an SV design for SVTV debugging, to the extent possible without specifying an SVTV." :long "<p>This does the initial compilation of the design, creating the moddb, aliases table, and local wire assignments and delays. See @(see svtv-debug-set-svtv) for the next step, which composes the signals into their nextstate and update functions given a timing diagram.</p> <p>Technical: Erases and recreates the moddb, aliases, and debugdata stobjs.</p>" (b* ((design (design-fix design)) ;; Make a moddb, canonical alias table, and flattened, alias-normalized ;; assignments from the design. :Indexedp nil leaves wires expressed in ;; terms of paths rather than absolute moddb indices. ((mv err assigns delays ?constraints moddb aliases) (svex-design-flatten-and-normalize design :indexedp nil)) ((when err) (raise "~@0~%" err) (mv err moddb aliases debugdata)) ;; get the index of the top-level module within the moddb (modidx (moddb-modname-get-index (design->top design) moddb)) (debugdata (set-debugdata->design design debugdata)) (debugdata (set-debugdata->modidx modidx debugdata)) (debugdata (set-debugdata->assigns assigns debugdata)) (debugdata (set-debugdata->delays delays debugdata)) (debugdata (set-debugdata->updates nil debugdata)) ;; not available yet (debugdata (set-debugdata->nextstates nil debugdata)) (debugdata (set-debugdata->status :initialized debugdata))) (mv nil moddb aliases debugdata)) /// (defret svtv-debug-init-moddb-ok (and (moddb-mods-ok moddb-out) (moddb-basics-ok moddb-out))) (defret svtv-debug-init-modidx-ok (implies (not err) (< (nth *debugdata->modidx* debugdata-out) (nfix (nth *moddb->nmods1* moddb-out))))) (defret svtv-debug-init-totalwires-ok (implies (not err) (<= (moddb-mod-totalwires (nth *debugdata->modidx* debugdata-out) moddb-out) (len aliases-out))))) (define svtv-debug-set-ios-logic (&key ((ins true-list-listp) 'nil) ((outs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (b* (((debugdata debugdata)) ((when (eq debugdata.status :empty)) (raise "Error: Need to do SVTV-DEBUG-INIT before SVTV-DEBUG-SET-IOS~%") debugdata) ;; Process the timing diagram into internal form (outs (append outs internals)) ;; really only doing the outs in case (likely) they contain more phases ;; than ins/overrides, for nphases computation ((mv err ins) (svtv-wires->lhses ins debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving inputs: ~@0" err) debugdata) ((mv err overrides) (svtv-wires->lhses overrides debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving overrides: ~@0" err) debugdata) ((mv err outs) (svtv-wires->lhses outs debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving outputs: ~@0" err) debugdata) ;; get the total number of phases to simulate and extend the ;; inputs/overrides to that length (nphases (max (svtv-max-length ins) (max (svtv-max-length overrides) (svtv-max-length outs)))) (overrides (svtv-expand-lines overrides nphases)) ((mv updates next-states override-assigns) (b* (((when (and (eq debugdata.status :composed) (equal debugdata.overrides overrides))) ;; Presumably we're just updating some inputs or outputs. We ;; don't need to compose assigns/delays again, which is an ;; expensive part of the operation. (mv debugdata.updates debugdata.nextstates nil)) ;; Each override has a unique test variable (determining if the override ;; happens in a given phase) and override value variable. This ;; generates them (as tagged indices) and records them in data ;; structures to associate the LHS for each override with its variables ;; and entries. ((mv ?ovlines ovs) (svtv-lines->overrides overrides 0)) ;; Apply the overrides to the assigns. Each wire that is overridden has ;; its gate-level assignment replaced with something like: ;; (if override-this-phase override-value original-assignment) ;; except that extra care is taken to override only the specified range. (overridden-assigns (svex-apply-overrides ovs (make-fast-alist debugdata.assigns))) ;; Note! In defsvtv-main, we need to keep the original assigns around so ;; that if an output/internal refers to an overridden variable, we can ;; get that variable's value before overriding it. At the moment we ;; don't pay attention to output variables in svtv-debug, so we don't ;; care about this. If this changes, revisit this issue. (- (fast-alist-free overridden-assigns)) ((mv updates next-states ?constraints) ;; Compose together the final (gate-level) assignments to get full ;; update formulas (in terms of PIs and current states), and compose ;; delays with these to get next states. (svex-compose-assigns/delays overridden-assigns debugdata.delays nil :rewrite rewrite))) (mv updates next-states overridden-assigns))) (debugdata (set-debugdata->updates updates debugdata)) (debugdata (set-debugdata->nextstates next-states debugdata)) (debugdata (set-debugdata->nphases nphases debugdata)) (debugdata (set-debugdata->ins ins debugdata)) (debugdata (set-debugdata->outs outs debugdata)) (debugdata (set-debugdata->overrides overrides debugdata)) (debugdata (set-debugdata->override-assigns override-assigns debugdata)) (debugdata (set-debugdata->status :composed debugdata))) debugdata) /// (defret svtv-debug-set-ios-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-set-ios (&key ((inputs true-list-listp) 'nil) ((outputs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :mode :program :hooks nil (svtv-debug-set-ios-logic :ins inputs :outs outputs :internals internals :overrides overrides :rewrite rewrite)) (define svtv-debug-set-svtv ((x svtv-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (svtv-debug-set-ios-logic :ins (svtv->orig-ins x) :outs (svtv->orig-outs x) :internals (svtv->orig-internals x) :overrides (svtv->orig-overrides x) :moddb moddb :aliases aliases :debugdata debugdata :rewrite rewrite) /// (defret svtv-debug-set-svtv-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-run-logic ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) ;; (- (acl2::sneaky-save 'debugdata.updates debugdata.updates)) ;; Compute an initial state of all Xes (states (svex-alist-keys debugdata.nextstates)) (initst (pairlis$ states (replicate (len states) (4vec-x)))) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) ((with-fast inalist)) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases (list inalist) ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-run ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :mode :program :hooks nil (svtv-debug-run-logic inalist :filename filename :moddb moddb :aliases aliases :debugdata debugdata :vcd-wiremap vcd-wiremap :vcd-vals vcd-vals)) (define svtv-debug-run-fsm ((inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) (states (svex-alist-keys debugdata.nextstates)) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases inalists ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-core ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-logic inalist :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug-fsm-core ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-fsm inalists initst :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-core x inalist :filename filename)) /// (defmacro stv-debug (&rest args) (cons 'svtv-debug args))) (define svtv-debug-fsm ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-fsm-core x inalists initst :filename filename)) /// (defmacro stv-debug-fsm (&rest args) (cons 'svtv-debug-fsm args)))
true
; SV - Symbolic Vector Hardware Analysis Framework ; Copyright (C) 2014-2015 Centaur Technology ; ; Contact: ; Centaur Technology Formal Verification Group ; 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. ; http://www.centtech.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original authors: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> ; PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "SV") (include-book "process") (include-book "fsm") (include-book "vcd") (include-book "oslib/date" :dir :system) (local (include-book "std/basic/arith-equivs" :dir :system)) (local (include-book "std/io/base" :dir :system)) (local (include-book "std/lists/top" :dir :system)) (local (in-theory (disable nth update-nth acl2::nth-when-zp))) (local (std::add-default-post-define-hook :fix)) (local (in-theory (disable pick-a-point-subset-strategy))) (defxdoc debug.lisp :parents (svtv-debug)) (local (xdoc::set-default-parents debug.lisp)) (define svtv-debug-lhs-eval ((x lhs-p) (bound natp) (wirevals svex-env-p) (vcd-vals)) :guard (< bound (4vecs-length vcd-vals)) :verify-guards nil :measure (len x) :returns (xval 4vec-p) (b* (((mv xf xr) (lhs-decomp x)) ((unless xf) (4vec-z)) ((lhrange xf) xf) (rest (svtv-debug-lhs-eval xr bound wirevals vcd-vals)) ((when (eq (lhatom-kind xf.atom) :z)) (4vec-concat (2vec xf.w) (4vec-z) rest)) ((lhatom-var xf) xf.atom) (idx (and (svar-indexedp xf.name) (svar-index xf.name))) (val (if (and idx (< idx (lnfix bound))) (get-4vec idx vcd-vals) (svex-env-fastlookup xf.name wirevals)))) (4vec-concat (2vec xf.w) (4vec-rsh (2vec xf.rsh) val) rest)) /// (verify-guards svtv-debug-lhs-eval)) (define svtv-debug-eval-aliases ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) ;; Evaluates each of the LHSes in aliases in terms of wirevals, storing the ;; 4vec results in vcd-vals. We count up from 0, so as a shortcut, for each ;; wire that is aliased to an earlier one, we look up the stored value in ;; vcd-vals instead. This saves hash lookups. Svtv-debug-eval-aliases-track ;; is the same, but keeps track of which indices changed values. :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (nfix (- (aliass-length aliases) (nfix n))) :returns (vcd-vals1) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) vcd-vals) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (vcd-vals (set-4vec n val vcd-vals))) (svtv-debug-eval-aliases (1+ (lnfix n)) aliases wirevals vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases (<= (len vcd-vals) (len (svtv-debug-eval-aliases n aliases wirevals vcd-vals))) :rule-classes :linear)) (define svtv-debug-eval-aliases-track ((n natp) (aliases) (wirevals svex-env-p) (vcd-vals)) :guard (and (<= n (aliass-length aliases)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv (changes nat-listp) (vcd-vals1)) :measure (nfix (- (aliass-length aliases) (nfix n))) (b* (((when (mbe :logic (zp (- (aliass-length aliases) (nfix n))) :exec (eql (aliass-length aliases) n))) (mv nil vcd-vals)) (lhs (get-alias n aliases)) (val (svtv-debug-lhs-eval lhs n wirevals vcd-vals)) (prev-val (get-4vec n vcd-vals)) (vcd-vals (set-4vec n val vcd-vals)) ((mv rest-changes vcd-vals) (svtv-debug-eval-aliases-track (1+ (lnfix n)) aliases wirevals vcd-vals))) (mv (if (equal prev-val val) rest-changes (cons (lnfix n) rest-changes)) vcd-vals)) /// (defthm len-vcd-vals-of-svtv-debug-eval-aliases-track (<= (len vcd-vals) (len (mv-nth 1 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals)))) :rule-classes :linear) (defthm nat-list-max-of-svtv-debug-eval-aliases-track (implies (consp (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (< (nat-list-max (mv-nth 0 (svtv-debug-eval-aliases-track n aliases wirevals vcd-vals))) (len aliases))) :hints(("Goal" :in-theory (enable nat-list-max))) :rule-classes :linear)) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) a :hints(("Goal" :in-theory (enable svex-env-fix)))) (fty::deffixcong svex-env-equiv svex-env-equiv (append a b) b :hints(("Goal" :in-theory (enable svex-env-fix append)))) #|| (trace$ #!sv (svtv-debug-writephases :entry (list 'svtv-debug-writephases phase nphases inalist ins) :exit (list 'svtv-debug-writephases))) ||# (define svtv-debug-writephases ((phase natp) (nphases natp) (offset natp) (inalist svex-env-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-state svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= phase nphases) (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :returns (mv vcd-vals1 (p1 vl-printedlist-p) (final-state svex-env-p)) :measure (nfix (- (nfix nphases) (nfix phase))) (b* (((when (mbe :logic (zp (- (nfix nphases) (nfix phase))) :exec (eql nphases phase))) (mv vcd-vals (vl::vl-printedlist-fix p) (svex-env-fix prev-state))) (in-vals (svex-alist-eval (svtv-phase-inputs phase ins ovlines invars) inalist)) (- (clear-memoize-table 'svex-eval)) (eval-alist (append in-vals prev-state)) ((mv wirevals next-state) (with-fast-alist eval-alist (mv (svex-alist-eval updates eval-alist) (svex-alist-eval next-states eval-alist)))) (all-wirevals (append in-vals wirevals)) (full-phase (+ (lnfix phase) (lnfix offset))) ((mv changes vcd-vals) (with-fast-alist all-wirevals ;; evaluate aliases and stick values in vcd-vals, ;; tracking changes if phase > 0 (if (zp full-phase) (let* ((vcd-vals (svtv-debug-eval-aliases 0 aliases all-wirevals vcd-vals))) (mv nil vcd-vals)) (svtv-debug-eval-aliases-track 0 aliases all-wirevals vcd-vals)))) ;; print out changed vals (or all if phase = 0) (p (if (zp full-phase) (vcd-dump-first-snapshot vcd-vals vcd-wiremap p) (vcd-dump-delta (* 10 full-phase) changes vcd-vals vcd-wiremap p)))) (svtv-debug-writephases (1+ (lnfix phase)) nphases offset inalist ins ovlines next-state updates next-states invars aliases vcd-wiremap vcd-vals p)) /// (defret len-of-svtv-debug-writephases-vcd-vals (<= (len vcd-vals) (len vcd-vals1)) :rule-classes :linear)) (define svtv-debug-fsm-writephases ((cycle natp) (nphases-per-cycle natp) (inalists svex-envlist-p) (ins svtv-lines-p) (ovlines svtv-overridelines-p) (prev-st svex-env-p) (updates svex-alist-p) (next-states svex-alist-p) (invars svarlist-p) aliases vcd-wiremap vcd-vals (p vl-printedlist-p)) :guard-hints (("goal" :do-not-induct t)) :guard (and (<= (aliass-length aliases) (vcdwires-length vcd-wiremap)) (<= (vcdwires-length vcd-wiremap) (4vecs-length vcd-vals)) (<= (aliass-length aliases) (4vecs-length vcd-vals))) :measure (len inalists) :returns (mv vcd-vals1 (p1 vl-printedlist-p)) (b* ((cycle (lnfix cycle)) (nphases-per-cycle (lnfix nphases-per-cycle)) (phase (* cycle nphases-per-cycle)) ((when (atom inalists)) ;; just print the new time. (mv vcd-vals (vcd-dump-delta (* 10 (lnfix phase)) nil vcd-vals vcd-wiremap p))) (inalist (car inalists)) ((with-fast inalist)) ((mv vcd-vals p next-st) (svtv-debug-writephases 0 nphases-per-cycle phase inalist ins ovlines prev-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (svtv-debug-fsm-writephases (1+ cycle) nphases-per-cycle (cdr inalists) ins ovlines next-st updates next-states invars aliases vcd-wiremap vcd-vals p))) (defthm true-list-listp-of-append (implies (and (true-list-listp a) (true-list-listp b)) (true-list-listp (append a b))) :hints(("Goal" :in-theory (enable true-list-listp)))) (defthm svex-env-p-of-pairlis$ (implies (and (svarlist-p x) (4veclist-p y) (equal (len x) (len y))) (svex-env-p (pairlis$ x y))) :hints(("Goal" :in-theory (enable svex-env-p svarlist-p 4veclist-p pairlis$)))) (defenum debugdata-status-p (:empty :initialized :composed)) (local (defun debugdata-renaming (field-names) (b* (((when (atom field-names)) nil) (field (car field-names)) (new-field (intern$ (cat "DEBUGDATA->" (symbol-name field)) "SV")) (update (intern$ (cat "UPDATE-" (symbol-name field)) "SV")) (new-update (intern$ (cat "SET-DEBUGDATA->" (symbol-name field)) "SV"))) (cons (list field new-field) (cons (list update new-update) (debugdata-renaming (cdr field-names))))))) (make-event (b* ((fields `((design :type (satisfies design-p) :initially ,(make-design :top "")) (modidx :type (integer 0 *) :initially 0) (assigns :type (satisfies svex-alist-p) :initially nil) (delays :type (satisfies svar-map-p) :initially nil) (updates :type (satisfies svex-alist-p) :initially nil) (nextstates :type (satisfies svex-alist-p) :initially nil) (svtv :type (satisfies svtv-p) :initially ,(make-svtv :nphases 0)) (nphases :type (integer 0 *) :initially 0) (ins :type (satisfies svtv-lines-p) :initially nil) (outs :type (satisfies svtv-lines-p) :initially nil) (overrides :type (satisfies svtv-lines-p) :initially nil) (override-assigns :type (satisfies svex-alist-p) :initially nil) (status :type (satisfies debugdata-status-p) :initially :empty))) (field-names (strip-cars fields)) (renaming (debugdata-renaming field-names)) ;; (fns (append '(debugdatap create-debugdata) ;; (acl2::strip-cadrs renaming))) (make-binder (std::da-make-binder 'debugdata field-names))) `(progn (defstobj debugdata ,@fields :renaming ,renaming) (in-theory (disable create-debugdata debugdatap)) ,make-binder))) ;; This is much faster in logic mode (even with the svarlist-addr-p guard ;; check) than program mode, where presumably invariant-risk is killing us. (define svtv-debug-init ((design design-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata)) :guard (svarlist-addr-p (modalist-vars (design->modalist design))) :returns (mv err moddb-out aliases-out debugdata-out) :short "Prepares an SV design for SVTV debugging, to the extent possible without specifying an SVTV." :long "<p>This does the initial compilation of the design, creating the moddb, aliases table, and local wire assignments and delays. See @(see svtv-debug-set-svtv) for the next step, which composes the signals into their nextstate and update functions given a timing diagram.</p> <p>Technical: Erases and recreates the moddb, aliases, and debugdata stobjs.</p>" (b* ((design (design-fix design)) ;; Make a moddb, canonical alias table, and flattened, alias-normalized ;; assignments from the design. :Indexedp nil leaves wires expressed in ;; terms of paths rather than absolute moddb indices. ((mv err assigns delays ?constraints moddb aliases) (svex-design-flatten-and-normalize design :indexedp nil)) ((when err) (raise "~@0~%" err) (mv err moddb aliases debugdata)) ;; get the index of the top-level module within the moddb (modidx (moddb-modname-get-index (design->top design) moddb)) (debugdata (set-debugdata->design design debugdata)) (debugdata (set-debugdata->modidx modidx debugdata)) (debugdata (set-debugdata->assigns assigns debugdata)) (debugdata (set-debugdata->delays delays debugdata)) (debugdata (set-debugdata->updates nil debugdata)) ;; not available yet (debugdata (set-debugdata->nextstates nil debugdata)) (debugdata (set-debugdata->status :initialized debugdata))) (mv nil moddb aliases debugdata)) /// (defret svtv-debug-init-moddb-ok (and (moddb-mods-ok moddb-out) (moddb-basics-ok moddb-out))) (defret svtv-debug-init-modidx-ok (implies (not err) (< (nth *debugdata->modidx* debugdata-out) (nfix (nth *moddb->nmods1* moddb-out))))) (defret svtv-debug-init-totalwires-ok (implies (not err) (<= (moddb-mod-totalwires (nth *debugdata->modidx* debugdata-out) moddb-out) (len aliases-out))))) (define svtv-debug-set-ios-logic (&key ((ins true-list-listp) 'nil) ((outs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (b* (((debugdata debugdata)) ((when (eq debugdata.status :empty)) (raise "Error: Need to do SVTV-DEBUG-INIT before SVTV-DEBUG-SET-IOS~%") debugdata) ;; Process the timing diagram into internal form (outs (append outs internals)) ;; really only doing the outs in case (likely) they contain more phases ;; than ins/overrides, for nphases computation ((mv err ins) (svtv-wires->lhses ins debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving inputs: ~@0" err) debugdata) ((mv err overrides) (svtv-wires->lhses overrides debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving overrides: ~@0" err) debugdata) ((mv err outs) (svtv-wires->lhses outs debugdata.modidx moddb aliases)) ((when err) (raise "Error resolving outputs: ~@0" err) debugdata) ;; get the total number of phases to simulate and extend the ;; inputs/overrides to that length (nphases (max (svtv-max-length ins) (max (svtv-max-length overrides) (svtv-max-length outs)))) (overrides (svtv-expand-lines overrides nphases)) ((mv updates next-states override-assigns) (b* (((when (and (eq debugdata.status :composed) (equal debugdata.overrides overrides))) ;; Presumably we're just updating some inputs or outputs. We ;; don't need to compose assigns/delays again, which is an ;; expensive part of the operation. (mv debugdata.updates debugdata.nextstates nil)) ;; Each override has a unique test variable (determining if the override ;; happens in a given phase) and override value variable. This ;; generates them (as tagged indices) and records them in data ;; structures to associate the LHS for each override with its variables ;; and entries. ((mv ?ovlines ovs) (svtv-lines->overrides overrides 0)) ;; Apply the overrides to the assigns. Each wire that is overridden has ;; its gate-level assignment replaced with something like: ;; (if override-this-phase override-value original-assignment) ;; except that extra care is taken to override only the specified range. (overridden-assigns (svex-apply-overrides ovs (make-fast-alist debugdata.assigns))) ;; Note! In defsvtv-main, we need to keep the original assigns around so ;; that if an output/internal refers to an overridden variable, we can ;; get that variable's value before overriding it. At the moment we ;; don't pay attention to output variables in svtv-debug, so we don't ;; care about this. If this changes, revisit this issue. (- (fast-alist-free overridden-assigns)) ((mv updates next-states ?constraints) ;; Compose together the final (gate-level) assignments to get full ;; update formulas (in terms of PIs and current states), and compose ;; delays with these to get next states. (svex-compose-assigns/delays overridden-assigns debugdata.delays nil :rewrite rewrite))) (mv updates next-states overridden-assigns))) (debugdata (set-debugdata->updates updates debugdata)) (debugdata (set-debugdata->nextstates next-states debugdata)) (debugdata (set-debugdata->nphases nphases debugdata)) (debugdata (set-debugdata->ins ins debugdata)) (debugdata (set-debugdata->outs outs debugdata)) (debugdata (set-debugdata->overrides overrides debugdata)) (debugdata (set-debugdata->override-assigns override-assigns debugdata)) (debugdata (set-debugdata->status :composed debugdata))) debugdata) /// (defret svtv-debug-set-ios-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-set-ios (&key ((inputs true-list-listp) 'nil) ((outputs true-list-listp) 'nil) ((internals true-list-listp) 'nil) ((overrides true-list-listp) 'nil) (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :mode :program :hooks nil (svtv-debug-set-ios-logic :ins inputs :outs outputs :internals internals :overrides overrides :rewrite rewrite)) (define svtv-debug-set-svtv ((x svtv-p) &key (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (rewrite 't)) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns debugdata-out :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) (svtv-debug-set-ios-logic :ins (svtv->orig-ins x) :outs (svtv->orig-outs x) :internals (svtv->orig-internals x) :overrides (svtv->orig-overrides x) :moddb moddb :aliases aliases :debugdata debugdata :rewrite rewrite) /// (defret svtv-debug-set-svtv-modidx-unchanged (equal (nth *debugdata->modidx* debugdata-out) (nth *debugdata->modidx* debugdata)))) (define svtv-debug-run-logic ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) ;; (- (acl2::sneaky-save 'debugdata.updates debugdata.updates)) ;; Compute an initial state of all Xes (states (svex-alist-keys debugdata.nextstates)) (initst (pairlis$ states (replicate (len states) (4vec-x)))) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) ((with-fast inalist)) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases (list inalist) ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-run ((inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :mode :program :hooks nil (svtv-debug-run-logic inalist :filename filename :moddb moddb :aliases aliases :debugdata debugdata :vcd-wiremap vcd-wiremap :vcd-vals vcd-vals)) (define svtv-debug-run-fsm ((inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (state 'state)) :guard-hints ((and stable-under-simplificationp '(:in-theory (enable debugdatap)))) :guard (and (moddb-ok moddb) (< (debugdata->modidx debugdata) (moddb->nmods moddb)) (<= (moddb-mod-totalwires (debugdata->modidx debugdata) moddb) (aliass-length aliases))) :returns (mv vcd-wiremap vcd-vals state) (b* (((debugdata debugdata)) (states (svex-alist-keys debugdata.nextstates)) ;; Start VCD creation. Make the wiremap and the scope structure (from ;; which we write out the module hierarchy portion of the VCD file.) (vcd-wiremap (resize-vcdwires (aliass-length aliases) vcd-wiremap)) ((mv scope & vcd-wiremap) (vcd-moddb->scopes "top" debugdata.modidx 0 0 moddb vcd-wiremap)) ;; Start accumulating the contents of the VCD file into reverse ;; string/char accumulator p. Print the header into p. ((mv date state) (oslib::date)) (p (vcd-print-header date scope nil)) ;; Set up the VCD values structure, an array of 4vecs -- these are ;; conveniently initialized to Xes (vcd-vals (resize-4vecs (vcdwires-length vcd-wiremap) vcd-vals)) ;; collect the set of all input variables. We generate a unique ;; variable per phase for each variable (unless it is bound to an STV ;; input variable). This wouldn't be strictly necessary since we're ;; going to set these to Xes anyway, but this is how we do it for now. (in-vars (acl2::hons-set-diff (svexlist-collect-vars (append (svex-alist-vals debugdata.updates) (svex-alist-vals debugdata.nextstates))) (append (svex-alist-keys debugdata.updates) states))) (ins (svtv-expand-lines debugdata.ins debugdata.nphases)) ((mv ovlines ?ovs) (svtv-lines->overrides debugdata.overrides 0)) ;; Run the sequence of steps, recording value changes at each step and ;; printing them into p. ((mv vcd-vals p) (svtv-debug-fsm-writephases 0 debugdata.nphases inalists ins ovlines initst debugdata.updates debugdata.nextstates in-vars aliases vcd-wiremap vcd-vals p)) ;; Write the contents of p to an actual file. ((mv channel state) (open-output-channel (mbe :logic (acl2::str-fix filename) :exec filename) :character state)) ((unless channel) (raise "Couldn't write vcd file ~s0~%" filename) (mv vcd-wiremap vcd-vals state)) (state (princ$ (vl::vl-printedlist->string p) channel state)) (state (close-output-channel channel state))) (mv vcd-wiremap vcd-vals state))) (define svtv-debug-core ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-logic inalist :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug-fsm-core ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (moddb 'moddb) (aliases 'aliases) (debugdata 'debugdata) (vcd-wiremap 'vcd-wiremap) (vcd-vals 'vcd-vals) (rewrite 't) (state 'state)) :returns (mv moddb aliases debugdata vcd-wiremap vcd-vals state) :hooks ((:fix :omit (moddb aliases))) (b* (((svtv x)) (mod-fn (intern-in-package-of-symbol (str::cat (symbol-name x.name) "-MOD") x.name)) ((mv err design) (acl2::magic-ev-fncall mod-fn nil state t t)) ((when err) (raise "Error: couldn't run ~x0: ~@1~%" mod-fn err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((unless (and (design-p design) (modalist-addr-p (design->modalist design)))) (raise "Error: ~x0 returned a malformed design~%" mod-fn) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) ((mv err moddb aliases debugdata) (svtv-debug-init design)) ((when err) (mv moddb aliases debugdata vcd-wiremap vcd-vals state)) (debugdata (svtv-debug-set-svtv x :rewrite rewrite)) ((mv vcd-wiremap vcd-vals state) (svtv-debug-run-fsm inalists initst :filename filename))) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (define svtv-debug ((x svtv-p) (inalist svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-core x inalist :filename filename)) /// (defmacro stv-debug (&rest args) (cons 'svtv-debug args))) (define svtv-debug-fsm ((x svtv-p) (inalists svex-envlist-p) (initst svex-env-p) &key ((filename stringp) '"svtv-debug.vcd") (state 'state)) :parents (svex-stvs) :short "Dump a VCD waveform showing the internal signals of an svex STV." :prepwork ((local (in-theory (disable max)))) :verbosep t (b* (((acl2::local-stobjs moddb aliases debugdata vcd-wiremap vcd-vals) (mv moddb aliases debugdata vcd-wiremap vcd-vals state))) (svtv-debug-fsm-core x inalists initst :filename filename)) /// (defmacro stv-debug-fsm (&rest args) (cons 'svtv-debug-fsm args)))
[ { "context": ";;;;;;;;;;;;;;;;;;;\n;;; (c) Copyright 1999-2005 by Michael Genesereth. All rights reserved.\n;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 130, "score": 0.9998716115951538, "start": 112, "tag": "NAME", "value": "Michael Genesereth" } ]
infomaster/source/integrator.lisp
timothyhinrichs/clicl
0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1999-2005 by Michael Genesereth. All rights reserved. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator.lisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when (compile load eval) (proclaim '(special *manager* *library* *warehouse* *repository* *ancestry* *collapse* *message* *sender* *receiver* *target*))) (defparameter *agents* nil) (defparameter *collapse* 'simple) (defparameter *compress* nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass integrator (agent) ()) (defmethod message-handler (*message* *sender* (*receiver* integrator)) (let (*library* *warehouse* *agents*) (setq *library* (referent (find-rulebase *receiver*))) (setq *warehouse* (referent (find-database *receiver*))) (eval *message*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Knowledge commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; affirm, retract ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod affirm (p sender (receiver integrator)) (declare (ignore sender)) (affirm p receiver (get-rulebase receiver))) (defmethod retract (p sender (receiver integrator)) (declare (ignore sender)) (retract p receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askabout ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askabout (x sender (receiver integrator)) (declare (ignore sender)) (askabout x receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Data commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; revise, revisions, errors, materializations, notifications, reactions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod revise (p sender (receiver integrator)) (declare (ignore sender)) (let (revisions notifications materializations reactions factserver) (setq revisions (revisions p receiver) p (maksand revisions)) (cond ((errors p receiver)) (t (setq materializations (materializations p receiver)) (setq notifications (notifications p receiver)) (setq reactions (reactions p receiver)) (setq factserver (find-target (name receiver))) ;(dolist (p revisions) (change p factserver)) (dolist (p materializations) (change p factserver)) (dolist (dum notifications) (revise (maksand (cdr dum)) receiver (car dum))) (dolist (dum reactions) (eval dum)) 'done)))) (defmethod revisions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertplusminus p temp) (includes temp ruleserver) (dolist (r (supports p ruleserver)) ; TLH #'extensionalp)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(minus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(plus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod errors (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(error ?e) temp #'specialp))) (setq answers (askallquery '?e query)) (decludes temp) (empty temp) answers)) (defmethod materializations (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (r (viewfinds '?r '(material ?a ?r) *manager*)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod notifications (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers subscripts) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (agent (subscribers '?)) (dolist (r (subscriptions agent)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (when answers (setq subscripts (cons (cons agent answers) subscripts))) (setq answers nil)) (decludes temp) (empty temp) subscripts)) (defmethod reactions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(trigger ?x) temp #'specialp))) (setq answers (askallquery '?x query)) (decludes temp) (empty temp) answers)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askp, askx, asks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askp (p sender (receiver integrator)) (askx t p sender receiver)) (defmethod askx (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askonequery x (integrateask x p receiver)))) (defmethod asks (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askallquery x (integrateask x p receiver)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askclass, askframe, asktable ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askclass (x sender (receiver integrator)) (declare (ignore sender)) (classify x receiver)) (defmethod askframe (x class sender (receiver integrator)) (declare (ignore x class sender)) nil) (defmethod asktable (ol sl sender (receiver integrator)) (call-next-method ol sl sender receiver)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Theory commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; classify, facts, rules ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod classify (x (receiver integrator)) (let (dum) (cond ((characterp x) 'character) ((stringp x) 'string) ((numberp x) 'number) ((setq dum (find-classifier (name receiver))) (or (askx '?class (list dum x '?class) receiver receiver) 'thing)) ((dolist (a (finds '?a '(specialty ?a ?r) *manager*)) (when (not (eq (setq dum (classify x a)) 'thing)) (return dum)))) ((ruleclass x receiver (get-rulebase receiver))) (t 'thing)))) (defmethod facts (x (th integrator) &optional (f #'matchp)) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((eq (car l) (name th))) (t (setq nl (unionize nl (facts x (car l) f))))))) (defmethod rules (x (th integrator) &optional (f #'matchp)) ;(declare (ignore sender)) (facts x (find-rulebase (name th)) f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Reduction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun integrateask (x p receiver) (let (ruleserver query) (setq ruleserver (symbol-value (find-rulebase receiver))) (setq query (maksor (viewresidues p ruleserver #'specialp))) (setq query (decolonize query)) (when *collapse* (setq query (collapse x query))) ;(when *collapse* (setq query (raisin x query))) query)) (defun askonequery (x p) (cond ((eq p 'true) x) ((eq p 'false) nil) (t (eval (route (makaskemone x (source p))))))) (defun askallquery (x p) (cond ((eq p 'true) (list x)) ((eq p 'false) nil) (t (eval (route (makaskemall x (source p))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Collapse stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod collapse (x p) "(COLLAPSE X P) COLLAPSE takes as argument a term and a boolean sentence. It removes redundant literals from embedded conjunctions by matching variables not included in the specified list. The result is a sentence with the same values for the specified variables as the original sentence." (cond ((eq *collapse* 'simple) (collapse2 x p)) (*collapse* (collapse1 x p)) (t p))) (defun collapse1 (x p) (cond ((atom p) p) ((eq 'and (car p)) (maksand (equalizer (vars x) (cdr p)))) ((eq 'or (car p)) (maksor (mapcar #'(lambda (p) (collapse1 x p)) (cdr p)))) (t p))) (defun equalizer (vl cl) (eqexp nil cl (makvlist vl))) (defun equalizerexp (ol nl al) (cond ((null nl) (remove-duplicates (nreverse ol) :test #'equalp)) ((do ((l (reverse ol) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((do ((l (cdr nl) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((setq al (clearup (car nl) al)) (eqexp (cons (car nl) ol) (cdr nl) al)))) (defun clearup (x al) (cond ((indvarp x) (let ((dum (assoc x al))) (cond ((null dum) (acons x x al)) ((eq x (cdr dum)) al)))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (unless (setq al (clearup (car l) al)) (return nil)))))) (defun eqexp (ol nl al) (equalizerexp ol nl al)) (defun makvlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Intermediate versions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun equalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (ncl) (ol)) ((null l) (nreverse ol)) (do ((m cl (cdr m)) (nol) (nl)) ((null m) (setq ol (cons (car l) ol))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nol (sublis bl ol) nl (sublis bl l)) (setq ncl (revappend nol (cdr nl))) (subsetp ncl cl :test #'equalp)) (setq cl ncl ol nol l nl) (return t)))))))) (defun equalize (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (dl) (nl)) ((null l) (nreverse nl)) (do ((m cl (cdr m)) (nnl) (ncl)) ((null m) (setq nl (cons (car l) nl))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nnl (sublis bl nl) ncl (sublis bl l)) (setq dl (revappend nnl (cdr ncl))) (subsumepands dl cl al)) (setq cl dl nl nnl l ncl) (return t)))))))) (defun subsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (subsumepands (cdr p) (cdr q) al)))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun subsumepands (pl ql al) (cond ((null pl) al) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (setq bl (subsumepands (cdr pl) ql bl))) (return bl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Old version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun oldequalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (setq vl (varlist cl (varlist vl nil))) (do ((l cl (cdr l)) (nl)) ((null l) nl) (setq vl (unvarlist (car l) vl)) (cond ((member (car l) nl :test #'(lambda (x y) (equalizablep x y truth vl)))) ((member (car l) (cdr l) :test #'(lambda (x y) (equalizablep x y truth vl)))) (t (setq vl (varlist (car l) vl)) (setq nl (cons (car l) nl)))))))) (defun varlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (cond (dum (rplacd dum (1+ (cdr dum))) al) (t (acons x 1 al))))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (varlist (car l) al)))))) (defun unvarlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (rplacd dum (1- (cdr dum))) al)) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (unvarlist (car l) al)))))) (defun equalizablep (x y al vl) (cond ((eq x y) al) ((indvarp x) (let ((dum)) (cond ((setq dum (assoc x al :test #'eq)) (if (equal (cdr dum) y) al)) ((< (cdr (assoc x vl)) 1) (acons x y al))))) ((atom x) nil) ((atom y) nil) (t (do ((l x (cdr l)) (m y (cdr m))) ((null l) (if (null m) al)) (cond ((null m) (return nil)) ((setq al (equalizablep (car l) (car m) al vl))) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Latest version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun collapse2 (x p) (cond ((atom p) p) ((eq 'or (car p)) (collapse2or x p)) ((eq 'and (car p)) (collapse2and x p)) (t p))) (defun collapse2or (x p) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (maksor (nreverse nl))) (setq nl (cons (collapse2 x (car l)) nl)))) (defun collapse2and (x p) (let ((cl (copy-list (cdr p))) (al truth)) (do ((l cl (cdr l)) (bl)) ((null l)) (cond ((basep (operator (car l)))) (t (do ((m (cdr l) (cdr m))) ((null m)) (cond ((eq (car l) (car m))) ((setq bl (collapser (car l) (car m) al)) (setq al bl) (setq l (delete (car m) l)))))))) ; TLH: didn't used to (setq l ...) to result of delete (do ((l al (cdr l)) (vl (vars x)) (dum) (bl truth)) ((null (cdr l)) (setq al bl)) (cond ((find (caar l) vl) (setq dum (plug (cdar l) al)) (cond ((groundp dum) (setq bl (cons (car l) bl))) ((find dum vl) (setq bl (cons (car l) bl))) (t (setq bl (acons dum (caar l) bl))))) (t (setq bl (cons (car l) bl))))) (setq cl (mapcar #'(lambda (x) (plug x al)) cl)) (do ((l (vars x) (cdr l)) (dum)) ((null l) (maksand cl)) (if (not (eq (setq dum (plug (car l) al)) (car l))) (setq cl (cons `(same ,(car l) ,dum) cl)))))) (defun collapser (p q al) (cond ((atom p) (if (equalp p q) al)) ((atom q) nil) ((eq 'not (car p)) nil) ((eq 'unprovable (car p)) nil) ((eq (car p) (car q)) (collapserexp p q al)))) (defun collapserexp (p q al) (let (cols keys) (when (and (setq cols (find-columns (car p))) (setq keys (find-keys (car p)))) (do ((l (cdr p) (cdr l)) (m (cdr q) (cdr m)) (bl) (cl cols (cdr cl)) (kl keys)) ((or (null l) (null m)) (if (and (null l) (null m) (null kl)) al)) (cond ((eq (car cl) (car kl)) (if (equalp (plug (car l) al) (plug (car m) al)) (setq kl (cdr kl)) (return nil))) ((setq bl (mguexp (car l) (car m) al)) (setq al bl)) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; raisin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun raisin (x p) (cond ((atom p) p) ((eq 'or (car p)) (raisinor x p)) (t p))) (defun raisinor (x p) (cond ((null (cdr p)) nil) ((null (cddr p)) (cadr p)) (t (do ((l (cdr p) (cdr l)) (al (makvarlist x)) (ol)) ((null l) (maksor (nreverse ol))) (cond ((some #'(lambda (p) (relsumep p (car l) al)) ol)) ((some #'(lambda (p) (relsumep p (car l) al)) (cdr l))) (t (setq ol (cons (car l) ol)))))))) (defun makvarlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) (defun relsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (relsumepands (cdr p) al (cdr q))) (t (relsumepands (cdr p) al (list q))))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun relsumepands (pl al ql) (cond ((null pl)) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (relsumepands (cdr pl) bl ql)) (return t)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Sourcing ;;; Example: (or (p 1) (and (q 2) (r 3))) where art performs p, bob q and r ;;; Output: (or (ask (art) (p 1)) (ask (bob) (and (q 2) (r 3)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun source (p) (setq p (sources p)) (remedy p)) (defun sources (p) (cond ((atom p) `(ask ,(find-specialists p) ,p)) ((eq 'and (car p)) (source-and p)) ((eq 'or (car p)) (source-or p)) ((eq 'not (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (not ,(caddr p)))) (t `(not ,p)))) ((eq 'unprovable (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (unprovable ,(caddr p)))) (t `(unprovable ,p)))) ((eq 'bagofall (car p)) (let (plan) (setq plan (sources (caddr p))) (cond ((eq 'ask (car plan)) `(ask ,(cadr plan) (bagofall ,(cadr p) ,(caddr plan) ,(cadddr p)))) (t `(bagofall ,(cadr p) ,plan ,(cadddr p)))))) (t `(ask ,(find-specialists (car p)) ,p)))) (defun source-and (p) (do ((l (mapcar #'sources (cdr p))) (sources) (dum) (nl)) ((null l) (cond ((null (cdr nl)) (car nl)) (t (mapc #'remedy nl) (cons 'and (nreverse nl))))) (cond ((not (eq 'ask (caar l))) (setq nl (cons (car l) nl) l (cdr l))) (t (setq sources (cadar l)) (do ((m (cdr l) (cdr m)) (nc (list (caddar l)))) ((null m) (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l nil)) (cond ((and (eq 'ask (caar m)) (setq dum (intersection* sources (cadar m)))) (setq sources dum nc (cons (caddar m) nc))) (t (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l m) (return t)))))))) (defun source-or (p) (cons 'or (mapcar #'remedy (mapcar #'sources (cdr p))))) (defun findallspecialists (p) (cond ((atom p) (find-specialists p)) ((eq 'not (car p)) (findallspecialists (cadr p))) ((member (car p) '(and or <= =>)) (do ((l (cddr p) (cdr l)) (nl (findallspecialists (cadr p)))) ((null l) (nreverse nl)) (setq nl (intersect nl (findallspecialists (car l)))))) ((eq 'unprovable (car p)) (findallspecialists (cadr p))) (t (find-specialists (car p))))) (defun find-specialist (x) (cond ((eq 'true x) 'warehouse) ((eq 'false x) 'warehouse) ((basep x) 'warehouse) ((findp `(specialty warehouse ,x) *manager*) 'warehouse) ((findp `(specialty library ,x) *manager*) 'library) (t (findx '?a `(specialty ?a ,x) *manager*)))) (defun find-specialists (x) (cond ((eq 'true x) *agents*) ((eq 'false x) *agents*) ((basep x) (append *agents* (finds '?a `(specialty ?a ,x) *manager*))) (t (sortspecialists (finds '?a `(specialty ?a ,x) *manager*))))) (defun sortspecialists (specialists) (if (find (name *warehouse*) specialists) (cons (name *warehouse*) (delete (name *warehouse*) specialists)) specialists)) (defun remedy (x) (cond ((atom x) x) ((eq 'ask (car x)) (rplaca (cdr x) (caadr x)) x) (t x))) (defun divvy (msg) (let (dum al) (dolist (p (cdr msg)) (dolist (a (finds '?a `(interest ?a ,(operator p)) *manager*)) (cond ((setq dum (assoc a al)) (rplacd dum (cons p (cdr dum)))) (t (setq al (acons a (list p) al)))))) (do ((l al (cdr l)) (pl)) ((null l) (maksprogn pl)) (setq pl (cons `(ask ,(caar l) (update . ,(nreverse (cdar l)))) pl))))) (defun makaskemone (x p) (cond ((null p) nil) ((atom p) `(askemone ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-one ,x ,(caddr p)))) (t `(askemone ',x ',p)))) (defun makaskemall (x p) (cond ((null p) nil) ((atom p) `(askemall ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-all ,x ,(caddr p)))) ((eq 'or (car p)) (cons 'union* (mapcar #'(lambda (p) (makaskemall x p)) (cdr p)))) (t `(askemall ',x ',p)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Routing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun route (c) (cond ((atom c) c) ((eq 'quote (car c)) c) ((eq 'ask (car c)) (rplaca (cdr c) (caadr c)) c) ((eq 'tellemall (car c)) c) (t (dolist (item (cdr c)) (route item)) c))) (defun router (c) (setq c (routes c)) (cond ((eq (name *library*) (caadr c)) (caddr c)) (t (rplaca (cdr c) (caadr c)) c))) (defun routes (c) (cond ((atom c) `(ask ,*agents* ,c)) ((eq 'quote (car c)) `(ask ,*agents* ,c)) ((eq 'ask (car c)) c) ((eq 'tellemall (car c)) `(ask ,*agents* ,c)) (t (route-call c)))) (defun route-call (c) (do* ((args (mapcar #'routes (cdr c))) (l args (cdr l)) (sources (find-performers (car c))) (s sources)) ((null l) `(ask ,s ,(cons (car c) (mapcar #'caddr args)))) (cond ((setq s (intersect s (cadar l)))) (t (mapc #'(lambda (x) (rplaca (cdr x) (caadr x))) args) (return `(ask ,sources ,(cons (car c) args))))))) (defun find-performers (x) (cond ((lispp x) (append *agents* (finds '?a `(performs ?a ,x) *manager*))) ((fboundp x) (list (name *library*))) ((eq 'if x) *agents*) (t (finds '?a `(performs ?a ,x) *manager*)))) (defun lispp (x) (find-symbol (symbol-name x) (find-package 'common-lisp))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Execution stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun askfacts (msg) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((and (eq (car l) *sender*) (equal msg *message*))) (t (setq nl (unionize nl (request msg *receiver* (car l)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; iterated version ;;; ;;; execution depends on *group* ;;; nil means nested ;;; t means all-at-once by copying ;;; yank means all-at-once using oneof ;;; yank2 means all-at-once using oneof and join ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *group* 'loyal) (defun tellemall (q p) (dolist (piece (askemall q p)) (tellem piece))) (defun tellem (p) (cond ((atom p)) ((eq 'tell (car p)) (dolist (agent (cadr p)) (request `(tell ,(caddr p)) *receiver* agent))) ((eq 'untell (car p)) (dolist (agent (cadr p)) (request `(untell ,(caddr p)) *receiver* agent))) ((eq 'progn (car p)) (mapc #'tellem (cdr p))))) (defun newtellemall (&rest rules) (let (tells) (do ((l rules (cdr l))) ((null l)) (cond ((atom (car l))) ((eq 'tell (caar l)) (setq tells (cons (car l) tells))) ((eq '==> (caar l)) (dolist (answer (askemall (caddar l) (cadar l))) (setq tells (contribute answer tells)))))) (setq tells (coalesce tells)) (do ((l tells (cdr l)) (nl) (dum)) ((null l) 'done) (setq dum (request `(tell ,(maksand (cdar l))) *receiver* (caar l))) (cond ((stringp dum) (do ((m nl (cdr m)) (untell)) ((null m)) (setq untell (maksand (nreverse (mapcar #'maknot (cdar m))))) (request `(tell ,untell) *receiver* (caar m))) (return dum)) (t (setq nl (cons (car l) nl))))))) (defun newcoalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (cons (list (cadar l) (caddar l)) nl))) (t (dolist (who (cadar l)) (setq nl (cons (list who (caddar l)) nl))))))) (defun coalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (coal (cadar l) (caddar l) nl))) (t (dolist (who (cadar l)) (setq nl (coal who (caddar l) nl))))))) (defun coal (who what nl) (let (dum) (cond ((setq dum (assoc who nl :test #'eq)) (rplacd dum (contribute what (cdr dum))) nl) (t (acons who (contribute what nil) nl))))) (defun askemone (x p) (cond ((eq *group* 'loyal) (loyalone x p)) ((eq *group* 'yank) (yankemone x p)) ((eq *group* 'yank2) (yankemone2 x p)) ((eq *group* 'rebel) (rebelone x p)) (t (getemone x p)))) (defun askemall (x p) (cond ((eq *group* 'loyal) (loyalall x p)) ((eq *group* 'yank) (yankemall x p)) ((eq *group* 'yank2) (yankemall2 x p)) ((eq *group* 'rebel) (rebelall x p)) (*group* (findemall x p)) (t (getemall x p)))) (defun assumeall (p th) (cond ((and th (symbolp th) (boundp th)) (assumeall p (symbol-value th))) (t (includes th *library*) (assume p th)))) (defun forgetall (p th) (cond ((and th (symbolp th) (boundp th)) (forgetall p (symbol-value th))) (t (includes th *library*) (forget p th)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; loyal - new flat all-at-once execution using oneof and no alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun loyalone (x p) (loyone x p '(t) '((t)))) (defun loyone (x p vl sl) (cond ((null p) nil) ((atom p) (loyproject x vl sl)) ((eq 'ask (car p)) (loyoneask x p vl sl)) ((eq 'and (car p)) (loyoneand x p vl sl)) ((eq 'or (car p)) (loyoneor x p vl sl)) ((eq 'unprovable (car p)) (loyoneunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyonebagofall x p vl sl)))) (defun loyoneask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-one ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-one ,x ,query) *receiver* db))))) (defun loyoneand (x p vl sl) (cond ((null (cdr p)) (loyproject x vl sl)) ((null (cddr p)) (loyone x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null (cdr l)) (loyone x (car l) vl sl)) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyoneor (x p vl sl) (do ((l (cdr p) (cdr l)) (dum)) ((null l) nil) (when (setq dum (loyone x (car l) vl sl)) (return dum)))) (defun loyoneunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) (car sl) (loyproject x vl sl))) (defun loyonebagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyproject (x vl sl) (findx x `(oneof ,vl . ,sl) *manager*)) (defun loyalall (x p) (loyal x p '(t) '((t)))) (defun loyal (x p vl sl) (cond ((null p) nil) ((atom p) (loyalproject x vl sl)) ((eq 'ask (car p)) (loyalask x p vl sl)) ((eq 'and (car p)) (loyaland x p vl sl)) ((eq 'or (car p)) (loyalor x p vl sl)) ((eq 'unprovable (car p)) (loyalunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyalbagofall x p vl sl)))) (defun loyalask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-all ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-all ,x ,query) *receiver* db))))) (defun loyaland (x p vl sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (loyal x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null l) (if (equal x vl) sl (loyalproject x vl sl))) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyalor (x p vl sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (loyal x (car l) vl sl) nl)))) (defun loyalunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) sl (loyalproject x vl sl))) (defun loyalbagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyalproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyalproj (x vl s) (findx x `(same ,vl ,s) *manager*)) (defun loyalproject (x vl sl) (finds x `(oneof ,vl . ,sl) *manager*)) (defun loyalvars (x p vl) (cdr (loyalvarscdr vl (cdr p) (vars x)))) (defun loyalvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (loyalvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) (defmethod variables ((al list)) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (caar l) nl)))) (defun bindings (al) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (cdar l) nl)))) (defun startp (l1 l2) (do () ((null l1) t) (cond ((null l2) (return nil)) ((equalp (car l1) (car l2)) (setq l1 (cdr l1) l2 (cdr l2))) (t (return nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; one-by-one execution ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun getemone (x p) (let ((al (askone p truth))) (if al (sublis al x)))) (defun askone (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askoneask p al)) ((eq 'and (car p)) (askoneand p al)) ((eq 'or (car p)) (askoneor p al)) (t (askoneask (list 'ask *library* p) al)))) (defun askoneand (p al) (askoneands (cdr p) al)) (defun askoneands (cl al) (cond ((null cl) al) ((null (cdr cl)) (askone (car cl) al)) (t (do ((l (askem (car cl) al) (cdr l)) (bl)) ((null l) nil) (if (setq bl (askoneands (cdr cl) (car l))) (return bl)))))) (defun askoneask (p al) (let ((dum)) (setq p (sublis al p)) (when (setq dum (request `(ask-one ,(caddr p) ,(caddr p)) *receiver* (cadr p))) (matchpexp (caddr p) dum al)))) (defun askoneor (p al) (do ((l (cdr p) (cdr l)) (bl)) ((null l)) (if (setq bl (askone (car l) al)) (return bl)))) (defun getemall (x p) (do ((l (askem p truth) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun askem (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askallask p al)) ((eq 'and (car p)) (askalland p al)) ((eq 'or (car p)) (askallor p al)) (t (askallask (list 'ask *library* p) al)))) (defun askallask (p al) (setq p (sublis al p)) (do ((l (request `(ask-all ,(caddr p) ,(caddr p)) *receiver* (cadr p)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp (caddr p) (car l) al) nl)))) (defun askalland (p al) (askallands (cdr p) al)) (defun askallands (cl al) (cond ((null cl) (list al)) (t (do ((l (askem (car cl) al) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askallands (cdr cl) (car l)) nl)))))) (defun askallor (p al) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askem (car l) al) nl)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; new flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun rebelone (x p) (let ((nl (rebel x p (list truth)))) (if nl (sublis (car nl) x)))) (defun rebelall (x p) (do ((l (rebel x p (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun rebel (x p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (rebelask x p sl)) ((eq 'and (car p)) (rebeland x p sl)) ((eq 'or (car p)) (rebelor x p sl)) ((eq 'unprovable (car p)) (rebelunprovable p sl)))) (defun rebelask (x p sl) (let* ((db (cadr p)) (query (caddr p)) ins answers) (cond ((null sl) nil) ((setq ins (variables (car sl))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (bindings (car l)) nl))) (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl)))) (t (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl))))))) (defun rebeland (x p sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (rebel x (cadr p) sl)) (t (do ((l (cdr p) (cdr l)) (vl (rebvars x p (car sl)) (cdr vl))) ((null l) sl) (setq sl (rebel (car vl) (car l) sl)))))) (defun rebelor (x p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (rebel x (car l) sl) nl)))) (defun rebelunprovable (p sl) (set-difference sl (rebel (variables (car sl)) (cadr p) sl) :test #'equal)) (defun rebvars (x p al) (cdr (rebvarscdr (mapcar #'car al) (cdr p) (vars x)))) (defun rebvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (rebvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; nested all-at-once execution by copying and returning list of answers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun findemone (x p) (let ((nl (findem (newvars x p) truth))) (if nl (sublis (car nl) x)))) (defun findemall (x p) (do ((l (findem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun findem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (findemask p sl)) ((eq 'and (car p)) (findemand p sl)) ((eq 'or (car p)) (findemor p sl)))) (defun findemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) answers) (cond ((null sl) nil) ((null (cdr sl)) (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,query)) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (cons 'list (nreverse nl)))) (setq nl (cons (sublis (car l) query) nl))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (n sl (cdr n)) (nl)) ((null l) (nreverse nl)) (do ((m (car l) (cdr m))) ((null m)) (setq nl (cons (matchpexp aspect (car m) (car n)) nl)))))))) (defun findemand (p sl) (findemands (cdr p) sl)) (defun findemands (cl sl) (cond ((null cl) sl) (t (findemands (cdr cl) (findem (car cl) sl))))) (defun findemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (findem (car l) sl) nl)))) (defun newvars (x p) (newvarsexp p nil (vars x))) (defun newvarsexp (p vl wl) (cond ((atom p) p) ((eq 'ask (car p)) (let ((vs (goodvars (caddr p))) (news) (useless) (locals)) (setq news (set-difference vs vl)) (setq useless (set-difference news wl)) (setq locals (set-difference news useless)) `(ask ,(cadr p) ,locals ,(caddr p)))) ((eq 'and (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'and (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl (append (vars (cdr l)) wl)) nl)) (setq vl (nconc (goodvars (car l)) vl)))) ((eq 'or (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'or (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl wl) nl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun economize (aspect) (cond ((null aspect) '(1)) ((atom aspect) (list aspect)) (t aspect))) (defun yankemone (x p) (let ((nl (yankem (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall (x p) (do ((l (yankem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask p sl)) ((eq 'and (car p)) (yankemand p sl)) ((eq 'or (car p)) (yankemor p sl)))) (defun yankemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (do ((l (car sl) (cdr l))) ((null (cdr l))) (setq ins (cons (caar l) ins))) (setq aspect (economize (unionize ins aspect))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (sublis (car l) ins) nl))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand (p sl) (yankemands (cdr p) sl)) (defun yankemands (cl sl) (cond ((null cl) sl) (t (yankemands (cdr cl) (yankem (car cl) sl))))) (defun yankemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem (car l) sl) nl)))) (defun yankemone2 (x p) (let ((nl (yankem2 (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall2 (x p) (do ((l (yankem2 (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem2 (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask2 p sl)) ((eq 'and (car p)) (yankemand2 p sl)) ((eq 'or (car p)) (yankemor2 p sl)))) (defun yankemask2 (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (setq ins (boundvars query (car sl))) (setq aspect (economize (unionize ins aspect))) (when ins (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(uniquify (nreverse nl))) query))) (setq nl (cons (sublis (car l) ins) nl)))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (joinal sl (nreverse nl))) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand2 (p sl) (yankemands2 (cdr p) sl)) (defun yankemands2 (cl sl) (cond ((null cl) sl) (t (yankemands2 (cdr cl) (yankem2 (car cl) sl))))) (defun yankemor2 (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem2 (car l) sl) nl)))) (defun boundvars (x al) (do ((l (vars x) (cdr l)) (nl)) ((null l) (nreverse nl)) (if (assoc (car l) al) (setq nl (cons (car l) nl))))) ;;; what do we do about ground queries? ;;; following assumes that alists all have same structure (defun joinal (as bs) (do ((l as (cdr l)) (dum) (nl)) ((null l) (nreverse nl)) (do ((m bs (cdr m))) ((null m)) (when (setq dum (joinemal (car l) (car m))) (setq nl (cons dum nl)))))) (defun joinemal (al bl) (let (dum) (cond ((null (cdr al)) bl) ((setq dum (assoc (caar al) bl :test #'eq)) (if (equal (cdar al) (cdr dum)) (joinemal (cdr al) bl))) ((setq bl (joinemal (cdr al) bl)) (cons (car al) bl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Miscellaneous ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun find-agents () (cons 'repository (finds '?a '(specialty ?a ?r) *manager*))) (defun interestp (r) (or (eq r 'evaluate) (findp `(interest ?a ,r) *manager*))) (defun specialp (r) (or (basep r) (findp `(specialty ?a ,r) *manager*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94519
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1999-2005 by <NAME>. All rights reserved. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator.lisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when (compile load eval) (proclaim '(special *manager* *library* *warehouse* *repository* *ancestry* *collapse* *message* *sender* *receiver* *target*))) (defparameter *agents* nil) (defparameter *collapse* 'simple) (defparameter *compress* nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass integrator (agent) ()) (defmethod message-handler (*message* *sender* (*receiver* integrator)) (let (*library* *warehouse* *agents*) (setq *library* (referent (find-rulebase *receiver*))) (setq *warehouse* (referent (find-database *receiver*))) (eval *message*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Knowledge commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; affirm, retract ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod affirm (p sender (receiver integrator)) (declare (ignore sender)) (affirm p receiver (get-rulebase receiver))) (defmethod retract (p sender (receiver integrator)) (declare (ignore sender)) (retract p receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askabout ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askabout (x sender (receiver integrator)) (declare (ignore sender)) (askabout x receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Data commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; revise, revisions, errors, materializations, notifications, reactions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod revise (p sender (receiver integrator)) (declare (ignore sender)) (let (revisions notifications materializations reactions factserver) (setq revisions (revisions p receiver) p (maksand revisions)) (cond ((errors p receiver)) (t (setq materializations (materializations p receiver)) (setq notifications (notifications p receiver)) (setq reactions (reactions p receiver)) (setq factserver (find-target (name receiver))) ;(dolist (p revisions) (change p factserver)) (dolist (p materializations) (change p factserver)) (dolist (dum notifications) (revise (maksand (cdr dum)) receiver (car dum))) (dolist (dum reactions) (eval dum)) 'done)))) (defmethod revisions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertplusminus p temp) (includes temp ruleserver) (dolist (r (supports p ruleserver)) ; TLH #'extensionalp)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(minus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(plus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod errors (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(error ?e) temp #'specialp))) (setq answers (askallquery '?e query)) (decludes temp) (empty temp) answers)) (defmethod materializations (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (r (viewfinds '?r '(material ?a ?r) *manager*)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod notifications (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers subscripts) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (agent (subscribers '?)) (dolist (r (subscriptions agent)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (when answers (setq subscripts (cons (cons agent answers) subscripts))) (setq answers nil)) (decludes temp) (empty temp) subscripts)) (defmethod reactions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(trigger ?x) temp #'specialp))) (setq answers (askallquery '?x query)) (decludes temp) (empty temp) answers)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askp, askx, asks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askp (p sender (receiver integrator)) (askx t p sender receiver)) (defmethod askx (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askonequery x (integrateask x p receiver)))) (defmethod asks (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askallquery x (integrateask x p receiver)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askclass, askframe, asktable ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askclass (x sender (receiver integrator)) (declare (ignore sender)) (classify x receiver)) (defmethod askframe (x class sender (receiver integrator)) (declare (ignore x class sender)) nil) (defmethod asktable (ol sl sender (receiver integrator)) (call-next-method ol sl sender receiver)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Theory commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; classify, facts, rules ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod classify (x (receiver integrator)) (let (dum) (cond ((characterp x) 'character) ((stringp x) 'string) ((numberp x) 'number) ((setq dum (find-classifier (name receiver))) (or (askx '?class (list dum x '?class) receiver receiver) 'thing)) ((dolist (a (finds '?a '(specialty ?a ?r) *manager*)) (when (not (eq (setq dum (classify x a)) 'thing)) (return dum)))) ((ruleclass x receiver (get-rulebase receiver))) (t 'thing)))) (defmethod facts (x (th integrator) &optional (f #'matchp)) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((eq (car l) (name th))) (t (setq nl (unionize nl (facts x (car l) f))))))) (defmethod rules (x (th integrator) &optional (f #'matchp)) ;(declare (ignore sender)) (facts x (find-rulebase (name th)) f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Reduction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun integrateask (x p receiver) (let (ruleserver query) (setq ruleserver (symbol-value (find-rulebase receiver))) (setq query (maksor (viewresidues p ruleserver #'specialp))) (setq query (decolonize query)) (when *collapse* (setq query (collapse x query))) ;(when *collapse* (setq query (raisin x query))) query)) (defun askonequery (x p) (cond ((eq p 'true) x) ((eq p 'false) nil) (t (eval (route (makaskemone x (source p))))))) (defun askallquery (x p) (cond ((eq p 'true) (list x)) ((eq p 'false) nil) (t (eval (route (makaskemall x (source p))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Collapse stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod collapse (x p) "(COLLAPSE X P) COLLAPSE takes as argument a term and a boolean sentence. It removes redundant literals from embedded conjunctions by matching variables not included in the specified list. The result is a sentence with the same values for the specified variables as the original sentence." (cond ((eq *collapse* 'simple) (collapse2 x p)) (*collapse* (collapse1 x p)) (t p))) (defun collapse1 (x p) (cond ((atom p) p) ((eq 'and (car p)) (maksand (equalizer (vars x) (cdr p)))) ((eq 'or (car p)) (maksor (mapcar #'(lambda (p) (collapse1 x p)) (cdr p)))) (t p))) (defun equalizer (vl cl) (eqexp nil cl (makvlist vl))) (defun equalizerexp (ol nl al) (cond ((null nl) (remove-duplicates (nreverse ol) :test #'equalp)) ((do ((l (reverse ol) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((do ((l (cdr nl) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((setq al (clearup (car nl) al)) (eqexp (cons (car nl) ol) (cdr nl) al)))) (defun clearup (x al) (cond ((indvarp x) (let ((dum (assoc x al))) (cond ((null dum) (acons x x al)) ((eq x (cdr dum)) al)))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (unless (setq al (clearup (car l) al)) (return nil)))))) (defun eqexp (ol nl al) (equalizerexp ol nl al)) (defun makvlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Intermediate versions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun equalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (ncl) (ol)) ((null l) (nreverse ol)) (do ((m cl (cdr m)) (nol) (nl)) ((null m) (setq ol (cons (car l) ol))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nol (sublis bl ol) nl (sublis bl l)) (setq ncl (revappend nol (cdr nl))) (subsetp ncl cl :test #'equalp)) (setq cl ncl ol nol l nl) (return t)))))))) (defun equalize (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (dl) (nl)) ((null l) (nreverse nl)) (do ((m cl (cdr m)) (nnl) (ncl)) ((null m) (setq nl (cons (car l) nl))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nnl (sublis bl nl) ncl (sublis bl l)) (setq dl (revappend nnl (cdr ncl))) (subsumepands dl cl al)) (setq cl dl nl nnl l ncl) (return t)))))))) (defun subsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (subsumepands (cdr p) (cdr q) al)))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun subsumepands (pl ql al) (cond ((null pl) al) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (setq bl (subsumepands (cdr pl) ql bl))) (return bl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Old version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun oldequalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (setq vl (varlist cl (varlist vl nil))) (do ((l cl (cdr l)) (nl)) ((null l) nl) (setq vl (unvarlist (car l) vl)) (cond ((member (car l) nl :test #'(lambda (x y) (equalizablep x y truth vl)))) ((member (car l) (cdr l) :test #'(lambda (x y) (equalizablep x y truth vl)))) (t (setq vl (varlist (car l) vl)) (setq nl (cons (car l) nl)))))))) (defun varlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (cond (dum (rplacd dum (1+ (cdr dum))) al) (t (acons x 1 al))))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (varlist (car l) al)))))) (defun unvarlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (rplacd dum (1- (cdr dum))) al)) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (unvarlist (car l) al)))))) (defun equalizablep (x y al vl) (cond ((eq x y) al) ((indvarp x) (let ((dum)) (cond ((setq dum (assoc x al :test #'eq)) (if (equal (cdr dum) y) al)) ((< (cdr (assoc x vl)) 1) (acons x y al))))) ((atom x) nil) ((atom y) nil) (t (do ((l x (cdr l)) (m y (cdr m))) ((null l) (if (null m) al)) (cond ((null m) (return nil)) ((setq al (equalizablep (car l) (car m) al vl))) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Latest version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun collapse2 (x p) (cond ((atom p) p) ((eq 'or (car p)) (collapse2or x p)) ((eq 'and (car p)) (collapse2and x p)) (t p))) (defun collapse2or (x p) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (maksor (nreverse nl))) (setq nl (cons (collapse2 x (car l)) nl)))) (defun collapse2and (x p) (let ((cl (copy-list (cdr p))) (al truth)) (do ((l cl (cdr l)) (bl)) ((null l)) (cond ((basep (operator (car l)))) (t (do ((m (cdr l) (cdr m))) ((null m)) (cond ((eq (car l) (car m))) ((setq bl (collapser (car l) (car m) al)) (setq al bl) (setq l (delete (car m) l)))))))) ; TLH: didn't used to (setq l ...) to result of delete (do ((l al (cdr l)) (vl (vars x)) (dum) (bl truth)) ((null (cdr l)) (setq al bl)) (cond ((find (caar l) vl) (setq dum (plug (cdar l) al)) (cond ((groundp dum) (setq bl (cons (car l) bl))) ((find dum vl) (setq bl (cons (car l) bl))) (t (setq bl (acons dum (caar l) bl))))) (t (setq bl (cons (car l) bl))))) (setq cl (mapcar #'(lambda (x) (plug x al)) cl)) (do ((l (vars x) (cdr l)) (dum)) ((null l) (maksand cl)) (if (not (eq (setq dum (plug (car l) al)) (car l))) (setq cl (cons `(same ,(car l) ,dum) cl)))))) (defun collapser (p q al) (cond ((atom p) (if (equalp p q) al)) ((atom q) nil) ((eq 'not (car p)) nil) ((eq 'unprovable (car p)) nil) ((eq (car p) (car q)) (collapserexp p q al)))) (defun collapserexp (p q al) (let (cols keys) (when (and (setq cols (find-columns (car p))) (setq keys (find-keys (car p)))) (do ((l (cdr p) (cdr l)) (m (cdr q) (cdr m)) (bl) (cl cols (cdr cl)) (kl keys)) ((or (null l) (null m)) (if (and (null l) (null m) (null kl)) al)) (cond ((eq (car cl) (car kl)) (if (equalp (plug (car l) al) (plug (car m) al)) (setq kl (cdr kl)) (return nil))) ((setq bl (mguexp (car l) (car m) al)) (setq al bl)) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; raisin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun raisin (x p) (cond ((atom p) p) ((eq 'or (car p)) (raisinor x p)) (t p))) (defun raisinor (x p) (cond ((null (cdr p)) nil) ((null (cddr p)) (cadr p)) (t (do ((l (cdr p) (cdr l)) (al (makvarlist x)) (ol)) ((null l) (maksor (nreverse ol))) (cond ((some #'(lambda (p) (relsumep p (car l) al)) ol)) ((some #'(lambda (p) (relsumep p (car l) al)) (cdr l))) (t (setq ol (cons (car l) ol)))))))) (defun makvarlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) (defun relsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (relsumepands (cdr p) al (cdr q))) (t (relsumepands (cdr p) al (list q))))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun relsumepands (pl al ql) (cond ((null pl)) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (relsumepands (cdr pl) bl ql)) (return t)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Sourcing ;;; Example: (or (p 1) (and (q 2) (r 3))) where art performs p, bob q and r ;;; Output: (or (ask (art) (p 1)) (ask (bob) (and (q 2) (r 3)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun source (p) (setq p (sources p)) (remedy p)) (defun sources (p) (cond ((atom p) `(ask ,(find-specialists p) ,p)) ((eq 'and (car p)) (source-and p)) ((eq 'or (car p)) (source-or p)) ((eq 'not (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (not ,(caddr p)))) (t `(not ,p)))) ((eq 'unprovable (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (unprovable ,(caddr p)))) (t `(unprovable ,p)))) ((eq 'bagofall (car p)) (let (plan) (setq plan (sources (caddr p))) (cond ((eq 'ask (car plan)) `(ask ,(cadr plan) (bagofall ,(cadr p) ,(caddr plan) ,(cadddr p)))) (t `(bagofall ,(cadr p) ,plan ,(cadddr p)))))) (t `(ask ,(find-specialists (car p)) ,p)))) (defun source-and (p) (do ((l (mapcar #'sources (cdr p))) (sources) (dum) (nl)) ((null l) (cond ((null (cdr nl)) (car nl)) (t (mapc #'remedy nl) (cons 'and (nreverse nl))))) (cond ((not (eq 'ask (caar l))) (setq nl (cons (car l) nl) l (cdr l))) (t (setq sources (cadar l)) (do ((m (cdr l) (cdr m)) (nc (list (caddar l)))) ((null m) (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l nil)) (cond ((and (eq 'ask (caar m)) (setq dum (intersection* sources (cadar m)))) (setq sources dum nc (cons (caddar m) nc))) (t (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l m) (return t)))))))) (defun source-or (p) (cons 'or (mapcar #'remedy (mapcar #'sources (cdr p))))) (defun findallspecialists (p) (cond ((atom p) (find-specialists p)) ((eq 'not (car p)) (findallspecialists (cadr p))) ((member (car p) '(and or <= =>)) (do ((l (cddr p) (cdr l)) (nl (findallspecialists (cadr p)))) ((null l) (nreverse nl)) (setq nl (intersect nl (findallspecialists (car l)))))) ((eq 'unprovable (car p)) (findallspecialists (cadr p))) (t (find-specialists (car p))))) (defun find-specialist (x) (cond ((eq 'true x) 'warehouse) ((eq 'false x) 'warehouse) ((basep x) 'warehouse) ((findp `(specialty warehouse ,x) *manager*) 'warehouse) ((findp `(specialty library ,x) *manager*) 'library) (t (findx '?a `(specialty ?a ,x) *manager*)))) (defun find-specialists (x) (cond ((eq 'true x) *agents*) ((eq 'false x) *agents*) ((basep x) (append *agents* (finds '?a `(specialty ?a ,x) *manager*))) (t (sortspecialists (finds '?a `(specialty ?a ,x) *manager*))))) (defun sortspecialists (specialists) (if (find (name *warehouse*) specialists) (cons (name *warehouse*) (delete (name *warehouse*) specialists)) specialists)) (defun remedy (x) (cond ((atom x) x) ((eq 'ask (car x)) (rplaca (cdr x) (caadr x)) x) (t x))) (defun divvy (msg) (let (dum al) (dolist (p (cdr msg)) (dolist (a (finds '?a `(interest ?a ,(operator p)) *manager*)) (cond ((setq dum (assoc a al)) (rplacd dum (cons p (cdr dum)))) (t (setq al (acons a (list p) al)))))) (do ((l al (cdr l)) (pl)) ((null l) (maksprogn pl)) (setq pl (cons `(ask ,(caar l) (update . ,(nreverse (cdar l)))) pl))))) (defun makaskemone (x p) (cond ((null p) nil) ((atom p) `(askemone ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-one ,x ,(caddr p)))) (t `(askemone ',x ',p)))) (defun makaskemall (x p) (cond ((null p) nil) ((atom p) `(askemall ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-all ,x ,(caddr p)))) ((eq 'or (car p)) (cons 'union* (mapcar #'(lambda (p) (makaskemall x p)) (cdr p)))) (t `(askemall ',x ',p)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Routing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun route (c) (cond ((atom c) c) ((eq 'quote (car c)) c) ((eq 'ask (car c)) (rplaca (cdr c) (caadr c)) c) ((eq 'tellemall (car c)) c) (t (dolist (item (cdr c)) (route item)) c))) (defun router (c) (setq c (routes c)) (cond ((eq (name *library*) (caadr c)) (caddr c)) (t (rplaca (cdr c) (caadr c)) c))) (defun routes (c) (cond ((atom c) `(ask ,*agents* ,c)) ((eq 'quote (car c)) `(ask ,*agents* ,c)) ((eq 'ask (car c)) c) ((eq 'tellemall (car c)) `(ask ,*agents* ,c)) (t (route-call c)))) (defun route-call (c) (do* ((args (mapcar #'routes (cdr c))) (l args (cdr l)) (sources (find-performers (car c))) (s sources)) ((null l) `(ask ,s ,(cons (car c) (mapcar #'caddr args)))) (cond ((setq s (intersect s (cadar l)))) (t (mapc #'(lambda (x) (rplaca (cdr x) (caadr x))) args) (return `(ask ,sources ,(cons (car c) args))))))) (defun find-performers (x) (cond ((lispp x) (append *agents* (finds '?a `(performs ?a ,x) *manager*))) ((fboundp x) (list (name *library*))) ((eq 'if x) *agents*) (t (finds '?a `(performs ?a ,x) *manager*)))) (defun lispp (x) (find-symbol (symbol-name x) (find-package 'common-lisp))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Execution stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun askfacts (msg) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((and (eq (car l) *sender*) (equal msg *message*))) (t (setq nl (unionize nl (request msg *receiver* (car l)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; iterated version ;;; ;;; execution depends on *group* ;;; nil means nested ;;; t means all-at-once by copying ;;; yank means all-at-once using oneof ;;; yank2 means all-at-once using oneof and join ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *group* 'loyal) (defun tellemall (q p) (dolist (piece (askemall q p)) (tellem piece))) (defun tellem (p) (cond ((atom p)) ((eq 'tell (car p)) (dolist (agent (cadr p)) (request `(tell ,(caddr p)) *receiver* agent))) ((eq 'untell (car p)) (dolist (agent (cadr p)) (request `(untell ,(caddr p)) *receiver* agent))) ((eq 'progn (car p)) (mapc #'tellem (cdr p))))) (defun newtellemall (&rest rules) (let (tells) (do ((l rules (cdr l))) ((null l)) (cond ((atom (car l))) ((eq 'tell (caar l)) (setq tells (cons (car l) tells))) ((eq '==> (caar l)) (dolist (answer (askemall (caddar l) (cadar l))) (setq tells (contribute answer tells)))))) (setq tells (coalesce tells)) (do ((l tells (cdr l)) (nl) (dum)) ((null l) 'done) (setq dum (request `(tell ,(maksand (cdar l))) *receiver* (caar l))) (cond ((stringp dum) (do ((m nl (cdr m)) (untell)) ((null m)) (setq untell (maksand (nreverse (mapcar #'maknot (cdar m))))) (request `(tell ,untell) *receiver* (caar m))) (return dum)) (t (setq nl (cons (car l) nl))))))) (defun newcoalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (cons (list (cadar l) (caddar l)) nl))) (t (dolist (who (cadar l)) (setq nl (cons (list who (caddar l)) nl))))))) (defun coalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (coal (cadar l) (caddar l) nl))) (t (dolist (who (cadar l)) (setq nl (coal who (caddar l) nl))))))) (defun coal (who what nl) (let (dum) (cond ((setq dum (assoc who nl :test #'eq)) (rplacd dum (contribute what (cdr dum))) nl) (t (acons who (contribute what nil) nl))))) (defun askemone (x p) (cond ((eq *group* 'loyal) (loyalone x p)) ((eq *group* 'yank) (yankemone x p)) ((eq *group* 'yank2) (yankemone2 x p)) ((eq *group* 'rebel) (rebelone x p)) (t (getemone x p)))) (defun askemall (x p) (cond ((eq *group* 'loyal) (loyalall x p)) ((eq *group* 'yank) (yankemall x p)) ((eq *group* 'yank2) (yankemall2 x p)) ((eq *group* 'rebel) (rebelall x p)) (*group* (findemall x p)) (t (getemall x p)))) (defun assumeall (p th) (cond ((and th (symbolp th) (boundp th)) (assumeall p (symbol-value th))) (t (includes th *library*) (assume p th)))) (defun forgetall (p th) (cond ((and th (symbolp th) (boundp th)) (forgetall p (symbol-value th))) (t (includes th *library*) (forget p th)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; loyal - new flat all-at-once execution using oneof and no alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun loyalone (x p) (loyone x p '(t) '((t)))) (defun loyone (x p vl sl) (cond ((null p) nil) ((atom p) (loyproject x vl sl)) ((eq 'ask (car p)) (loyoneask x p vl sl)) ((eq 'and (car p)) (loyoneand x p vl sl)) ((eq 'or (car p)) (loyoneor x p vl sl)) ((eq 'unprovable (car p)) (loyoneunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyonebagofall x p vl sl)))) (defun loyoneask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-one ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-one ,x ,query) *receiver* db))))) (defun loyoneand (x p vl sl) (cond ((null (cdr p)) (loyproject x vl sl)) ((null (cddr p)) (loyone x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null (cdr l)) (loyone x (car l) vl sl)) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyoneor (x p vl sl) (do ((l (cdr p) (cdr l)) (dum)) ((null l) nil) (when (setq dum (loyone x (car l) vl sl)) (return dum)))) (defun loyoneunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) (car sl) (loyproject x vl sl))) (defun loyonebagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyproject (x vl sl) (findx x `(oneof ,vl . ,sl) *manager*)) (defun loyalall (x p) (loyal x p '(t) '((t)))) (defun loyal (x p vl sl) (cond ((null p) nil) ((atom p) (loyalproject x vl sl)) ((eq 'ask (car p)) (loyalask x p vl sl)) ((eq 'and (car p)) (loyaland x p vl sl)) ((eq 'or (car p)) (loyalor x p vl sl)) ((eq 'unprovable (car p)) (loyalunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyalbagofall x p vl sl)))) (defun loyalask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-all ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-all ,x ,query) *receiver* db))))) (defun loyaland (x p vl sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (loyal x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null l) (if (equal x vl) sl (loyalproject x vl sl))) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyalor (x p vl sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (loyal x (car l) vl sl) nl)))) (defun loyalunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) sl (loyalproject x vl sl))) (defun loyalbagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyalproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyalproj (x vl s) (findx x `(same ,vl ,s) *manager*)) (defun loyalproject (x vl sl) (finds x `(oneof ,vl . ,sl) *manager*)) (defun loyalvars (x p vl) (cdr (loyalvarscdr vl (cdr p) (vars x)))) (defun loyalvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (loyalvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) (defmethod variables ((al list)) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (caar l) nl)))) (defun bindings (al) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (cdar l) nl)))) (defun startp (l1 l2) (do () ((null l1) t) (cond ((null l2) (return nil)) ((equalp (car l1) (car l2)) (setq l1 (cdr l1) l2 (cdr l2))) (t (return nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; one-by-one execution ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun getemone (x p) (let ((al (askone p truth))) (if al (sublis al x)))) (defun askone (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askoneask p al)) ((eq 'and (car p)) (askoneand p al)) ((eq 'or (car p)) (askoneor p al)) (t (askoneask (list 'ask *library* p) al)))) (defun askoneand (p al) (askoneands (cdr p) al)) (defun askoneands (cl al) (cond ((null cl) al) ((null (cdr cl)) (askone (car cl) al)) (t (do ((l (askem (car cl) al) (cdr l)) (bl)) ((null l) nil) (if (setq bl (askoneands (cdr cl) (car l))) (return bl)))))) (defun askoneask (p al) (let ((dum)) (setq p (sublis al p)) (when (setq dum (request `(ask-one ,(caddr p) ,(caddr p)) *receiver* (cadr p))) (matchpexp (caddr p) dum al)))) (defun askoneor (p al) (do ((l (cdr p) (cdr l)) (bl)) ((null l)) (if (setq bl (askone (car l) al)) (return bl)))) (defun getemall (x p) (do ((l (askem p truth) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun askem (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askallask p al)) ((eq 'and (car p)) (askalland p al)) ((eq 'or (car p)) (askallor p al)) (t (askallask (list 'ask *library* p) al)))) (defun askallask (p al) (setq p (sublis al p)) (do ((l (request `(ask-all ,(caddr p) ,(caddr p)) *receiver* (cadr p)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp (caddr p) (car l) al) nl)))) (defun askalland (p al) (askallands (cdr p) al)) (defun askallands (cl al) (cond ((null cl) (list al)) (t (do ((l (askem (car cl) al) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askallands (cdr cl) (car l)) nl)))))) (defun askallor (p al) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askem (car l) al) nl)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; new flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun rebelone (x p) (let ((nl (rebel x p (list truth)))) (if nl (sublis (car nl) x)))) (defun rebelall (x p) (do ((l (rebel x p (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun rebel (x p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (rebelask x p sl)) ((eq 'and (car p)) (rebeland x p sl)) ((eq 'or (car p)) (rebelor x p sl)) ((eq 'unprovable (car p)) (rebelunprovable p sl)))) (defun rebelask (x p sl) (let* ((db (cadr p)) (query (caddr p)) ins answers) (cond ((null sl) nil) ((setq ins (variables (car sl))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (bindings (car l)) nl))) (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl)))) (t (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl))))))) (defun rebeland (x p sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (rebel x (cadr p) sl)) (t (do ((l (cdr p) (cdr l)) (vl (rebvars x p (car sl)) (cdr vl))) ((null l) sl) (setq sl (rebel (car vl) (car l) sl)))))) (defun rebelor (x p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (rebel x (car l) sl) nl)))) (defun rebelunprovable (p sl) (set-difference sl (rebel (variables (car sl)) (cadr p) sl) :test #'equal)) (defun rebvars (x p al) (cdr (rebvarscdr (mapcar #'car al) (cdr p) (vars x)))) (defun rebvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (rebvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; nested all-at-once execution by copying and returning list of answers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun findemone (x p) (let ((nl (findem (newvars x p) truth))) (if nl (sublis (car nl) x)))) (defun findemall (x p) (do ((l (findem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun findem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (findemask p sl)) ((eq 'and (car p)) (findemand p sl)) ((eq 'or (car p)) (findemor p sl)))) (defun findemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) answers) (cond ((null sl) nil) ((null (cdr sl)) (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,query)) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (cons 'list (nreverse nl)))) (setq nl (cons (sublis (car l) query) nl))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (n sl (cdr n)) (nl)) ((null l) (nreverse nl)) (do ((m (car l) (cdr m))) ((null m)) (setq nl (cons (matchpexp aspect (car m) (car n)) nl)))))))) (defun findemand (p sl) (findemands (cdr p) sl)) (defun findemands (cl sl) (cond ((null cl) sl) (t (findemands (cdr cl) (findem (car cl) sl))))) (defun findemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (findem (car l) sl) nl)))) (defun newvars (x p) (newvarsexp p nil (vars x))) (defun newvarsexp (p vl wl) (cond ((atom p) p) ((eq 'ask (car p)) (let ((vs (goodvars (caddr p))) (news) (useless) (locals)) (setq news (set-difference vs vl)) (setq useless (set-difference news wl)) (setq locals (set-difference news useless)) `(ask ,(cadr p) ,locals ,(caddr p)))) ((eq 'and (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'and (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl (append (vars (cdr l)) wl)) nl)) (setq vl (nconc (goodvars (car l)) vl)))) ((eq 'or (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'or (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl wl) nl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun economize (aspect) (cond ((null aspect) '(1)) ((atom aspect) (list aspect)) (t aspect))) (defun yankemone (x p) (let ((nl (yankem (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall (x p) (do ((l (yankem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask p sl)) ((eq 'and (car p)) (yankemand p sl)) ((eq 'or (car p)) (yankemor p sl)))) (defun yankemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (do ((l (car sl) (cdr l))) ((null (cdr l))) (setq ins (cons (caar l) ins))) (setq aspect (economize (unionize ins aspect))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (sublis (car l) ins) nl))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand (p sl) (yankemands (cdr p) sl)) (defun yankemands (cl sl) (cond ((null cl) sl) (t (yankemands (cdr cl) (yankem (car cl) sl))))) (defun yankemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem (car l) sl) nl)))) (defun yankemone2 (x p) (let ((nl (yankem2 (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall2 (x p) (do ((l (yankem2 (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem2 (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask2 p sl)) ((eq 'and (car p)) (yankemand2 p sl)) ((eq 'or (car p)) (yankemor2 p sl)))) (defun yankemask2 (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (setq ins (boundvars query (car sl))) (setq aspect (economize (unionize ins aspect))) (when ins (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(uniquify (nreverse nl))) query))) (setq nl (cons (sublis (car l) ins) nl)))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (joinal sl (nreverse nl))) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand2 (p sl) (yankemands2 (cdr p) sl)) (defun yankemands2 (cl sl) (cond ((null cl) sl) (t (yankemands2 (cdr cl) (yankem2 (car cl) sl))))) (defun yankemor2 (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem2 (car l) sl) nl)))) (defun boundvars (x al) (do ((l (vars x) (cdr l)) (nl)) ((null l) (nreverse nl)) (if (assoc (car l) al) (setq nl (cons (car l) nl))))) ;;; what do we do about ground queries? ;;; following assumes that alists all have same structure (defun joinal (as bs) (do ((l as (cdr l)) (dum) (nl)) ((null l) (nreverse nl)) (do ((m bs (cdr m))) ((null m)) (when (setq dum (joinemal (car l) (car m))) (setq nl (cons dum nl)))))) (defun joinemal (al bl) (let (dum) (cond ((null (cdr al)) bl) ((setq dum (assoc (caar al) bl :test #'eq)) (if (equal (cdar al) (cdr dum)) (joinemal (cdr al) bl))) ((setq bl (joinemal (cdr al) bl)) (cons (car al) bl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Miscellaneous ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun find-agents () (cons 'repository (finds '?a '(specialty ?a ?r) *manager*))) (defun interestp (r) (or (eq r 'evaluate) (findp `(interest ?a ,r) *manager*))) (defun specialp (r) (or (basep r) (findp `(specialty ?a ,r) *manager*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
true
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (c) Copyright 1999-2005 by PI:NAME:<NAME>END_PI. All rights reserved. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator.lisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when (compile load eval) (proclaim '(special *manager* *library* *warehouse* *repository* *ancestry* *collapse* *message* *sender* *receiver* *target*))) (defparameter *agents* nil) (defparameter *collapse* 'simple) (defparameter *compress* nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; integrator ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass integrator (agent) ()) (defmethod message-handler (*message* *sender* (*receiver* integrator)) (let (*library* *warehouse* *agents*) (setq *library* (referent (find-rulebase *receiver*))) (setq *warehouse* (referent (find-database *receiver*))) (eval *message*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Knowledge commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; affirm, retract ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod affirm (p sender (receiver integrator)) (declare (ignore sender)) (affirm p receiver (get-rulebase receiver))) (defmethod retract (p sender (receiver integrator)) (declare (ignore sender)) (retract p receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askabout ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askabout (x sender (receiver integrator)) (declare (ignore sender)) (askabout x receiver (get-rulebase receiver))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Data commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; revise, revisions, errors, materializations, notifications, reactions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod revise (p sender (receiver integrator)) (declare (ignore sender)) (let (revisions notifications materializations reactions factserver) (setq revisions (revisions p receiver) p (maksand revisions)) (cond ((errors p receiver)) (t (setq materializations (materializations p receiver)) (setq notifications (notifications p receiver)) (setq reactions (reactions p receiver)) (setq factserver (find-target (name receiver))) ;(dolist (p revisions) (change p factserver)) (dolist (p materializations) (change p factserver)) (dolist (dum notifications) (revise (maksand (cdr dum)) receiver (car dum))) (dolist (dum reactions) (eval dum)) 'done)))) (defmethod revisions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertplusminus p temp) (includes temp ruleserver) (dolist (r (supports p ruleserver)) ; TLH #'extensionalp)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(minus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(plus ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod errors (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(error ?e) temp #'specialp))) (setq answers (askallquery '?e query)) (decludes temp) (empty temp) answers)) (defmethod materializations (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (r (viewfinds '?r '(material ?a ?r) *manager*)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (decludes temp) (empty temp) answers)) (defmethod notifications (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp pat pos neg answers subscripts) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (dolist (agent (subscribers '?)) (dolist (r (subscriptions agent)) (setq pat `(,r @l)) (setq neg (maksor (viewresidues `(neg ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery `(not ,pat) neg))) (setq pos (maksor (viewresidues `(pos ,pat) temp #'specialp))) (setq answers (nconc answers (askallquery pat pos)))) (when answers (setq subscripts (cons (cons agent answers) subscripts))) (setq answers nil)) (decludes temp) (empty temp) subscripts)) (defmethod reactions (p (receiver integrator)) (let (*agent* *library* *agents* ruleserver temp query answers) (setq *agent* (name receiver)) (setq *library* (find-rulebase *agent*)) (setq *agents* (find-agents)) (setq ruleserver (symbol-value *library*)) (setq temp (make-instance 'theory)) (insertposneg p temp) (includes temp ruleserver) (setq query (maksor (viewresidues '(trigger ?x) temp #'specialp))) (setq answers (askallquery '?x query)) (decludes temp) (empty temp) answers)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askp, askx, asks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askp (p sender (receiver integrator)) (askx t p sender receiver)) (defmethod askx (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askonequery x (integrateask x p receiver)))) (defmethod asks (x p sender (receiver integrator)) (declare (ignore sender)) (let (*agents*) (setq *agents* (find-agents)) (askallquery x (integrateask x p receiver)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; askclass, askframe, asktable ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod askclass (x sender (receiver integrator)) (declare (ignore sender)) (classify x receiver)) (defmethod askframe (x class sender (receiver integrator)) (declare (ignore x class sender)) nil) (defmethod asktable (ol sl sender (receiver integrator)) (call-next-method ol sl sender receiver)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Theory commands ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; classify, facts, rules ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod classify (x (receiver integrator)) (let (dum) (cond ((characterp x) 'character) ((stringp x) 'string) ((numberp x) 'number) ((setq dum (find-classifier (name receiver))) (or (askx '?class (list dum x '?class) receiver receiver) 'thing)) ((dolist (a (finds '?a '(specialty ?a ?r) *manager*)) (when (not (eq (setq dum (classify x a)) 'thing)) (return dum)))) ((ruleclass x receiver (get-rulebase receiver))) (t 'thing)))) (defmethod facts (x (th integrator) &optional (f #'matchp)) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((eq (car l) (name th))) (t (setq nl (unionize nl (facts x (car l) f))))))) (defmethod rules (x (th integrator) &optional (f #'matchp)) ;(declare (ignore sender)) (facts x (find-rulebase (name th)) f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Reduction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun integrateask (x p receiver) (let (ruleserver query) (setq ruleserver (symbol-value (find-rulebase receiver))) (setq query (maksor (viewresidues p ruleserver #'specialp))) (setq query (decolonize query)) (when *collapse* (setq query (collapse x query))) ;(when *collapse* (setq query (raisin x query))) query)) (defun askonequery (x p) (cond ((eq p 'true) x) ((eq p 'false) nil) (t (eval (route (makaskemone x (source p))))))) (defun askallquery (x p) (cond ((eq p 'true) (list x)) ((eq p 'false) nil) (t (eval (route (makaskemall x (source p))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Collapse stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmethod collapse (x p) "(COLLAPSE X P) COLLAPSE takes as argument a term and a boolean sentence. It removes redundant literals from embedded conjunctions by matching variables not included in the specified list. The result is a sentence with the same values for the specified variables as the original sentence." (cond ((eq *collapse* 'simple) (collapse2 x p)) (*collapse* (collapse1 x p)) (t p))) (defun collapse1 (x p) (cond ((atom p) p) ((eq 'and (car p)) (maksand (equalizer (vars x) (cdr p)))) ((eq 'or (car p)) (maksor (mapcar #'(lambda (p) (collapse1 x p)) (cdr p)))) (t p))) (defun equalizer (vl cl) (eqexp nil cl (makvlist vl))) (defun equalizerexp (ol nl al) (cond ((null nl) (remove-duplicates (nreverse ol) :test #'equalp)) ((do ((l (reverse ol) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((do ((l (cdr nl) (cdr l)) (bl) (dum)) ((null l) nil) (cond ((and (setq bl (matchpexp (car nl) (car l) al)) (setq dum (eqexp ol (cdr nl) bl))) (return dum))))) ((setq al (clearup (car nl) al)) (eqexp (cons (car nl) ol) (cdr nl) al)))) (defun clearup (x al) (cond ((indvarp x) (let ((dum (assoc x al))) (cond ((null dum) (acons x x al)) ((eq x (cdr dum)) al)))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (unless (setq al (clearup (car l) al)) (return nil)))))) (defun eqexp (ol nl al) (equalizerexp ol nl al)) (defun makvlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Intermediate versions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun equalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (ncl) (ol)) ((null l) (nreverse ol)) (do ((m cl (cdr m)) (nol) (nl)) ((null m) (setq ol (cons (car l) ol))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nol (sublis bl ol) nl (sublis bl l)) (setq ncl (revappend nol (cdr nl))) (subsetp ncl cl :test #'equalp)) (setq cl ncl ol nol l nl) (return t)))))))) (defun equalize (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (do ((l cl (cdr l)) (al (makvlist vl)) (bl) (dl) (nl)) ((null l) (nreverse nl)) (do ((m cl (cdr m)) (nnl) (ncl)) ((null m) (setq nl (cons (car l) nl))) (cond ((eq (car l) (car m))) ((and (setq bl (matchpexp (car l) (car m) al)) (setq nnl (sublis bl nl) ncl (sublis bl l)) (setq dl (revappend nnl (cdr ncl))) (subsumepands dl cl al)) (setq cl dl nl nnl l ncl) (return t)))))))) (defun subsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (subsumepands (cdr p) (cdr q) al)))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun subsumepands (pl ql al) (cond ((null pl) al) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (setq bl (subsumepands (cdr pl) ql bl))) (return bl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Old version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun oldequalify (vl cl) (cond ((null cl) nil) ((null (cdr cl)) cl) (t (setq vl (varlist cl (varlist vl nil))) (do ((l cl (cdr l)) (nl)) ((null l) nl) (setq vl (unvarlist (car l) vl)) (cond ((member (car l) nl :test #'(lambda (x y) (equalizablep x y truth vl)))) ((member (car l) (cdr l) :test #'(lambda (x y) (equalizablep x y truth vl)))) (t (setq vl (varlist (car l) vl)) (setq nl (cons (car l) nl)))))))) (defun varlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (cond (dum (rplacd dum (1+ (cdr dum))) al) (t (acons x 1 al))))) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (varlist (car l) al)))))) (defun unvarlist (x al) (cond ((varp x) (let ((dum (assoc x al :test #'eq))) (rplacd dum (1- (cdr dum))) al)) ((atom x) al) (t (do ((l x (cdr l))) ((null l) al) (setq al (unvarlist (car l) al)))))) (defun equalizablep (x y al vl) (cond ((eq x y) al) ((indvarp x) (let ((dum)) (cond ((setq dum (assoc x al :test #'eq)) (if (equal (cdr dum) y) al)) ((< (cdr (assoc x vl)) 1) (acons x y al))))) ((atom x) nil) ((atom y) nil) (t (do ((l x (cdr l)) (m y (cdr m))) ((null l) (if (null m) al)) (cond ((null m) (return nil)) ((setq al (equalizablep (car l) (car m) al vl))) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Latest version ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun collapse2 (x p) (cond ((atom p) p) ((eq 'or (car p)) (collapse2or x p)) ((eq 'and (car p)) (collapse2and x p)) (t p))) (defun collapse2or (x p) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (maksor (nreverse nl))) (setq nl (cons (collapse2 x (car l)) nl)))) (defun collapse2and (x p) (let ((cl (copy-list (cdr p))) (al truth)) (do ((l cl (cdr l)) (bl)) ((null l)) (cond ((basep (operator (car l)))) (t (do ((m (cdr l) (cdr m))) ((null m)) (cond ((eq (car l) (car m))) ((setq bl (collapser (car l) (car m) al)) (setq al bl) (setq l (delete (car m) l)))))))) ; TLH: didn't used to (setq l ...) to result of delete (do ((l al (cdr l)) (vl (vars x)) (dum) (bl truth)) ((null (cdr l)) (setq al bl)) (cond ((find (caar l) vl) (setq dum (plug (cdar l) al)) (cond ((groundp dum) (setq bl (cons (car l) bl))) ((find dum vl) (setq bl (cons (car l) bl))) (t (setq bl (acons dum (caar l) bl))))) (t (setq bl (cons (car l) bl))))) (setq cl (mapcar #'(lambda (x) (plug x al)) cl)) (do ((l (vars x) (cdr l)) (dum)) ((null l) (maksand cl)) (if (not (eq (setq dum (plug (car l) al)) (car l))) (setq cl (cons `(same ,(car l) ,dum) cl)))))) (defun collapser (p q al) (cond ((atom p) (if (equalp p q) al)) ((atom q) nil) ((eq 'not (car p)) nil) ((eq 'unprovable (car p)) nil) ((eq (car p) (car q)) (collapserexp p q al)))) (defun collapserexp (p q al) (let (cols keys) (when (and (setq cols (find-columns (car p))) (setq keys (find-keys (car p)))) (do ((l (cdr p) (cdr l)) (m (cdr q) (cdr m)) (bl) (cl cols (cdr cl)) (kl keys)) ((or (null l) (null m)) (if (and (null l) (null m) (null kl)) al)) (cond ((eq (car cl) (car kl)) (if (equalp (plug (car l) al) (plug (car m) al)) (setq kl (cdr kl)) (return nil))) ((setq bl (mguexp (car l) (car m) al)) (setq al bl)) (t (return nil))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; raisin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun raisin (x p) (cond ((atom p) p) ((eq 'or (car p)) (raisinor x p)) (t p))) (defun raisinor (x p) (cond ((null (cdr p)) nil) ((null (cddr p)) (cadr p)) (t (do ((l (cdr p) (cdr l)) (al (makvarlist x)) (ol)) ((null l) (maksor (nreverse ol))) (cond ((some #'(lambda (p) (relsumep p (car l) al)) ol)) ((some #'(lambda (p) (relsumep p (car l) al)) (cdr l))) (t (setq ol (cons (car l) ol)))))))) (defun makvarlist (x) (do ((l (vars x) (cdr l)) (al)) ((null l) (nreverse (cons '(t . t) al))) (setq al (acons (car l) (car l) al)))) (defun relsumep (p q al) (cond ((atom p) (cond ((atom q) (eq p q)) ((eq 'and (car q)) (find p (cdr q))))) ((eq 'and (car p)) (cond ((atom q) nil) ((eq 'and (car q)) (relsumepands (cdr p) al (cdr q))) (t (relsumepands (cdr p) al (list q))))) (t (cond ((atom q) nil) ((eq 'and (car q)) (some #'(lambda (x) (matchpexp p x al)) (cdr q))) (t (matchpexp p q al)))))) (defun relsumepands (pl al ql) (cond ((null pl)) (t (do ((m ql (cdr m)) (bl)) ((null m)) (if (and (setq bl (matchpexp (car pl) (car m) al)) (relsumepands (cdr pl) bl ql)) (return t)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Sourcing ;;; Example: (or (p 1) (and (q 2) (r 3))) where art performs p, bob q and r ;;; Output: (or (ask (art) (p 1)) (ask (bob) (and (q 2) (r 3)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun source (p) (setq p (sources p)) (remedy p)) (defun sources (p) (cond ((atom p) `(ask ,(find-specialists p) ,p)) ((eq 'and (car p)) (source-and p)) ((eq 'or (car p)) (source-or p)) ((eq 'not (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (not ,(caddr p)))) (t `(not ,p)))) ((eq 'unprovable (car p)) (setq p (sources (cadr p))) (cond ((eq 'ask (car p)) `(ask ,(cadr p) (unprovable ,(caddr p)))) (t `(unprovable ,p)))) ((eq 'bagofall (car p)) (let (plan) (setq plan (sources (caddr p))) (cond ((eq 'ask (car plan)) `(ask ,(cadr plan) (bagofall ,(cadr p) ,(caddr plan) ,(cadddr p)))) (t `(bagofall ,(cadr p) ,plan ,(cadddr p)))))) (t `(ask ,(find-specialists (car p)) ,p)))) (defun source-and (p) (do ((l (mapcar #'sources (cdr p))) (sources) (dum) (nl)) ((null l) (cond ((null (cdr nl)) (car nl)) (t (mapc #'remedy nl) (cons 'and (nreverse nl))))) (cond ((not (eq 'ask (caar l))) (setq nl (cons (car l) nl) l (cdr l))) (t (setq sources (cadar l)) (do ((m (cdr l) (cdr m)) (nc (list (caddar l)))) ((null m) (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l nil)) (cond ((and (eq 'ask (caar m)) (setq dum (intersection* sources (cadar m)))) (setq sources dum nc (cons (caddar m) nc))) (t (setq nl (cons `(ask ,sources ,(maksand (nreverse nc))) nl)) (setq l m) (return t)))))))) (defun source-or (p) (cons 'or (mapcar #'remedy (mapcar #'sources (cdr p))))) (defun findallspecialists (p) (cond ((atom p) (find-specialists p)) ((eq 'not (car p)) (findallspecialists (cadr p))) ((member (car p) '(and or <= =>)) (do ((l (cddr p) (cdr l)) (nl (findallspecialists (cadr p)))) ((null l) (nreverse nl)) (setq nl (intersect nl (findallspecialists (car l)))))) ((eq 'unprovable (car p)) (findallspecialists (cadr p))) (t (find-specialists (car p))))) (defun find-specialist (x) (cond ((eq 'true x) 'warehouse) ((eq 'false x) 'warehouse) ((basep x) 'warehouse) ((findp `(specialty warehouse ,x) *manager*) 'warehouse) ((findp `(specialty library ,x) *manager*) 'library) (t (findx '?a `(specialty ?a ,x) *manager*)))) (defun find-specialists (x) (cond ((eq 'true x) *agents*) ((eq 'false x) *agents*) ((basep x) (append *agents* (finds '?a `(specialty ?a ,x) *manager*))) (t (sortspecialists (finds '?a `(specialty ?a ,x) *manager*))))) (defun sortspecialists (specialists) (if (find (name *warehouse*) specialists) (cons (name *warehouse*) (delete (name *warehouse*) specialists)) specialists)) (defun remedy (x) (cond ((atom x) x) ((eq 'ask (car x)) (rplaca (cdr x) (caadr x)) x) (t x))) (defun divvy (msg) (let (dum al) (dolist (p (cdr msg)) (dolist (a (finds '?a `(interest ?a ,(operator p)) *manager*)) (cond ((setq dum (assoc a al)) (rplacd dum (cons p (cdr dum)))) (t (setq al (acons a (list p) al)))))) (do ((l al (cdr l)) (pl)) ((null l) (maksprogn pl)) (setq pl (cons `(ask ,(caar l) (update . ,(nreverse (cdar l)))) pl))))) (defun makaskemone (x p) (cond ((null p) nil) ((atom p) `(askemone ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-one ,x ,(caddr p)))) (t `(askemone ',x ',p)))) (defun makaskemall (x p) (cond ((null p) nil) ((atom p) `(askemall ',x ',p)) ((eq 'ask (car p)) `(ask ,(list (cadr p)) (ask-all ,x ,(caddr p)))) ((eq 'or (car p)) (cons 'union* (mapcar #'(lambda (p) (makaskemall x p)) (cdr p)))) (t `(askemall ',x ',p)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Routing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun route (c) (cond ((atom c) c) ((eq 'quote (car c)) c) ((eq 'ask (car c)) (rplaca (cdr c) (caadr c)) c) ((eq 'tellemall (car c)) c) (t (dolist (item (cdr c)) (route item)) c))) (defun router (c) (setq c (routes c)) (cond ((eq (name *library*) (caadr c)) (caddr c)) (t (rplaca (cdr c) (caadr c)) c))) (defun routes (c) (cond ((atom c) `(ask ,*agents* ,c)) ((eq 'quote (car c)) `(ask ,*agents* ,c)) ((eq 'ask (car c)) c) ((eq 'tellemall (car c)) `(ask ,*agents* ,c)) (t (route-call c)))) (defun route-call (c) (do* ((args (mapcar #'routes (cdr c))) (l args (cdr l)) (sources (find-performers (car c))) (s sources)) ((null l) `(ask ,s ,(cons (car c) (mapcar #'caddr args)))) (cond ((setq s (intersect s (cadar l)))) (t (mapc #'(lambda (x) (rplaca (cdr x) (caadr x))) args) (return `(ask ,sources ,(cons (car c) args))))))) (defun find-performers (x) (cond ((lispp x) (append *agents* (finds '?a `(performs ?a ,x) *manager*))) ((fboundp x) (list (name *library*))) ((eq 'if x) *agents*) (t (finds '?a `(performs ?a ,x) *manager*)))) (defun lispp (x) (find-symbol (symbol-name x) (find-package 'common-lisp))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Execution stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun askfacts (msg) (do ((l (find-agents) (cdr l)) (nl)) ((null l) nl) (cond ((and (eq (car l) *sender*) (equal msg *message*))) (t (setq nl (unionize nl (request msg *receiver* (car l)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; iterated version ;;; ;;; execution depends on *group* ;;; nil means nested ;;; t means all-at-once by copying ;;; yank means all-at-once using oneof ;;; yank2 means all-at-once using oneof and join ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defparameter *group* 'loyal) (defun tellemall (q p) (dolist (piece (askemall q p)) (tellem piece))) (defun tellem (p) (cond ((atom p)) ((eq 'tell (car p)) (dolist (agent (cadr p)) (request `(tell ,(caddr p)) *receiver* agent))) ((eq 'untell (car p)) (dolist (agent (cadr p)) (request `(untell ,(caddr p)) *receiver* agent))) ((eq 'progn (car p)) (mapc #'tellem (cdr p))))) (defun newtellemall (&rest rules) (let (tells) (do ((l rules (cdr l))) ((null l)) (cond ((atom (car l))) ((eq 'tell (caar l)) (setq tells (cons (car l) tells))) ((eq '==> (caar l)) (dolist (answer (askemall (caddar l) (cadar l))) (setq tells (contribute answer tells)))))) (setq tells (coalesce tells)) (do ((l tells (cdr l)) (nl) (dum)) ((null l) 'done) (setq dum (request `(tell ,(maksand (cdar l))) *receiver* (caar l))) (cond ((stringp dum) (do ((m nl (cdr m)) (untell)) ((null m)) (setq untell (maksand (nreverse (mapcar #'maknot (cdar m))))) (request `(tell ,untell) *receiver* (caar m))) (return dum)) (t (setq nl (cons (car l) nl))))))) (defun newcoalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (cons (list (cadar l) (caddar l)) nl))) (t (dolist (who (cadar l)) (setq nl (cons (list who (caddar l)) nl))))))) (defun coalesce (tells) (do ((l tells (cdr l)) (nl)) ((null l) nl) (cond ((atom (cadar l)) (setq nl (coal (cadar l) (caddar l) nl))) (t (dolist (who (cadar l)) (setq nl (coal who (caddar l) nl))))))) (defun coal (who what nl) (let (dum) (cond ((setq dum (assoc who nl :test #'eq)) (rplacd dum (contribute what (cdr dum))) nl) (t (acons who (contribute what nil) nl))))) (defun askemone (x p) (cond ((eq *group* 'loyal) (loyalone x p)) ((eq *group* 'yank) (yankemone x p)) ((eq *group* 'yank2) (yankemone2 x p)) ((eq *group* 'rebel) (rebelone x p)) (t (getemone x p)))) (defun askemall (x p) (cond ((eq *group* 'loyal) (loyalall x p)) ((eq *group* 'yank) (yankemall x p)) ((eq *group* 'yank2) (yankemall2 x p)) ((eq *group* 'rebel) (rebelall x p)) (*group* (findemall x p)) (t (getemall x p)))) (defun assumeall (p th) (cond ((and th (symbolp th) (boundp th)) (assumeall p (symbol-value th))) (t (includes th *library*) (assume p th)))) (defun forgetall (p th) (cond ((and th (symbolp th) (boundp th)) (forgetall p (symbol-value th))) (t (includes th *library*) (forget p th)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; loyal - new flat all-at-once execution using oneof and no alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun loyalone (x p) (loyone x p '(t) '((t)))) (defun loyone (x p vl sl) (cond ((null p) nil) ((atom p) (loyproject x vl sl)) ((eq 'ask (car p)) (loyoneask x p vl sl)) ((eq 'and (car p)) (loyoneand x p vl sl)) ((eq 'or (car p)) (loyoneor x p vl sl)) ((eq 'unprovable (car p)) (loyoneunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyonebagofall x p vl sl)))) (defun loyoneask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-one ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-one ,x ,query) *receiver* db))))) (defun loyoneand (x p vl sl) (cond ((null (cdr p)) (loyproject x vl sl)) ((null (cddr p)) (loyone x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null (cdr l)) (loyone x (car l) vl sl)) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyoneor (x p vl sl) (do ((l (cdr p) (cdr l)) (dum)) ((null l) nil) (when (setq dum (loyone x (car l) vl sl)) (return dum)))) (defun loyoneunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) (car sl) (loyproject x vl sl))) (defun loyonebagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyproject (x vl sl) (findx x `(oneof ,vl . ,sl) *manager*)) (defun loyalall (x p) (loyal x p '(t) '((t)))) (defun loyal (x p vl sl) (cond ((null p) nil) ((atom p) (loyalproject x vl sl)) ((eq 'ask (car p)) (loyalask x p vl sl)) ((eq 'and (car p)) (loyaland x p vl sl)) ((eq 'or (car p)) (loyalor x p vl sl)) ((eq 'unprovable (car p)) (loyalunprovable x p vl sl)) ((eq 'bagofall (car p)) (loyalbagofall x p vl sl)))) (defun loyalask (x p vl sl) (let* ((db (cadr p)) (query (caddr p))) (cond ((or (null vl) (equal vl '(t))) (request `(ask-all ,x ,query) *receiver* db)) (t (setq query (makand `(oneof ,vl . ,sl) query)) (request `(ask-all ,x ,query) *receiver* db))))) (defun loyaland (x p vl sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (loyal x (cadr p) vl sl)) (t (do ((l (cdr p) (cdr l)) (vs (loyalvars x p vl) (cdr vs))) ((null l) (if (equal x vl) sl (loyalproject x vl sl))) (if (setq sl (loyal (car vs) (car l) vl sl)) (setq vl (car vs)) (return nil)))))) (defun loyalor (x p vl sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (loyal x (car l) vl sl) nl)))) (defun loyalunprovable (x p vl sl) (setq sl (set-difference sl (loyal vl (cadr p) vl sl) :test #'equalp)) (if (equal x vl) sl (loyalproject x vl sl))) (defun loyalbagofall (x p vl sl) (let (ivl answers) (setq ivl (unionize vl (vars (cadr p)))) (setq answers (loyal ivl (caddr p) vl sl)) (do ((l sl (cdr l)) (m answers) (nl)) ((null l) (loyalproject x (append vl (list (cadddr p))) (nreverse nl))) (do ((il)) (nil) (cond ((or (null m) (not (startp (car l) (car m)))) (setq nl (cons (append (car l) (list (cons 'listof (nreverse il)))) nl)) (return t)) (t (setq il (cons (loyalproj (cadr p) ivl (car m)) il)) (setq m (cdr m)))))))) (defun loyalproj (x vl s) (findx x `(same ,vl ,s) *manager*)) (defun loyalproject (x vl sl) (finds x `(oneof ,vl . ,sl) *manager*)) (defun loyalvars (x p vl) (cdr (loyalvarscdr vl (cdr p) (vars x)))) (defun loyalvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (loyalvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) (defmethod variables ((al list)) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (caar l) nl)))) (defun bindings (al) (do ((l al (cdr l)) (nl)) ((null (cdr l)) nl) (setq nl (cons (cdar l) nl)))) (defun startp (l1 l2) (do () ((null l1) t) (cond ((null l2) (return nil)) ((equalp (car l1) (car l2)) (setq l1 (cdr l1) l2 (cdr l2))) (t (return nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; one-by-one execution ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun getemone (x p) (let ((al (askone p truth))) (if al (sublis al x)))) (defun askone (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askoneask p al)) ((eq 'and (car p)) (askoneand p al)) ((eq 'or (car p)) (askoneor p al)) (t (askoneask (list 'ask *library* p) al)))) (defun askoneand (p al) (askoneands (cdr p) al)) (defun askoneands (cl al) (cond ((null cl) al) ((null (cdr cl)) (askone (car cl) al)) (t (do ((l (askem (car cl) al) (cdr l)) (bl)) ((null l) nil) (if (setq bl (askoneands (cdr cl) (car l))) (return bl)))))) (defun askoneask (p al) (let ((dum)) (setq p (sublis al p)) (when (setq dum (request `(ask-one ,(caddr p) ,(caddr p)) *receiver* (cadr p))) (matchpexp (caddr p) dum al)))) (defun askoneor (p al) (do ((l (cdr p) (cdr l)) (bl)) ((null l)) (if (setq bl (askone (car l) al)) (return bl)))) (defun getemall (x p) (do ((l (askem p truth) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun askem (p al) (cond ((null p) nil) ((atom p) (list al)) ((eq 'ask (car p)) (askallask p al)) ((eq 'and (car p)) (askalland p al)) ((eq 'or (car p)) (askallor p al)) (t (askallask (list 'ask *library* p) al)))) (defun askallask (p al) (setq p (sublis al p)) (do ((l (request `(ask-all ,(caddr p) ,(caddr p)) *receiver* (cadr p)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp (caddr p) (car l) al) nl)))) (defun askalland (p al) (askallands (cdr p) al)) (defun askallands (cl al) (cond ((null cl) (list al)) (t (do ((l (askem (car cl) al) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askallands (cdr cl) (car l)) nl)))))) (defun askallor (p al) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (askem (car l) al) nl)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; new flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun rebelone (x p) (let ((nl (rebel x p (list truth)))) (if nl (sublis (car nl) x)))) (defun rebelall (x p) (do ((l (rebel x p (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun rebel (x p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (rebelask x p sl)) ((eq 'and (car p)) (rebeland x p sl)) ((eq 'or (car p)) (rebelor x p sl)) ((eq 'unprovable (car p)) (rebelunprovable p sl)))) (defun rebelask (x p sl) (let* ((db (cadr p)) (query (caddr p)) ins answers) (cond ((null sl) nil) ((setq ins (variables (car sl))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (bindings (car l)) nl))) (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl)))) (t (setq x (economize x)) (setq answers (request `(ask-all ,x ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp x (car l) truth) nl))))))) (defun rebeland (x p sl) (cond ((null (cdr p)) sl) ((null (cddr p)) (rebel x (cadr p) sl)) (t (do ((l (cdr p) (cdr l)) (vl (rebvars x p (car sl)) (cdr vl))) ((null l) sl) (setq sl (rebel (car vl) (car l) sl)))))) (defun rebelor (x p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (rebel x (car l) sl) nl)))) (defun rebelunprovable (p sl) (set-difference sl (rebel (variables (car sl)) (cadr p) sl) :test #'equal)) (defun rebvars (x p al) (cdr (rebvarscdr (mapcar #'car al) (cdr p) (vars x)))) (defun rebvarscdr (vl pl xl) (cond ((null pl) (list xl)) (t (let (nl) (setq nl (rebvarscdr (goodvarsform (car pl) vl) (cdr pl) xl)) (cons (intersect vl (unionize (vars (car pl)) (car nl))) nl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; nested all-at-once execution by copying and returning list of answers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun findemone (x p) (let ((nl (findem (newvars x p) truth))) (if nl (sublis (car nl) x)))) (defun findemall (x p) (do ((l (findem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (adjoin (sublis (car l) x) nl :test #'equal)))) (defun findem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (findemask p sl)) ((eq 'and (car p)) (findemand p sl)) ((eq 'or (car p)) (findemor p sl)))) (defun findemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) answers) (cond ((null sl) nil) ((null (cdr sl)) (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (unless aspect (setq aspect t)) (setq query `(ask-all ,aspect ,query)) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (cons 'list (nreverse nl)))) (setq nl (cons (sublis (car l) query) nl))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (n sl (cdr n)) (nl)) ((null l) (nreverse nl)) (do ((m (car l) (cdr m))) ((null m)) (setq nl (cons (matchpexp aspect (car m) (car n)) nl)))))))) (defun findemand (p sl) (findemands (cdr p) sl)) (defun findemands (cl sl) (cond ((null cl) sl) (t (findemands (cdr cl) (findem (car cl) sl))))) (defun findemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (findem (car l) sl) nl)))) (defun newvars (x p) (newvarsexp p nil (vars x))) (defun newvarsexp (p vl wl) (cond ((atom p) p) ((eq 'ask (car p)) (let ((vs (goodvars (caddr p))) (news) (useless) (locals)) (setq news (set-difference vs vl)) (setq useless (set-difference news wl)) (setq locals (set-difference news useless)) `(ask ,(cadr p) ,locals ,(caddr p)))) ((eq 'and (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'and (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl (append (vars (cdr l)) wl)) nl)) (setq vl (nconc (goodvars (car l)) vl)))) ((eq 'or (car p)) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (cons 'or (nreverse nl))) (setq nl (cons (newvarsexp (car l) vl wl) nl)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; flat all-at-once execution using oneof but all alists ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun economize (aspect) (cond ((null aspect) '(1)) ((atom aspect) (list aspect)) (t aspect))) (defun yankemone (x p) (let ((nl (yankem (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall (x p) (do ((l (yankem (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask p sl)) ((eq 'and (car p)) (yankemand p sl)) ((eq 'or (car p)) (yankemor p sl)))) (defun yankemask (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (do ((l (car sl) (cdr l))) ((null (cdr l))) (setq ins (cons (caar l) ins))) (setq aspect (economize (unionize ins aspect))) (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(nreverse nl)) query))) (setq nl (cons (sublis (car l) ins) nl))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand (p sl) (yankemands (cdr p) sl)) (defun yankemands (cl sl) (cond ((null cl) sl) (t (yankemands (cdr cl) (yankem (car cl) sl))))) (defun yankemor (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem (car l) sl) nl)))) (defun yankemone2 (x p) (let ((nl (yankem2 (newvars x p) (list truth)))) (if nl (sublis (car nl) x)))) (defun yankemall2 (x p) (do ((l (yankem2 (newvars x p) (list truth)) (cdr l)) (nl)) ((null l) (uniquify (nreverse nl))) (setq nl (cons (sublis (car l) x) nl)))) (defun yankem2 (p sl) (cond ((null p) nil) ((atom p) sl) ((eq 'ask (car p)) (yankemask2 p sl)) ((eq 'and (car p)) (yankemand2 p sl)) ((eq 'or (car p)) (yankemor2 p sl)))) (defun yankemask2 (p sl) (let* ((db (cadr p)) (aspect (caddr p)) (query (cadddr p)) ins answers) (cond ((null sl) nil) ((null (cdr sl)) (setq aspect (economize aspect)) (setq query `(ask-all ,aspect ,(sublis (car sl) query))) (setq answers (request query *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (cons (matchpexp aspect (car l) (car sl)) nl)))) (t (setq ins (boundvars query (car sl))) (setq aspect (economize (unionize ins aspect))) (when ins (do ((l sl (cdr l)) (nl)) ((null l) (setq query (makand `(oneof ,ins . ,(uniquify (nreverse nl))) query))) (setq nl (cons (sublis (car l) ins) nl)))) (setq answers (request `(ask-all ,aspect ,query) *receiver* db)) (do ((l answers (cdr l)) (nl)) ((null l) (joinal sl (nreverse nl))) (setq nl (cons (matchpexp aspect (car l) truth) nl))))))) (defun yankemand2 (p sl) (yankemands2 (cdr p) sl)) (defun yankemands2 (cl sl) (cond ((null cl) sl) (t (yankemands2 (cdr cl) (yankem2 (car cl) sl))))) (defun yankemor2 (p sl) (do ((l (cdr p) (cdr l)) (nl)) ((null l) (nreverse nl)) (setq nl (nreconc (yankem2 (car l) sl) nl)))) (defun boundvars (x al) (do ((l (vars x) (cdr l)) (nl)) ((null l) (nreverse nl)) (if (assoc (car l) al) (setq nl (cons (car l) nl))))) ;;; what do we do about ground queries? ;;; following assumes that alists all have same structure (defun joinal (as bs) (do ((l as (cdr l)) (dum) (nl)) ((null l) (nreverse nl)) (do ((m bs (cdr m))) ((null m)) (when (setq dum (joinemal (car l) (car m))) (setq nl (cons dum nl)))))) (defun joinemal (al bl) (let (dum) (cond ((null (cdr al)) bl) ((setq dum (assoc (caar al) bl :test #'eq)) (if (equal (cdar al) (cdr dum)) (joinemal (cdr al) bl))) ((setq bl (joinemal (cdr al) bl)) (cons (car al) bl))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Miscellaneous ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun find-agents () (cons 'repository (finds '?a '(specialty ?a ?r) *manager*))) (defun interestp (r) (or (eq r 'evaluate) (findp `(interest ?a ,r) *manager*))) (defun specialp (r) (or (basep r) (findp `(specialty ?a ,r) *manager*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ { "context": "#|\n This file is a part of Chirp\n (c) 2014 Shirakumo http://tymoon.eu ([email protected])\n Author: Ni", "end": 52, "score": 0.8626478910446167, "start": 43, "tag": "NAME", "value": "Shirakumo" }, { "context": "rt of Chirp\n (c) 2014 Shirakumo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n", "end": 89, "score": 0.9999123811721802, "start": 71, "tag": "EMAIL", "value": "[email protected]" }, { "context": "umo http://tymoon.eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:org.tymoon", "end": 114, "score": 0.9998872876167297, "start": 100, "tag": "NAME", "value": "Nicolas Hafner" }, { "context": ".eu ([email protected])\n Author: Nicolas Hafner <[email protected]>\n|#\n\n(in-package #:org.tymoonnext.chirp)\n\n(defvar", "end": 134, "score": 0.9999160766601562, "start": 116, "tag": "EMAIL", "value": "[email protected]" } ]
timelines.lisp
defaultxr/chirp
59
#| This file is a part of Chirp (c) 2014 Shirakumo http://tymoon.eu ([email protected]) Author: Nicolas Hafner <[email protected]> |# (in-package #:org.tymoonnext.chirp) (defvar *statuses/mentions-timeline* "https://api.twitter.com/1.1/statuses/mentions_timeline.json") (defvar *statuses/user-timeline* "https://api.twitter.com/1.1/statuses/user_timeline.json") (defvar *statuses/home-timeline* "https://api.twitter.com/1.1/statuses/home_timeline.json") (defvar *statuses/retweets-of-me* "https://api.twitter.com/1.1/statuses/retweets_of_me.json") (defun statuses/mentions-timeline (&key (count 20) since-id max-id trim-user (include-entities T) contributor-details tweet-mode) "Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/mentions_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/mentions-timeline* :parameters (prepare* count since-id max-id trim-user include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/user-timeline (&key user-id screen-name (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details (include-rts T) tweet-mode) "Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (assert (or user-id screen-name) () "Either USER-ID or SCREEN-NAME are required.") (unless include-rts (setf include-rts "false")) (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/user-timeline* :parameters (prepare* user-id screen-name count since-id max-id trim-user exclude-replies include-entities contributor-details include-rts tweet-mode) :method :GET))) (defun statuses/home-timeline (&key (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details tweet-mode) "Returns a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow. The home timeline is central to how most users interact with the Twitter service. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/home-timeline* :parameters (prepare* count since-id max-id trim-user exclude-replies include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/retweets-of-me (&key (count 20) since-id max-id trim-user (include-entities T) (include-user-entities T) tweet-mode) "Returns the most recent tweets authored by the authenticating user that have been retweeted by others. This timeline is a subset of the user's GET statuses/user_timeline. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/retweets_of_me" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (unless include-user-entities (setf include-user-entities "false")) (mapcar #'make-status (signed-request *statuses/retweets-of-me* :parameters (prepare* count since-id max-id trim-user include-entities include-user-entities tweet-mode) :method :GET)))
68249
#| This file is a part of Chirp (c) 2014 <NAME> http://tymoon.eu (<EMAIL>) Author: <NAME> <<EMAIL>> |# (in-package #:org.tymoonnext.chirp) (defvar *statuses/mentions-timeline* "https://api.twitter.com/1.1/statuses/mentions_timeline.json") (defvar *statuses/user-timeline* "https://api.twitter.com/1.1/statuses/user_timeline.json") (defvar *statuses/home-timeline* "https://api.twitter.com/1.1/statuses/home_timeline.json") (defvar *statuses/retweets-of-me* "https://api.twitter.com/1.1/statuses/retweets_of_me.json") (defun statuses/mentions-timeline (&key (count 20) since-id max-id trim-user (include-entities T) contributor-details tweet-mode) "Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/mentions_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/mentions-timeline* :parameters (prepare* count since-id max-id trim-user include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/user-timeline (&key user-id screen-name (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details (include-rts T) tweet-mode) "Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (assert (or user-id screen-name) () "Either USER-ID or SCREEN-NAME are required.") (unless include-rts (setf include-rts "false")) (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/user-timeline* :parameters (prepare* user-id screen-name count since-id max-id trim-user exclude-replies include-entities contributor-details include-rts tweet-mode) :method :GET))) (defun statuses/home-timeline (&key (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details tweet-mode) "Returns a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow. The home timeline is central to how most users interact with the Twitter service. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/home-timeline* :parameters (prepare* count since-id max-id trim-user exclude-replies include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/retweets-of-me (&key (count 20) since-id max-id trim-user (include-entities T) (include-user-entities T) tweet-mode) "Returns the most recent tweets authored by the authenticating user that have been retweeted by others. This timeline is a subset of the user's GET statuses/user_timeline. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/retweets_of_me" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (unless include-user-entities (setf include-user-entities "false")) (mapcar #'make-status (signed-request *statuses/retweets-of-me* :parameters (prepare* count since-id max-id trim-user include-entities include-user-entities tweet-mode) :method :GET)))
true
#| This file is a part of Chirp (c) 2014 PI:NAME:<NAME>END_PI http://tymoon.eu (PI:EMAIL:<EMAIL>END_PI) Author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> |# (in-package #:org.tymoonnext.chirp) (defvar *statuses/mentions-timeline* "https://api.twitter.com/1.1/statuses/mentions_timeline.json") (defvar *statuses/user-timeline* "https://api.twitter.com/1.1/statuses/user_timeline.json") (defvar *statuses/home-timeline* "https://api.twitter.com/1.1/statuses/home_timeline.json") (defvar *statuses/retweets-of-me* "https://api.twitter.com/1.1/statuses/retweets_of_me.json") (defun statuses/mentions-timeline (&key (count 20) since-id max-id trim-user (include-entities T) contributor-details tweet-mode) "Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/mentions_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/mentions-timeline* :parameters (prepare* count since-id max-id trim-user include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/user-timeline (&key user-id screen-name (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details (include-rts T) tweet-mode) "Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline" (assert (<= count 200) () "COUNT cannot be higher than 200.") (assert (or user-id screen-name) () "Either USER-ID or SCREEN-NAME are required.") (unless include-rts (setf include-rts "false")) (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/user-timeline* :parameters (prepare* user-id screen-name count since-id max-id trim-user exclude-replies include-entities contributor-details include-rts tweet-mode) :method :GET))) (defun statuses/home-timeline (&key (count 20) since-id max-id trim-user exclude-replies (include-entities T) contributor-details tweet-mode) "Returns a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow. The home timeline is central to how most users interact with the Twitter service. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (mapcar #'make-status (signed-request *statuses/home-timeline* :parameters (prepare* count since-id max-id trim-user exclude-replies include-entities contributor-details tweet-mode) :method :GET))) (defun statuses/retweets-of-me (&key (count 20) since-id max-id trim-user (include-entities T) (include-user-entities T) tweet-mode) "Returns the most recent tweets authored by the authenticating user that have been retweeted by others. This timeline is a subset of the user's GET statuses/user_timeline. According to spec https://dev.twitter.com/docs/api/1.1/get/statuses/retweets_of_me" (assert (<= count 200) () "Count cannot be higher than 200.") (unless include-entities (setf include-entities "false")) (unless include-user-entities (setf include-user-entities "false")) (mapcar #'make-status (signed-request *statuses/retweets-of-me* :parameters (prepare* count since-id max-id trim-user include-entities include-user-entities tweet-mode) :method :GET)))
[ { "context": " part of cl-reexport project.\n Copyright (c) 2014 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(d", "end": 85, "score": 0.9998111724853516, "start": 70, "tag": "NAME", "value": "Masayuki Takagi" }, { "context": "rt project.\n Copyright (c) 2014 Masayuki Takagi ([email protected])\n|#\n\n(in-package :cl-user)\n(defpackage cl-reexpor", "end": 105, "score": 0.9999260306358337, "start": 87, "tag": "EMAIL", "value": "[email protected]" } ]
vendor/quicklisp/dists/quicklisp/software/cl-reexport-20210228-git/src/cl-reexport.lisp
corpix/clx
7
#| This file is a part of cl-reexport project. Copyright (c) 2014 Masayuki Takagi ([email protected]) |# (in-package :cl-user) (defpackage cl-reexport (:use :cl) (:export :reexport-from)) (in-package :cl-reexport) ;;; ;;; Helpers ;;; (defun external-symbols (package) (let (ret) (do-external-symbols (var package ret) (push var ret)))) (defun exclude-symbols (exclude symbols) (flet ((aux (symbol) (member symbol exclude :key #'symbol-name :test #'string=))) (remove-if #'aux symbols))) (defun include-symbols (include symbols) (flet ((aux (symbol) (member symbol include :key #'symbol-name :test #'string=))) (if include (remove-if-not #'aux symbols) symbols))) ;;; ;;; Syntax: ;;; ;;; REEXPORT-FROM package-from &key include exclude ;;; ;;; Arguments and values: ;;; ;;; package-from --- a package designator from which symbols are reexported ;;; (defun reexport-from (package-from &key include exclude) (unless (not (and include exclude)) (error "INCLUDE option and EXCLUDE option are exclusive.")) (let ((symbols (include-symbols include (exclude-symbols exclude (external-symbols package-from))))) (import symbols) (export symbols)))
89808
#| This file is a part of cl-reexport project. Copyright (c) 2014 <NAME> (<EMAIL>) |# (in-package :cl-user) (defpackage cl-reexport (:use :cl) (:export :reexport-from)) (in-package :cl-reexport) ;;; ;;; Helpers ;;; (defun external-symbols (package) (let (ret) (do-external-symbols (var package ret) (push var ret)))) (defun exclude-symbols (exclude symbols) (flet ((aux (symbol) (member symbol exclude :key #'symbol-name :test #'string=))) (remove-if #'aux symbols))) (defun include-symbols (include symbols) (flet ((aux (symbol) (member symbol include :key #'symbol-name :test #'string=))) (if include (remove-if-not #'aux symbols) symbols))) ;;; ;;; Syntax: ;;; ;;; REEXPORT-FROM package-from &key include exclude ;;; ;;; Arguments and values: ;;; ;;; package-from --- a package designator from which symbols are reexported ;;; (defun reexport-from (package-from &key include exclude) (unless (not (and include exclude)) (error "INCLUDE option and EXCLUDE option are exclusive.")) (let ((symbols (include-symbols include (exclude-symbols exclude (external-symbols package-from))))) (import symbols) (export symbols)))
true
#| This file is a part of cl-reexport project. Copyright (c) 2014 PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) |# (in-package :cl-user) (defpackage cl-reexport (:use :cl) (:export :reexport-from)) (in-package :cl-reexport) ;;; ;;; Helpers ;;; (defun external-symbols (package) (let (ret) (do-external-symbols (var package ret) (push var ret)))) (defun exclude-symbols (exclude symbols) (flet ((aux (symbol) (member symbol exclude :key #'symbol-name :test #'string=))) (remove-if #'aux symbols))) (defun include-symbols (include symbols) (flet ((aux (symbol) (member symbol include :key #'symbol-name :test #'string=))) (if include (remove-if-not #'aux symbols) symbols))) ;;; ;;; Syntax: ;;; ;;; REEXPORT-FROM package-from &key include exclude ;;; ;;; Arguments and values: ;;; ;;; package-from --- a package designator from which symbols are reexported ;;; (defun reexport-from (package-from &key include exclude) (unless (not (and include exclude)) (error "INCLUDE option and EXCLUDE option are exclusive.")) (let ((symbols (include-symbols include (exclude-symbols exclude (external-symbols package-from))))) (import symbols) (export symbols)))
[ { "context": "ame \"cl-stocks\"\n :version \"0.1.0\"\n :maintainer \"Chris Howey\"\n :author \"Chris Howey\"\n :license \"ISC\"\n :desc", "end": 681, "score": 0.9998893737792969, "start": 670, "tag": "NAME", "value": "Chris Howey" }, { "context": "on \"0.1.0\"\n :maintainer \"Chris Howey\"\n :author \"Chris Howey\"\n :license \"ISC\"\n :description \"Test stock purc", "end": 705, "score": 0.9998810887336731, "start": 694, "tag": "NAME", "value": "Chris Howey" } ]
cl-stocks.asd
howeyc/cl-stocks
2
;;;; cl-stocks.asd (asdf:defsystem #:cl-stocks :serial t :depends-on (#:cl-yahoo-finance #:group-by #:cl-utilities) :components ((:file "package") (:file "date") (:file "sma") (:file "transaction") (:file "stock-position") (:file "stock-price") (:file "parse-fns") (:file "get-stock-info") (:file "stock-yield") (:file "strategies") (:file "scenarios") (:file "portfolio-mgmt") (:file "cl-stocks")) :name "cl-stocks" :version "0.1.0" :maintainer "Chris Howey" :author "Chris Howey" :license "ISC" :description "Test stock purchasing strategies")
14968
;;;; cl-stocks.asd (asdf:defsystem #:cl-stocks :serial t :depends-on (#:cl-yahoo-finance #:group-by #:cl-utilities) :components ((:file "package") (:file "date") (:file "sma") (:file "transaction") (:file "stock-position") (:file "stock-price") (:file "parse-fns") (:file "get-stock-info") (:file "stock-yield") (:file "strategies") (:file "scenarios") (:file "portfolio-mgmt") (:file "cl-stocks")) :name "cl-stocks" :version "0.1.0" :maintainer "<NAME>" :author "<NAME>" :license "ISC" :description "Test stock purchasing strategies")
true
;;;; cl-stocks.asd (asdf:defsystem #:cl-stocks :serial t :depends-on (#:cl-yahoo-finance #:group-by #:cl-utilities) :components ((:file "package") (:file "date") (:file "sma") (:file "transaction") (:file "stock-position") (:file "stock-price") (:file "parse-fns") (:file "get-stock-info") (:file "stock-yield") (:file "strategies") (:file "scenarios") (:file "portfolio-mgmt") (:file "cl-stocks")) :name "cl-stocks" :version "0.1.0" :maintainer "PI:NAME:<NAME>END_PI" :author "PI:NAME:<NAME>END_PI" :license "ISC" :description "Test stock purchasing strategies")
[ { "context": "; DEALINGS IN THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"SIDEKICK\")\n(i", "end": 1328, "score": 0.9996393322944641, "start": 1317, "tag": "NAME", "value": "Jared Davis" }, { "context": "N THE SOFTWARE.\n;\n; Original author: Jared Davis <[email protected]>\n\n(in-package \"SIDEKICK\")\n(include-book \"centaur/", "end": 1349, "score": 0.9999344944953918, "start": 1330, "tag": "EMAIL", "value": "[email protected]" } ]
books/projects/sidekick/io.lisp
mayankmanj/acl2
305
; ACL2 Sidekick ; Copyright (C) 2014 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: Jared Davis <[email protected]> (in-package "SIDEKICK") (include-book "centaur/bridge/to-json" :dir :system) (include-book "std/strings/defs-program" :dir :system) (include-book "std/io/read-string" :dir :system) (include-book "std/util/define" :dir :system) (define format$-fn (str args) :mode :program (declare (ignorable str args)) (raise "Under the hood definition not installed.")) (defmacro format$ (str &rest args) `(format$-fn ,str (list . ,args))) (defmacro sk-json-error (fmt-str &rest args) `(bridge::json-encode (list (cons :error (format$ ,fmt-str . ,args))))) (defttag :sidekick) ; (depends-on "io-raw.lsp") (include-raw "io-raw.lsp" :host-readtable t)
1710
; ACL2 Sidekick ; Copyright (C) 2014 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: <NAME> <<EMAIL>> (in-package "SIDEKICK") (include-book "centaur/bridge/to-json" :dir :system) (include-book "std/strings/defs-program" :dir :system) (include-book "std/io/read-string" :dir :system) (include-book "std/util/define" :dir :system) (define format$-fn (str args) :mode :program (declare (ignorable str args)) (raise "Under the hood definition not installed.")) (defmacro format$ (str &rest args) `(format$-fn ,str (list . ,args))) (defmacro sk-json-error (fmt-str &rest args) `(bridge::json-encode (list (cons :error (format$ ,fmt-str . ,args))))) (defttag :sidekick) ; (depends-on "io-raw.lsp") (include-raw "io-raw.lsp" :host-readtable t)
true
; ACL2 Sidekick ; Copyright (C) 2014 Kookamara LLC ; ; Contact: ; ; Kookamara LLC ; 11410 Windermere Meadows ; Austin, TX 78759, USA ; http://www.kookamara.com/ ; ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; ; Original author: PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> (in-package "SIDEKICK") (include-book "centaur/bridge/to-json" :dir :system) (include-book "std/strings/defs-program" :dir :system) (include-book "std/io/read-string" :dir :system) (include-book "std/util/define" :dir :system) (define format$-fn (str args) :mode :program (declare (ignorable str args)) (raise "Under the hood definition not installed.")) (defmacro format$ (str &rest args) `(format$-fn ,str (list . ,args))) (defmacro sk-json-error (fmt-str &rest args) `(bridge::json-encode (list (cons :error (format$ ,fmt-str . ,args))))) (defttag :sidekick) ; (depends-on "io-raw.lsp") (include-raw "io-raw.lsp" :host-readtable t)
[ { "context": "\n :description \"Describe cltool here\"\n :author \"Tim Hawes <[email protected]>\"\n :license \"MIT\"\n :vers", "end": 100, "score": 0.9998798966407776, "start": 91, "tag": "NAME", "value": "Tim Hawes" }, { "context": "tion \"Describe cltool here\"\n :author \"Tim Hawes <[email protected]>\"\n :license \"MIT\"\n :version \"0.0.1\"\n :serial ", "end": 122, "score": 0.9999288320541382, "start": 102, "tag": "EMAIL", "value": "[email protected]" } ]
cltool.asd
timotheosh/common-lisp-project
0
;;;; cltool.asd (asdf:defsystem #:cltool :description "Describe cltool here" :author "Tim Hawes <[email protected]>" :license "MIT" :version "0.0.1" :serial t :components ((:file "package") (:file "cltool")) :build-operation "asdf:program-op" :build-pathname "target/cltool" :entry-point "cltool:-main")
56451
;;;; cltool.asd (asdf:defsystem #:cltool :description "Describe cltool here" :author "<NAME> <<EMAIL>>" :license "MIT" :version "0.0.1" :serial t :components ((:file "package") (:file "cltool")) :build-operation "asdf:program-op" :build-pathname "target/cltool" :entry-point "cltool:-main")
true
;;;; cltool.asd (asdf:defsystem #:cltool :description "Describe cltool here" :author "PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>" :license "MIT" :version "0.0.1" :serial t :components ((:file "package") (:file "cltool")) :build-operation "asdf:program-op" :build-pathname "target/cltool" :entry-point "cltool:-main")
[ { "context": "#| This file is part of luna\n Copyright (C) 2019 Gnuxie <[email protected]>|#\n\n(in-package #:luna.fra", "end": 57, "score": 0.6908300518989563, "start": 51, "tag": "NAME", "value": "Gnuxie" }, { "context": "ile is part of luna\n Copyright (C) 2019 Gnuxie <[email protected]>|#\n\n(in-package #:luna.framework)\n\n(defvar *parse", "end": 80, "score": 0.9999268054962158, "start": 59, "tag": "EMAIL", "value": "[email protected]" } ]
src/framework/command-parser.lisp
lisp-mirror/luna
1
#| This file is part of luna Copyright (C) 2019 Gnuxie <[email protected]>|# (in-package #:luna.framework) (defvar *parser-table* (make-hash-table :test 'equal) "the parser table needs to intern strings tbh because package complicated things a lot.") (defclass parser () ((%%function :initarg :function :initform (error 'luna-compile-error "must supply a function to a parser") :accessor %parser-function :type function) (%%helpstring :initarg :helpstring :initform "" :accessor %parser-help :type string))) (defun transform-parser-designator (designator) (string-upcase ;; first convert the designator to string, then upcase it so that it is EQUAL. (etypecase designator (string designator) (symbol (symbol-name designator))))) (defun %get-parser (designator) (let ((designator (transform-parser-designator designator))) (gethash designator *parser-table*))) (defun get-parser (designator) "get the parser function from the parser table for the given designator" (%parser-function (or (and designator (%get-parser designator)) (%get-parser "help")))) (defun get-help (designator) "get the help message from the parser table for the given designator" (let ((parser (%get-parser designator))) (or (and parser (%parser-help parser)) ""))) (defmethod get-synopsis ((parser parser)) (car (cl-strings:split (%parser-help parser) (coerce '(#\Newline #\Newline) 'string)))) (defmethod get-synopsis (designator) (let ((parser (%get-parser designator))) (or (and parser (get-synopsis parser)) ""))) (defun list-parsers-with-synopsis () "used for help pages, doc purposes. reutrns a string with the synopsis messages for all interned commands." (with-output-to-string (s) (maphash (lambda (k v) (format s "~a: ~a~%~%" (string-downcase k) (get-synopsis v))) *parser-table*))) (defun intern-parser (designator parser) "parsers are interned by the symbol name as string. At the minute there is no package system." (let ((designator (transform-parser-designator designator))) (setf (gethash designator *parser-table*) parser))) (defmacro define-command-parser (name (given-command string-args room-id event) &body body) "define a parser for make-command-job and the luna-command hook to use. name is the key the parser is to be interned with. The strucutre of the lambda-list is as follows: !luna <given-command> <&rest string-args>. commands parsers are usually retrieved by doing (get-parser given-command) but it is possible to have foo and baz point to the same parser in the parser-table, hence the need to pass a given-command to the parser so it is possible to tell if it was called as foo or as baz. The docstring supplied to this macro will be used as the help message for a given command. The paragraph (string seperated by two line breaks) of docstring will be used as the synopsis when listing all commands. See intern-parser See get-parser" (multiple-value-bind (new-body declarations docstring) (alexandria:parse-body body :documentation t) (declare (ignore new-body declarations)) `(eval-when (:compile-toplevel :load-toplevel :execute) (intern-parser ',name (make-instance 'parser :function (lambda (,given-command ,string-args ,room-id ,event) ,@body) :helpstring ,(or docstring ""))))))
17917
#| This file is part of luna Copyright (C) 2019 <NAME> <<EMAIL>>|# (in-package #:luna.framework) (defvar *parser-table* (make-hash-table :test 'equal) "the parser table needs to intern strings tbh because package complicated things a lot.") (defclass parser () ((%%function :initarg :function :initform (error 'luna-compile-error "must supply a function to a parser") :accessor %parser-function :type function) (%%helpstring :initarg :helpstring :initform "" :accessor %parser-help :type string))) (defun transform-parser-designator (designator) (string-upcase ;; first convert the designator to string, then upcase it so that it is EQUAL. (etypecase designator (string designator) (symbol (symbol-name designator))))) (defun %get-parser (designator) (let ((designator (transform-parser-designator designator))) (gethash designator *parser-table*))) (defun get-parser (designator) "get the parser function from the parser table for the given designator" (%parser-function (or (and designator (%get-parser designator)) (%get-parser "help")))) (defun get-help (designator) "get the help message from the parser table for the given designator" (let ((parser (%get-parser designator))) (or (and parser (%parser-help parser)) ""))) (defmethod get-synopsis ((parser parser)) (car (cl-strings:split (%parser-help parser) (coerce '(#\Newline #\Newline) 'string)))) (defmethod get-synopsis (designator) (let ((parser (%get-parser designator))) (or (and parser (get-synopsis parser)) ""))) (defun list-parsers-with-synopsis () "used for help pages, doc purposes. reutrns a string with the synopsis messages for all interned commands." (with-output-to-string (s) (maphash (lambda (k v) (format s "~a: ~a~%~%" (string-downcase k) (get-synopsis v))) *parser-table*))) (defun intern-parser (designator parser) "parsers are interned by the symbol name as string. At the minute there is no package system." (let ((designator (transform-parser-designator designator))) (setf (gethash designator *parser-table*) parser))) (defmacro define-command-parser (name (given-command string-args room-id event) &body body) "define a parser for make-command-job and the luna-command hook to use. name is the key the parser is to be interned with. The strucutre of the lambda-list is as follows: !luna <given-command> <&rest string-args>. commands parsers are usually retrieved by doing (get-parser given-command) but it is possible to have foo and baz point to the same parser in the parser-table, hence the need to pass a given-command to the parser so it is possible to tell if it was called as foo or as baz. The docstring supplied to this macro will be used as the help message for a given command. The paragraph (string seperated by two line breaks) of docstring will be used as the synopsis when listing all commands. See intern-parser See get-parser" (multiple-value-bind (new-body declarations docstring) (alexandria:parse-body body :documentation t) (declare (ignore new-body declarations)) `(eval-when (:compile-toplevel :load-toplevel :execute) (intern-parser ',name (make-instance 'parser :function (lambda (,given-command ,string-args ,room-id ,event) ,@body) :helpstring ,(or docstring ""))))))
true
#| This file is part of luna Copyright (C) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>|# (in-package #:luna.framework) (defvar *parser-table* (make-hash-table :test 'equal) "the parser table needs to intern strings tbh because package complicated things a lot.") (defclass parser () ((%%function :initarg :function :initform (error 'luna-compile-error "must supply a function to a parser") :accessor %parser-function :type function) (%%helpstring :initarg :helpstring :initform "" :accessor %parser-help :type string))) (defun transform-parser-designator (designator) (string-upcase ;; first convert the designator to string, then upcase it so that it is EQUAL. (etypecase designator (string designator) (symbol (symbol-name designator))))) (defun %get-parser (designator) (let ((designator (transform-parser-designator designator))) (gethash designator *parser-table*))) (defun get-parser (designator) "get the parser function from the parser table for the given designator" (%parser-function (or (and designator (%get-parser designator)) (%get-parser "help")))) (defun get-help (designator) "get the help message from the parser table for the given designator" (let ((parser (%get-parser designator))) (or (and parser (%parser-help parser)) ""))) (defmethod get-synopsis ((parser parser)) (car (cl-strings:split (%parser-help parser) (coerce '(#\Newline #\Newline) 'string)))) (defmethod get-synopsis (designator) (let ((parser (%get-parser designator))) (or (and parser (get-synopsis parser)) ""))) (defun list-parsers-with-synopsis () "used for help pages, doc purposes. reutrns a string with the synopsis messages for all interned commands." (with-output-to-string (s) (maphash (lambda (k v) (format s "~a: ~a~%~%" (string-downcase k) (get-synopsis v))) *parser-table*))) (defun intern-parser (designator parser) "parsers are interned by the symbol name as string. At the minute there is no package system." (let ((designator (transform-parser-designator designator))) (setf (gethash designator *parser-table*) parser))) (defmacro define-command-parser (name (given-command string-args room-id event) &body body) "define a parser for make-command-job and the luna-command hook to use. name is the key the parser is to be interned with. The strucutre of the lambda-list is as follows: !luna <given-command> <&rest string-args>. commands parsers are usually retrieved by doing (get-parser given-command) but it is possible to have foo and baz point to the same parser in the parser-table, hence the need to pass a given-command to the parser so it is possible to tell if it was called as foo or as baz. The docstring supplied to this macro will be used as the help message for a given command. The paragraph (string seperated by two line breaks) of docstring will be used as the synopsis when listing all commands. See intern-parser See get-parser" (multiple-value-bind (new-body declarations docstring) (alexandria:parse-body body :documentation t) (declare (ignore new-body declarations)) `(eval-when (:compile-toplevel :load-toplevel :execute) (intern-parser ',name (make-instance 'parser :function (lambda (,given-command ,string-args ,room-id ,event) ,@body) :helpstring ,(or docstring ""))))))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 231, "score": 0.9998789429664612, "start": 214, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 251, "score": 0.9999299645423889, "start": 233, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/utilities/fixbytes/defbytelist.lisp
nadezhin/acl2
0
; Fixtypes for Unsigned and Signed Byte Lists -- Macro ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "FTY") (include-book "std/typed-lists/unsigned-byte-listp" :dir :system) (include-book "std/typed-lists/signed-byte-listp" :dir :system) (include-book "defbyte") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc defbytelist :parents (acl2::kestrel-utilities fty defbyte) :short "Introduce <see topic='@(url fty)'>fixtypes</see> for true lists of unsigned or signed bytes of a specified size." :long (xdoc::topapp (xdoc::h3 "Introduction") (xdoc::p "Currently fixtypes can only be associated to unary predicates, but @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp) are binary predicates.") (xdoc::p "This macro introduces fixtypes for true lists of values of fixtypes previously introduced via @(tsee defbyte). This macro uses @(tsee fty::deflist) to introduce the list fixtype, but it also generates various theorems that relate the unary recognizers for lists of bytes to the aforementioned binary predicates for lists of bytes, and to other built-in predicates.") (xdoc::h3 "General Form") (xdoc::code "(defbytelist byte" " :type ..." " :pred ..." " :fix ..." " :equiv ..." " :parents ..." " :long ..." " )") (xdoc::h3 "Inputs") (xdoc::desc "@('byte')" (xdoc::p "A symbol that names a fixtype previously introduced via @(tsee defbyte). This is the type of the elements of the generated list type.")) (xdoc::desc "@(':type')" (xdoc::p "A symbol that specifies the name of the fixtype. If this is @('nil') (the default), the name of the type is @('<byte>-list'), where @('<byte>') is the name of the element type, as specified via the @('byte') input.")) (xdoc::desc "@(':pred')" (xdoc::p "A symbol that specifies the name of the unary recognizer. If this is @('nil') (the default), the name of the recognizer is @('<type>-p'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':fix')" (xdoc::p "A symbol that specifies the name of the fixer. If this is @('nil') (the default), the name of the fixer is @('<type>-fix'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':equiv')" (xdoc::p "A symbol that specifies the name of the equivalence. If this is @('nil') (the default), the name of the equivalence is @('<type>-equiv'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':parents')" (xdoc::p "A list of symbols to use as XDOC parents of the generated fixtype, in addition to the XDOC topic for the element type. The default is @('nil'), i.e. just the XDOC topic for the element type. All the other generated XDOC topics are (directly or indirectly) under the XDOC topic for this generated fixtype.")) (xdoc::desc "@(':long')" (xdoc::p "A string that provides additional documentation for the fixtype, or @('nil') (the default). If this is a string, it is used as the XDOC @(':long') string of the generated fixtype. If this is @('nil') instead, no @(':long') is generated for the fixtype.")) (xdoc::p "This macro currently does not perform a thorough validation of its inputs. In particular, it does not check whether the names of the generated events already exists. Errors may result in failures of the generated events. These errors should be easy to diagnose, also since this macro has a very simple and readable implementation.") (xdoc::h3 "Generated Functions and Theorems") (xdoc::p "The following are generated, inclusive of XDOC documentation:") (xdoc::ul (xdoc::li "A call of @(tsee fty::deflist) to generate the fixtype.") (xdoc::li "Forward chaining rules from the unary recognizers to the binary predicates @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp). These rules can combine with forward chaining rules from the binary predicates.") (xdoc::li "Rules that rewrite between the binary predicate and the unary recognizer. These rules are disabled by default, but may be useful in some proofs. Since these are converse rules, a theory invariant is also generated preventing the enabling of both.") (xdoc::li "A rule to prove @(tsee true-listp) from the unary recognizer. Since @(tsee true-listp) is relatively common, this rule is disabled by default for efficiency.")) (xdoc::p "See the implementation, which uses a readable backquote notation, for details."))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (acl2::defxdoc+ defbytelist-implementation :parents (defbytelist) :short "Implementation of @(tsee defbytelist)." :order-subtopics t :default-parent t) (define defbytelist-fn (byte type pred fix equiv parents long (wrld plist-worldp)) :returns (event "A @(tsee acl2::maybe-pseudo-event-formp).") :mode :program :short "Event generated by the @(tsee defbytelist) macro." (b* (;; validate the BYTE input: ((unless (symbolp byte)) (raise "The BYTE input must be a symbol, but it is ~x0 instead." byte)) (table (table-alist *defbyte-table-name* wrld)) (pair (assoc-eq byte table)) ((unless pair) (raise "The ~x0 input must name a type ~ previously introduced via DEFBYTE, ~ but this is not the case." byte)) ;; retrieve the necessary information from the DEFBYTE table: (info (cdr pair)) (size (defbyte-info->size info)) (signed (defbyte-info->signed info)) (bytep (defbyte-info->pred info)) (description (defbyte-info->description info)) ;; validate the other inputs: ((unless (symbolp type)) (raise "The :TYPE input must be a symbol, ~ but it is ~x0 instead." type)) ((unless (symbolp pred)) (raise "The :PRED input must be a symbol, ~ but it is ~x0 instead." pred)) ((unless (symbolp fix)) (raise "The :FIX input must be a symbol, ~ but it is ~x0 instead." fix)) ((unless (symbolp equiv)) (raise "The :EQUIV input must be a symbol, ~ but it is ~x0 instead." equiv)) ((unless (symbol-listp parents)) (raise "The :PARENTS input must be a true list of symbols, ~ but it is ~x0 instead." parents)) ((unless (acl2::maybe-stringp long)) (raise "The :LONG input must be a string or NIL, ~ but it is ~x0 instead." long)) ;; name of the binary predicate: (binpred (if signed 'acl2::signed-byte-listp 'acl2::unsigned-byte-listp)) ;; name of the generated fixtype: (type (or type (acl2::add-suffix-to-fn byte "-LIST"))) ;; names of the generated functions: (pred (or pred (acl2::add-suffix-to-fn type "-P"))) (fix (or fix (acl2::add-suffix-to-fn type "-FIX"))) (equiv (or equiv (acl2::add-suffix-to-fn type "-EQUIV"))) ;; names of the generated theorems: (pred-forward-binpred (acl2::packn (list pred '-forward- binpred))) (pred-rewrite-binpred (acl2::packn (list pred '-rewrite- binpred))) (binpred-rewrite-pred (acl2::packn-pos (list binpred '-rewrite- pred) (pkg-witness (symbol-package-name pred)))) (true-listp-when-pred-rewrite (acl2::packn-pos (list 'true-listp-when- pred '-rewrite) (pkg-witness (symbol-package-name pred)))) ;; XDOC topic name for the generated theorems: (type-theorems (acl2::add-suffix-to-fn type "-THEOREMS"))) ;; generated events: `(encapsulate () (fty::deflist ,type :elt-type ,byte :parents (,@parents ,byte) :short ,(concatenate 'string "<see topic='@(url acl2::fty)'>Fixtype</see> of " "true lists of " description ".") ,@(and long `(:long ,long)) :true-listp t :pred ,pred :fix ,fix :equiv ,equiv) (defsection ,type-theorems :extension ,type (defrule ,pred-forward-binpred (implies (,pred x) (,binpred ,size x)) :rule-classes :forward-chaining :enable (,pred ,bytep)) (defruled ,pred-rewrite-binpred (equal (,pred x) (,binpred ,size x)) :enable (,pred ,bytep)) (defruled ,binpred-rewrite-pred (equal (,binpred ,size x) (,pred x)) :enable ,pred-rewrite-binpred) (theory-invariant (incompatible (:rewrite ,pred-rewrite-binpred) (:rewrite ,binpred-rewrite-pred))) (defruled ,true-listp-when-pred-rewrite (implies (,pred x) (true-listp x))))))) (defsection defbytelist-macro-definition :short "Definition of the @(tsee defbytelist) macro." :long "@(def defbytelist)" (defmacro defbytelist (byte &key type pred fix equiv parents long) `(make-event (defbytelist-fn ',byte ',type ',pred ',fix ',equiv ',parents ,long (w state)))))
82251
; Fixtypes for Unsigned and Signed Byte Lists -- Macro ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "FTY") (include-book "std/typed-lists/unsigned-byte-listp" :dir :system) (include-book "std/typed-lists/signed-byte-listp" :dir :system) (include-book "defbyte") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc defbytelist :parents (acl2::kestrel-utilities fty defbyte) :short "Introduce <see topic='@(url fty)'>fixtypes</see> for true lists of unsigned or signed bytes of a specified size." :long (xdoc::topapp (xdoc::h3 "Introduction") (xdoc::p "Currently fixtypes can only be associated to unary predicates, but @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp) are binary predicates.") (xdoc::p "This macro introduces fixtypes for true lists of values of fixtypes previously introduced via @(tsee defbyte). This macro uses @(tsee fty::deflist) to introduce the list fixtype, but it also generates various theorems that relate the unary recognizers for lists of bytes to the aforementioned binary predicates for lists of bytes, and to other built-in predicates.") (xdoc::h3 "General Form") (xdoc::code "(defbytelist byte" " :type ..." " :pred ..." " :fix ..." " :equiv ..." " :parents ..." " :long ..." " )") (xdoc::h3 "Inputs") (xdoc::desc "@('byte')" (xdoc::p "A symbol that names a fixtype previously introduced via @(tsee defbyte). This is the type of the elements of the generated list type.")) (xdoc::desc "@(':type')" (xdoc::p "A symbol that specifies the name of the fixtype. If this is @('nil') (the default), the name of the type is @('<byte>-list'), where @('<byte>') is the name of the element type, as specified via the @('byte') input.")) (xdoc::desc "@(':pred')" (xdoc::p "A symbol that specifies the name of the unary recognizer. If this is @('nil') (the default), the name of the recognizer is @('<type>-p'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':fix')" (xdoc::p "A symbol that specifies the name of the fixer. If this is @('nil') (the default), the name of the fixer is @('<type>-fix'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':equiv')" (xdoc::p "A symbol that specifies the name of the equivalence. If this is @('nil') (the default), the name of the equivalence is @('<type>-equiv'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':parents')" (xdoc::p "A list of symbols to use as XDOC parents of the generated fixtype, in addition to the XDOC topic for the element type. The default is @('nil'), i.e. just the XDOC topic for the element type. All the other generated XDOC topics are (directly or indirectly) under the XDOC topic for this generated fixtype.")) (xdoc::desc "@(':long')" (xdoc::p "A string that provides additional documentation for the fixtype, or @('nil') (the default). If this is a string, it is used as the XDOC @(':long') string of the generated fixtype. If this is @('nil') instead, no @(':long') is generated for the fixtype.")) (xdoc::p "This macro currently does not perform a thorough validation of its inputs. In particular, it does not check whether the names of the generated events already exists. Errors may result in failures of the generated events. These errors should be easy to diagnose, also since this macro has a very simple and readable implementation.") (xdoc::h3 "Generated Functions and Theorems") (xdoc::p "The following are generated, inclusive of XDOC documentation:") (xdoc::ul (xdoc::li "A call of @(tsee fty::deflist) to generate the fixtype.") (xdoc::li "Forward chaining rules from the unary recognizers to the binary predicates @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp). These rules can combine with forward chaining rules from the binary predicates.") (xdoc::li "Rules that rewrite between the binary predicate and the unary recognizer. These rules are disabled by default, but may be useful in some proofs. Since these are converse rules, a theory invariant is also generated preventing the enabling of both.") (xdoc::li "A rule to prove @(tsee true-listp) from the unary recognizer. Since @(tsee true-listp) is relatively common, this rule is disabled by default for efficiency.")) (xdoc::p "See the implementation, which uses a readable backquote notation, for details."))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (acl2::defxdoc+ defbytelist-implementation :parents (defbytelist) :short "Implementation of @(tsee defbytelist)." :order-subtopics t :default-parent t) (define defbytelist-fn (byte type pred fix equiv parents long (wrld plist-worldp)) :returns (event "A @(tsee acl2::maybe-pseudo-event-formp).") :mode :program :short "Event generated by the @(tsee defbytelist) macro." (b* (;; validate the BYTE input: ((unless (symbolp byte)) (raise "The BYTE input must be a symbol, but it is ~x0 instead." byte)) (table (table-alist *defbyte-table-name* wrld)) (pair (assoc-eq byte table)) ((unless pair) (raise "The ~x0 input must name a type ~ previously introduced via DEFBYTE, ~ but this is not the case." byte)) ;; retrieve the necessary information from the DEFBYTE table: (info (cdr pair)) (size (defbyte-info->size info)) (signed (defbyte-info->signed info)) (bytep (defbyte-info->pred info)) (description (defbyte-info->description info)) ;; validate the other inputs: ((unless (symbolp type)) (raise "The :TYPE input must be a symbol, ~ but it is ~x0 instead." type)) ((unless (symbolp pred)) (raise "The :PRED input must be a symbol, ~ but it is ~x0 instead." pred)) ((unless (symbolp fix)) (raise "The :FIX input must be a symbol, ~ but it is ~x0 instead." fix)) ((unless (symbolp equiv)) (raise "The :EQUIV input must be a symbol, ~ but it is ~x0 instead." equiv)) ((unless (symbol-listp parents)) (raise "The :PARENTS input must be a true list of symbols, ~ but it is ~x0 instead." parents)) ((unless (acl2::maybe-stringp long)) (raise "The :LONG input must be a string or NIL, ~ but it is ~x0 instead." long)) ;; name of the binary predicate: (binpred (if signed 'acl2::signed-byte-listp 'acl2::unsigned-byte-listp)) ;; name of the generated fixtype: (type (or type (acl2::add-suffix-to-fn byte "-LIST"))) ;; names of the generated functions: (pred (or pred (acl2::add-suffix-to-fn type "-P"))) (fix (or fix (acl2::add-suffix-to-fn type "-FIX"))) (equiv (or equiv (acl2::add-suffix-to-fn type "-EQUIV"))) ;; names of the generated theorems: (pred-forward-binpred (acl2::packn (list pred '-forward- binpred))) (pred-rewrite-binpred (acl2::packn (list pred '-rewrite- binpred))) (binpred-rewrite-pred (acl2::packn-pos (list binpred '-rewrite- pred) (pkg-witness (symbol-package-name pred)))) (true-listp-when-pred-rewrite (acl2::packn-pos (list 'true-listp-when- pred '-rewrite) (pkg-witness (symbol-package-name pred)))) ;; XDOC topic name for the generated theorems: (type-theorems (acl2::add-suffix-to-fn type "-THEOREMS"))) ;; generated events: `(encapsulate () (fty::deflist ,type :elt-type ,byte :parents (,@parents ,byte) :short ,(concatenate 'string "<see topic='@(url acl2::fty)'>Fixtype</see> of " "true lists of " description ".") ,@(and long `(:long ,long)) :true-listp t :pred ,pred :fix ,fix :equiv ,equiv) (defsection ,type-theorems :extension ,type (defrule ,pred-forward-binpred (implies (,pred x) (,binpred ,size x)) :rule-classes :forward-chaining :enable (,pred ,bytep)) (defruled ,pred-rewrite-binpred (equal (,pred x) (,binpred ,size x)) :enable (,pred ,bytep)) (defruled ,binpred-rewrite-pred (equal (,binpred ,size x) (,pred x)) :enable ,pred-rewrite-binpred) (theory-invariant (incompatible (:rewrite ,pred-rewrite-binpred) (:rewrite ,binpred-rewrite-pred))) (defruled ,true-listp-when-pred-rewrite (implies (,pred x) (true-listp x))))))) (defsection defbytelist-macro-definition :short "Definition of the @(tsee defbytelist) macro." :long "@(def defbytelist)" (defmacro defbytelist (byte &key type pred fix equiv parents long) `(make-event (defbytelist-fn ',byte ',type ',pred ',fix ',equiv ',parents ,long (w state)))))
true
; Fixtypes for Unsigned and Signed Byte Lists -- Macro ; ; Copyright (C) 2018 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "FTY") (include-book "std/typed-lists/unsigned-byte-listp" :dir :system) (include-book "std/typed-lists/signed-byte-listp" :dir :system) (include-book "defbyte") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc defbytelist :parents (acl2::kestrel-utilities fty defbyte) :short "Introduce <see topic='@(url fty)'>fixtypes</see> for true lists of unsigned or signed bytes of a specified size." :long (xdoc::topapp (xdoc::h3 "Introduction") (xdoc::p "Currently fixtypes can only be associated to unary predicates, but @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp) are binary predicates.") (xdoc::p "This macro introduces fixtypes for true lists of values of fixtypes previously introduced via @(tsee defbyte). This macro uses @(tsee fty::deflist) to introduce the list fixtype, but it also generates various theorems that relate the unary recognizers for lists of bytes to the aforementioned binary predicates for lists of bytes, and to other built-in predicates.") (xdoc::h3 "General Form") (xdoc::code "(defbytelist byte" " :type ..." " :pred ..." " :fix ..." " :equiv ..." " :parents ..." " :long ..." " )") (xdoc::h3 "Inputs") (xdoc::desc "@('byte')" (xdoc::p "A symbol that names a fixtype previously introduced via @(tsee defbyte). This is the type of the elements of the generated list type.")) (xdoc::desc "@(':type')" (xdoc::p "A symbol that specifies the name of the fixtype. If this is @('nil') (the default), the name of the type is @('<byte>-list'), where @('<byte>') is the name of the element type, as specified via the @('byte') input.")) (xdoc::desc "@(':pred')" (xdoc::p "A symbol that specifies the name of the unary recognizer. If this is @('nil') (the default), the name of the recognizer is @('<type>-p'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':fix')" (xdoc::p "A symbol that specifies the name of the fixer. If this is @('nil') (the default), the name of the fixer is @('<type>-fix'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':equiv')" (xdoc::p "A symbol that specifies the name of the equivalence. If this is @('nil') (the default), the name of the equivalence is @('<type>-equiv'), where @('<type>') is the name of the fixtype, as specified via the @(':type') input.")) (xdoc::desc "@(':parents')" (xdoc::p "A list of symbols to use as XDOC parents of the generated fixtype, in addition to the XDOC topic for the element type. The default is @('nil'), i.e. just the XDOC topic for the element type. All the other generated XDOC topics are (directly or indirectly) under the XDOC topic for this generated fixtype.")) (xdoc::desc "@(':long')" (xdoc::p "A string that provides additional documentation for the fixtype, or @('nil') (the default). If this is a string, it is used as the XDOC @(':long') string of the generated fixtype. If this is @('nil') instead, no @(':long') is generated for the fixtype.")) (xdoc::p "This macro currently does not perform a thorough validation of its inputs. In particular, it does not check whether the names of the generated events already exists. Errors may result in failures of the generated events. These errors should be easy to diagnose, also since this macro has a very simple and readable implementation.") (xdoc::h3 "Generated Functions and Theorems") (xdoc::p "The following are generated, inclusive of XDOC documentation:") (xdoc::ul (xdoc::li "A call of @(tsee fty::deflist) to generate the fixtype.") (xdoc::li "Forward chaining rules from the unary recognizers to the binary predicates @(tsee acl2::unsigned-byte-listp) and @(tsee acl2::signed-byte-listp). These rules can combine with forward chaining rules from the binary predicates.") (xdoc::li "Rules that rewrite between the binary predicate and the unary recognizer. These rules are disabled by default, but may be useful in some proofs. Since these are converse rules, a theory invariant is also generated preventing the enabling of both.") (xdoc::li "A rule to prove @(tsee true-listp) from the unary recognizer. Since @(tsee true-listp) is relatively common, this rule is disabled by default for efficiency.")) (xdoc::p "See the implementation, which uses a readable backquote notation, for details."))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (acl2::defxdoc+ defbytelist-implementation :parents (defbytelist) :short "Implementation of @(tsee defbytelist)." :order-subtopics t :default-parent t) (define defbytelist-fn (byte type pred fix equiv parents long (wrld plist-worldp)) :returns (event "A @(tsee acl2::maybe-pseudo-event-formp).") :mode :program :short "Event generated by the @(tsee defbytelist) macro." (b* (;; validate the BYTE input: ((unless (symbolp byte)) (raise "The BYTE input must be a symbol, but it is ~x0 instead." byte)) (table (table-alist *defbyte-table-name* wrld)) (pair (assoc-eq byte table)) ((unless pair) (raise "The ~x0 input must name a type ~ previously introduced via DEFBYTE, ~ but this is not the case." byte)) ;; retrieve the necessary information from the DEFBYTE table: (info (cdr pair)) (size (defbyte-info->size info)) (signed (defbyte-info->signed info)) (bytep (defbyte-info->pred info)) (description (defbyte-info->description info)) ;; validate the other inputs: ((unless (symbolp type)) (raise "The :TYPE input must be a symbol, ~ but it is ~x0 instead." type)) ((unless (symbolp pred)) (raise "The :PRED input must be a symbol, ~ but it is ~x0 instead." pred)) ((unless (symbolp fix)) (raise "The :FIX input must be a symbol, ~ but it is ~x0 instead." fix)) ((unless (symbolp equiv)) (raise "The :EQUIV input must be a symbol, ~ but it is ~x0 instead." equiv)) ((unless (symbol-listp parents)) (raise "The :PARENTS input must be a true list of symbols, ~ but it is ~x0 instead." parents)) ((unless (acl2::maybe-stringp long)) (raise "The :LONG input must be a string or NIL, ~ but it is ~x0 instead." long)) ;; name of the binary predicate: (binpred (if signed 'acl2::signed-byte-listp 'acl2::unsigned-byte-listp)) ;; name of the generated fixtype: (type (or type (acl2::add-suffix-to-fn byte "-LIST"))) ;; names of the generated functions: (pred (or pred (acl2::add-suffix-to-fn type "-P"))) (fix (or fix (acl2::add-suffix-to-fn type "-FIX"))) (equiv (or equiv (acl2::add-suffix-to-fn type "-EQUIV"))) ;; names of the generated theorems: (pred-forward-binpred (acl2::packn (list pred '-forward- binpred))) (pred-rewrite-binpred (acl2::packn (list pred '-rewrite- binpred))) (binpred-rewrite-pred (acl2::packn-pos (list binpred '-rewrite- pred) (pkg-witness (symbol-package-name pred)))) (true-listp-when-pred-rewrite (acl2::packn-pos (list 'true-listp-when- pred '-rewrite) (pkg-witness (symbol-package-name pred)))) ;; XDOC topic name for the generated theorems: (type-theorems (acl2::add-suffix-to-fn type "-THEOREMS"))) ;; generated events: `(encapsulate () (fty::deflist ,type :elt-type ,byte :parents (,@parents ,byte) :short ,(concatenate 'string "<see topic='@(url acl2::fty)'>Fixtype</see> of " "true lists of " description ".") ,@(and long `(:long ,long)) :true-listp t :pred ,pred :fix ,fix :equiv ,equiv) (defsection ,type-theorems :extension ,type (defrule ,pred-forward-binpred (implies (,pred x) (,binpred ,size x)) :rule-classes :forward-chaining :enable (,pred ,bytep)) (defruled ,pred-rewrite-binpred (equal (,pred x) (,binpred ,size x)) :enable (,pred ,bytep)) (defruled ,binpred-rewrite-pred (equal (,binpred ,size x) (,pred x)) :enable ,pred-rewrite-binpred) (theory-invariant (incompatible (:rewrite ,pred-rewrite-binpred) (:rewrite ,binpred-rewrite-pred))) (defruled ,true-listp-when-pred-rewrite (implies (,pred x) (true-listp x))))))) (defsection defbytelist-macro-definition :short "Definition of the @(tsee defbytelist) macro." :long "@(def defbytelist)" (defmacro defbytelist (byte &key type pred fix equiv parents long) `(make-event (defbytelist-fn ',byte ',type ',pred ',fix ',equiv ',parents ,long (w state)))))
[ { "context": "ense. See the file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;", "end": 177, "score": 0.9987056851387024, "start": 167, "tag": "NAME", "value": "Eric Smith" }, { "context": " file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 201, "score": 0.9999315738677979, "start": 179, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/utilities/defun-events.lisp
nzt/acl2
1
; Utilities for processing defun forms ; ; Copyright (C) 2015-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; STATUS: IN-PROGRESS (include-book "declares0") ;move (defthm butlast-of-nil (equal (butlast nil n) nil) :hints (("Goal" :in-theory (enable butlast)))) ;; (defthm symbol-listp-of-butlast ;; (implies (and (SYMBOL-LISTP X) ;; (natp n) ;; (<= n (len x))) ;; (SYMBOL-LISTP (BUTLAST X N))) ;; :hints (("Goal" :in-theory (enable butlast SYMBOL-LISTP)))) (defconst *defun-types* '(defun defund defun-nx defund-nx)) ;add more to this! (defund defun-formp (defun) (declare (xargs :guard t)) (and (true-listp defun) (>= (len defun) 4) (member-eq (first defun) *defun-types*) ;TODO: Handle defun-inline, etc.? define (maybe not) Handle anything we might call fixup-defun on... (symbolp (second defun)) ;the function name (symbol-listp (third defun)) ;the formals ;; what to say about the body? may contain macros? (all-declarep (butlast (cdr (cdr (cdr defun))) 1)) ;skip the defun, name, formals, and body. )) (defun get-declares-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (butlast (cdr (cdr (cdr defun))) 1)) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; DEFUN is of the form (defun <name> <formals> <declare> ... <declare> <body>) (defun replace-declares-in-defun (defun declares) (declare (xargs :guard (and (defun-formp defun) (true-listp declares) (all-declarep declares)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) `(,(first defun) ;defun, defund, etc. ,(second defun) ;name ,(third defun) ;formals ,@declares ;the new declares ,(car (last defun)) ;body )) (defun get-body-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (car (last defun))) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; ;Check whether a defun form is recursive (TOOD: what about mutual recursion?) ;; (defun defun-recursivep (defun) ;; (declare (xargs :guard (defun-formp defun) ;; :guard-hints (("Goal" :in-theory (enable defun-formp))))) ;; (let* ((fn (second defun)) ;; (body (get-body-from-defun defun)) ;; (called-fns (get-called-fns-in-untranslated-term body))) ;; (if (member-eq fn called-fns) t nil))) (defund get-xargs-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (get-xargs-from-declares (get-declares-from-defun defun))) ;(defforall-simple defun-formp) ;(verify-guards all-defun-formp) (defun all-defun-formp (forms) (declare (xargs :guard t)) (if (atom forms) t (and (defun-formp (first forms)) (all-defun-formp (rest forms))))) ;add more to this! (defun mutual-recursion-formp (mut-rec) (declare (xargs :guard t)) (and (consp mut-rec) (eq 'mutual-recursion (ffn-symb mut-rec)) (true-listp mut-rec) (all-defun-formp (fargs mut-rec)))) (defun defun-or-mutual-recursion-formp (event) (declare (xargs :guard t)) (or (defun-formp event) (mutual-recursion-formp event))) (defun find-defun-in-mut-rec (fn defuns) (declare (xargs :guard (and (symbolp fn) (true-listp defuns) (all-defun-formp defuns)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (endp defuns) nil (if (eq fn (second (first defuns))) (first defuns) (find-defun-in-mut-rec fn (rest defuns))))) (defun get-declares-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-declares-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-declares-from-event fn defun))) (hard-error 'get-declares-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defthm all-declarep-of-get-declares-from-event (implies (defun-or-mutual-recursion-formp fn-event) (all-declarep (get-declares-from-event fn fn-event))) :hints (("Goal" :in-theory (enable defun-formp)))) (defun get-xargs-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-xargs-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-xargs-from-event fn defun))) (hard-error 'get-xargs-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defund get-body-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-body-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-body-from-event fn defun))) (hard-error 'get-body-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defun defun-has-explicit-guardp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (some-declare-has-a-guard-or-type (get-declares-from-defun defun))) ;TODO: Consider stobj declarations (these act like guards?) (defun any-defun-has-explicit-guardp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-explicit-guardp (first defuns)) (any-defun-has-explicit-guardp (rest defuns))))) (defthm keyword-value-listp-of-get-xargs-from-defun (implies (defun-formp defun) (keyword-value-listp (get-xargs-from-defun defun))) :hints (("Goal" :in-theory (enable defun-formp get-xargs-from-defun)))) (local (in-theory (disable len))) (defun defun-has-verify-guards-nilp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let* ((xargs (get-xargs-from-defun defun)) (verify-guards (assoc-keyword :verify-guards xargs))) (if (not verify-guards) nil (equal nil (cadr verify-guards))))) (defun any-defun-has-verify-guards-nilp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-verify-guards-nilp (first defuns)) (any-defun-has-verify-guards-nilp (rest defuns))))) (defun guards-were-verified-in-defunp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (and (defun-has-explicit-guardp defun) (not (defun-has-verify-guards-nilp defun)))) (defun guards-were-verified-in-eventp (fn-event) ;;TODO This assumes the verify-guards-eagerness was 1 when FN-EVENT was submitted. (declare (xargs :guard (defun-or-mutual-recursion-formp fn-event) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (member-eq (ffn-symb fn-event) *defun-types*) (guards-were-verified-in-defunp fn-event) ;; it's a mutual-recursion (let ((defuns (rest fn-event))) (and (any-defun-has-explicit-guardp defuns) (not (any-defun-has-verify-guards-nilp defuns)))))) (defun add-verify-guards-nil-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-nil declares)) (defun (replace-declares-in-defun defun declares))) defun)) (defun add-verify-guards-t-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-t declares)) (defun (replace-declares-in-defun defun declares))) defun))
53682
; Utilities for processing defun forms ; ; Copyright (C) 2015-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; STATUS: IN-PROGRESS (include-book "declares0") ;move (defthm butlast-of-nil (equal (butlast nil n) nil) :hints (("Goal" :in-theory (enable butlast)))) ;; (defthm symbol-listp-of-butlast ;; (implies (and (SYMBOL-LISTP X) ;; (natp n) ;; (<= n (len x))) ;; (SYMBOL-LISTP (BUTLAST X N))) ;; :hints (("Goal" :in-theory (enable butlast SYMBOL-LISTP)))) (defconst *defun-types* '(defun defund defun-nx defund-nx)) ;add more to this! (defund defun-formp (defun) (declare (xargs :guard t)) (and (true-listp defun) (>= (len defun) 4) (member-eq (first defun) *defun-types*) ;TODO: Handle defun-inline, etc.? define (maybe not) Handle anything we might call fixup-defun on... (symbolp (second defun)) ;the function name (symbol-listp (third defun)) ;the formals ;; what to say about the body? may contain macros? (all-declarep (butlast (cdr (cdr (cdr defun))) 1)) ;skip the defun, name, formals, and body. )) (defun get-declares-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (butlast (cdr (cdr (cdr defun))) 1)) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; DEFUN is of the form (defun <name> <formals> <declare> ... <declare> <body>) (defun replace-declares-in-defun (defun declares) (declare (xargs :guard (and (defun-formp defun) (true-listp declares) (all-declarep declares)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) `(,(first defun) ;defun, defund, etc. ,(second defun) ;name ,(third defun) ;formals ,@declares ;the new declares ,(car (last defun)) ;body )) (defun get-body-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (car (last defun))) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; ;Check whether a defun form is recursive (TOOD: what about mutual recursion?) ;; (defun defun-recursivep (defun) ;; (declare (xargs :guard (defun-formp defun) ;; :guard-hints (("Goal" :in-theory (enable defun-formp))))) ;; (let* ((fn (second defun)) ;; (body (get-body-from-defun defun)) ;; (called-fns (get-called-fns-in-untranslated-term body))) ;; (if (member-eq fn called-fns) t nil))) (defund get-xargs-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (get-xargs-from-declares (get-declares-from-defun defun))) ;(defforall-simple defun-formp) ;(verify-guards all-defun-formp) (defun all-defun-formp (forms) (declare (xargs :guard t)) (if (atom forms) t (and (defun-formp (first forms)) (all-defun-formp (rest forms))))) ;add more to this! (defun mutual-recursion-formp (mut-rec) (declare (xargs :guard t)) (and (consp mut-rec) (eq 'mutual-recursion (ffn-symb mut-rec)) (true-listp mut-rec) (all-defun-formp (fargs mut-rec)))) (defun defun-or-mutual-recursion-formp (event) (declare (xargs :guard t)) (or (defun-formp event) (mutual-recursion-formp event))) (defun find-defun-in-mut-rec (fn defuns) (declare (xargs :guard (and (symbolp fn) (true-listp defuns) (all-defun-formp defuns)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (endp defuns) nil (if (eq fn (second (first defuns))) (first defuns) (find-defun-in-mut-rec fn (rest defuns))))) (defun get-declares-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-declares-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-declares-from-event fn defun))) (hard-error 'get-declares-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defthm all-declarep-of-get-declares-from-event (implies (defun-or-mutual-recursion-formp fn-event) (all-declarep (get-declares-from-event fn fn-event))) :hints (("Goal" :in-theory (enable defun-formp)))) (defun get-xargs-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-xargs-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-xargs-from-event fn defun))) (hard-error 'get-xargs-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defund get-body-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-body-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-body-from-event fn defun))) (hard-error 'get-body-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defun defun-has-explicit-guardp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (some-declare-has-a-guard-or-type (get-declares-from-defun defun))) ;TODO: Consider stobj declarations (these act like guards?) (defun any-defun-has-explicit-guardp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-explicit-guardp (first defuns)) (any-defun-has-explicit-guardp (rest defuns))))) (defthm keyword-value-listp-of-get-xargs-from-defun (implies (defun-formp defun) (keyword-value-listp (get-xargs-from-defun defun))) :hints (("Goal" :in-theory (enable defun-formp get-xargs-from-defun)))) (local (in-theory (disable len))) (defun defun-has-verify-guards-nilp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let* ((xargs (get-xargs-from-defun defun)) (verify-guards (assoc-keyword :verify-guards xargs))) (if (not verify-guards) nil (equal nil (cadr verify-guards))))) (defun any-defun-has-verify-guards-nilp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-verify-guards-nilp (first defuns)) (any-defun-has-verify-guards-nilp (rest defuns))))) (defun guards-were-verified-in-defunp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (and (defun-has-explicit-guardp defun) (not (defun-has-verify-guards-nilp defun)))) (defun guards-were-verified-in-eventp (fn-event) ;;TODO This assumes the verify-guards-eagerness was 1 when FN-EVENT was submitted. (declare (xargs :guard (defun-or-mutual-recursion-formp fn-event) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (member-eq (ffn-symb fn-event) *defun-types*) (guards-were-verified-in-defunp fn-event) ;; it's a mutual-recursion (let ((defuns (rest fn-event))) (and (any-defun-has-explicit-guardp defuns) (not (any-defun-has-verify-guards-nilp defuns)))))) (defun add-verify-guards-nil-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-nil declares)) (defun (replace-declares-in-defun defun declares))) defun)) (defun add-verify-guards-t-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-t declares)) (defun (replace-declares-in-defun defun declares))) defun))
true
; Utilities for processing defun forms ; ; Copyright (C) 2015-2020 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; STATUS: IN-PROGRESS (include-book "declares0") ;move (defthm butlast-of-nil (equal (butlast nil n) nil) :hints (("Goal" :in-theory (enable butlast)))) ;; (defthm symbol-listp-of-butlast ;; (implies (and (SYMBOL-LISTP X) ;; (natp n) ;; (<= n (len x))) ;; (SYMBOL-LISTP (BUTLAST X N))) ;; :hints (("Goal" :in-theory (enable butlast SYMBOL-LISTP)))) (defconst *defun-types* '(defun defund defun-nx defund-nx)) ;add more to this! (defund defun-formp (defun) (declare (xargs :guard t)) (and (true-listp defun) (>= (len defun) 4) (member-eq (first defun) *defun-types*) ;TODO: Handle defun-inline, etc.? define (maybe not) Handle anything we might call fixup-defun on... (symbolp (second defun)) ;the function name (symbol-listp (third defun)) ;the formals ;; what to say about the body? may contain macros? (all-declarep (butlast (cdr (cdr (cdr defun))) 1)) ;skip the defun, name, formals, and body. )) (defun get-declares-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (butlast (cdr (cdr (cdr defun))) 1)) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; DEFUN is of the form (defun <name> <formals> <declare> ... <declare> <body>) (defun replace-declares-in-defun (defun declares) (declare (xargs :guard (and (defun-formp defun) (true-listp declares) (all-declarep declares)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) `(,(first defun) ;defun, defund, etc. ,(second defun) ;name ,(third defun) ;formals ,@declares ;the new declares ,(car (last defun)) ;body )) (defun get-body-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (car (last defun))) ; (defun <name> <formals> <declare> ... <declare> <body>) ;; ;Check whether a defun form is recursive (TOOD: what about mutual recursion?) ;; (defun defun-recursivep (defun) ;; (declare (xargs :guard (defun-formp defun) ;; :guard-hints (("Goal" :in-theory (enable defun-formp))))) ;; (let* ((fn (second defun)) ;; (body (get-body-from-defun defun)) ;; (called-fns (get-called-fns-in-untranslated-term body))) ;; (if (member-eq fn called-fns) t nil))) (defund get-xargs-from-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (get-xargs-from-declares (get-declares-from-defun defun))) ;(defforall-simple defun-formp) ;(verify-guards all-defun-formp) (defun all-defun-formp (forms) (declare (xargs :guard t)) (if (atom forms) t (and (defun-formp (first forms)) (all-defun-formp (rest forms))))) ;add more to this! (defun mutual-recursion-formp (mut-rec) (declare (xargs :guard t)) (and (consp mut-rec) (eq 'mutual-recursion (ffn-symb mut-rec)) (true-listp mut-rec) (all-defun-formp (fargs mut-rec)))) (defun defun-or-mutual-recursion-formp (event) (declare (xargs :guard t)) (or (defun-formp event) (mutual-recursion-formp event))) (defun find-defun-in-mut-rec (fn defuns) (declare (xargs :guard (and (symbolp fn) (true-listp defuns) (all-defun-formp defuns)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (endp defuns) nil (if (eq fn (second (first defuns))) (first defuns) (find-defun-in-mut-rec fn (rest defuns))))) (defun get-declares-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-declares-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-declares-from-event fn defun))) (hard-error 'get-declares-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defthm all-declarep-of-get-declares-from-event (implies (defun-or-mutual-recursion-formp fn-event) (all-declarep (get-declares-from-event fn fn-event))) :hints (("Goal" :in-theory (enable defun-formp)))) (defun get-xargs-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-xargs-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-xargs-from-event fn defun))) (hard-error 'get-xargs-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defund get-body-from-event (fn event) (declare (xargs :guard (and (symbolp fn) (defun-or-mutual-recursion-formp event)) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let ((event-type (ffn-symb event))) (if (member-eq event-type *defun-types*) (get-body-from-defun event) (if (eq 'mutual-recursion event-type) (let ((defun (find-defun-in-mut-rec fn (fargs event)))) (if (not (defun-formp defun)) nil ;TODO error! (get-body-from-event fn defun))) (hard-error 'get-body-from-event "Unknown type of event for ~x0." (acons #\0 fn nil)))))) (defun defun-has-explicit-guardp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (some-declare-has-a-guard-or-type (get-declares-from-defun defun))) ;TODO: Consider stobj declarations (these act like guards?) (defun any-defun-has-explicit-guardp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-explicit-guardp (first defuns)) (any-defun-has-explicit-guardp (rest defuns))))) (defthm keyword-value-listp-of-get-xargs-from-defun (implies (defun-formp defun) (keyword-value-listp (get-xargs-from-defun defun))) :hints (("Goal" :in-theory (enable defun-formp get-xargs-from-defun)))) (local (in-theory (disable len))) (defun defun-has-verify-guards-nilp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (let* ((xargs (get-xargs-from-defun defun)) (verify-guards (assoc-keyword :verify-guards xargs))) (if (not verify-guards) nil (equal nil (cadr verify-guards))))) (defun any-defun-has-verify-guards-nilp (defuns) (declare (xargs :guard (all-defun-formp defuns))) (if (atom defuns) nil (or (defun-has-verify-guards-nilp (first defuns)) (any-defun-has-verify-guards-nilp (rest defuns))))) (defun guards-were-verified-in-defunp (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (and (defun-has-explicit-guardp defun) (not (defun-has-verify-guards-nilp defun)))) (defun guards-were-verified-in-eventp (fn-event) ;;TODO This assumes the verify-guards-eagerness was 1 when FN-EVENT was submitted. (declare (xargs :guard (defun-or-mutual-recursion-formp fn-event) :guard-hints (("Goal" :in-theory (enable defun-formp))))) (if (member-eq (ffn-symb fn-event) *defun-types*) (guards-were-verified-in-defunp fn-event) ;; it's a mutual-recursion (let ((defuns (rest fn-event))) (and (any-defun-has-explicit-guardp defuns) (not (any-defun-has-verify-guards-nilp defuns)))))) (defun add-verify-guards-nil-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-nil declares)) (defun (replace-declares-in-defun defun declares))) defun)) (defun add-verify-guards-t-to-defun (defun) (declare (xargs :guard (defun-formp defun) :guard-hints (("Goal" :in-theory (enable defun-formp))) )) (let* ((declares (get-declares-from-defun defun)) (declares (add-verify-guards-t declares)) (defun (replace-declares-in-defun defun declares))) defun))
[ { "context": "ense. See the file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;", "end": 174, "score": 0.9988013505935669, "start": 164, "tag": "NAME", "value": "Eric Smith" }, { "context": " file books/3BSD-mod.txt.\n;\n; Author: Eric Smith ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 198, "score": 0.9999300241470337, "start": 176, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/utilities/theory-invariants.lisp
mayankmanj/acl2
0
; Utilities related to theory-invariants ; ; Copyright (C) 2022 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: Eric Smith ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; Extends ACC with a list of all the names declared to be incompatible with any of the RUNES. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund runes-incompatible-with-runes (runes theory-invariant-table-alist acc) (declare (xargs :guard (and (true-listp runes) (alistp theory-invariant-table-alist)))) (if (endp theory-invariant-table-alist) acc (let* ((entry (first theory-invariant-table-alist)) (inv-rec (cdr entry))) (if (not (weak-theory-invariant-record-p inv-rec)) (er hard? 'runes-incompatible-with-runes "Ill-formed theory invariant record: ~x0.") (let ((form (access theory-invariant-record inv-rec :untrans-term))) (if (and (true-listp form) (consp form) (eq 'incompatible (car form)) (equal 3 (len form))) ;; form is (incompatible rune1 rune2). If rune1 is among the runes, ;; and rune2 as incompatible, and vice versa. (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) (append (if (member-equal (cadr form) runes) (list (caddr form)) nil) (if (member-equal (caddr form) runes) (list (cadr form)) nil) acc)) ;; TODO: Add support for other cases: (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) acc))))))) ;; Returns a list of all the names declared to be incompatible with NAME-OR-RUNE. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund incompatible-runes (name-or-rune wrld) (declare (xargs :guard (and (plist-worldp wrld) (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune)) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (let ((runes (if (consp name-or-rune) ; checks if it is a rune (list name-or-rune) ;; it's a symbol: (strip-cdrs (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))))) (if (not runes) (er hard? 'incompatible-runes "Can't find any runes for ~x0." name-or-rune) (runes-incompatible-with-runes runes (table-alist 'theory-invariant-table wrld) nil)))) ;; Extends ACC with a list of all the names declared to be incompatible with any of the names-or-runes. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst-aux (names-or-runes wrld acc) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (if (endp names-or-runes) acc (let ((name-or-rune (first names-or-runes))) (if ;; for guards: (not (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune))) (er hard? 'incompatible-runes-lst-aux "Bad name or rune: ~x0.") (incompatible-runes-lst-aux (rest names-or-runes) wrld (incompatible-runes name-or-rune wrld)))))) ;; Returns a list of all the names declared to be incompatible with any of the NAMES-OR-RUNES. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst (names-or-runes wrld) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) ;; todo: consider strengthening this, using the table guard from "(table theory-invariant-table nil nil" in other-events.lisp (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (incompatible-runes-lst-aux names-or-runes wrld nil))
12715
; Utilities related to theory-invariants ; ; Copyright (C) 2022 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; Extends ACC with a list of all the names declared to be incompatible with any of the RUNES. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund runes-incompatible-with-runes (runes theory-invariant-table-alist acc) (declare (xargs :guard (and (true-listp runes) (alistp theory-invariant-table-alist)))) (if (endp theory-invariant-table-alist) acc (let* ((entry (first theory-invariant-table-alist)) (inv-rec (cdr entry))) (if (not (weak-theory-invariant-record-p inv-rec)) (er hard? 'runes-incompatible-with-runes "Ill-formed theory invariant record: ~x0.") (let ((form (access theory-invariant-record inv-rec :untrans-term))) (if (and (true-listp form) (consp form) (eq 'incompatible (car form)) (equal 3 (len form))) ;; form is (incompatible rune1 rune2). If rune1 is among the runes, ;; and rune2 as incompatible, and vice versa. (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) (append (if (member-equal (cadr form) runes) (list (caddr form)) nil) (if (member-equal (caddr form) runes) (list (cadr form)) nil) acc)) ;; TODO: Add support for other cases: (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) acc))))))) ;; Returns a list of all the names declared to be incompatible with NAME-OR-RUNE. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund incompatible-runes (name-or-rune wrld) (declare (xargs :guard (and (plist-worldp wrld) (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune)) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (let ((runes (if (consp name-or-rune) ; checks if it is a rune (list name-or-rune) ;; it's a symbol: (strip-cdrs (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))))) (if (not runes) (er hard? 'incompatible-runes "Can't find any runes for ~x0." name-or-rune) (runes-incompatible-with-runes runes (table-alist 'theory-invariant-table wrld) nil)))) ;; Extends ACC with a list of all the names declared to be incompatible with any of the names-or-runes. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst-aux (names-or-runes wrld acc) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (if (endp names-or-runes) acc (let ((name-or-rune (first names-or-runes))) (if ;; for guards: (not (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune))) (er hard? 'incompatible-runes-lst-aux "Bad name or rune: ~x0.") (incompatible-runes-lst-aux (rest names-or-runes) wrld (incompatible-runes name-or-rune wrld)))))) ;; Returns a list of all the names declared to be incompatible with any of the NAMES-OR-RUNES. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst (names-or-runes wrld) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) ;; todo: consider strengthening this, using the table guard from "(table theory-invariant-table nil nil" in other-events.lisp (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (incompatible-runes-lst-aux names-or-runes wrld nil))
true
; Utilities related to theory-invariants ; ; Copyright (C) 2022 Kestrel Institute ; ; License: A 3-clause BSD license. See the file books/3BSD-mod.txt. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "ACL2") ;; Extends ACC with a list of all the names declared to be incompatible with any of the RUNES. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund runes-incompatible-with-runes (runes theory-invariant-table-alist acc) (declare (xargs :guard (and (true-listp runes) (alistp theory-invariant-table-alist)))) (if (endp theory-invariant-table-alist) acc (let* ((entry (first theory-invariant-table-alist)) (inv-rec (cdr entry))) (if (not (weak-theory-invariant-record-p inv-rec)) (er hard? 'runes-incompatible-with-runes "Ill-formed theory invariant record: ~x0.") (let ((form (access theory-invariant-record inv-rec :untrans-term))) (if (and (true-listp form) (consp form) (eq 'incompatible (car form)) (equal 3 (len form))) ;; form is (incompatible rune1 rune2). If rune1 is among the runes, ;; and rune2 as incompatible, and vice versa. (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) (append (if (member-equal (cadr form) runes) (list (caddr form)) nil) (if (member-equal (caddr form) runes) (list (cadr form)) nil) acc)) ;; TODO: Add support for other cases: (runes-incompatible-with-runes runes (rest theory-invariant-table-alist) acc))))))) ;; Returns a list of all the names declared to be incompatible with NAME-OR-RUNE. ;; NOTE: This only deals with theory-invariants defined using INCOMPATIBLE. (defund incompatible-runes (name-or-rune wrld) (declare (xargs :guard (and (plist-worldp wrld) (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune)) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (let ((runes (if (consp name-or-rune) ; checks if it is a rune (list name-or-rune) ;; it's a symbol: (strip-cdrs (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))))) (if (not runes) (er hard? 'incompatible-runes "Can't find any runes for ~x0." name-or-rune) (runes-incompatible-with-runes runes (table-alist 'theory-invariant-table wrld) nil)))) ;; Extends ACC with a list of all the names declared to be incompatible with any of the names-or-runes. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst-aux (names-or-runes wrld acc) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (if (endp names-or-runes) acc (let ((name-or-rune (first names-or-runes))) (if ;; for guards: (not (or (and (symbolp name-or-rune) (alistp (fgetprop name-or-rune 'runic-mapping-pairs nil wrld))) (consp name-or-rune))) (er hard? 'incompatible-runes-lst-aux "Bad name or rune: ~x0.") (incompatible-runes-lst-aux (rest names-or-runes) wrld (incompatible-runes name-or-rune wrld)))))) ;; Returns a list of all the names declared to be incompatible with any of the NAMES-OR-RUNES. ;; NOTE: This only deals with theory-invariants actually defined using INCOMPATIBLE. (defund incompatible-runes-lst (names-or-runes wrld) (declare (xargs :guard (and (true-listp names-or-runes) (plist-worldp wrld) ;; todo: consider strengthening this, using the table guard from "(table theory-invariant-table nil nil" in other-events.lisp (alistp (fgetprop 'theory-invariant-table 'table-alist nil wrld))))) (incompatible-runes-lst-aux names-or-runes wrld nil))
[ { "context": "he LICENSE file distributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 190, "score": 0.9998709559440613, "start": 173, "tag": "NAME", "value": "Alessandro Coglio" }, { "context": "ributed with ACL2.\n;\n; Author: Alessandro Coglio ([email protected])\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "end": 210, "score": 0.9999303221702576, "start": 192, "tag": "EMAIL", "value": "[email protected]" } ]
books/kestrel/yul/language/abstract-syntax.lisp
mayankmanj/acl2
0
; Yul Library ; ; Copyright (C) 2022 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: Alessandro Coglio ([email protected]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "YUL") (include-book "../library-extensions/osets") (include-book "kestrel/fty/defresult" :dir :system) (include-book "kestrel/fty/hex-digit-char" :dir :system) (include-book "std/basic/two-nats-measure" :dir :system) (include-book "std/util/defprojection" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ abstract-syntax :parents (language) :short "Abstract syntax of Yul." :long (xdoc::topstring (xdoc::p "We introduce an abstract syntax of Yul based on its " (xdoc::seetopic "concrete-syntax" "concrete syntax") "; more precisely, on the new grammar.") (xdoc::p "The abstract syntax defined here is fairly close to the concrete syntax, more precisely to the grammar, which already omits lexical entities like whitespace. The reason for this closeness is that we want to keep as much information as possible in the abstract syntax. In some cases our abstract syntax may be broader than the concrete syntax, to keep the definition of the abstract syntax slightly simpler; the important thing is that all the concrete syntax is representable in abstract syntax.") (xdoc::p "It is not yet clear whether the proper handling of Yul dialects will require extending this abstract syntax with types (which are not present in the new grammar). For now we omit types, but we may revisit this at some point.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod identifier :short "Fixtype of identifiers." :long (xdoc::topstring (xdoc::p "An identifier is a sequence of characters satisfying certain conditions. For now we use an ACL2 string, wrapped in a one-field product type. ACL2 strings suffice to represent all identifiers, and more. In the future we may add restrictions on the string to be a true identifier as defined in the concrete syntax.")) ((get string)) :tag :identifier :pred identifierp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-result :short "Fixtype of errors and identifiers." :ok identifier :pred identifier-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifierp (implies (identifierp x) (not (resulterrp x))) :enable (identifierp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption identifier-option identifier :short "Fixtype of optional identifiers." :pred identifier-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist identifier-list :short "Fixtype of lists of identifiers." :elt-type identifier :true-listp t :elementp-of-nil nil :pred identifier-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-list-result :short "Fixtype of errors and lists of identifiers." :ok identifier-list :pred identifier-list-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-listp (implies (identifier-listp x) (not (resulterrp x))) :enable resulterrp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defset identifier-set :short "Fixtype of osets of identifiers." :elt-type identifier :elementp-of-nil nil :pred identifier-setp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-mergesort (implies (true-listp x) (equal (identifier-setp (set::mergesort x)) (identifier-listp x))) :enable set::mergesort) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-list-insert (implies (and (identifier-listp list) (identifier-setp set)) (identifier-setp (set::list-insert list set))) :enable set::list-insert) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-set-result :short "Fixtype of errors and osets of identifiers." :ok identifier-set :pred identifier-set-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-setp (implies (identifier-setp x) (not (resulterrp x))) :enable (resulterrp identifier-setp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap identifier-identifier-map :short "Fixtype of omaps from identifiers to identifiers." :key-type identifier :val-type identifier :pred identifier-identifier-mapp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-keys-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::keys m))) :enable omap::keys) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-values-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::values m))) :enable omap::values) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-identifier-map-result :short "Fixtype of errors and omaps from identifiers to identifiers." :ok identifier-identifier-map :pred identifier-identifier-map-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defalist identifier-identifier-alist :short "Fixtype of alists from identifiers to identifiers." :key-type identifier :val-type identifier :true-listp t :keyp-of-nil nil :valp-of-nil nil :pred identifier-identifier-alistp) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cars-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cars alist)))) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cdrs-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cdrs alist)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod path :short "Fixtype of paths." :long (xdoc::topstring (xdoc::p "A path is a non-empty sequence of identifiers, separated by dots. Here we define a path as a list of identifiers, wrapped in a one-field product type. In the future we may add an invariant that the list is not empty.") (xdoc::p "Representing paths as a wrapped list of identifiers, as opposed to just a list of identifiers, lets us make a finer distinction between lists of identifiers representing paths (when wrapped), and just lists of identifiers that may be used for other purposes. In other words, the wrapping conveys that it is a path, and that the identifiers in the list are separated by dots (if written in concrete syntax).")) ((get identifier-list)) :tag :path :pred pathp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult path-result :short "Fixtype of errors and paths." :ok path :pred path-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-pathp (implies (pathp x) (not (resulterrp x))) :enable (pathp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist path-list :short "Fixtype of lists of paths." :elt-type path :true-listp t :elementp-of-nil nil :pred path-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-digit :short "Fixtype of hex digits." :long (xdoc::topstring (xdoc::p "We wrap a hexadecimal digit character into a one-field product. We could perhaps use @(tsee hex-digit-char) directly here, but the name @('hex-digit') is slightly shorter, and unambiguous in the Yul context.")) ((get hex-digit-char)) :tag :hex-digit :pred hex-digitp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-digit-list :short "Fixtype of lists of hex digits." :elt-type hex-digit :true-listp t :elementp-of-nil nil :pred hex-digit-listp) ;;;;;;;;;;;;;;;;;;;; (std::defprojection hex-digit-list->chars ((x hex-digit-listp)) :returns (chars str::hex-digit-char-listp) :short "Extract the characters from a list of hex digits." (hex-digit->get x) /// (fty::deffixequiv hex-digit-list->chars)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-pair :short "Fixtype of pairs of hex digits." ((1st hex-digit) (2nd hex-digit)) :tag :hex-pair :pred hex-pairp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-pair-list :short "Fixtype of lists of hex pairs." :elt-type hex-pair :true-listp t :elementp-of-nil nil :pred hex-pair-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult hex-pair-list-result :short "Fixtype of errors and lists of hex pairs." :ok hex-pair-list :pred hex-pair-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-quad :short "Fixtype of quadruples of hex digits." ((1st hex-digit) (2nd hex-digit) (3rd hex-digit) (4th hex-digit)) :tag :hex-quad :pred hex-quadp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum escape :short "Fixtype of escapes." :long (xdoc::topstring (xdoc::p "These are the escapes used in string literals. They are all preceded by backslash, which we do not need to represent explicitly in abstract syntax. There are simple escapes consisting of a single character just after the backslash, as well as escapes consisting of @('x') (not explicitly represented) followed by a pair of hex digits, and Unicode escapes consisting of @('u') (not explicitly represented) followed by a quadruple of hex digits. Thus in this abstract syntax of escapes we capture all the information from the concrete syntax.")) (:single-quote ()) (:double-quote ()) (:backslash ()) (:letter-n ()) (:letter-r ()) (:letter-t ()) (:line-feed ()) (:carriage-return ()) (:x ((get hex-pair))) (:u ((get hex-quad))) :pred escapep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult escape-result :short "Fixtype of errors and escapes." :ok escape :pred escape-resultp :prepwork ((local (in-theory (enable escape-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum string-element :short "Fixtype of string elements." :long (xdoc::topstring (xdoc::p "A string literal consists of a sequence of printable ASCII characters and escapes: these are the string elements we define here. We use ACL2 characters for the former, which can represent all the printable ASCII characters and more; We might restrict the range of characters at some point.")) (:char ((get character))) (:escape ((get escape))) :pred string-elementp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-result :short "Fixtype of errors and string elements." :ok string-element :pred string-element-resultp :prepwork ((local (in-theory (enable string-element-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist string-element-list :short "Fixtype of string elements." :elt-type string-element :true-listp t :elementp-of-nil nil :pred string-element-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-list-result :short "Fixtype of errors and lists of string elements." :ok string-element-list :pred string-element-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod plain-string :short "Fixtype of plain strings." :long (xdoc::topstring (xdoc::p "These are used as literals; they are the regular, non-hex strings. We call them `plain' to clearly distinguish them from hex strings.") (xdoc::p "We represent a plain string as a list of elements, plus a flag saying whether the surrounding quotes are double or not (i.e. single). This captures the full concrete syntax information.")) ((content string-element-list) (double-quote-p bool)) :tag :plain-string :pred plain-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-string :short "Fixtype of hex strings." :long (xdoc::topstring (xdoc::p "We represent a hex string as a list of hex pairs, plus a flag saying whether the surrounding quotes are double or not (i.e. single). We do not capture the optional underscores for now.")) ((content hex-pair-list) (double-quote-p bool)) :tag :hex-string :pred hex-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum literal :short "Fixtype of literals." :long (xdoc::topstring (xdoc::p "Boolean literals are straightforward.") (xdoc::p "We represent a decimal literal as a natural number. Since the Yul grammar requires no leading zeros in decimal numbers, a natural number captures the full information.") (xdoc::p "We represent a hexadecimal literal as a list of hex digits, which therefore captures full information: leading zeros and capitalization of the letters.") (xdoc::p "We represent plain and hex strings as described in @(tsee plain-string) and @(tsee hex-string).")) (:boolean ((get bool))) (:dec-number ((get nat))) (:hex-number ((get hex-digit-list))) (:plain-string ((get plain-string))) (:hex-string ((get hex-string))) :pred literalp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption literal-option literal :short "Fixtype of optional literals." :pred literal-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult literal-result :short "Fixtype of errors and literals." :ok literal :pred literal-resultp :prepwork ((local (in-theory (enable literal-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist literal-list :short "Fixtype of lists of literals." :elt-type literal :true-listp t :elementp-of-nil nil :pred literal-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes expressions/funcalls :short "Fixtypes of expressions and function calls." (fty::deftagsum expression :short "Fixtype of expressions." (:path ((get path))) (:literal ((get literal))) (:funcall ((get funcall))) :pred expressionp :measure (two-nats-measure (acl2-count x) 1)) (fty::deflist expression-list :short "Fixtype of lists of expressions." :elt-type expression :true-listp t :elementp-of-nil nil :pred expression-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod funcall :short "Fixtype of function calls." ((name identifier) (args expression-list)) :tag :funcall :pred funcallp :measure (two-nats-measure (acl2-count x) 1))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption expression-option expression :short "Fixtype of optional expressions." :pred expression-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult expression-result :short "Fixtype of errors and expressions." :ok expression :pred expression-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-expressionp (implies (expressionp x) (not (resulterrp x))) :enable (expressionp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption funcall-option funcall :short "Fixtype of optional function calls." :pred funcall-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult funcall-result :short "Fixtype of errors and function calls." :ok funcall :pred funcall-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-funcallp (implies (funcallp x) (not (resulterrp x))) :enable (funcallp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes statements/blocks/cases/fundefs :short "Fixtypes of statements, blocks, cases, and function definitions." (fty::deftagsum statement :short "Fixtype of statements." :long (xdoc::topstring (xdoc::p "We use different constructors for declaration of single vs. multiple variables. We also use different constructors for assignments to single or mulitple paths. This way, we can restrict the use of function calls for multiple variables/targets, as opposed to general expressions for single variables/targets. The requirements that the lists of multiple variables or paths contain at least two elements are given in the static semantics. Also the requirement that switch statements have at least one case (literal or default) is given in the static semantics.")) (:block ((get block))) (:variable-single ((name identifier) (init expression-option))) (:variable-multi ((names identifier-list) (init funcall-optionp))) (:assign-single ((target path) (value expression))) (:assign-multi ((targets path-list) (value funcall))) (:funcall ((get funcall))) (:if ((test expression) (body block))) (:for ((init block) (test expression) (update block) (body block))) (:switch ((target expression) (cases swcase-list) (default block-option))) (:leave ()) (:break ()) (:continue ()) (:fundef ((get fundef))) :pred statementp :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist statement-list :short "Fixtype of lists of statements." :elt-type statement :true-listp t :elementp-of-nil nil :pred statement-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod block :short "Fixtype of blocks." ((statements statement-list)) :tag :block :pred blockp :measure (two-nats-measure (acl2-count x) 1)) (fty::defoption block-option block :short "Fixtype of optional blocks." :pred block-optionp :measure (two-nats-measure (acl2-count x) 2)) (fty::defprod swcase :short "Fixtype of cases (of switch statements)." ((value literal) (body block)) :tag :swcase :pred swcasep :measure (two-nats-measure (acl2-count x) 2)) (fty::deflist swcase-list :short "Fixtype of lists of cases (of switch statements)." :elt-type swcase :true-listp t :elementp-of-nil nil :pred swcase-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod fundef :short "Fixtype of function definitions." ((name identifier) (inputs identifier-list) (outputs identifier-list) (body block)) :tag :fundef :pred fundefp :measure (two-nats-measure (acl2-count x) 2)) /// (defruled block-option-some->val-when-nonnil (implies x (equal (block-option-some->val x) (block-fix x))) :enable block-option-some->val)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption statement-option statement :short "Fixtype of optional statements." :pred statement-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult block-result :short "Fixtype of errors and blocks." :ok block :pred block-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-blockp (implies (blockp x) (not (resulterrp x))) :enable (blockp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult statement-result :short "Fixtype of errors and statements." :ok statement :pred statement-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-statementp (implies (statementp x) (not (resulterrp x))) :enable (statementp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult fundef-result :short "Fixtype of errors and function definitions." :ok fundef :pred fundef-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-fundefp (implies (fundefp x) (not (resulterrp x))) :enable (fundefp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult swcase-result :short "Fixtype of errors and swcase clauses (for switch statements)." :ok swcase :pred swcase-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-swcasep (implies (swcasep x) (not (resulterrp x))) :enable (swcasep resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection swcase-list->value-list ((x swcase-listp)) :returns (lits literal-listp) :short "Lift @(tsee swcase->value) to lists." (swcase->value x) /// (fty::deffixequiv swcase-list->value-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist fundef-list :short "Fixtype of lists of function definitions." :elt-type fundef :true-listp t :elementp-of-nil nil :pred fundef-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection fundef-list->name-list ((x fundef-listp)) :returns (names identifier-listp) :short "Lift @(tsee fundef->name) to lists." (fundef->name x) /// (fty::deffixequiv fundef-list->name-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define statements-to-fundefs ((stmts statement-listp)) :returns (fundefs fundef-listp) :short "Filter function definitions out of a list of statements." :long (xdoc::topstring (xdoc::p "The function definitions are in the same order as they appear in the list of statements. We discard all the statements that are not function definitions, and we eliminate the @(':statement-fundef') wrappers.")) (cond ((endp stmts) nil) ((statement-case (car stmts) :fundef) (cons (statement-fundef->get (car stmts)) (statements-to-fundefs (cdr stmts)))) (t (statements-to-fundefs (cdr stmts)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum data-value :short "Fixtype of data values in Yul objects." :long (xdoc::topstring (xdoc::p "A data value is either a hex string or a plain string.") (xdoc::p "See @(tsee data-item).")) (:hex ((get hex-string))) (:plain ((get plain-string))) :pred data-value-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod data-item :short "Fixtype of data items in Yul objects." :long (xdoc::topstring (xdoc::p "A data item consits of a name (a plain string) and a value.")) ((name plain-string) (value data-value)) :tag :data :pred data-item-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes objects :short "Fixtypes of Yul objects and related entities." :long (xdoc::topstring (xdoc::p "The concrete syntax of Yul objects is described in [Yul: Specification of Yul Object]. That description refers to the old grammar (see (@see concrete-syntax)); the new grammar does not include Yul objects.") (xdoc::p "Here we formalize an abstract syntax version of Yul objects. We ``map'' from the old grammar to the new grammar as needed.")) (fty::defprod object :short "Fixtype of Yul objects." :long (xdoc::topstring (xdoc::p "An object consists of a name (a plain string literal), a code block, and a sequence of zero or more objects and data items. In that sequence of objects and data items, the objects are sub-objects of this object, which motivates our choice of field name.")) ((name plain-string) (code block) (sub/data object/data-list)) :tag :object :pred objectp :measure (two-nats-measure (acl2-count x) 1)) (fty::deftagsum object/data :short "Fixtype of Yul objects and data items." (:object ((get object))) (:data ((get data-item))) :pred object/data-p :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist object/data-list :short "Fixtype of lists of Yul objects and data items." :elt-type object/data :true-listp t :elementp-of-nil nil :pred object/data-listp :measure (two-nats-measure (acl2-count x) 0)))
98313
; Yul Library ; ; Copyright (C) 2022 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: <NAME> (<EMAIL>) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "YUL") (include-book "../library-extensions/osets") (include-book "kestrel/fty/defresult" :dir :system) (include-book "kestrel/fty/hex-digit-char" :dir :system) (include-book "std/basic/two-nats-measure" :dir :system) (include-book "std/util/defprojection" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ abstract-syntax :parents (language) :short "Abstract syntax of Yul." :long (xdoc::topstring (xdoc::p "We introduce an abstract syntax of Yul based on its " (xdoc::seetopic "concrete-syntax" "concrete syntax") "; more precisely, on the new grammar.") (xdoc::p "The abstract syntax defined here is fairly close to the concrete syntax, more precisely to the grammar, which already omits lexical entities like whitespace. The reason for this closeness is that we want to keep as much information as possible in the abstract syntax. In some cases our abstract syntax may be broader than the concrete syntax, to keep the definition of the abstract syntax slightly simpler; the important thing is that all the concrete syntax is representable in abstract syntax.") (xdoc::p "It is not yet clear whether the proper handling of Yul dialects will require extending this abstract syntax with types (which are not present in the new grammar). For now we omit types, but we may revisit this at some point.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod identifier :short "Fixtype of identifiers." :long (xdoc::topstring (xdoc::p "An identifier is a sequence of characters satisfying certain conditions. For now we use an ACL2 string, wrapped in a one-field product type. ACL2 strings suffice to represent all identifiers, and more. In the future we may add restrictions on the string to be a true identifier as defined in the concrete syntax.")) ((get string)) :tag :identifier :pred identifierp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-result :short "Fixtype of errors and identifiers." :ok identifier :pred identifier-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifierp (implies (identifierp x) (not (resulterrp x))) :enable (identifierp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption identifier-option identifier :short "Fixtype of optional identifiers." :pred identifier-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist identifier-list :short "Fixtype of lists of identifiers." :elt-type identifier :true-listp t :elementp-of-nil nil :pred identifier-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-list-result :short "Fixtype of errors and lists of identifiers." :ok identifier-list :pred identifier-list-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-listp (implies (identifier-listp x) (not (resulterrp x))) :enable resulterrp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defset identifier-set :short "Fixtype of osets of identifiers." :elt-type identifier :elementp-of-nil nil :pred identifier-setp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-mergesort (implies (true-listp x) (equal (identifier-setp (set::mergesort x)) (identifier-listp x))) :enable set::mergesort) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-list-insert (implies (and (identifier-listp list) (identifier-setp set)) (identifier-setp (set::list-insert list set))) :enable set::list-insert) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-set-result :short "Fixtype of errors and osets of identifiers." :ok identifier-set :pred identifier-set-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-setp (implies (identifier-setp x) (not (resulterrp x))) :enable (resulterrp identifier-setp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap identifier-identifier-map :short "Fixtype of omaps from identifiers to identifiers." :key-type identifier :val-type identifier :pred identifier-identifier-mapp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-keys-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::keys m))) :enable omap::keys) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-values-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::values m))) :enable omap::values) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-identifier-map-result :short "Fixtype of errors and omaps from identifiers to identifiers." :ok identifier-identifier-map :pred identifier-identifier-map-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defalist identifier-identifier-alist :short "Fixtype of alists from identifiers to identifiers." :key-type identifier :val-type identifier :true-listp t :keyp-of-nil nil :valp-of-nil nil :pred identifier-identifier-alistp) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cars-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cars alist)))) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cdrs-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cdrs alist)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod path :short "Fixtype of paths." :long (xdoc::topstring (xdoc::p "A path is a non-empty sequence of identifiers, separated by dots. Here we define a path as a list of identifiers, wrapped in a one-field product type. In the future we may add an invariant that the list is not empty.") (xdoc::p "Representing paths as a wrapped list of identifiers, as opposed to just a list of identifiers, lets us make a finer distinction between lists of identifiers representing paths (when wrapped), and just lists of identifiers that may be used for other purposes. In other words, the wrapping conveys that it is a path, and that the identifiers in the list are separated by dots (if written in concrete syntax).")) ((get identifier-list)) :tag :path :pred pathp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult path-result :short "Fixtype of errors and paths." :ok path :pred path-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-pathp (implies (pathp x) (not (resulterrp x))) :enable (pathp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist path-list :short "Fixtype of lists of paths." :elt-type path :true-listp t :elementp-of-nil nil :pred path-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-digit :short "Fixtype of hex digits." :long (xdoc::topstring (xdoc::p "We wrap a hexadecimal digit character into a one-field product. We could perhaps use @(tsee hex-digit-char) directly here, but the name @('hex-digit') is slightly shorter, and unambiguous in the Yul context.")) ((get hex-digit-char)) :tag :hex-digit :pred hex-digitp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-digit-list :short "Fixtype of lists of hex digits." :elt-type hex-digit :true-listp t :elementp-of-nil nil :pred hex-digit-listp) ;;;;;;;;;;;;;;;;;;;; (std::defprojection hex-digit-list->chars ((x hex-digit-listp)) :returns (chars str::hex-digit-char-listp) :short "Extract the characters from a list of hex digits." (hex-digit->get x) /// (fty::deffixequiv hex-digit-list->chars)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-pair :short "Fixtype of pairs of hex digits." ((1st hex-digit) (2nd hex-digit)) :tag :hex-pair :pred hex-pairp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-pair-list :short "Fixtype of lists of hex pairs." :elt-type hex-pair :true-listp t :elementp-of-nil nil :pred hex-pair-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult hex-pair-list-result :short "Fixtype of errors and lists of hex pairs." :ok hex-pair-list :pred hex-pair-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-quad :short "Fixtype of quadruples of hex digits." ((1st hex-digit) (2nd hex-digit) (3rd hex-digit) (4th hex-digit)) :tag :hex-quad :pred hex-quadp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum escape :short "Fixtype of escapes." :long (xdoc::topstring (xdoc::p "These are the escapes used in string literals. They are all preceded by backslash, which we do not need to represent explicitly in abstract syntax. There are simple escapes consisting of a single character just after the backslash, as well as escapes consisting of @('x') (not explicitly represented) followed by a pair of hex digits, and Unicode escapes consisting of @('u') (not explicitly represented) followed by a quadruple of hex digits. Thus in this abstract syntax of escapes we capture all the information from the concrete syntax.")) (:single-quote ()) (:double-quote ()) (:backslash ()) (:letter-n ()) (:letter-r ()) (:letter-t ()) (:line-feed ()) (:carriage-return ()) (:x ((get hex-pair))) (:u ((get hex-quad))) :pred escapep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult escape-result :short "Fixtype of errors and escapes." :ok escape :pred escape-resultp :prepwork ((local (in-theory (enable escape-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum string-element :short "Fixtype of string elements." :long (xdoc::topstring (xdoc::p "A string literal consists of a sequence of printable ASCII characters and escapes: these are the string elements we define here. We use ACL2 characters for the former, which can represent all the printable ASCII characters and more; We might restrict the range of characters at some point.")) (:char ((get character))) (:escape ((get escape))) :pred string-elementp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-result :short "Fixtype of errors and string elements." :ok string-element :pred string-element-resultp :prepwork ((local (in-theory (enable string-element-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist string-element-list :short "Fixtype of string elements." :elt-type string-element :true-listp t :elementp-of-nil nil :pred string-element-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-list-result :short "Fixtype of errors and lists of string elements." :ok string-element-list :pred string-element-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod plain-string :short "Fixtype of plain strings." :long (xdoc::topstring (xdoc::p "These are used as literals; they are the regular, non-hex strings. We call them `plain' to clearly distinguish them from hex strings.") (xdoc::p "We represent a plain string as a list of elements, plus a flag saying whether the surrounding quotes are double or not (i.e. single). This captures the full concrete syntax information.")) ((content string-element-list) (double-quote-p bool)) :tag :plain-string :pred plain-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-string :short "Fixtype of hex strings." :long (xdoc::topstring (xdoc::p "We represent a hex string as a list of hex pairs, plus a flag saying whether the surrounding quotes are double or not (i.e. single). We do not capture the optional underscores for now.")) ((content hex-pair-list) (double-quote-p bool)) :tag :hex-string :pred hex-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum literal :short "Fixtype of literals." :long (xdoc::topstring (xdoc::p "Boolean literals are straightforward.") (xdoc::p "We represent a decimal literal as a natural number. Since the Yul grammar requires no leading zeros in decimal numbers, a natural number captures the full information.") (xdoc::p "We represent a hexadecimal literal as a list of hex digits, which therefore captures full information: leading zeros and capitalization of the letters.") (xdoc::p "We represent plain and hex strings as described in @(tsee plain-string) and @(tsee hex-string).")) (:boolean ((get bool))) (:dec-number ((get nat))) (:hex-number ((get hex-digit-list))) (:plain-string ((get plain-string))) (:hex-string ((get hex-string))) :pred literalp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption literal-option literal :short "Fixtype of optional literals." :pred literal-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult literal-result :short "Fixtype of errors and literals." :ok literal :pred literal-resultp :prepwork ((local (in-theory (enable literal-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist literal-list :short "Fixtype of lists of literals." :elt-type literal :true-listp t :elementp-of-nil nil :pred literal-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes expressions/funcalls :short "Fixtypes of expressions and function calls." (fty::deftagsum expression :short "Fixtype of expressions." (:path ((get path))) (:literal ((get literal))) (:funcall ((get funcall))) :pred expressionp :measure (two-nats-measure (acl2-count x) 1)) (fty::deflist expression-list :short "Fixtype of lists of expressions." :elt-type expression :true-listp t :elementp-of-nil nil :pred expression-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod funcall :short "Fixtype of function calls." ((name identifier) (args expression-list)) :tag :funcall :pred funcallp :measure (two-nats-measure (acl2-count x) 1))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption expression-option expression :short "Fixtype of optional expressions." :pred expression-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult expression-result :short "Fixtype of errors and expressions." :ok expression :pred expression-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-expressionp (implies (expressionp x) (not (resulterrp x))) :enable (expressionp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption funcall-option funcall :short "Fixtype of optional function calls." :pred funcall-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult funcall-result :short "Fixtype of errors and function calls." :ok funcall :pred funcall-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-funcallp (implies (funcallp x) (not (resulterrp x))) :enable (funcallp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes statements/blocks/cases/fundefs :short "Fixtypes of statements, blocks, cases, and function definitions." (fty::deftagsum statement :short "Fixtype of statements." :long (xdoc::topstring (xdoc::p "We use different constructors for declaration of single vs. multiple variables. We also use different constructors for assignments to single or mulitple paths. This way, we can restrict the use of function calls for multiple variables/targets, as opposed to general expressions for single variables/targets. The requirements that the lists of multiple variables or paths contain at least two elements are given in the static semantics. Also the requirement that switch statements have at least one case (literal or default) is given in the static semantics.")) (:block ((get block))) (:variable-single ((name identifier) (init expression-option))) (:variable-multi ((names identifier-list) (init funcall-optionp))) (:assign-single ((target path) (value expression))) (:assign-multi ((targets path-list) (value funcall))) (:funcall ((get funcall))) (:if ((test expression) (body block))) (:for ((init block) (test expression) (update block) (body block))) (:switch ((target expression) (cases swcase-list) (default block-option))) (:leave ()) (:break ()) (:continue ()) (:fundef ((get fundef))) :pred statementp :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist statement-list :short "Fixtype of lists of statements." :elt-type statement :true-listp t :elementp-of-nil nil :pred statement-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod block :short "Fixtype of blocks." ((statements statement-list)) :tag :block :pred blockp :measure (two-nats-measure (acl2-count x) 1)) (fty::defoption block-option block :short "Fixtype of optional blocks." :pred block-optionp :measure (two-nats-measure (acl2-count x) 2)) (fty::defprod swcase :short "Fixtype of cases (of switch statements)." ((value literal) (body block)) :tag :swcase :pred swcasep :measure (two-nats-measure (acl2-count x) 2)) (fty::deflist swcase-list :short "Fixtype of lists of cases (of switch statements)." :elt-type swcase :true-listp t :elementp-of-nil nil :pred swcase-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod fundef :short "Fixtype of function definitions." ((name identifier) (inputs identifier-list) (outputs identifier-list) (body block)) :tag :fundef :pred fundefp :measure (two-nats-measure (acl2-count x) 2)) /// (defruled block-option-some->val-when-nonnil (implies x (equal (block-option-some->val x) (block-fix x))) :enable block-option-some->val)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption statement-option statement :short "Fixtype of optional statements." :pred statement-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult block-result :short "Fixtype of errors and blocks." :ok block :pred block-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-blockp (implies (blockp x) (not (resulterrp x))) :enable (blockp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult statement-result :short "Fixtype of errors and statements." :ok statement :pred statement-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-statementp (implies (statementp x) (not (resulterrp x))) :enable (statementp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult fundef-result :short "Fixtype of errors and function definitions." :ok fundef :pred fundef-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-fundefp (implies (fundefp x) (not (resulterrp x))) :enable (fundefp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult swcase-result :short "Fixtype of errors and swcase clauses (for switch statements)." :ok swcase :pred swcase-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-swcasep (implies (swcasep x) (not (resulterrp x))) :enable (swcasep resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection swcase-list->value-list ((x swcase-listp)) :returns (lits literal-listp) :short "Lift @(tsee swcase->value) to lists." (swcase->value x) /// (fty::deffixequiv swcase-list->value-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist fundef-list :short "Fixtype of lists of function definitions." :elt-type fundef :true-listp t :elementp-of-nil nil :pred fundef-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection fundef-list->name-list ((x fundef-listp)) :returns (names identifier-listp) :short "Lift @(tsee fundef->name) to lists." (fundef->name x) /// (fty::deffixequiv fundef-list->name-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define statements-to-fundefs ((stmts statement-listp)) :returns (fundefs fundef-listp) :short "Filter function definitions out of a list of statements." :long (xdoc::topstring (xdoc::p "The function definitions are in the same order as they appear in the list of statements. We discard all the statements that are not function definitions, and we eliminate the @(':statement-fundef') wrappers.")) (cond ((endp stmts) nil) ((statement-case (car stmts) :fundef) (cons (statement-fundef->get (car stmts)) (statements-to-fundefs (cdr stmts)))) (t (statements-to-fundefs (cdr stmts)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum data-value :short "Fixtype of data values in Yul objects." :long (xdoc::topstring (xdoc::p "A data value is either a hex string or a plain string.") (xdoc::p "See @(tsee data-item).")) (:hex ((get hex-string))) (:plain ((get plain-string))) :pred data-value-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod data-item :short "Fixtype of data items in Yul objects." :long (xdoc::topstring (xdoc::p "A data item consits of a name (a plain string) and a value.")) ((name plain-string) (value data-value)) :tag :data :pred data-item-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes objects :short "Fixtypes of Yul objects and related entities." :long (xdoc::topstring (xdoc::p "The concrete syntax of Yul objects is described in [Yul: Specification of Yul Object]. That description refers to the old grammar (see (@see concrete-syntax)); the new grammar does not include Yul objects.") (xdoc::p "Here we formalize an abstract syntax version of Yul objects. We ``map'' from the old grammar to the new grammar as needed.")) (fty::defprod object :short "Fixtype of Yul objects." :long (xdoc::topstring (xdoc::p "An object consists of a name (a plain string literal), a code block, and a sequence of zero or more objects and data items. In that sequence of objects and data items, the objects are sub-objects of this object, which motivates our choice of field name.")) ((name plain-string) (code block) (sub/data object/data-list)) :tag :object :pred objectp :measure (two-nats-measure (acl2-count x) 1)) (fty::deftagsum object/data :short "Fixtype of Yul objects and data items." (:object ((get object))) (:data ((get data-item))) :pred object/data-p :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist object/data-list :short "Fixtype of lists of Yul objects and data items." :elt-type object/data :true-listp t :elementp-of-nil nil :pred object/data-listp :measure (two-nats-measure (acl2-count x) 0)))
true
; Yul Library ; ; Copyright (C) 2022 Kestrel Institute (http://www.kestrel.edu) ; ; License: A 3-clause BSD license. See the LICENSE file distributed with ACL2. ; ; Author: PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "YUL") (include-book "../library-extensions/osets") (include-book "kestrel/fty/defresult" :dir :system) (include-book "kestrel/fty/hex-digit-char" :dir :system) (include-book "std/basic/two-nats-measure" :dir :system) (include-book "std/util/defprojection" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defxdoc+ abstract-syntax :parents (language) :short "Abstract syntax of Yul." :long (xdoc::topstring (xdoc::p "We introduce an abstract syntax of Yul based on its " (xdoc::seetopic "concrete-syntax" "concrete syntax") "; more precisely, on the new grammar.") (xdoc::p "The abstract syntax defined here is fairly close to the concrete syntax, more precisely to the grammar, which already omits lexical entities like whitespace. The reason for this closeness is that we want to keep as much information as possible in the abstract syntax. In some cases our abstract syntax may be broader than the concrete syntax, to keep the definition of the abstract syntax slightly simpler; the important thing is that all the concrete syntax is representable in abstract syntax.") (xdoc::p "It is not yet clear whether the proper handling of Yul dialects will require extending this abstract syntax with types (which are not present in the new grammar). For now we omit types, but we may revisit this at some point.")) :order-subtopics t :default-parent t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod identifier :short "Fixtype of identifiers." :long (xdoc::topstring (xdoc::p "An identifier is a sequence of characters satisfying certain conditions. For now we use an ACL2 string, wrapped in a one-field product type. ACL2 strings suffice to represent all identifiers, and more. In the future we may add restrictions on the string to be a true identifier as defined in the concrete syntax.")) ((get string)) :tag :identifier :pred identifierp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-result :short "Fixtype of errors and identifiers." :ok identifier :pred identifier-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifierp (implies (identifierp x) (not (resulterrp x))) :enable (identifierp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption identifier-option identifier :short "Fixtype of optional identifiers." :pred identifier-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist identifier-list :short "Fixtype of lists of identifiers." :elt-type identifier :true-listp t :elementp-of-nil nil :pred identifier-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-list-result :short "Fixtype of errors and lists of identifiers." :ok identifier-list :pred identifier-list-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-listp (implies (identifier-listp x) (not (resulterrp x))) :enable resulterrp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defset identifier-set :short "Fixtype of osets of identifiers." :elt-type identifier :elementp-of-nil nil :pred identifier-setp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-mergesort (implies (true-listp x) (equal (identifier-setp (set::mergesort x)) (identifier-listp x))) :enable set::mergesort) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-list-insert (implies (and (identifier-listp list) (identifier-setp set)) (identifier-setp (set::list-insert list set))) :enable set::list-insert) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-set-result :short "Fixtype of errors and osets of identifiers." :ok identifier-set :pred identifier-set-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-identifier-setp (implies (identifier-setp x) (not (resulterrp x))) :enable (resulterrp identifier-setp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defomap identifier-identifier-map :short "Fixtype of omaps from identifiers to identifiers." :key-type identifier :val-type identifier :pred identifier-identifier-mapp) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-keys-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::keys m))) :enable omap::keys) ;;;;;;;;;;;;;;;;;;;; (defrule identifier-setp-of-values-when-identifier-identifier-mapp (implies (identifier-identifier-mapp m) (identifier-setp (omap::values m))) :enable omap::values) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult identifier-identifier-map-result :short "Fixtype of errors and omaps from identifiers to identifiers." :ok identifier-identifier-map :pred identifier-identifier-map-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defalist identifier-identifier-alist :short "Fixtype of alists from identifiers to identifiers." :key-type identifier :val-type identifier :true-listp t :keyp-of-nil nil :valp-of-nil nil :pred identifier-identifier-alistp) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cars-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cars alist)))) ;;;;;;;;;;;;;;;;;;;; (defruled identifier-listp-of-strip-cdrs-when-identifier-identifier-alistp (implies (identifier-identifier-alistp alist) (identifier-listp (strip-cdrs alist)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod path :short "Fixtype of paths." :long (xdoc::topstring (xdoc::p "A path is a non-empty sequence of identifiers, separated by dots. Here we define a path as a list of identifiers, wrapped in a one-field product type. In the future we may add an invariant that the list is not empty.") (xdoc::p "Representing paths as a wrapped list of identifiers, as opposed to just a list of identifiers, lets us make a finer distinction between lists of identifiers representing paths (when wrapped), and just lists of identifiers that may be used for other purposes. In other words, the wrapping conveys that it is a path, and that the identifiers in the list are separated by dots (if written in concrete syntax).")) ((get identifier-list)) :tag :path :pred pathp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult path-result :short "Fixtype of errors and paths." :ok path :pred path-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-pathp (implies (pathp x) (not (resulterrp x))) :enable (pathp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist path-list :short "Fixtype of lists of paths." :elt-type path :true-listp t :elementp-of-nil nil :pred path-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-digit :short "Fixtype of hex digits." :long (xdoc::topstring (xdoc::p "We wrap a hexadecimal digit character into a one-field product. We could perhaps use @(tsee hex-digit-char) directly here, but the name @('hex-digit') is slightly shorter, and unambiguous in the Yul context.")) ((get hex-digit-char)) :tag :hex-digit :pred hex-digitp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-digit-list :short "Fixtype of lists of hex digits." :elt-type hex-digit :true-listp t :elementp-of-nil nil :pred hex-digit-listp) ;;;;;;;;;;;;;;;;;;;; (std::defprojection hex-digit-list->chars ((x hex-digit-listp)) :returns (chars str::hex-digit-char-listp) :short "Extract the characters from a list of hex digits." (hex-digit->get x) /// (fty::deffixequiv hex-digit-list->chars)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-pair :short "Fixtype of pairs of hex digits." ((1st hex-digit) (2nd hex-digit)) :tag :hex-pair :pred hex-pairp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist hex-pair-list :short "Fixtype of lists of hex pairs." :elt-type hex-pair :true-listp t :elementp-of-nil nil :pred hex-pair-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult hex-pair-list-result :short "Fixtype of errors and lists of hex pairs." :ok hex-pair-list :pred hex-pair-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-quad :short "Fixtype of quadruples of hex digits." ((1st hex-digit) (2nd hex-digit) (3rd hex-digit) (4th hex-digit)) :tag :hex-quad :pred hex-quadp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum escape :short "Fixtype of escapes." :long (xdoc::topstring (xdoc::p "These are the escapes used in string literals. They are all preceded by backslash, which we do not need to represent explicitly in abstract syntax. There are simple escapes consisting of a single character just after the backslash, as well as escapes consisting of @('x') (not explicitly represented) followed by a pair of hex digits, and Unicode escapes consisting of @('u') (not explicitly represented) followed by a quadruple of hex digits. Thus in this abstract syntax of escapes we capture all the information from the concrete syntax.")) (:single-quote ()) (:double-quote ()) (:backslash ()) (:letter-n ()) (:letter-r ()) (:letter-t ()) (:line-feed ()) (:carriage-return ()) (:x ((get hex-pair))) (:u ((get hex-quad))) :pred escapep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult escape-result :short "Fixtype of errors and escapes." :ok escape :pred escape-resultp :prepwork ((local (in-theory (enable escape-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum string-element :short "Fixtype of string elements." :long (xdoc::topstring (xdoc::p "A string literal consists of a sequence of printable ASCII characters and escapes: these are the string elements we define here. We use ACL2 characters for the former, which can represent all the printable ASCII characters and more; We might restrict the range of characters at some point.")) (:char ((get character))) (:escape ((get escape))) :pred string-elementp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-result :short "Fixtype of errors and string elements." :ok string-element :pred string-element-resultp :prepwork ((local (in-theory (enable string-element-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist string-element-list :short "Fixtype of string elements." :elt-type string-element :true-listp t :elementp-of-nil nil :pred string-element-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult string-element-list-result :short "Fixtype of errors and lists of string elements." :ok string-element-list :pred string-element-list-resultp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod plain-string :short "Fixtype of plain strings." :long (xdoc::topstring (xdoc::p "These are used as literals; they are the regular, non-hex strings. We call them `plain' to clearly distinguish them from hex strings.") (xdoc::p "We represent a plain string as a list of elements, plus a flag saying whether the surrounding quotes are double or not (i.e. single). This captures the full concrete syntax information.")) ((content string-element-list) (double-quote-p bool)) :tag :plain-string :pred plain-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod hex-string :short "Fixtype of hex strings." :long (xdoc::topstring (xdoc::p "We represent a hex string as a list of hex pairs, plus a flag saying whether the surrounding quotes are double or not (i.e. single). We do not capture the optional underscores for now.")) ((content hex-pair-list) (double-quote-p bool)) :tag :hex-string :pred hex-stringp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum literal :short "Fixtype of literals." :long (xdoc::topstring (xdoc::p "Boolean literals are straightforward.") (xdoc::p "We represent a decimal literal as a natural number. Since the Yul grammar requires no leading zeros in decimal numbers, a natural number captures the full information.") (xdoc::p "We represent a hexadecimal literal as a list of hex digits, which therefore captures full information: leading zeros and capitalization of the letters.") (xdoc::p "We represent plain and hex strings as described in @(tsee plain-string) and @(tsee hex-string).")) (:boolean ((get bool))) (:dec-number ((get nat))) (:hex-number ((get hex-digit-list))) (:plain-string ((get plain-string))) (:hex-string ((get hex-string))) :pred literalp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption literal-option literal :short "Fixtype of optional literals." :pred literal-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult literal-result :short "Fixtype of errors and literals." :ok literal :pred literal-resultp :prepwork ((local (in-theory (enable literal-kind))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist literal-list :short "Fixtype of lists of literals." :elt-type literal :true-listp t :elementp-of-nil nil :pred literal-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes expressions/funcalls :short "Fixtypes of expressions and function calls." (fty::deftagsum expression :short "Fixtype of expressions." (:path ((get path))) (:literal ((get literal))) (:funcall ((get funcall))) :pred expressionp :measure (two-nats-measure (acl2-count x) 1)) (fty::deflist expression-list :short "Fixtype of lists of expressions." :elt-type expression :true-listp t :elementp-of-nil nil :pred expression-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod funcall :short "Fixtype of function calls." ((name identifier) (args expression-list)) :tag :funcall :pred funcallp :measure (two-nats-measure (acl2-count x) 1))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption expression-option expression :short "Fixtype of optional expressions." :pred expression-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult expression-result :short "Fixtype of errors and expressions." :ok expression :pred expression-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-expressionp (implies (expressionp x) (not (resulterrp x))) :enable (expressionp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption funcall-option funcall :short "Fixtype of optional function calls." :pred funcall-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult funcall-result :short "Fixtype of errors and function calls." :ok funcall :pred funcall-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-funcallp (implies (funcallp x) (not (resulterrp x))) :enable (funcallp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes statements/blocks/cases/fundefs :short "Fixtypes of statements, blocks, cases, and function definitions." (fty::deftagsum statement :short "Fixtype of statements." :long (xdoc::topstring (xdoc::p "We use different constructors for declaration of single vs. multiple variables. We also use different constructors for assignments to single or mulitple paths. This way, we can restrict the use of function calls for multiple variables/targets, as opposed to general expressions for single variables/targets. The requirements that the lists of multiple variables or paths contain at least two elements are given in the static semantics. Also the requirement that switch statements have at least one case (literal or default) is given in the static semantics.")) (:block ((get block))) (:variable-single ((name identifier) (init expression-option))) (:variable-multi ((names identifier-list) (init funcall-optionp))) (:assign-single ((target path) (value expression))) (:assign-multi ((targets path-list) (value funcall))) (:funcall ((get funcall))) (:if ((test expression) (body block))) (:for ((init block) (test expression) (update block) (body block))) (:switch ((target expression) (cases swcase-list) (default block-option))) (:leave ()) (:break ()) (:continue ()) (:fundef ((get fundef))) :pred statementp :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist statement-list :short "Fixtype of lists of statements." :elt-type statement :true-listp t :elementp-of-nil nil :pred statement-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod block :short "Fixtype of blocks." ((statements statement-list)) :tag :block :pred blockp :measure (two-nats-measure (acl2-count x) 1)) (fty::defoption block-option block :short "Fixtype of optional blocks." :pred block-optionp :measure (two-nats-measure (acl2-count x) 2)) (fty::defprod swcase :short "Fixtype of cases (of switch statements)." ((value literal) (body block)) :tag :swcase :pred swcasep :measure (two-nats-measure (acl2-count x) 2)) (fty::deflist swcase-list :short "Fixtype of lists of cases (of switch statements)." :elt-type swcase :true-listp t :elementp-of-nil nil :pred swcase-listp :measure (two-nats-measure (acl2-count x) 0)) (fty::defprod fundef :short "Fixtype of function definitions." ((name identifier) (inputs identifier-list) (outputs identifier-list) (body block)) :tag :fundef :pred fundefp :measure (two-nats-measure (acl2-count x) 2)) /// (defruled block-option-some->val-when-nonnil (implies x (equal (block-option-some->val x) (block-fix x))) :enable block-option-some->val)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defoption statement-option statement :short "Fixtype of optional statements." :pred statement-optionp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult block-result :short "Fixtype of errors and blocks." :ok block :pred block-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-blockp (implies (blockp x) (not (resulterrp x))) :enable (blockp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult statement-result :short "Fixtype of errors and statements." :ok statement :pred statement-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-statementp (implies (statementp x) (not (resulterrp x))) :enable (statementp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult fundef-result :short "Fixtype of errors and function definitions." :ok fundef :pred fundef-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-fundefp (implies (fundefp x) (not (resulterrp x))) :enable (fundefp resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defresult swcase-result :short "Fixtype of errors and swcase clauses (for switch statements)." :ok swcase :pred swcase-resultp) ;;;;;;;;;;;;;;;;;;;; (defruled not-resulterrp-when-swcasep (implies (swcasep x) (not (resulterrp x))) :enable (swcasep resulterrp)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection swcase-list->value-list ((x swcase-listp)) :returns (lits literal-listp) :short "Lift @(tsee swcase->value) to lists." (swcase->value x) /// (fty::deffixequiv swcase-list->value-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deflist fundef-list :short "Fixtype of lists of function definitions." :elt-type fundef :true-listp t :elementp-of-nil nil :pred fundef-listp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (std::defprojection fundef-list->name-list ((x fundef-listp)) :returns (names identifier-listp) :short "Lift @(tsee fundef->name) to lists." (fundef->name x) /// (fty::deffixequiv fundef-list->name-list)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define statements-to-fundefs ((stmts statement-listp)) :returns (fundefs fundef-listp) :short "Filter function definitions out of a list of statements." :long (xdoc::topstring (xdoc::p "The function definitions are in the same order as they appear in the list of statements. We discard all the statements that are not function definitions, and we eliminate the @(':statement-fundef') wrappers.")) (cond ((endp stmts) nil) ((statement-case (car stmts) :fundef) (cons (statement-fundef->get (car stmts)) (statements-to-fundefs (cdr stmts)))) (t (statements-to-fundefs (cdr stmts)))) :hooks (:fix)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftagsum data-value :short "Fixtype of data values in Yul objects." :long (xdoc::topstring (xdoc::p "A data value is either a hex string or a plain string.") (xdoc::p "See @(tsee data-item).")) (:hex ((get hex-string))) (:plain ((get plain-string))) :pred data-value-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::defprod data-item :short "Fixtype of data items in Yul objects." :long (xdoc::topstring (xdoc::p "A data item consits of a name (a plain string) and a value.")) ((name plain-string) (value data-value)) :tag :data :pred data-item-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (fty::deftypes objects :short "Fixtypes of Yul objects and related entities." :long (xdoc::topstring (xdoc::p "The concrete syntax of Yul objects is described in [Yul: Specification of Yul Object]. That description refers to the old grammar (see (@see concrete-syntax)); the new grammar does not include Yul objects.") (xdoc::p "Here we formalize an abstract syntax version of Yul objects. We ``map'' from the old grammar to the new grammar as needed.")) (fty::defprod object :short "Fixtype of Yul objects." :long (xdoc::topstring (xdoc::p "An object consists of a name (a plain string literal), a code block, and a sequence of zero or more objects and data items. In that sequence of objects and data items, the objects are sub-objects of this object, which motivates our choice of field name.")) ((name plain-string) (code block) (sub/data object/data-list)) :tag :object :pred objectp :measure (two-nats-measure (acl2-count x) 1)) (fty::deftagsum object/data :short "Fixtype of Yul objects and data items." (:object ((get object))) (:data ((get data-item))) :pred object/data-p :measure (two-nats-measure (acl2-count x) 0)) (fty::deflist object/data-list :short "Fixtype of lists of Yul objects and data items." :elt-type object/data :true-listp t :elementp-of-nil nil :pred object/data-listp :measure (two-nats-measure (acl2-count x) 0)))