• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
        • Yul-json
          • Parse-yul-json
            • Solc-json-file-to-irs
            • Json-to-irs
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)