• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
              • Disambiguator
                • Dimb-exprs/decls/stmts
                • Dimb-make/adjust-expr-cast
                • Dimb-make/adjust-expr-binary
                • Dimb-params-to-names
                • Dimb-fundef
                • Dimb-cast/call-to-call
                • Dimb-transunit
                • Dimb-dirdeclor
                • Dimb-transunit-ensemble
                • Dimb-make/adjust-expr-unary
                • Dimb-expr
                • Dimb-amb-declor/absdeclor
                • Dimb-cast/call-to-cast
                • Dimb-cast/addsub-to-cast
                • Dimb-cast/addsub-to-addsub
                • Dimb-add-ident
                • Dimb-kind
                • Dimb-amb-expr/tyname
                • Dimb-cast/logand-to-logand
                • Dimb-cast/and-to-cast
                • Dimb-extdecl-list
                • Dimb-cast/mul-to-cast
                  • Dimb-cast/logand-to-cast
                  • Dimb-extdecl
                  • Dimb-cast/mul-to-mul
                  • Dimb-cast/and-to-and
                  • Dimb-declor
                  • Dimb-kind-option
                  • Dimb-type-spec
                  • Dimb-add-ident-objfun-file-scope
                  • Dimb-make/adjust-expr-label-addr
                  • Dimb-param-declor
                  • Dimb-lookup-ident
                  • Dimb-decl-spec
                  • Dimb-add-idents-objfun
                  • Dimb-add-ident-objfun
                  • Dimb-param-declon
                  • Dimb-amb-decl/stmt
                  • Dimb-table
                  • Dimb-pop-scope
                  • Dimb-initdeclor
                  • Dimb-stmt
                  • Dimb-push-scope
                  • Dimb-comp-stmt
                  • Dimb-declor-option
                  • Dimb-enum-spec
                  • Dimb-decl
                  • Dimb-struct-declor
                  • Dimb-scope
                  • Dimb-initdeclor-list
                  • Dimb-decl-spec-list
                  • Dimb-absdeclor
                  • Dimb-dirabsdeclor
                  • Dimb-align-spec
                  • Dimb-struni-spec
                  • Dimb-init-table
                  • Dimb-spec/qual-list
                  • Dimb-spec/qual
                  • Irr-dimb-table
                  • Irr-dimb-kind
                  • Dimb-param-declon-list
                  • Dimb-enumer-list
                  • Dimb-enumer
                  • Dimb-dirabsdeclor-option
                  • Dimb-block-item
                  • Dimb-struct-declor-list
                  • Dimb-struct-declon-list
                  • Dimb-struct-declon
                  • Dimb-statassert
                  • Dimb-label
                  • Dimb-desiniter-list
                  • Dimb-desiniter
                  • Dimb-decl-list
                  • Dimb-const-expr-option
                  • Dimb-absdeclor-option
                  • Dimb-member-designor
                  • Dimb-initer-option
                  • Dimb-genassoc-list
                  • Dimb-genassoc
                  • Dimb-expr-option
                  • Dimb-expr-list
                  • Dimb-designor-list
                  • Dimb-designor
                  • Dimb-const-expr
                  • Dimb-block-item-list
                  • Dimb-tyname
                  • Dimb-initer
                • Unambiguity
              • Validation
              • Gcc-builtins
              • Preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Disambiguator

    Dimb-cast/mul-to-cast

    Disambiguate an ambiguous cast or multiplication expression to be a cast expression.

    Signature
    (dimb-cast/mul-to-cast tyname inc/dec arg) → cast-expr
    Arguments
    tyname — Guard (tynamep tyname).
    inc/dec — Guard (inc/dec-op-listp inc/dec).
    arg — Guard (exprp arg).
    Returns
    cast-expr — Type (exprp cast-expr).

    This is analogous in purpose to dimb-cast/call-to-cast, but for a different kind of ambiguous expression. Note that the *, which is unary in this disambiguation, is implicit in the abstract syntax of the ambiguous expression.

    Definitions and Theorems

    Function: dimb-cast/mul-to-cast

    (defun dimb-cast/mul-to-cast (tyname inc/dec arg)
      (declare (xargs :guard (and (tynamep tyname)
                                  (inc/dec-op-listp inc/dec)
                                  (exprp arg))))
      (declare (xargs :guard (and (tyname-unambp tyname)
                                  (expr-unambp arg))))
      (let ((__function__ 'dimb-cast/mul-to-cast))
        (declare (ignorable __function__))
        (dimb-make/adjust-expr-cast
             tyname inc/dec
             (dimb-make/adjust-expr-unary (unop-indir)
                                          arg))))

    Theorem: exprp-of-dimb-cast/mul-to-cast

    (defthm exprp-of-dimb-cast/mul-to-cast
      (b* ((cast-expr (dimb-cast/mul-to-cast tyname inc/dec arg)))
        (exprp cast-expr))
      :rule-classes :rewrite)

    Theorem: expr-unambp-of-dimb-cast/mul-to-cast

    (defthm expr-unambp-of-dimb-cast/mul-to-cast
      (implies
           (and (tyname-unambp tyname)
                (expr-unambp arg))
           (b* ((?cast-expr (dimb-cast/mul-to-cast tyname inc/dec arg)))
             (expr-unambp cast-expr))))

    Theorem: dimb-cast/mul-to-cast-of-tyname-fix-tyname

    (defthm dimb-cast/mul-to-cast-of-tyname-fix-tyname
      (equal (dimb-cast/mul-to-cast (tyname-fix tyname)
                                    inc/dec arg)
             (dimb-cast/mul-to-cast tyname inc/dec arg)))

    Theorem: dimb-cast/mul-to-cast-tyname-equiv-congruence-on-tyname

    (defthm dimb-cast/mul-to-cast-tyname-equiv-congruence-on-tyname
      (implies (tyname-equiv tyname tyname-equiv)
               (equal (dimb-cast/mul-to-cast tyname inc/dec arg)
                      (dimb-cast/mul-to-cast tyname-equiv inc/dec arg)))
      :rule-classes :congruence)

    Theorem: dimb-cast/mul-to-cast-of-inc/dec-op-list-fix-inc/dec

    (defthm dimb-cast/mul-to-cast-of-inc/dec-op-list-fix-inc/dec
      (equal (dimb-cast/mul-to-cast tyname (inc/dec-op-list-fix inc/dec)
                                    arg)
             (dimb-cast/mul-to-cast tyname inc/dec arg)))

    Theorem: dimb-cast/mul-to-cast-inc/dec-op-list-equiv-congruence-on-inc/dec

    (defthm
      dimb-cast/mul-to-cast-inc/dec-op-list-equiv-congruence-on-inc/dec
      (implies (inc/dec-op-list-equiv inc/dec inc/dec-equiv)
               (equal (dimb-cast/mul-to-cast tyname inc/dec arg)
                      (dimb-cast/mul-to-cast tyname inc/dec-equiv arg)))
      :rule-classes :congruence)

    Theorem: dimb-cast/mul-to-cast-of-expr-fix-arg

    (defthm dimb-cast/mul-to-cast-of-expr-fix-arg
      (equal (dimb-cast/mul-to-cast tyname inc/dec (expr-fix arg))
             (dimb-cast/mul-to-cast tyname inc/dec arg)))

    Theorem: dimb-cast/mul-to-cast-expr-equiv-congruence-on-arg

    (defthm dimb-cast/mul-to-cast-expr-equiv-congruence-on-arg
      (implies (expr-equiv arg arg-equiv)
               (equal (dimb-cast/mul-to-cast tyname inc/dec arg)
                      (dimb-cast/mul-to-cast tyname inc/dec arg-equiv)))
      :rule-classes :congruence)