Abstract a
(abs-signed-literal tree) → lit
Function:
(defun abs-signed-literal (tree) (declare (xargs :guard (abnf::treep tree))) (let ((__function__ 'abs-signed-literal)) (declare (ignorable __function__)) (b* (((okf (abnf::tree-list-tuple2 sub)) (abnf::check-tree-nonleaf-2 tree "signed-literal")) ((okf num-tree) (abnf::check-tree-list-1 sub.1st)) ((okf nat) (abs-numeral num-tree)) ((okf type-tree) (abnf::check-tree-list-1 sub.2nd)) ((okf type-tree) (abnf::check-tree-nonleaf-1-1 type-tree nil)) ((okf nats) (abnf::check-tree-leafterm type-tree))) (cond ((abnf::nats-match-sensitive-chars-p nats (acl2::explode "i8")) (make-literal-signed :val nat :size (bitsize-8))) ((abnf::nats-match-sensitive-chars-p nats (acl2::explode "i16")) (make-literal-signed :val nat :size (bitsize-16))) ((abnf::nats-match-sensitive-chars-p nats (acl2::explode "i32")) (make-literal-signed :val nat :size (bitsize-32))) ((abnf::nats-match-sensitive-chars-p nats (acl2::explode "i64")) (make-literal-signed :val nat :size (bitsize-64))) ((abnf::nats-match-sensitive-chars-p nats (acl2::explode "i128")) (make-literal-signed :val nat :size (bitsize-128))) (t (reserrf (list :found-subtree (abnf::tree-info-for-error tree))))))))
Theorem:
(defthm literal-resultp-of-abs-signed-literal (b* ((lit (abs-signed-literal tree))) (literal-resultp lit)) :rule-classes :rewrite)
Theorem:
(defthm abs-signed-literal-of-tree-fix-tree (equal (abs-signed-literal (abnf::tree-fix tree)) (abs-signed-literal tree)))
Theorem:
(defthm abs-signed-literal-tree-equiv-congruence-on-tree (implies (abnf::tree-equiv tree tree-equiv) (equal (abs-signed-literal tree) (abs-signed-literal tree-equiv))) :rule-classes :congruence)