• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
          • Moddb.lisp
            • Moddb-add-modinst-to-last
            • Moddb-add-module1
            • Moddb-norm
            • Elab-modlist-norm
            • Moddb-ok
            • Elab-modinsts-rem-dups
            • Moddb-add-modinst
            • Elab-mod-initialize-aliases
            • Modinstlist-add-modinsts
            • Moddb-mod-ok
            • Wirelist-rem-dups
            • Moddb-norm-p
            • Elab-mod$a-fix
            • Moddb-mod-order-ok
            • Moddb-mod-insts-ok
            • Elab-mod-wire-find-inst-aux
            • Svex-alist->absindexed
            • Modscope-push-frame
            • Moddb-modinst-ok
            • Lhspairs->absindexed
            • Moddb-mod-inst-wireoffset
            • Moddb-find-bad-modinst-order
            • Constraintlist->absindexed
            • Wirelist-remove-names
            • Moddb-mod-inst-instoffset
            • Lhspairs-named->indexed
            • Elab-modinst-fix
            • Moddb-mod-totalwires
            • Svar-map->absindexed
            • Moddb-modinst-order-ok
            • Moddb-mod-totalinsts
            • Moddb-find-bad-modinst
            • Modscope
            • Constraintlist-named->indexed
            • Assigns->absindexed
            • Moddb-indices-ok
            • Lhs->absindexed
            • Svar-map-named->indexed
            • Module-named->indexed
            • Moddb-find-bad-index
            • Assigns-named->indexed
            • Svar-named->indexed
            • Lhs-named->indexed
            • Elab-mod$c-add-wire
            • Moddb-modname-get-index
            • Moddb-maybe-grow
            • Lhspairs-named->indexed-aux-nrev
            • Elab-modinst-list-names
            • Elab-mod-wire-find-inst
            • Svar->absindexed
            • Moddb-path->wiredecl
            • Modalist-named->indexed
            • Lhspairs->absindexed-nrev
            • Elab-mod$ap
            • Elab-modinst-remove-names
            • Moddb-wireidx->paths
            • Moddb-mods-ok
            • Moddb-find-bad-mod
            • Elab-mod$c-add-inst
            • Elab-mod$c-modinsts-ok
              • Elab-modinst-remove-name
              • Modscope->nth
              • Moddb-basics-ok
              • Svex->absindexed-memo-ok
              • Svex-named->indexed-memo-ok
              • Svarlist-idxaddr-okp
              • Elab-modlist-normp
              • Wirelist-remove-name
              • Modscope->top
              • Moddb-fix
              • Elab-mod$a-add-inst
              • Elab-mod-wiresearch-smartpivot
              • Elab-mod$c-wires-ok
              • Update-elab-mod$a->totalwires
              • Update-elab-mod$a->totalinsts
              • Update-elab-mod$a->orig-mod
              • Update-elab-mod$a->name
              • Moddb-modinst-order-badguy
              • Elab-mod$a-add-wire
              • Elab-mod$a-wiretablei
              • Elab-mod-wiresearch-pivot
              • Elab-mod-wireoffset
              • Elab-mod-instoffset
              • Svar-idxaddr-okp
              • Paths-add-scope
              • Moddb-modinst-badguy
              • Moddb-mod-nwires
              • Moddb-mod-ninsts
              • Modalist-all-idxaddr-okp
              • Elab-mod$a->instname
              • Elab-mods->names
              • Elab-modinst$c-copy
              • Elab-mod$a->inst-wireoffset
              • Elab-mod$a->inst-instoffset
              • Moddb-elab-mod-stats
              • Moddb-contains-modnames
              • Elab-mod$c-inst-abstraction
              • Elab-mod$a->inst-modidx
              • Elab-mod$a-wirename->idx
              • Elab-mod$a-instname->idx
              • Elab-mod-add-wires
              • Modscope-top-bound
              • Modscope-local-bound
              • Constraintlist-add-scope
              • Moddb-modidx-get-name
              • Moddb-add-module
              • Elab-mod-wiresearch-dumbpivot
              • Update-moddb->nmods
              • Elab-mod$c->inst-wireoffset
              • Elab-mod$c->inst-modidx
              • Elab-mod$c->inst-instoffset
              • Elab-mod$c-wire-abstraction
              • Moddb-clear
              • Elab-mod$c->instname
              • Svex-mod->flatten
              • Names->paths
              • Modscope->wireoffset
              • Modscope->instoffset
              • Moddb-mod-badguy
              • Elab-modinsts-nodups-p
              • Wirelist-nodups-p
              • Nat-list-max
              • Modscope->modidx
              • Elab-mod-wiresearch-next-smartp
              • Elab-mod$a->totalwires
              • Elab-mod$a->totalinsts
              • Elab-mod$a->orig-mod
              • Elab-mod$a->name
              • Elab-mod$a-nwires
              • Elab-mod$a-ninsts
              • Elab-modinst$c-fix
              • Elab-mod-fix
              • Create-elab-mod$a
              • Pathlist
              • Module->db
              • Elab-modlist
              • Elab-modinst-list
              • Nrec-list-mods
              • Moddb->nmods
              • Nrec-list
              • Nrec
            • Elab-mod
            • Moddb-path->wireidx/decl
            • Moddb-wireidx->path/decl
            • Moddb-path->wireidx
            • Moddb-address->wireidx
            • Moddb-address->wiredecl
            • Moddb-wireidx->path
            • Modscope-okp
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Moddb.lisp

    Elab-mod$c-modinsts-ok

    Signature
    (elab-mod$c-modinsts-ok elab-mod$c) → *

    Definitions and Theorems

    Function: elab-mod$c-modinsts-ok

    (defun elab-mod$c-modinsts-ok (elab-mod$c)
      (declare (xargs :stobjs (elab-mod$c)))
      (declare (xargs :guard t))
      (let ((__function__ 'elab-mod$c-modinsts-ok))
        (declare (ignorable __function__))
        (and (<= (nfix (elab-mod$c->ninsts elab-mod$c))
                 (elab-mod$c->modinsttable-length elab-mod$c))
             (ec-call (elab-mod$c-inst-indices-ok elab-mod$c))
             (ec-call (elab-mod$c-inst-names-ok elab-mod$c)))))

    Theorem: elab-mod$c-modinsts-ok-when-empty

    (defthm elab-mod$c-modinsts-ok-when-empty
      (implies (and (nat-equiv (nth *elab-mod$c->ninsts* elab-mod$c)
                               0)
                    (not (consp (nth *elab-mod$c->modinstname-idxes-get*
                                     elab-mod$c))))
               (elab-mod$c-modinsts-ok elab-mod$c)))

    Theorem: elab-mod$c-modinsts-ok-implies-lookup-name

    (defthm elab-mod$c-modinsts-ok-implies-lookup-name
     (let
      ((look (hons-assoc-equal k
                               (nth *elab-mod$c->modinstname-idxes-get*
                                    elab-mod$c)))
       (idx
          (index-of
               k
               (elab-modinst-list-names (nth *elab-mod$c->modinsttablei*
                                             elab-mod$c)))))
      (implies
           (and (elab-mod$c-modinsts-ok elab-mod$c)
                (name-p k))
           (equal look
                  (and idx
                       (< idx
                          (nfix (nth *elab-mod$c->ninsts* elab-mod$c)))
                       (cons k idx))))))

    Theorem: elab-mod$c-inst-indices-ok-in-terms-of-index-of

    (defthm elab-mod$c-inst-indices-ok-in-terms-of-index-of
     (implies (and (elab-mod$c-modinsts-ok elab-mod$c)
                   (< (nfix idx)
                      (nfix (nth *elab-mod$c->ninsts* elab-mod$c))))
              (let ((idxes->insts (nth *elab-mod$c->modinsttablei*
                                       elab-mod$c)))
                (equal (index-of (nth *elab-modinst$c->instname*
                                      (nth idx idxes->insts))
                                 (elab-modinst-list-names idxes->insts))
                       (nfix idx)))))

    Theorem: elab-mod$c-modinsts-ok-linear

    (defthm elab-mod$c-modinsts-ok-linear
     (implies (elab-mod$c-modinsts-ok elab-mod$c)
              (and (<= (nfix (nth *elab-mod$c->ninsts* elab-mod$c))
                       (len (nth *elab-mod$c->modinsttablei*
                                 elab-mod$c)))
                   (implies (natp (nth *elab-mod$c->ninsts* elab-mod$c))
                            (<= (nth *elab-mod$c->ninsts* elab-mod$c)
                                (len (nth *elab-mod$c->modinsttablei*
                                          elab-mod$c))))))
     :rule-classes :linear)

    Theorem: elab-mod$c-insts-ok-implies-no-duplicated-names

    (defthm elab-mod$c-insts-ok-implies-no-duplicated-names
     (implies
      (and (elab-mod$c-modinsts-ok elab-mod$c)
           (< (nfix n)
              (nfix (nth *elab-mod$c->ninsts* elab-mod$c)))
           (< (nfix m)
              (nfix (nth *elab-mod$c->ninsts* elab-mod$c))))
      (and
        (equal
             (equal (name-fix (nth *elab-modinst$c->instname*
                                   (nth n
                                        (nth *elab-mod$c->modinsttablei*
                                             elab-mod$c))))
                    (name-fix (nth *elab-modinst$c->instname*
                                   (nth m
                                        (nth *elab-mod$c->modinsttablei*
                                             elab-mod$c)))))
             (nat-equiv n m))
        (equal (equal (nth n
                           (nth *elab-mod$c->modinsttablei* elab-mod$c))
                      (nth m
                           (nth *elab-mod$c->modinsttablei*
                                elab-mod$c)))
               (nat-equiv n m)))))