• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
          • Language
          • Yul-json
            • Parse-yul-json
              • Solc-json-file-to-irs
              • Json-to-irs
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Parse-yul-json

    Json-to-irs

    Extracts Yul IR surface syntax strings from a JSON fty structure.

    Signature
    (json-to-irs yul-object-json) → (mv erp irs-pair)
    Arguments
    yul-object-json — Guard (json::valuep yul-object-json).
    Returns
    erp — Type (booleanp erp).
    irs-pair — Type (consp irs-pair).

    Definitions and Theorems

    Function: json-to-irs

    (defun json-to-irs (yul-object-json)
     (declare (xargs :guard (json::valuep yul-object-json)))
     (let ((__function__ 'json-to-irs))
      (declare (ignorable __function__))
      (b*
       (((unless (and (json::valuep yul-object-json)
                      (json::value-case yul-object-json :object)))
         (mv t '("" . "")))
        ((json::pattern
          (:object
           (:member
            "contracts"
            (:object
             (:member
              _
              (:object
               (:member
                   "object"
                   (:object (:member "evm" _)
                            (:member "ir" (:string ir-string))
                            (:member "irOptimized"
                                     (:string iroptimized-string))))))))
           *..))
         yul-object-json)
        ((unless (and json::match? (stringp ir-string)
                      (stringp iroptimized-string)))
         (mv t '("" . ""))))
       (mv nil
           (cons ir-string iroptimized-string)))))

    Theorem: booleanp-of-json-to-irs.erp

    (defthm booleanp-of-json-to-irs.erp
      (b* (((mv ?erp ?irs-pair)
            (json-to-irs yul-object-json)))
        (booleanp erp))
      :rule-classes :rewrite)

    Theorem: consp-of-json-to-irs.irs-pair

    (defthm consp-of-json-to-irs.irs-pair
      (b* (((mv ?erp ?irs-pair)
            (json-to-irs yul-object-json)))
        (consp irs-pair))
      :rule-classes :rewrite)