• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
        • Fgl-rewrite-rules
        • Fgl-function-mode
        • Fgl-object
        • Fgl-solving
          • Fgl-sat-check
          • Fgl-exhaustive-test-config
          • Fgl-prove
          • Fgl-vacuity-check
          • Fgl-sat-check/print-counterexample
          • Fgl-handling-if-then-elses
          • Fgl-counterexamples
          • Fgl-getting-bits-from-objects
          • Fgl-primitive-and-meta-rules
          • Fgl-interpreter-overview
          • Fgl-correctness-of-binding-free-variables
          • Fgl-debugging
          • Fgl-testbenches
          • Def-fgl-boolean-constraint
          • Fgl-stack
          • Fgl-rewrite-tracing
          • Def-fgl-param-thm
          • Def-fgl-thm
          • Fgl-fast-alist-support
          • Fgl-array-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-fty-support
          • Fgl-internals
        • Removable-runes
        • Efficiency
        • Rewrite-bounds
        • Bash
        • Def-dag-measure
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Fgl-solving

    Fgl-sat-check/print-counterexample

    Check satisfiability during FGL interpretation and print counterexamples.

    Signature
    (fgl-sat-check/print-counterexample params msg x) → *

    Similar to fgl-sat-check, but this version additionally prints the counterexample bindings, when satisfiable, for the context from which it was called. Its functionality depends on the rewrite rule fgl-sat-check/print-counterexample-rw. The extra argument msg should be a string or message identifying the particular SAT check.

    Definitions and Theorems

    Function: fgl-sat-check/print-counterexample

    (defun fgl-sat-check/print-counterexample (params msg x)
      (declare (ignore params msg))
      (declare (xargs :guard t))
      (let ((__function__ 'fgl-sat-check/print-counterexample))
        (declare (ignorable __function__))
        (if x t nil)))

    Theorem: fgl-sat-check/print-counterexample-rw

    (defthm fgl-sat-check/print-counterexample-rw
     (equal
      (fgl-sat-check/print-counterexample params msg x)
      (b*
       ((ans (fgl-sat-check params x))
        (unsatp (syntax-bind unsat (eq ans nil)))
        ((when unsatp) ans)
        ((list (list error bindings vars) &)
         (syntax-bind
              alists
              (show-counterexample-bind params interp-st state)))
        ((when error)
         (b* ((?ignore (cw "~@0: ~@1" msg error)))
           ans))
        (?ignore
             (cw "~@0: Counterexample -- bindings: ~x1 variables: ~x2~%"
                 msg bindings vars)))
       ans)))