IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.56k stars 475 forks source link

What is the state of the ecosystem for proof engineering? #4180

Closed quinn-dougherty closed 2 years ago

quinn-dougherty commented 2 years ago

Describe the feature you'd like

A unified workflow for proving properties about contracts and dapps.

Suppose I'm a proof engineer tasked with formally verifying dozens of formulae about a cardano dapp and it's underlying contract. How do I reason about:

  1. selecting a proof assistant
  2. ingesting plutus and haskell code that my team has written as terms in that proof assistant
  3. if the project is at a different stage, maybe translating the spec into such a proof assistant, (as a bonus, in such away that the proof assistant -represented spec can be leveraged by the implementation engineers).
  4. other considerations that might be at play designing specs to prove the onchain and offchain code's adherence to, such as common failure modes or blindspots.

Is there some major hyperlink I haven't found that explains this?

Describe alternatives you've considered

Here are some options.

Proof assistants

Did I miss any candidates?

pipelines/workflows

Something inspired by the hs-to-coq tutorial would look like

  1. perhaps using git-submodules, place dapp and contract code in src-haskell/
  2. codegen from haskell to a proof assistant and dump it in src-myproofassistant/
  3. write your formulae, specs, and their proofs in a theories/ subdir

nix code ought to be leveraged to make this look like

  1. contents of src-haskell is input to the .nix file, perhaps read directly from a github commit.
  2. contents of src-myproofassistant perhaps read-only to the user, write access is restricted only to the codegen tool
  3. i.e. the step from having a contract or dapp I want to prove stuff about to working in my theories/ subdir should be nix-build with some arguments, modulo the near certainty of the codegen tool not working on the whole codebase on the first try.
  4. Some debugging capabilities for when the codegen tool's behavior isn't exactly what you want at first.

What sort of pipeline or workflow would other proof engineers like to have?

ak3n commented 2 years ago

Thanks for the questions and links!

Unfortunately there is no any major hyperlink that may help at this point. I want to recommend to post this to https://cardano.stackexchange.com/ or somewhere else to get more attention and discussion, so it won't get lost here among other issues. And because it's more about the community and collaboration of users rather than the developers yet.

I'm closing this as there is no technical issue on plutus side to resolve.

quinn-dougherty commented 2 years ago

I think this question provided the conversation starter I'd be looking for, but it's been largely ignored. I'll try /r/CardanoDevelopers. Thanks!