Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformer based memory model #4

Draft
wants to merge 110 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
7d41b7d
add bplus syntactic form
2over12 Oct 2, 2024
4cc3506
new expr form for bvs
2over12 Oct 3, 2024
d867c21
more bitvectors
2over12 Oct 3, 2024
044fd3a
type inference
2over12 Oct 3, 2024
f71e567
bv type visitors
2over12 Oct 4, 2024
cc3a255
smt translation
2over12 Oct 4, 2024
c610e53
declare bv stuff
2over12 Oct 4, 2024
e1b9a6a
actually call decls
2over12 Oct 4, 2024
fb15532
handle in sstate
2over12 Oct 4, 2024
899d620
stub normalizer
2over12 Oct 4, 2024
20cb9ea
noop reductions
2over12 Oct 4, 2024
207b084
fix construction when no bvs
2over12 Oct 4, 2024
efea9f4
add add encodings
2over12 Nov 10, 2024
86cfea7
Fix overlapping cons
2over12 Nov 10, 2024
90dde0d
add ops
2over12 Nov 19, 2024
c898317
typed expressions for bv instrinsic
2over12 Nov 20, 2024
d12a2a4
fix types
2over12 Nov 22, 2024
c860369
fix parser
2over12 Nov 22, 2024
f99eb4a
refactor to have preds
2over12 Dec 29, 2024
0e08a53
make visitors less painful
2over12 Dec 29, 2024
f917d2e
more visitor fixes
2over12 Dec 29, 2024
6a25665
implement typing
2over12 Dec 30, 2024
79188ab
matching plan
2over12 Dec 30, 2024
93fb86a
norm
2over12 Dec 30, 2024
a6ed95c
mor norm
2over12 Dec 30, 2024
f691a20
more type fixes
2over12 Dec 30, 2024
092e370
even more types
2over12 Dec 30, 2024
d7d7e23
more
2over12 Dec 30, 2024
26ce163
fixes for types, implement extract
2over12 Jan 6, 2025
365a720
add form parsing
2over12 Jan 6, 2025
61f1d5a
encode assertions
2over12 Jan 9, 2025
f40973d
stubs
2over12 Jan 10, 2025
7cf60be
remove chunks
2over12 Jan 10, 2025
febccfc
bv literals
2over12 Jan 10, 2025
426932f
wrapper bv
2over12 Jan 10, 2025
04a7326
more sval implementations
2over12 Jan 11, 2025
47950f4
implement cast
2over12 Jan 11, 2025
d15f94e
fix decode as sval
2over12 Jan 11, 2025
636a8b9
fix value -> array
2over12 Jan 11, 2025
26908df
rename
2over12 Jan 11, 2025
2ecda3e
fix
2over12 Jan 11, 2025
a32d549
cg logging...
2over12 Jan 13, 2025
949c954
hacky fix for callgraph
2over12 Jan 13, 2025
347e5e4
fix semantics of branching
2over12 Jan 13, 2025
15dd551
only preserve basic ci
2over12 Jan 13, 2025
383edbe
remove prints
2over12 Jan 13, 2025
6d5d145
flip to optional
2over12 Jan 13, 2025
04f4631
add whole program symbolic test runner
2over12 Jan 13, 2025
c0dee46
add bulk wpst to workflow
2over12 Jan 13, 2025
6e3161f
add gil_test
2over12 Jan 13, 2025
b938a56
fix git ignore
2over12 Jan 13, 2025
555435a
try to fix linking when cached
2over12 Jan 13, 2025
d88ae0e
dont waste storage
2over12 Jan 13, 2025
f7b2b19
sudo
2over12 Jan 13, 2025
ee835e6
add more binop encodings
2over12 Jan 16, 2025
303fc21
add unop encodings
2over12 Jan 16, 2025
8ed3a38
remove unneeded case
2over12 Jan 16, 2025
d694f34
add backend xor srem sub
2over12 Jan 16, 2025
ec3e885
add parser for xor srem and sub
2over12 Jan 16, 2025
a47d223
backend preds uleq slt sleq
2over12 Jan 16, 2025
9e06624
add parser bvuleq bvslt bvsleq
2over12 Jan 16, 2025
808a15b
add backend for BVSignExtend|BVZeroExtend|BVSdiv|BVSmod|BVAshr
2over12 Jan 16, 2025
2a6a616
parser for sext zext sdiv smod and ashr
2over12 Jan 16, 2025
569a82a
use fork with overflow preds
2over12 Jan 17, 2025
554f595
add bv preds
2over12 Jan 17, 2025
9923f42
fixes
2over12 Jan 18, 2025
698c67c
builds
2over12 Jan 18, 2025
9017a68
fix types
2over12 Jan 18, 2025
7f749d2
implement type checking for preds
2over12 Jan 18, 2025
b8eaaca
update parser
2over12 Jan 18, 2025
ca637de
fix test
2over12 Jan 18, 2025
46e9218
remove runtime:
2over12 Jan 18, 2025
7731417
remove runtime from dune
2over12 Jan 18, 2025
5361b6a
building transformer model
2over12 Jan 23, 2025
06193bd
modify chunk
2over12 Jan 24, 2025
82259a8
use C2 wrapped in trasnformer
2over12 Jan 24, 2025
ba7685c
more mem model
2over12 Jan 24, 2025
3445c66
implement free check
2over12 Jan 24, 2025
cf5fb07
working on intefaces
2over12 Jan 27, 2025
956dca7
fix heap tree
2over12 Jan 27, 2025
20205d1
builds
2over12 Jan 27, 2025
e8e88f5
fix memory model bug
2over12 Jan 28, 2025
7b08bd5
test runs
2over12 Jan 28, 2025
9820678
assertions others
2over12 Jan 29, 2025
07d9750
fix root updates
2over12 Jan 30, 2025
4d0107a
fix type learning
2over12 Jan 30, 2025
517404c
fix width
2over12 Jan 30, 2025
65a8380
add intorptr
2over12 Jan 30, 2025
6f6a5c2
enforce resulting type on loaded value
2over12 Jan 30, 2025
a4f0df4
add comment labeling issue
2over12 Jan 30, 2025
78e7ba2
fix learned
2over12 Jan 30, 2025
c1c87d0
update memory model to do typechecking
2over12 Jan 31, 2025
229f331
retarget tests
2over12 Feb 3, 2025
4798b92
gil_parser: add BV literals
tnytown Feb 3, 2025
6b387b0
fixed lift model?
2over12 Feb 3, 2025
9275487
gil_parser: accept hex digits for bv literals
tnytown Feb 3, 2025
a72900e
hacky tester
2over12 Feb 3, 2025
af81f07
Merge pull request #5 from trail-of-forks/andrew/bv-literal-syntax
2over12 Feb 3, 2025
2845462
branch on any creation
2over12 Feb 5, 2025
7ff7497
type candidates abduce
2over12 Feb 5, 2025
2878687
more type fixes
2over12 Feb 5, 2025
c9ba75d
fix test
2over12 Feb 5, 2025
cc92f86
rename-test
2over12 Feb 5, 2025
9521854
allow biadbductive axiomatic specs
2over12 Feb 5, 2025
36bfd35
fix mem_test
2over12 Feb 5, 2025
10a0a61
brief fix
2over12 Feb 5, 2025
3c359f8
re-enable recogs
2over12 Feb 5, 2025
ca1696f
fix simple wrap encoding
2over12 Feb 5, 2025
0d57edb
fix typeof
2over12 Feb 5, 2025
5ebf2bc
add bug specs to the syntax
2over12 Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 189 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: ocaml/setup-ocaml@v2
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "ocaml-variants.5.2.0+options"
- name: Installing Python prerequisites
Expand All @@ -38,7 +38,7 @@ jobs:
id: restore-cache
uses: actions/cache@v3
env:
cache-name: cache-ocaml
cache-name: cache-ocaml
with:
path: _opam
key: ${{ runner.os }}-${{ env.cache-name}}-ocaml-5.2.0-${{ hashFiles('**/*.opam') }}
Expand All @@ -47,10 +47,15 @@ jobs:

- name: Install dependencies
run: make init-ci
- name: Install ubuntu dependencies
run: sudo apt-get install libgmp-dev pkg-config libsqlite3-dev python3 z3 -y
if: runner.os == 'Linux'
- name: Build Gillian
run: opam exec -- dune build @all
- name: Basic tests
run: opam exec -- dune test
- name: Gillian-LLVM Tests
run: opam exec -- dune exec gillian-llvm -- bulk-wpst Gillian-LLVM/examples/wpst
- name: Wisl checks
run: "opam exec -- dune exec -- bash ./wisl/scripts/quicktests.sh"
- name: Format checking
Expand All @@ -69,12 +74,12 @@ jobs:
- name: Building docs
run: make docs
if: runner.os == 'Linux'
- name: Sending docs artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-docs
path: _docs
if: runner.os == 'Linux'
# - name: Sending docs artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ runner.os }}-docs
# path: _docs
# if: runner.os == 'Linux'
- name: Setting dependency cache
run: opam clean
if: steps.restore-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -265,7 +270,7 @@ jobs:
# if: ( github.event_name == 'pull_request') && ( github.base_ref == 'master')
# strategy:
# matrix:
# operating-system: [macos-latest]
# operating-system: [ubuntu-latest]
# runs-on: ${{ matrix.operating-system }}
# needs: build
# steps:
Expand All @@ -284,14 +289,159 @@ jobs:
# - name: Download release
# uses: actions/download-artifact@v4
# with:
# name: ${{ runner.os }}-opam
# path: opam
# name: ${{ runner.os }}-opam
# path: opam
# - name: Extract release
# run: |
# tar xzf opam/opam.tar.gz
# rm opam -rf
# - name: init env
# run: "Gillian-JS/scripts/setup_environment.sh"
# working-directory: "Gillian"
# - name: Test JaVerT
# run: "./testJaVerT.sh"
# working-directory: "Gillian/Gillian-JS/environment/"
# # - name: Test Amazon
# # run: "make"
# # working-directory: "Gillian/Gillian-JS/Examples/Amazon/"

# kanillian_c_tests:
# strategy:
# matrix:
# operating-system: [ubuntu-latest]
# runs-on: ${{ matrix.operating-system }}
# needs: build
# steps:
# - name: Setup Z3
# id: z3
# uses: cda-tum/setup-z3@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: "ocaml-variants.5.2.0+options"
# - name: install CBMC
# run: sudo apt install cbmc -y
# - name: Checkout project
# uses: actions/checkout@v3
# with:
# path: Gillian
# - name: Download release
# uses: actions/download-artifact@v4
# with:
# name: ${{ runner.os }}-opam
# path: opam
# - name: Extract release
# run: |
# tar xzf opam/opam.tar.gz
# rm -rf opam
# - name: init env
# run: "kanillian/scripts/setup_environment.sh"
# working-directory: "Gillian"
# - name: Test All
# run: "opam exec -- bash ./testAll.sh"
# working-directory: "Gillian/kanillian/environment/"

# test262:
# if: ( github.event_name == 'pull_request') && ( github.base_ref == 'master')
# strategy:
# matrix:
# operating-system: [ubuntu-latest]
# runs-on: ${{ matrix.operating-system }}
# needs: build
# steps:
# - name: Setup Z3
# id: z3
# uses: cda-tum/setup-z3@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: "ocaml-variants.5.2.0+options"
# - name: Checkout project
# uses: actions/checkout@v3
# with:
# repository: GillianPlatform/javert-test262
# path: test262
# ref: 93e0d0b04093cabc3234a776eec5cc3e165f3b1a
# - name: Download release
# uses: actions/download-artifact@v4
# with:
# name: ${{ runner.os }}-opam
# path: opam
# - name: Extract release
# run: |
# tar xzf opam/opam.tar.gz
# rm -rf opam
# - name: Symbolic Testing Buckets.js
# run: "opam exec -- gillian-js cosette-bulk Gillian/Gillian-JS/Examples/Cosette/Buckets --ci"
# - name: Test262
# run: "opam exec -- gillian-js test262 test262/test --ci"

# collections-c:
# if: ( github.event_name == 'pull_request') && ( github.base_ref == 'master')
# strategy:
# matrix:
# operating-system: [ubuntu-latest]
# runs-on: ${{ matrix.operating-system }}
# needs: build
# steps:
# - name: Setup Z3
# id: z3
# uses: cda-tum/setup-z3@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: "ocaml-variants.5.2.0+options"
# - name: checkout project
# uses: actions/checkout@v3
# with:
# repository: GillianPlatform/collections-c-for-gillian
# path: collections-c
# ref: ffa76e788a1fbdb67910bb7b794214ebc22c1b8c
# - name: Download release
# uses: actions/download-artifact@v4
# with:
# name: ${{ runner.os }}-opam
# path: opam
# - name: Extract release
# run: |
# tar xzf opam/opam.tar.gz
# rm -rf opam
# - name: Symbolic Testing Collections-C
# run: "opam exec -- bash ./scripts/gillian-compcert/runTests.sh"
# working-directory: collections-c

# # test-Buckets:
# # if: ( github.event_name == 'pull_request') && ( github.base_ref == 'master')
# # strategy:
# # matrix:
# # operating-system: [macos-latest]
# # runs-on: ${{ matrix.operating-system }}
# # needs: build
# # steps:
# # - name: Setup Z3
# # id: z3
# # uses: cda-tum/setup-z3@v1
# # env:
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # - uses: ocaml/setup-ocaml@v2
# # with:
# # ocaml-compiler: "ocaml-variants.5.2.0+options"
# # - name: Checkout project
# # uses: actions/checkout@v3
# # with:
# # path: Gillian
# # - name: Download release
# # uses: actions/download-artifact@v4
# # with:
# # name: ${{ runner.os }}-opam
# # path: opam
# # - name: Extract release
# # run: |
# # tar xzf opam/opam.tar.gz
# # rm -rf opam
# # - name: Symbolic Testing Buckets.js
# # run: "opam exec -- gillian-js cosette-bulk Gillian/Gillian-JS/Examples/Cosette/Buckets --ci"

build-docker:
runs-on: ubuntu-latest
Expand All @@ -306,7 +456,7 @@ jobs:
id: restore-cache
uses: actions/cache@v3
env:
cache-name: cache-ocaml
cache-name: cache-ocaml
with:
path: .docker_opam_cache
key: docker-${{ env.cache-name }}-ocaml-5.2.0-${{ hashFiles('**/*.opam') }}
Expand All @@ -329,28 +479,28 @@ jobs:
docker cp deps:/home/opam/.opam/5.2 ./.docker_opam_cache
docker rm deps

deploy-docs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
steps:
- name: Download built docs
uses: actions/download-artifact@v4
with:
name: ${{ runner.os }}-docs
path: docs
- name: Deploy docs
run: |
git config --global user.email "<>"
git config --global user.name "GitHub Actions"
git clone https://${{ secrets.DOCS_USER }}:${{ secrets.DOCS_TOKEN }}@github.com/GillianPlatform/GillianPlatform.github.io.git docs-repo --branch master
cd docs-repo
rm * -rf
cp -r ../docs/* .
git add -A
git commit --allow-empty -m "Deployment from $GITHUB_REPOSITORY@$GITHUB_SHA"
git push --force
# deploy-docs:
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# needs: [build]
# strategy:
# fail-fast: false
# matrix:
# operating-system: [ubuntu-latest]
# steps:
# - name: Download built docs
# uses: actions/download-artifact@v4
# with:
# name: ${{ runner.os }}-docs
# path: docs
# - name: Deploy docs
# run: |
# git config --global user.email "<>"
# git config --global user.name "GitHub Actions"
# git clone https://${{ secrets.DOCS_USER }}:${{ secrets.DOCS_TOKEN }}@github.com/GillianPlatform/GillianPlatform.github.io.git docs-repo --branch master
# cd docs-repo
# rm * -rf
# cp -r ../docs/* .
# git add -A
# git commit --allow-empty -m "Deployment from $GITHUB_REPOSITORY@$GITHUB_SHA"
# git push --force
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"python.pythonPath": "/usr/bin/python3",
"ocaml.sandbox": {
"kind": "opam",
"switch": "${workspaceFolder:Gillian}"
"switch": "ocaml-variants.5.2.0+options"
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
Expand Down
1 change: 1 addition & 0 deletions Gillian-Alcotest-Runner/alcotestCheckers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Make (Outcome : Bulk.Outcome.S) = struct
(Outcome.ParserAndCompiler.err -> bool) ->
Outcome.t ->
unit;
finish_in_fail : Outcome.t -> unit;
fail_at_exec : Outcome.t -> unit;
finish_in_error_mode : BranchReasoning.branches -> Outcome.t -> unit;
finish_in_error_mode_with :
Expand Down
8 changes: 8 additions & 0 deletions Gillian-Alcotest-Runner/alcotestFramework.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ module Make (Outcome : Outcome.S) = struct
let finish_in_error_mode =
make_check_finish_in_mode ~flag:Flag.Error ~expected:None

let finish_in_fail test =
match test with
| Outcome.FinishedExec [ RFail _ ] -> ()
| _ ->
Alcotest.failf "Expected the test to end with fail \nBut the test %a"
Outcome.pp_what_test_did test

let finish_in_error_mode_with branches ~constraint_name constr =
make_check_finish_in_mode ~flag:Flag.Error
~expected:(Some (constraint_name, constr))
Expand All @@ -78,5 +85,6 @@ module Make (Outcome : Outcome.S) = struct
finish_in_error_mode_with;
finish_in_normal_mode;
finish_in_normal_mode_with;
finish_in_fail;
}
end
5 changes: 5 additions & 0 deletions Gillian-LLVM/bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(executable
(name gillian_llvm)
(public_name gillian-llvm)
(libraries gillian_llvm_lib gillian llvm_memory_model lifter)
(package gillian-llvm))
Loading
Loading