• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
        • Syntax-for-tools
          • Formalized-subset
          • Mapping-to-language-definition
          • Input-files
          • Compilation-database
            • Comp-db-entry
            • Comp-db-arg
            • Json-to-comp-db-entry
            • Json-to-comp-db-entry-list
            • To-preprocess-db
            • To-preprocess-map
            • Comp-db-arguments-absolute-dirs
            • Comp-db-keep-only-preprocessor-args
            • Json-to-comp-db
              • Json-to-comp-db-arguments
              • Comp-db-relativize-keys
              • Json-to-comp-db-get-exec-and-arguments
              • Preprocess-map-from-comp-file
              • Json-to-comp-db-exec-and-arguments
              • Relativize-path
              • Comp-db-arguments-keep-only-preprocessor-args
              • Comp-db-arguments-escape-for-shell
              • Parse-comp-db
              • Json-to-comp-db-get-directory
              • Json-to-comp-db-get-output
              • Json-to-comp-db-get-file
              • Comp-db-drop-shared
              • Comp-db-drop-non-c
              • Comp-db-arg-list-to-string-list
              • Comp-db-absolute-dirs
              • Comp-db-escape-for-shell
              • Json-to-comp-db-try-parse-short-option
              • Preprocess-db-to-map
              • Comp-db-arg-to-string
              • Comp-db
              • Json-to-comp-db-try-parse-equal-arg
              • Defpreprocess-map-fn
              • String-escape-for-shell
              • Comp-db-arg-list
              • Irr-comp-db-arg
              • Show-warnings
              • *cc-options-space-sep*
              • *cc-options-equal-sep*
              • *cc-options-dir*
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
            • Parsing
          • Atc
          • Transformation-tools
          • Language
          • Representation
          • Insertion-sort
          • Pack
        • 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
        • 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
    • Compilation-database

    Json-to-comp-db

    Signature
    (json-to-comp-db value warnings-onp warnings) 
      → 
    (mv erp db warnings$)
    Arguments
    value — Guard (json::valuep value).
    warnings-onp — Guard (booleanp warnings-onp).
    warnings — Guard (acl2::msg-listp warnings).
    Returns
    db — Type (comp-dbp db).
    warnings$ — Type (acl2::msg-listp warnings$).

    Definitions and Theorems

    Function: json-to-comp-db

    (defun json-to-comp-db (value warnings-onp warnings)
     (declare (xargs :guard (and (json::valuep value)
                                 (booleanp warnings-onp)
                                 (acl2::msg-listp warnings))))
     (b* ((warnings (mbe :logic
                         (if (acl2::msg-listp warnings)
                             warnings
                           nil)
                         :exec warnings))
          ((reterr) nil warnings))
      (json::value-case
       value
       :array (json-to-comp-db-entry-list value.elements
                                          nil warnings-onp warnings)
       :otherwise
       (retmsg$
        "Expected array type at ~
                    top level of JSON compilation database. ~
                    Found ~x0 instead."
        (json::value-kind value)))))

    Theorem: comp-dbp-of-json-to-comp-db.db

    (defthm comp-dbp-of-json-to-comp-db.db
      (b* (((mv acl2::?erp ?db ?warnings$)
            (json-to-comp-db value warnings-onp warnings)))
        (comp-dbp db))
      :rule-classes :rewrite)

    Theorem: msg-listp-of-json-to-comp-db.warnings$

    (defthm msg-listp-of-json-to-comp-db.warnings$
      (b* (((mv acl2::?erp ?db ?warnings$)
            (json-to-comp-db value warnings-onp warnings)))
        (acl2::msg-listp warnings$))
      :rule-classes :rewrite)

    Theorem: json-to-comp-db-of-value-fix-value

    (defthm json-to-comp-db-of-value-fix-value
      (equal (json-to-comp-db (json::value-fix value)
                              warnings-onp warnings)
             (json-to-comp-db value warnings-onp warnings)))

    Theorem: json-to-comp-db-value-equiv-congruence-on-value

    (defthm json-to-comp-db-value-equiv-congruence-on-value
      (implies
           (json::value-equiv value value-equiv)
           (equal (json-to-comp-db value warnings-onp warnings)
                  (json-to-comp-db value-equiv warnings-onp warnings)))
      :rule-classes :congruence)

    Theorem: json-to-comp-db-of-bool-fix-warnings-onp

    (defthm json-to-comp-db-of-bool-fix-warnings-onp
      (equal (json-to-comp-db value (bool-fix warnings-onp)
                              warnings)
             (json-to-comp-db value warnings-onp warnings)))

    Theorem: json-to-comp-db-iff-congruence-on-warnings-onp

    (defthm json-to-comp-db-iff-congruence-on-warnings-onp
      (implies
           (iff warnings-onp warnings-onp-equiv)
           (equal (json-to-comp-db value warnings-onp warnings)
                  (json-to-comp-db value warnings-onp-equiv warnings)))
      :rule-classes :congruence)