• 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
        • Syntax-for-tools
        • Atc
        • Language
        • Transformation-tools
          • Simpadd0
            • Simpadd0-implementation
              • Simpadd0-event-generation
              • Simpadd0-process-inputs-and-gen-everything
              • Simpadd0-fn
              • Simpadd0-input-processing
              • Simpadd0-macro-definition
            • Simpadd0-expr-option
            • Simpadd0-structdeclor-list
            • Simpadd0-structdecl-list
            • Simpadd0-spec/qual-list
            • Simpadd0-param-declon-list
            • Simpadd0-initdeclor-list
            • Simpadd0-dirabsdeclor-option
            • Simpadd0-dirabsdeclor
            • Simpadd0-desiniter-list
            • Simpadd0-absdeclor-option
            • Simpadd0-struni-spec
            • Simpadd0-structdeclor
            • Simpadd0-structdecl
            • Simpadd0-statassert
            • Simpadd0-spec/qual
            • Simpadd0-param-declor
            • Simpadd0-param-declon
            • Simpadd0-member-designor
            • Simpadd0-initer-option
            • Simpadd0-initdeclor
            • Simpadd0-genassoc-list
            • Simpadd0-genassoc
            • Simpadd0-expr
            • Simpadd0-enumspec
            • Simpadd0-enumer-list
            • Simpadd0-dirdeclor
            • Simpadd0-desiniter
            • Simpadd0-designor-list
            • Simpadd0-designor
            • Simpadd0-declor-option
            • Simpadd0-decl-spec-list
            • Simpadd0-decl-spec
            • Simpadd0-decl-list
            • Simpadd0-const-expr-option
            • Simpadd0-const-expr
            • Simpadd0-block-item-list
            • Simpadd0-align-spec
            • Simpadd0-absdeclor
            • Simpadd0-type-spec
            • Simpadd0-tyname
            • Simpadd0-stmt
            • Simpadd0-label
            • Simpadd0-initer
            • Simpadd0-expr-list
            • Simpadd0-enumer
            • Simpadd0-declor
            • Simpadd0-decl
            • Simpadd0-block-item
          • Splitgso
          • Constant-propagation
          • Specialize
          • Split-fn
          • Split-fn-when
          • Copy-fn
          • Split-all-gso
          • Rename
          • Utilities
        • Representation
        • Insertion-sort
        • Pack
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • Ethereum
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • 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
  • Simpadd0

Simpadd0-implementation

Implementation of simpadd0.

The implementation functions have arguments and results consistently named as follows (unless otherwise stated, explicitly or implicitly, in the functions):

  • const-old is the homonymous input to the event macro.
  • const-new is the homonymous input to the event macro.
  • proofs is the homonymous input to the event macro.

Implementation functions' arguments and results that are not listed above are described in, or clear from, those functions' documentation.

This transformation is implemented as a collection of ACL2 functions that operate on the abstract syntax, following the recursive structure of the abstract syntax. This is a typical pattern for C-to-C transformations, which we may want to partially automate, via things like generalized `folds' over the abstract syntax.These functions also return correctness theorems in a bottom-up fashion, for a growing subset of constructs currently supported. This is one of a few different or slightly different approaches to proof generation, which we are exploring.For a growing number of constructs, we have ACL2 functions that do most of the transformation of the construct, including theorem generation when applicable, and these ACL2 function are outside the large mutual recursion. The recursive functions recursively transform the sub-constructs, and then call the separate non-recursive functions with the results from transforming the sub-constructs. A simple example is simpadd0-expr-paren, which is called by simpadd0-expr: the caller recursively transforms the inner expression, and passes the possibly transformed expression to the callee, along with some of the simpadd0-gout components resulting from that transformation; it also passes a simpadd0-gin whose components have been updated from the aforementioned simpadd0-gout.The generated theorems involve hypotheses about variables in scope having values of appropriate types, captured as ACL2 values of type ident-type-map. Our initial approach has been to take the variables from the constructs, joining the ones for sub-constructs via simpadd0-join-vartys to obtain the ones for super-constructs. This is adequate for some of the constructs, but we need to generalize this approach for other constructs. Specifically, we are moving towards having information about the variables in scope in the AST validation annotations, and using that instead of calculating the information from the constructs. As we move towards the new approach, we may have a mix of the new and old appraoches.

Subtopics

Simpadd0-event-generation
Event generation performed by simpadd0.
Simpadd0-process-inputs-and-gen-everything
Process the inputs and generate the events.
Simpadd0-fn
Event expansion of simpadd0.
Simpadd0-input-processing
Input processing performed by simpadd0.
Simpadd0-macro-definition
Definition of the simpadd0 macro.