Skip to content

Support a verifier in staged channel soundness - #7

Draft
nicole-graus wants to merge 4 commits into
pr-base-upstream-mainfrom
staged-verifier
Draft

nicole-graus wants to merge 4 commits into
pr-base-upstream-mainfrom
staged-verifier

Conversation

@nicole-graus

Copy link
Copy Markdown
Collaborator

Builds on PR #2. The staged soundness theorems no longer require ens.verifier = .empty.

What changes

  • The verifier's interactions on a stage are part of that stage. Its pulls get their guarantees from the stage's consistency, and its spec follows from them.

  • The verifier's requirements on a stage are a new hypothesis, VerifierStagedRequirementsOn. Like a component's, they may use its guarantees on earlier stages. When the verifier pushes nothing on a stage's channel, verifierStagedRequirementsOn_of_not_mem discharges them.

  • tableSoundness_of_stagedRequirementsOn drops verifier_empty and takes:

    • verifier_covered: every verifier pull lies in a finished stage.
    • verifier_staged: the verifier's requirements on each stage.
  • tableSoundness_of_stagedRequirements (the channel form) takes:

    • verifier_subset_finished: the verifier's guarantee channels are finished.
    • verifier_no_requirements: the verifier pushes to no finished channel.

    A verifier push whose requirement follows from its earlier guarantees needs the stage form.

Example (Clean/Examples/RangeCheckedCount.lean)

  • The same tables, with a verifier that pulls its public input from bytes. Its spec, "the input is a byte", is proved.
  • A verifier that also pushes that input to seenBytes. Its requirement there is paid by its guarantee on the earlier bytes stage.

Not covered: a staged counterpart of addVm_soundVmChannel_of_soundChannels.

Breaking: callers of the two staged theorems pass the new verifier hypotheses instead of verifier_empty. With an empty verifier, each one closes by simp [circuit_norm, Verifier.Program.empty].

Verified: lake build --wfail and lake build CleanTests pass. The new theorems use only propext, Classical.choice and Quot.sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant