• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
        • Proof-support
        • Semantics
        • Lifting
        • R1cs-subset
        • Indexed-names
        • Well-formedness
        • Abstract-syntax
          • Syntax-abstraction
          • Abstract-syntax-trees
            • Expression
              • Expression-fix
              • Expression-count
              • Expressionp
              • Expression-case
              • Expression-equiv
              • Expression-sub
              • Expression-mul
              • Expression-add
              • Expression-var
              • Expression-neg
              • Expression-const
              • Expression-kind
            • Definition
            • Constraint
            • Definition-option
            • System
            • System-result
            • Expression-result
            • Expression-list-result
            • Definition-result
            • Definition-list-result
            • Constraint-result
            • Constraint-list-result
            • Expression-list
            • Definition-list
            • Constraint-list
          • Abstract-syntax-operations
          • Convenience-constructors
        • Concrete-syntax
        • R1cs-bridge
        • Parser-interface
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • 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
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Abstract-syntax-trees

Expression

Fixtype of expressions.

This is a tagged union type, introduced by fty::deftagsum.

Member Tags → Types
:const → expression-const
:var → expression-var
:neg → expression-neg
:add → expression-add
:sub → expression-sub
:mul → expression-mul

We use any integers as constants. This way, the definition of expression (and of the other syntactic entities) does not depend on (the prime number that defines) the prime field. Semantically, integers are treated modulo the prime.

We use (any) strings for variables.

Two field operations, addition and multiplication, suffice for arithmetic circuits. We also add negation (unary), and subtraction (binary) for convenience. We may add other operations in the future, most notably reciprocal, and therefore division. We may also add square roots, and even support user defined functions. Some of these operations will introduce the issue of well-definedness, e.g. non-zero divisors.

Subtopics

Expression-fix
Fixing function for expression structures.
Expression-count
Measure for recurring over expression structures.
Expressionp
Recognizer for expression structures.
Expression-case
Case macro for the different kinds of expression structures.
Expression-equiv
Basic equivalence relation for expression structures.
Expression-sub
Expression-mul
Expression-add
Expression-var
Expression-neg
Expression-const
Expression-kind
Get the kind (tag) of a expression structure.