• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
        • Base-api
        • Aignet-construction
        • Representation
        • Aignet-copy-init
        • Aignet-simplify-with-tracking
        • Aignet-simplify-marked-with-tracking
        • Aignet-cnf
        • Aignet-simplify-marked
        • Aignet-complete-copy
        • Aignet-transforms
        • Aignet-eval
          • Vector-simulation
            • Aignet-vecsim
            • Aignet-vecsim1
            • S32v
            • Random-sim
            • Exhaustive-sim
              • S32v-randomize-inputs
              • S32v-randomize-regs
              • Aignet-vecsim-top
          • Semantics
          • Aignet-read-aiger
          • Aignet-write-aiger
          • Aignet-abc-interface
          • Utilities
        • Aig
        • Satlink
        • Truth
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Vector-simulation

    Exhaustive-sim

    Exhaustively simulate an AIG with one output node to determine if it is satisfiable

    Signature
    (exhaustive-sim aignet) → ctrex
    Returns
    ctrex — Type (acl2::maybe-natp ctrex).

    Given a combinational AIG with 37 or fewer inputs and no registers, this uses aignet-vecsim to run through all combinations of inputs to check the satisfiability of the 0th output of the AIG. This function returns NIL if that output is unsatisfiable (always 0), and otherwise returns a natural number giving the satisfying assignment for the PIs; i.e. (logbitp n result) gives the assignment for input n.

    Definitions and Theorems

    Function: exhaustive-sim

    (defun exhaustive-sim (aignet)
      (declare (xargs :stobjs (aignet)))
      (declare (xargs :guard (and (<= (num-ins aignet) 37)
                                  (<= 1 (num-outs aignet)))))
      (let ((__function__ 'exhaustive-sim))
        (declare (ignorable __function__))
        (b* (((local-stobjs s32v) (mv ctrex s32v))
             (s32v (s32v-resize-cols 1 s32v))
             (s32v (s32v-resize-rows (num-fanins aignet)
                                     s32v)))
          (exhaustive-sim-aux 0
                              (logmask (nfix (- (num-ins aignet) 5)))
                              s32v aignet))))

    Theorem: maybe-natp-of-exhaustive-sim

    (defthm maybe-natp-of-exhaustive-sim
      (b* ((ctrex (exhaustive-sim aignet)))
        (acl2::maybe-natp ctrex))
      :rule-classes :type-prescription)

    Theorem: exhaustive-sim-correct

    (defthm exhaustive-sim-correct
      (b* ((?ctrex (exhaustive-sim aignet)))
        (implies (and (equal (output-eval 0 invals regvals aignet)
                             1)
                      (equal (num-regs aignet) 0))
                 ctrex)))