• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-fixpoint-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Moddb
        • Svex-compilation
          • Alias-normalization
          • Svex-design-flatten-and-normalize
          • Svex-design-compile
          • Svex-composition
          • Compile.lisp
            • Svex-normalize-assigns
            • Svex-design-flatten
            • Svex-override-lhrange
            • Svex-override-lhs
            • Svex-compose-assigns/delays
            • Aliases-indexed->named-aux
            • Svex-alist-truncate-by-var-decls
            • Svar-map-truncate-by-var-decls
            • Aliases-to-var-decl-map-aux
            • Aliases-indexed->named
            • Svar-indexed->named-memo
            • Lhs-indexed->named
              • Maybe-svar-p
              • Svar-register-indnamememo
              • Svarlist-indexed->named
              • Maybe-svar-fix
              • Lhs-register-indnamememo
              • Maybe-indname-result
              • Aliases-to-var-decl-map
              • Svar-indexed->named
              • Svex-apply-overrides
              • Aliases-boundedp-aux
              • Indnamememo-to-var-decl-map
              • Indname-result
              • Assigns-compose
              • Delay-svarlist->delays
              • Svex-override-vars
              • Indnamememo
              • Delay-svar->delays
              • Assigns-to-overrides
              • Svarlist-collect-delays
              • Svex-overridelist-vars
              • Svex-overridelist-keys
              • Assigns-to-overrides-nrev
              • Cap-length
              • Var-decl-map
            • Assign->netassigns
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Compile.lisp

    Lhs-indexed->named

    Signature
    (lhs-indexed->named x scope moddb indnamememo) 
      → 
    (mv xx indnamememo1)
    Arguments
    x — Guard (lhs-p x).
    scope — Guard (modscope-p scope).
    moddb — Guard (moddb-ok moddb).
    Returns
    xx — Type (and (lhs-p xx) (svarlist-addr-p (lhs-vars xx))).
    indnamememo1 — Type (equal (len indnamememo1) (len indnamememo)).

    Definitions and Theorems

    Function: lhs-indexed->named

    (defun
     lhs-indexed->named
     (x scope moddb indnamememo)
     (declare (xargs :stobjs (moddb indnamememo)))
     (declare (xargs :guard (and (lhs-p x)
                                 (modscope-p scope)
                                 (moddb-ok moddb))))
     (declare
      (xargs
          :guard
          (and (modscope-okp scope moddb)
               (svarlist-boundedp (lhs-vars x)
                                  (modscope-local-bound scope moddb)))))
     (let
      ((__function__ 'lhs-indexed->named))
      (declare (ignorable __function__))
      (b*
       (((mv first rest) (lhs-decomp x))
        ((unless first) (mv nil indnamememo))
        ((lhrange first) first)
        ((mv repl indnamememo)
         (lhatom-case
              first.atom
              :z (mv first indnamememo)
              :var
              (b* (((mv name indnamememo)
                    (svar-indexed->named-memo first.atom.name
                                              scope moddb indnamememo)))
                  (mv (lhrange first.w
                               (lhatom-var name first.atom.rsh))
                      indnamememo))))
        ((mv rest indnamememo)
         (lhs-indexed->named rest scope moddb indnamememo)))
       (mv (lhs-cons repl rest) indnamememo))))

    Theorem: return-type-of-lhs-indexed->named.xx

    (defthm return-type-of-lhs-indexed->named.xx
            (b* (((mv ?xx ?indnamememo1)
                  (lhs-indexed->named x scope moddb indnamememo)))
                (and (lhs-p xx)
                     (svarlist-addr-p (lhs-vars xx))))
            :rule-classes :rewrite)

    Theorem: return-type-of-lhs-indexed->named.indnamememo1

    (defthm return-type-of-lhs-indexed->named.indnamememo1
            (b* (((mv ?xx ?indnamememo1)
                  (lhs-indexed->named x scope moddb indnamememo)))
                (equal (len indnamememo1)
                       (len indnamememo)))
            :rule-classes :rewrite)

    Theorem: lhs-indexed->named-of-lhs-fix-x

    (defthm lhs-indexed->named-of-lhs-fix-x
            (equal (lhs-indexed->named (lhs-fix x)
                                       scope moddb indnamememo)
                   (lhs-indexed->named x scope moddb indnamememo)))

    Theorem: lhs-indexed->named-lhs-equiv-congruence-on-x

    (defthm
      lhs-indexed->named-lhs-equiv-congruence-on-x
      (implies
           (lhs-equiv x x-equiv)
           (equal (lhs-indexed->named x scope moddb indnamememo)
                  (lhs-indexed->named x-equiv scope moddb indnamememo)))
      :rule-classes :congruence)

    Theorem: lhs-indexed->named-of-modscope-fix-scope

    (defthm lhs-indexed->named-of-modscope-fix-scope
            (equal (lhs-indexed->named x (modscope-fix scope)
                                       moddb indnamememo)
                   (lhs-indexed->named x scope moddb indnamememo)))

    Theorem: lhs-indexed->named-modscope-equiv-congruence-on-scope

    (defthm
      lhs-indexed->named-modscope-equiv-congruence-on-scope
      (implies
           (modscope-equiv scope scope-equiv)
           (equal (lhs-indexed->named x scope moddb indnamememo)
                  (lhs-indexed->named x scope-equiv moddb indnamememo)))
      :rule-classes :congruence)

    Theorem: lhs-indexed->named-of-moddb-fix-moddb

    (defthm lhs-indexed->named-of-moddb-fix-moddb
            (equal (lhs-indexed->named x scope (moddb-fix moddb)
                                       indnamememo)
                   (lhs-indexed->named x scope moddb indnamememo)))

    Theorem: lhs-indexed->named-moddb-equiv-congruence-on-moddb

    (defthm
      lhs-indexed->named-moddb-equiv-congruence-on-moddb
      (implies
           (moddb-equiv moddb moddb-equiv)
           (equal (lhs-indexed->named x scope moddb indnamememo)
                  (lhs-indexed->named x scope moddb-equiv indnamememo)))
      :rule-classes :congruence)