• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
          • Soft-future-work
          • Soft-macros
          • Updates-to-workshop-material
          • Soft-implementation
            • Soft-implementation-core
            • Gen-macro2-of-macro
            • Defun-inst-implementation
            • Defthm-inst-implementation
            • Defsoft-implementation
              • Defsoft-fn
              • Ensure-defun-sk-rule-same-funvars
              • Ensure-wfrel-o<
                • Defsoft-macro-definition
              • Defunvar-implementation
              • Defund-sk2-implementation
              • Defun-sk2-implementation
              • Define-sk2-implementation
              • Defchoose2-implementation
              • Defund2-implementation
              • Defun2-implementation
              • Define2-implementation
            • Soft-notions
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • 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 (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)