Filtering...

guard-verified-exec-fnsp-tests

books/std/system/guard-verified-exec-fnsp-tests

Included Books

other
(in-package "ACL2")
include-book
(include-book "guard-verified-exec-fnsp")
include-book
(include-book "std/testing/assert-bang" :dir :system)
include-book
(include-book "std/testing/must-succeed-star" :dir :system)
other
(assert! (guard-verified-exec-fnsp 'x (w state)))
other
(assert! (guard-verified-exec-fnsp ''4 (w state)))
other
(assert! (guard-verified-exec-fnsp '(cons x y) (w state)))
other
(must-succeed* (defun f (x) (declare (xargs :verify-guards nil)) x)
  (defun g (x) (declare (xargs :verify-guards t)) x)
  (assert! (not (guard-verified-exec-fnsp '(cons (f x) (g (f y))) (w state)))))
other
(must-succeed* (defun mycar
    (x)
    (declare (xargs :verify-guards nil))
    (car x))
  (assert! (not (guard-verified-exec-fnsp '(cons (mycar z) (len y))
        (w state))))
  (defun f
    (x)
    (mbe :logic (mycar x)
      :exec (if (consp x)
        (car x)
        nil)))
  (assert! (guard-verified-exec-fnsp (body 'f nil (w state)) (w state))))
other
(must-succeed* (defun f (x) (declare (xargs :verify-guards nil)) x)
  (defun g
    (x)
    (declare (xargs :verify-guards t))
    (cons (ec-call (f x)) (len x)))
  (assert! (guard-verified-exec-fnsp (body 'g nil (w state)) (w state))))