GithubHelp home page GithubHelp logo

test-mass-forker-org-1 / aliveinlean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/aliveinlean

0.0 0.0 0.0 154 KB

Formally verified implementation of Alive in Lean

License: Other

Shell 0.34% Python 0.34% Lean 99.32%

aliveinlean's Introduction

AliveInLean

Setup

Run

# Run selected tests from Alive's test suite (which contain
# no precondition and do not require additional grammars)
./run-alive.sh
# Run random tests for the specification of Z3 expression -
# concrete value, as well as 4 admitted arithmetic lemmas.
# Note that bv_equiv.zext/sext/trunc will have 'omitted' tests
# because sometimes generated expressions try to compare
# bitvectors with different bitwidths.
./run-proptest.sh
# Run random tests for the specification of LLVM assembly language.
# Set clang path to yours by modifying the script.
./run-irtest.sh

Theorems

  • Specification, as well as proof, is in src/spec/.
  1. Execution of bigstep with two different value semantics (SMT expr / concrete value) has some good relations.
def encode (ss:irstate_smt) (se:irstate_exec) (η:freevar.env) :=
    irstate_equiv (η⟦ss⟧) se

def bigstep_both:= ∀ ss se (p:program) oss' ose' η
    (HENC:encode ss se η)
    (HOSS': oss' = bigstep irsem_smt ss p)
    (HOSE': ose' = bigstep irsem_exec se p),
  none_or_some oss' ose' (λ ss' se', encode ss' se' η)
-- Its proof is at equiv.lean
  1. We can generate initial state correctly.
def init_state_encode:= ∀ (freevars:list (string × ty)) (sg sg':std_gen) ise iss
    (HUNQ: list.unique $ freevars.map prod.fst)
    (HIE:(ise, sg') = create_init_state_exec freevars sg)
    (HIS:iss = create_init_state_smt freevars),
  ∃ η, encode iss ise η
-- Its proof is at initialstate.lean
  1. If refinement checking function check_single_reg0 says it's true, refinement indeed holds.
def refines_single_reg_correct := ∀ (psrc ptgt:program)
    (root:string) (ss0:irstate_smt) sb
    (HSREF:some sb = check_single_reg0 irsem_smt psrc ptgt root ss0)
    (HEQ:∀ (η0:freevar.env) e, b_equiv (η0⟦sb⟧) e → e = tt),
  root_refines_smt psrc ptgt ss0 root
-- Its proof is at refinement.lean

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

aliveinlean's People

Contributors

aqjune avatar nunoplopes avatar microsoftopensource avatar msftgits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.