• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
              • Json2ast-mutual-recursion-expressions
              • Json-fixtype-span-removal
              • Json2ast-mutual-recursion-statements
              • Json-value-is-span-object-p
              • Json-value-is-core-span-object-p
              • Json2ast-mutual-recursion-types
              • J2f-struct-declaration
              • J2f-console-statement
              • Jsonast-looks-like-function-definition-p
              • J2f-function-definition
              • J2f-assign-statement
              • Json-member-is-span-p
              • J2f-struct-declarations
              • J2f-let-or-const-statement
                • J2f-console-error
                • J2f-struct-members
                • J2f-return-statement
                • J2f-function-definitions
                • J2f-console-log
                • J2f-console-assert
                • Jsonast-looks-like-struct-declaration-p
                • J2f-funinputs
                • J2f-if-statement-tail
                • Jsonast-looks-like-file-p
                • J2f-iteration-statement
                • J2f-if-statement
                • J2f-block-statement
                • J2f-statements
                • J2f-statement
                • J2f-type
              • Testing
              • Definition
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Json2ast

    J2f-let-or-const-statement

    Converts a json-member let statement to a leo::statmement of kind :let.

    Signature
    (j2f-let-or-const-statement json-let-or-const-statement) 
      → 
    (mv erp leo-let-or-const-statement)
    Arguments
    json-let-or-const-statement — Guard (json::memberp json-let-or-const-statement).
    Returns
    erp — Type (booleanp erp).
    leo-let-or-const-statement — Type (statementp leo-let-or-const-statement).

    Definitions and Theorems

    Function: j2f-let-or-const-statement

    (defun j2f-let-or-const-statement (json-let-or-const-statement)
     (declare
          (xargs :guard (json::memberp json-let-or-const-statement)))
     (let ((__function__ 'j2f-let-or-const-statement))
      (declare (ignorable __function__))
      (b*
       (((unless
          (and
              (json::memberp json-let-or-const-statement)
              (equal "Definition"
                     (json::member->name json-let-or-const-statement))))
         (mv t *error-let-statement*))
        (def-member-val
             (json::member->value json-let-or-const-statement))
        ((json::pattern (:object (:member "declaration_type"
                                          (:string let-or-const))
                                 *..))
         def-member-val)
        ((unless (and json::match?
                      (member-equal let-or-const '("Let" "Const"))))
         (mv t *error-let-statement*)))
       (if (equal let-or-const "Let")
           (j2f-let-statement def-member-val)
         (j2f-const-statement def-member-val)))))