All Projects → microsoft → AliveInLean

microsoft / AliveInLean

Licence: other
Formally verified implementation of Alive in Lean

Programming Languages

Lean
33 projects

Labels

Projects that are alternatives of or similar to AliveInLean

js-ziju
Compile javascript to LLVM IR, x86 assembly and self interpreting
Stars: ✭ 112 (+273.33%)
Mutual labels:  llvm
llvm-project-prepo
Fork of LLVM with modifications to support a program repository
Stars: ✭ 27 (-10%)
Mutual labels:  llvm
qcc
qcc is a small toy C compiler
Stars: ✭ 37 (+23.33%)
Mutual labels:  llvm
Vist
The Vist programming language
Stars: ✭ 16 (-46.67%)
Mutual labels:  llvm
cosmix
A Compiler-based System for Secure Memory Instrumentation and Execution in Enclaves
Stars: ✭ 22 (-26.67%)
Mutual labels:  llvm
snowstar
Here lies the code for the Snow* programming language, currently being rewritten.
Stars: ✭ 31 (+3.33%)
Mutual labels:  llvm
LLVM.jl
Julia wrapper for the LLVM C API
Stars: ✭ 90 (+200%)
Mutual labels:  llvm
clang-format-editor
Clang-Format Editor is a tool that helps you find the best Clang-Format Style for your C++, C#, Java, JavaScript, and Objective-C code.
Stars: ✭ 15 (-50%)
Mutual labels:  llvm
llvm-kaleidoscope
LLVM Tutorial: Kaleidoscope (Implementing a Language with LLVM)
Stars: ✭ 124 (+313.33%)
Mutual labels:  llvm
dmr c
dmr_C is a C parser and JIT compiler with LLVM, Eclipse OMR and NanoJIT backends
Stars: ✭ 45 (+50%)
Mutual labels:  llvm
SameTypeClangPlugin
自定义检查规范的 Clang 插件
Stars: ✭ 47 (+56.67%)
Mutual labels:  llvm
LLVM4D
LLVM C-Api Headers and binaries for Delphi
Stars: ✭ 21 (-30%)
Mutual labels:  llvm
llvm-svn
Arch Linux PKGBUILD for LLVM, Clang et al. (latest SVN code)
Stars: ✭ 18 (-40%)
Mutual labels:  llvm
neeilang
Fast, type-safe, object-oriented language by yours truly
Stars: ✭ 42 (+40%)
Mutual labels:  llvm
llvm-brainfuck
Brainfuck compiler based on LLVM API
Stars: ✭ 27 (-10%)
Mutual labels:  llvm
scalehls
A scalable High-Level Synthesis framework on MLIR
Stars: ✭ 62 (+106.67%)
Mutual labels:  llvm
graph-llvm-ir
Visualization of LLVM IR
Stars: ✭ 43 (+43.33%)
Mutual labels:  llvm
libebpf
Experiemental userspace eBPF library
Stars: ✭ 14 (-53.33%)
Mutual labels:  llvm
progge.rs
Program analysis playground for a simple, imperative language
Stars: ✭ 29 (-3.33%)
Mutual labels:  llvm
core
Erdiko framework core components
Stars: ✭ 18 (-40%)
Mutual labels:  lean

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].