• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
      • Defdata
      • Defrstobj
      • Seq
      • Match-tree
      • Defrstobj
      • With-supporters
      • Def-partial-measure
      • Template-subst
      • Soft
        • Soft-future-work
        • Soft-macros
          • Defun-inst
          • Defequal
          • Defsoft
            • Defsoft-implementation
              • Defsoft-fn
              • Ensure-defun-sk-rule-same-funvars
              • Ensure-wfrel-o<
                • Defsoft-macro-definition
            • Defthm-inst
            • Defun2
            • Defunvar
            • Defun-sk2
            • Defchoose2
            • Defthm-2nd-order
            • Define-sk2
            • Defund-sk2
            • Define2
            • Defund2
          • Updates-to-workshop-material
          • Soft-implementation
          • Soft-notions
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • Trans
          • User-defined-functions-table
          • Untranslate-for-execution
          • Macro-libraries
            • B*
            • Defunc
            • Fty
            • Apt
            • Std/util
            • Defdata
            • Defrstobj
            • Seq
            • Match-tree
            • Defrstobj
            • With-supporters
            • Def-partial-measure
            • Template-subst
            • Soft
              • Soft-future-work
              • Soft-macros
                • Defun-inst
                • Defequal
                • Defsoft
                  • Defsoft-implementation
                    • Defsoft-fn
                    • Ensure-defun-sk-rule-same-funvars
                    • Ensure-wfrel-o<
                      • Defsoft-macro-definition
                  • Defthm-inst
                  • Defun2
                  • Defunvar
                  • Defun-sk2
                  • Defchoose2
                  • Defthm-2nd-order
                  • Define-sk2
                  • Defund-sk2
                  • Define2
                  • Defund2
                • Updates-to-workshop-material
                • Soft-implementation
                • Soft-notions
              • Defthm-domain
              • Event-macros
              • Def-universal-equiv
              • Def-saved-obligs
              • With-supporters-after
              • Definec
              • Sig
              • Outer-local
              • Data-structures
            • Add-macro-fn
            • Check-vars-not-free
            • Safe-mode
            • 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
          • Installation
          • Mailing-lists
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Defsoft-implementation

      Ensure-wfrel-o<

      Ensure that a function, if logic-mode and recursive, has o< as well-founded relation.

      Signature
      (ensure-wfrel-o< fn ctx state) → (mv erp nothing state)
      Arguments
      fn — Guard (symbolp fn).
      Returns
      nothing — Type (null nothing).

      For now, we only support logic-mode recursive second-order functions with the default well-founded relation (i.e. o<). This might be relaxed in the future.

      Definitions and Theorems

      Function: ensure-wfrel-o<

      (defun ensure-wfrel-o< (fn ctx state)
       (declare (xargs :stobjs (state)))
       (declare (xargs :guard (symbolp fn)))
       (let ((__function__ 'ensure-wfrel-o<))
        (declare (ignorable __function__))
        (b* ((wrld (w state))
             ((unless (logicp fn wrld)) (value nil))
             ((unless (irecursivep fn wrld))
              (value nil))
             (wfrel (get-well-founded-relation+ fn wrld))
             ((when (eq wfrel 'o<)) (value nil)))
         (er-soft+
          ctx t nil
          "The well-founded relation of the recursive function ~x0 ~
                     must be O<, but it is ~x1 instead."
          fn wfrel))))

      Theorem: null-of-ensure-wfrel-o<.nothing

      (defthm null-of-ensure-wfrel-o<.nothing
        (b* (((mv ?erp ?nothing acl2::?state)
              (ensure-wfrel-o< fn ctx state)))
          (null nothing))
        :rule-classes :rewrite)