• 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-output-ranges
          • Aignet-comb-transforms
            • Fraig
            • Parametrize
              • Aignet-parametrize-output-ranges
              • Aignet-parametrize-copy-set-regs
              • Aignet-parametrize-copy-set-ins
              • Aignet-parametrize-collect-bdd-order-aux
              • Aignet-parametrize-collect-bdd-order
              • Aignet-output-range-conjoin-ubdds
              • Aignet-output-range-collect-in/reg-ubdd-order
              • Aignet-finish-reg-ubdd-order
              • Aignet-finish-in-ubdd-order
              • Aignet-copy-dfs-output-range
              • Aignet-parametrize-m-n
              • Aignet-node-to-ubdd
              • Aignet-output-range-to-ubdds
              • Ubdd-to-aignet
              • Aignet-parametrize-copy-init
              • Parametrize-config
              • Parametrize-output-type
              • Ubdd-arr-to-param-space
              • Copy-lits-compose
                • Bitarr-range-1bit-indices
                • Bitarr-range-count
                • Aignet-count-ubdd-branches-wrap
                • Ubdd-to-aignet-memo-ok
                • Aignet-node-to-ubdd-build-cond
                • Copy-lits-compose-in-place
                • Bitarr-range-set
                • Ubdd/level
                • Ubdd-arr
                • Ubdd-arr-max-depth
                • Aignet-count-ubdd-branches
                • Ubdd-negate-cond
                • Ubdd-apply-gate
                • Aignet-node-to-ubdd-short-circuit-cond
                • Bits->bools
                • Eval-ubddarr
                • Ubdd-to-aignet-memo
                • Parametrize-output-type-map
                • Lubdd-fix
              • Observability-fix
              • Constprop
              • Apply-m-assumption-n-output-output-transform-default
              • Balance
              • Apply-n-output-comb-transform-default
              • Apply-comb-transform-default
              • Obs-constprop
              • Rewrite
              • Comb-transform
              • Abc-comb-simplify
              • Prune
              • Rewrite!
              • M-assumption-n-output-comb-transform->name
              • N-output-comb-transform->name
              • Comb-transform->name
              • N-output-comb-transformlist
              • M-assumption-n-output-comb-transformlist
              • Comb-transformlist
              • Apply-comb-transform
            • Aignet-m-assumption-n-output-transforms
            • Aignet-n-output-comb-transforms
          • Aignet-eval
          • 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
    • Parametrize

    Copy-lits-compose

    Signature
    (copy-lits-compose start count aignet litarr copy copy2) 
      → 
    new-copy2
    Arguments
    start — Guard (natp start).
    count — Guard (natp count).

    Definitions and Theorems

    Function: copy-lits-compose

    (defun copy-lits-compose (start count aignet litarr copy copy2)
      (declare (xargs :stobjs (aignet litarr copy copy2)))
      (declare (xargs :guard (and (natp start) (natp count))))
      (declare
           (xargs :guard (and (<= (+ start count)
                                  (lits-length litarr))
                              (<= (num-fanins aignet)
                                  (lits-length copy))
                              (<= (+ start count) (lits-length copy2))
                              (aignet-copies-in-bounds litarr aignet))))
      (let ((__function__ 'copy-lits-compose))
        (declare (ignorable __function__))
        (b* (((when (zp count)) copy2)
             (lit (get-lit start litarr))
             (copy2 (set-lit start (lit-copy lit copy)
                             copy2)))
          (copy-lits-compose (1+ (lnfix start))
                             (1- count)
                             aignet litarr copy copy2))))

    Theorem: len-of-copy-lits-compose

    (defthm len-of-copy-lits-compose
      (b*
        ((?new-copy2
              (copy-lits-compose start count aignet litarr copy copy2)))
        (implies (<= (+ (nfix start) (nfix count))
                     (len copy2))
                 (equal (len new-copy2) (len copy2)))))

    Theorem: nth-of-copy-lits-compose

    (defthm nth-of-copy-lits-compose
      (b*
        ((?new-copy2
              (copy-lits-compose start count aignet litarr copy copy2)))
        (equal (nth-lit n new-copy2)
               (if (and (<= (nfix start) (nfix n))
                        (< (nfix n)
                           (+ (nfix start) (nfix count))))
                   (lit-copy (nth-lit n litarr) copy)
                 (nth-lit n copy2)))))

    Theorem: aignet-elim-copy-lits-compose

    (defthm aignet-elim-copy-lits-compose
     (b*
       ((?new-copy2
             (copy-lits-compose start count aignet litarr copy copy2)))
      (implies
        (syntaxp (not (equal aignet ''nil)))
        (equal new-copy2
               (let ((aignet nil))
                 (copy-lits-compose start
                                    count aignet litarr copy copy2))))))

    Theorem: aignet-lit-listp-of-copy-lits-compose

    (defthm aignet-lit-listp-of-copy-lits-compose
      (b*
        ((?new-copy2
              (copy-lits-compose start count aignet litarr copy copy2)))
        (implies (and (aignet-copies-in-bounds copy aignet2)
                      (aignet-lit-listp copy2 aignet2))
                 (aignet-lit-listp new-copy2 aignet2))))

    Theorem: copy-lits-compose-of-nfix-start

    (defthm copy-lits-compose-of-nfix-start
      (equal (copy-lits-compose (nfix start)
                                count aignet litarr copy copy2)
             (copy-lits-compose start count aignet litarr copy copy2)))

    Theorem: copy-lits-compose-nat-equiv-congruence-on-start

    (defthm copy-lits-compose-nat-equiv-congruence-on-start
     (implies
         (nat-equiv start start-equiv)
         (equal (copy-lits-compose start count aignet litarr copy copy2)
                (copy-lits-compose start-equiv
                                   count aignet litarr copy copy2)))
     :rule-classes :congruence)

    Theorem: copy-lits-compose-of-nfix-count

    (defthm copy-lits-compose-of-nfix-count
      (equal (copy-lits-compose start (nfix count)
                                aignet litarr copy copy2)
             (copy-lits-compose start count aignet litarr copy copy2)))

    Theorem: copy-lits-compose-nat-equiv-congruence-on-count

    (defthm copy-lits-compose-nat-equiv-congruence-on-count
     (implies
       (nat-equiv count count-equiv)
       (equal (copy-lits-compose start count aignet litarr copy copy2)
              (copy-lits-compose start
                                 count-equiv aignet litarr copy copy2)))
     :rule-classes :congruence)

    Theorem: copy-lits-compose-of-node-list-fix-aignet

    (defthm copy-lits-compose-of-node-list-fix-aignet
      (equal (copy-lits-compose start count (node-list-fix aignet)
                                litarr copy copy2)
             (copy-lits-compose start count aignet litarr copy copy2)))

    Theorem: copy-lits-compose-node-list-equiv-congruence-on-aignet

    (defthm copy-lits-compose-node-list-equiv-congruence-on-aignet
     (implies
       (node-list-equiv aignet aignet-equiv)
       (equal (copy-lits-compose start count aignet litarr copy copy2)
              (copy-lits-compose start
                                 count aignet-equiv litarr copy copy2)))
     :rule-classes :congruence)