• 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
        • Concrete-syntax
        • R1cs-bridge
          • R1cs-constraints-to-pfcs
          • R1cs-vec-elem-to-pfcs
          • R1cs-vector-to-pfcs
          • R1cs-to-pfcs
          • R1cs-constraint-to-pfcs
          • 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
    • R1cs-bridge

    R1cs-constraint-to-pfcs

    Translate an R1CS constraint to a PFCS constraint.

    Signature
    (r1cs-constraint-to-pfcs rconstr) → pconstr
    Arguments
    rconstr — Guard (r1cs::r1cs-constraintp rconstr).
    Returns
    pconstr — Type (constraintp pconstr).

    We translate this to an equality constraint between (i) the product of a and b and (ii) c.

    Definitions and Theorems

    Function: r1cs-constraint-to-pfcs

    (defun r1cs-constraint-to-pfcs (rconstr)
     (declare (xargs :guard (r1cs::r1cs-constraintp rconstr)))
     (let ((__function__ 'r1cs-constraint-to-pfcs))
       (declare (ignorable __function__))
       (b*
        ((a-expr
              (r1cs-vector-to-pfcs (r1cs::r1cs-constraint->a rconstr)))
         (b-expr
              (r1cs-vector-to-pfcs (r1cs::r1cs-constraint->b rconstr)))
         (c-expr
              (r1cs-vector-to-pfcs (r1cs::r1cs-constraint->c rconstr))))
        (make-constraint-equal :left (make-expression-mul :arg1 a-expr
                                                          :arg2 b-expr)
                               :right c-expr))))

    Theorem: constraintp-of-r1cs-constraint-to-pfcs

    (defthm constraintp-of-r1cs-constraint-to-pfcs
      (b* ((pconstr (r1cs-constraint-to-pfcs rconstr)))
        (constraintp pconstr))
      :rule-classes :rewrite)

    Theorem: r1cs-constraintp-of-r1cs-constraint-to-pfcs

    (defthm r1cs-constraintp-of-r1cs-constraint-to-pfcs
      (b* ((pconstr (r1cs-constraint-to-pfcs rconstr)))
        (r1cs-constraintp pconstr))
      :rule-classes :rewrite)