• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
        • Make-event
        • Defmacro
        • Untranslate-patterns
        • Tc
        • Trans*
        • Macro-aliases-table
        • Macro-args
        • Defabbrev
        • User-defined-functions-table
        • Trans
        • Untranslate-for-execution
        • Add-macro-fn
        • Check-vars-not-free
        • Safe-mode
        • Macro-libraries
          • B*
          • Defunc
          • Fty
          • Apt
            • Simplify-defun
            • Isodata
            • Tailrec
            • Schemalg
            • Restrict
              • Restrict-implementation
                • Restrict-event-generation
                • Restrict-fn
                • Restrict-macro-definition
                • Restrict-input-processing
                  • Restrict-process-inputs
                  • Restrict-process-restriction
                    • Restrict-process-old
                    • Restrict-process-undefined
              • Expdata
              • Casesplit
              • Simplify-term
              • Simplify-defun-sk
              • Parteval
              • Solve
              • Wrap-output
              • Propagate-iso
              • Simplify
              • Finite-difference
              • Drop-irrelevant-params
              • Copy-function
              • Lift-iso
              • Rename-params
              • Utilities
              • Simplify-term-programmatic
              • Simplify-defun-sk-programmatic
              • Simplify-defun-programmatic
              • Simplify-defun+
              • Common-options
              • Common-concepts
            • Std/util
            • Defdata
            • Defrstobj
            • Seq
            • Match-tree
            • Defrstobj
            • With-supporters
            • Def-partial-measure
            • Template-subst
            • Soft
            • Defthm-domain
            • Event-macros
            • Def-universal-equiv
            • Def-saved-obligs
            • With-supporters-after
            • Definec
            • Sig
            • Outer-local
            • Data-structures
          • Trans1
          • Defmacro-untouchable
          • Set-duplicate-keys-action
          • Add-macro-alias
          • Magic-macroexpand
          • Defmacroq
          • Trans!
          • Remove-macro-fn
          • Remove-macro-alias
          • Add-binop
          • Untrans-table
          • Trans*-
          • Remove-binop
          • Tcp
          • Tca
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
        • B*
        • Defunc
        • Fty
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
            • Restrict-implementation
              • Restrict-event-generation
              • Restrict-fn
              • Restrict-macro-definition
              • Restrict-input-processing
                • Restrict-process-inputs
                • Restrict-process-restriction
                  • Restrict-process-old
                  • Restrict-process-undefined
            • Expdata
            • Casesplit
            • Simplify-term
            • Simplify-defun-sk
            • Parteval
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Std/util
          • Defdata
          • Defrstobj
          • Seq
          • Match-tree
          • Defrstobj
          • With-supporters
          • Def-partial-measure
          • Template-subst
          • Soft
          • Defthm-domain
          • Event-macros
          • Def-universal-equiv
          • Def-saved-obligs
          • With-supporters-after
          • Definec
          • Sig
          • Outer-local
          • Data-structures
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Restrict-input-processing

      Restrict-process-restriction

      Process the restriction input.

      Signature
      (restrict-process-restriction 
           restriction old verify-guards ctx state) 
       
        → 
      (mv erp restriction state)
      Arguments
      old — Guard (symbolp old).
      verify-guards — Guard (booleanp verify-guards).
      Returns
      restriction — A pseudo-termp that is the translation of restriction.

      Definitions and Theorems

      Function: restrict-process-restriction

      (defun restrict-process-restriction
             (restriction old verify-guards ctx state)
       (declare (xargs :stobjs (state)))
       (declare (xargs :guard (and (symbolp old)
                                   (booleanp verify-guards))))
       (let ((__function__ 'restrict-process-restriction))
        (declare (ignorable __function__))
        (b*
         ((wrld (w state))
          (restriction (if (equal restriction ':guard)
                           (guard old nil wrld)
                         restriction))
          ((er (list term stobjs-out))
           (ensure-value-is-untranslated-term$
                restriction "The second input" t nil))
          (description
               (msg "The term ~x0 that denotes the restricting predicate"
                    restriction))
          ((er &)
           (ensure-term-free-vars-subset$ term (formals old wrld)
                                          description t nil))
          ((er &)
           (ensure-term-logic-mode$ term description t nil))
          ((er &)
           (ensure-function/lambda/term-number-of-results$
                stobjs-out 1 description t nil))
          ((er &)
           (ensure-term-no-stobjs$ stobjs-out description t nil))
          ((er &)
           (if
            (eq verify-guards t)
            (ensure-term-guard-verified-exec-fns$
             term
             (msg
              "Since either the :VERIFY-GUARDS input is T, ~
                                or it is (perhaps by default) :AUTO ~
                                and the target function ~x0 is guard-verified, ~@1"
              old (msg-downcase-first description))
             t nil)
            (value nil)))
          ((er &)
           (ensure-term-does-not-call$ term old description t nil)))
         (value term))))