• 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
        • Defun
        • Verify-guards
        • Table
        • Mutual-recursion
        • Memoize
        • Make-event
        • Include-book
        • Encapsulate
        • Defun-sk
          • Define-sk
          • Quantifier-tutorial
          • Defun-sk-queries
          • Quantifiers
          • Defun-sk-example
          • Defund-sk
          • Forall
          • Def::un-sk
          • Equiv
          • Exists
          • Congruence
          • Defttag
          • Defstobj
          • Defpkg
          • Defattach
          • Defabsstobj
          • Defchoose
          • Progn
          • Verify-termination
          • Redundant-events
          • Defmacro
          • Defconst
          • Skip-proofs
          • In-theory
          • Embedded-event-form
          • Value-triple
          • Comp
          • Local
          • Defthm
          • Progn!
          • Defevaluator
          • Theory-invariant
          • Assert-event
          • Defun-inline
          • Project-dir-alist
          • Partial-encapsulate
          • Define-trusted-clause-processor
          • Defproxy
          • Defexec
          • Defun-nx
          • Defthmg
          • Defpun
          • Defabbrev
          • Set-table-guard
          • Name
          • Defrec
          • Add-custom-keyword-hint
          • Regenerate-tau-database
          • Defcong
          • Deftheory
          • Defaxiom
          • Deftheory-static
          • Defund
          • Evisc-table
          • Verify-guards+
          • Logical-name
          • Profile
          • Defequiv
          • Defmacro-untouchable
          • Add-global-stobj
          • Defthmr
          • Defstub
          • Defrefinement
          • Deflabel
          • In-arithmetic-theory
          • Unmemoize
          • Defabsstobj-missing-events
          • Defthmd
          • Fake-event
          • Set-body
          • Defun-notinline
          • Functions-after
          • Macros-after
          • Dump-events
          • Defund-nx
          • Defun$
          • Remove-global-stobj
          • Remove-custom-keyword-hint
          • Dft
          • Defthy
          • Defund-notinline
          • Defnd
          • Defn
          • Defund-inline
          • Defmacro-last
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defun-sk

    Congruence

    A macro to prove congruence rules for quantified formulae and their associated witnesses

    The quant::congruence macro can be used to prove ACL2::congruence rules for quantified formulae and their associated witnesses introduced using defun-sk. Note: this macro only works for formula that are introduced with the :strengthen t keyword.

    Usage:

    (include-book "coi/quantification/quantified-congruence" :dir :system)
                 
    ;; Given a predicate that satisfies some congruence
    (defcong pred-equiv equal (pred a x y) 2)
    
    ;; A quantified formula involving pred introduced using
    ;; defun-sk with the :strengthen t option.
    (defun-sk quantified-pred (v z)
      (forall (a) (pred a v z))
      :strengthen t)
    
    ;; We prove congruence rules relative to 'v'
    (quant::congruence quantified-pred (v z)
      (forall (a) (pred a v z))
      :congruences ((v pred-equiv)))
    
    ;; The following lemmas now follow directly ..
    (defthmd witness-congruence
      (implies
       (pred-equiv v1 v2)
       (equal (quantified-pred-witness v1 z)
              (quantified-pred-witness v2 z))))
              
            
    (defthmd quantified-congruence
      (implies
       (pred-equiv v1 v2)
       (equal (quantified-pred v1 z)
              (quantified-pred v2 z))))