IntersectMBO / plutus

The Plutus language implementation and tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler certification

ana-pantilie opened this issue · comments

Introduction

We want to certify the PIR to UPLC compiler. Part of the motivation behind this feature is:

  • a better guarantee that the end user's high level code behaves the same as the low level code they upload and is run on the chain
  • we want to ensure that proofs of properties of the high level code also translate to the low level code

Jacco has worked on a couple of papers presenting his incremental approach to verification. See https://github.com/jaccokrijnen/plutus-cert/tree/master, https://iohk.io/en/research/library/papers/translation-certification-for-smart-contracts-scp/. His implementation is done in Coq.

Our approach

The idea is to certify that the optimisations done by the compiler on the input code produces code which is equivalent in some way. A part of the work is defining this equivalence.

Based on Jacco's ideas, we will first formalise the optimisations as translation relations between two ASTs. This provides a syntactic specification which will be proven in some language which we need to agree on. The next step is to define the equivalence relation and prove that holds for the two ASTs as well.

The implementation therefore, for each compiler optimisation, expects a before-AST and an after-AST and finds and checks a proof that the two ASTs are equivalent in both the syntatic sense and the semantic sense.

Preliminary phase

Our goal during the preliminary phase is to gather the requirements for a POC.

Action items:

Proof of concept

We have decided on the following:

Action items:

  • #5916
  • #5941
  • #5944
  • Examples/Case studies/Tests
  • Explore possibilities for Semantic Equivalence proof