• 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
          • Signature
          • Constraint
            • Constraint-info
            • Partial-encapsulate
            • Redundant-encapsulate
            • Infected-constraints
            • Functional-instantiation
          • Defun-sk
          • 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
    • System-utilities
    • Constraint

    Constraint-info

    Obtaining the constraint on a function symbol

    For a function symbol, fn, and a logical world, wrld — for example, the current world, (w state) — evaluation of the form (constraint-info fn wrld) returns (mv flg c), where c is the list of constraints on fn (implicitly conjoined), and flg is nil if fn is a defined function and otherwise is a function symbol with that same list of constraints (possibly fn itself). See constraint for relevant background.

    We illustrate with the following example.

    (encapsulate
      (((f1 *) => *)
       ((f3 *) => *))
      (local (defun f1 (x) x))
      (defun f2 (x) (f1 x))
      (local (defun f3 (x) x))
      (defun f4 (x) (f3 x))
      (defthm f1-prop (equal (f1 x) (f4 x))))

    Then we can see the results of constraint-info on each introduced function symbol, as follows.

    ACL2 !>(let ((wrld (w state)))
              (list
               'result
               'f1 (mv-let (flg1 c1) (constraint-info 'f1 wrld) (list flg1 c1))
               'f2 (mv-let (flg2 c2) (constraint-info 'f2 wrld) (list flg2 c2))
               'f3 (mv-let (flg3 c3) (constraint-info 'f3 wrld) (list flg3 c3))
               'f4 (mv-let (flg4 c4) (constraint-info 'f4 wrld) (list flg4 c4))))
    (RESULT F1
            (F1 ((EQUAL (F4 X) (F3 X))
                 (EQUAL (F1 X) (F4 X))))
            F2 (NIL (EQUAL (F2 X) (F1 X)))
            F3
            (F1 ((EQUAL (F4 X) (F3 X))
                 (EQUAL (F1 X) (F4 X))))
            F4
            (F1 ((EQUAL (F4 X) (F3 X))
                 (EQUAL (F1 X) (F4 X)))))
    ACL2 !>

    Notice that the flag (first result) for f2 is nil, because even though the definition of f2 is lexically inside the encapsulate, it doesn't affect the constraints because it can be safely moved to just after the encapsulate. However, the definition of f4 does affect (or ``infect''; see subversive-recursions) the constraints: it can't be moved to after the encapsulate because of the defthm after it.

    Also see constraint. For more details, see comments in the definition of constraint-info in the ACL2 source code.