• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
          • Lambda
          • Warrant
          • Defwarrant
            • Fn-equal
            • Badge
            • Lambda$
            • Tame
            • Defbadge
            • Print-cl-cache
            • Introduction-to-apply$
            • Well-formed-lambda-objectp
            • Rewriting-calls-of-apply$-ev$-and-loop$-scions
            • Mixed-mode-functions
            • Explain-giant-lambda-object
            • Gratuitous-lambda-object-restrictions
            • Scion
            • Ilk
            • Ev$
            • Translam
            • Fn-equal
              • Apply$-guard
              • L<
              • Apply$-lambda-guard
              • Apply$-userfn
              • Badge-userfn
              • Defun$
              • Apply$-lambda
            • Loop$
            • Programming-with-state
            • Arrays
            • Characters
            • Time$
            • Defmacro
            • Loop$-primer
            • Fast-alists
            • Defconst
            • Evaluation
            • Guard
            • Equality-variants
            • Compilation
            • Hons
            • ACL2-built-ins
            • Developers-guide
            • System-attachments
            • Advanced-features
            • Set-check-invariant-risk
            • Numbers
            • Efficiency
            • Irrelevant-formals
            • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
            • Redefining-programs
            • Lists
            • Invariant-risk
            • Errors
            • Defabbrev
            • Conses
            • Alists
            • Set-register-invariant-risk
            • Strings
            • Program-wrapper
            • Get-internal-time
            • Basics
            • Packages
            • Oracle-eval
            • Defmacro-untouchable
            • <<
            • Primitive
            • Revert-world
            • Unmemoize
            • Set-duplicate-keys-action
            • Symbols
            • Def-list-constructor
            • Easy-simplify-term
            • Defiteration
            • Fake-oracle-eval
            • Defopen
            • Sleep
          • Operational-semantics
          • Real
          • Start-here
          • Debugging
          • Miscellaneous
          • Output-controls
          • Macros
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Apply$
      • Defwarrant

      Fn-equal

      Equivalence relation on tame functions

      Fn-equal is an equivalence relation on tame functions. It holds between fn1 and fn2 iff both are tame functions and (apply$ fn1 args) is (apply$ fn2 args), for all args. A defun-sk event is used to express the universally quantified condition. defwarrant proves that fn-equal is a congruence relation for every argument position of ilk :FN.

      Ideally one can substitute one functional object for an equivalent one in functional positions. For example, fn-equal holds between '(LAMBDA (X) X) and 'IDENTITY, so one would hold that (collect$ '(LAMBDA (X) X) lst) could be rewritten to (collect$ 'IDENTITY lst) since the first argument of collect$ (as defined in the introduction-to-apply$) has ilk :FN. Unfortunately, because these are quoted constants, ACL2's rewriter will not rewrite one to the other!

      We regard fn-equal as a reminder to us — or a challenge to users! — to find a way to handle functional equivalence in the rewriter.