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

Rebase on master of original repo #5

Draft
wants to merge 1,071 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1071 commits
Select commit Hold shift + click to select a range
e677195
Fix swap prop
andreaslindner Jul 29, 2024
3e8d01b
Improve debug output
andreaslindner Jul 29, 2024
fdede53
Disable irrelevant simplification theorems
andreaslindner Jul 29, 2024
5e3d4e0
Add outputs, fix program term (as constant)
andreaslindner Jul 29, 2024
a98f126
Remove split that slows down
andreaslindner Jul 29, 2024
5ca4564
Fix riscv test
andreaslindner Jul 29, 2024
0fe1580
Fix tests
andreaslindner Jul 29, 2024
f825618
Improve build/holheap for development focused on symbolic execution l…
andreaslindner Jul 29, 2024
1f4d045
Fix lifting boundaries
andreaslindner Jul 29, 2024
f8fa12c
Fix specScript dependencies
andreaslindner Jul 29, 2024
16721f4
Simplify generation of readable theorems (avoids METIS-madness)
andreaslindner Jul 29, 2024
9caf9f6
Add output of bir expression sizes
andreaslindner Jul 29, 2024
41daf5f
Fix test
andreaslindner Jul 30, 2024
ebe100b
Add pruning at conditional branches
andreaslindner Jul 30, 2024
568c2fa
Add automatic backup to experiment collection script
andreaslindner Jul 30, 2024
ba7ed41
Add profiling of birs_exec_step_CONV
andreaslindner Jul 30, 2024
8c17301
WIP: Add profiling outputs
andreaslindner Jul 30, 2024
29db8bc
Fix experiment data collection
andreaslindner Jul 30, 2024
28473ac
Experiments with abbreviations and evaluations
andreaslindner Jul 30, 2024
d85ab1e
Fix
andreaslindner Jul 30, 2024
7a59ab3
Add experiment modifications and profiling code
andreaslindner Jul 31, 2024
ebe84e4
Update benchmark
andreaslindner Jul 31, 2024
ddf44ab
Streamline basic statement execution
andreaslindner Jul 31, 2024
920274c
Add latest benchmark results
andreaslindner Jul 31, 2024
78b4d52
Fix
andreaslindner Jul 31, 2024
25bc08a
Fixes
andreaslindner Jul 31, 2024
2b6c3ab
Add references in README
andreaslindner Jul 31, 2024
4ec00ed
Fix numbers
andreaslindner Jul 31, 2024
af03ac8
Add more profiling
andreaslindner Jul 31, 2024
3fc1e91
Fix aes-unopt (end label was set wrongly)
andreaslindner Jul 31, 2024
3b4a4f0
Add proof of concept of program theorems in dictionary
andreaslindner Aug 1, 2024
c6543c3
Need to exclude aes-unopt until fixed
andreaslindner Aug 1, 2024
337f4d6
.
andreaslindner Aug 1, 2024
2b02fe4
Apply program lookups to other examples as well
andreaslindner Aug 1, 2024
a105721
Add reference measurement
andreaslindner Aug 1, 2024
ab92c55
Add more profiling
andreaslindner Aug 1, 2024
ccceaf5
Fix dependencies
andreaslindner Aug 5, 2024
fb360fd
Change source of randomness
andreaslindner Aug 5, 2024
7407cf9
include all small examples in examples/riscv Holmakefile
palmskog Aug 5, 2024
8b2f1d8
Merge branch 'master' into riscv-symbexec
palmskog Aug 5, 2024
e0d7ded
Add stresstest example for development
andreaslindner Aug 6, 2024
702d7af
Add profiling output in symbolic simplification library
andreaslindner Aug 6, 2024
2db3a8a
Update measurements
andreaslindner Aug 6, 2024
b43063d
Refactor
andreaslindner Aug 6, 2024
434608c
Small tweaks
andreaslindner Aug 6, 2024
c8e8d7c
Add deabbreviation performance experiment
andreaslindner Aug 7, 2024
3a40312
Keep the best version
andreaslindner Aug 7, 2024
ea843f0
fix RISC-V README
palmskog Aug 8, 2024
424b622
Improve z3 interface performance
andreaslindner Aug 8, 2024
5c770c2
Add another experiment that was working well with the latest stable z…
andreaslindner Aug 8, 2024
8ab9713
enable heapless build in CI using HOLBA_POLYML_HEAPLESS env variable
palmskog Aug 8, 2024
3456f2f
modify CI build workflow for heapless
palmskog Aug 8, 2024
b6bdb57
small reorganization of CI and heap stuff
palmskog Aug 8, 2024
d9d3cc5
Merge pull request #184 from kth-step/riscv-symbexec+heaps
palmskog Aug 9, 2024
e5501e1
Fix
andreaslindner Aug 10, 2024
8ae4a3d
Update benchmarks
andreaslindner Aug 10, 2024
876482a
Update benchmarks
andreaslindner Aug 10, 2024
7ca5a44
update riscv README
palmskog Aug 12, 2024
add4942
prove strongest postconditions for isqrt
palmskog Aug 8, 2024
505b8f5
Merge pull request #185 from kth-step/riscv-symbexec
palmskog Aug 12, 2024
9f8e74e
rename aux directory to extra, holba_ prefix instead of bir_ in extra
palmskog Aug 13, 2024
750de3a
rename non-bir-specific libraries in shared to use holba_ prefix inst…
palmskog Aug 13, 2024
26aefba
update of directory structure in README.md
palmskog Aug 13, 2024
963b5ac
Merge pull request #186 from kth-step/aux-to-extra
didriklundberg Aug 15, 2024
64b85a0
CV Computation examples (#187)
jules-timmerman Aug 22, 2024
2a4e65d
Refactored deep embedding code
jules-timmerman Aug 21, 2024
2371ecf
Added cv version of example sum_list
jules-timmerman Aug 21, 2024
9822454
Added first draft of the slides
jules-timmerman Aug 23, 2024
e68e28f
adjust Holmakefiles in compute
palmskog Aug 28, 2024
b1de722
flatten sum_list compute directory for maintainability
palmskog Aug 28, 2024
d512cef
move compute presentation to doc
palmskog Aug 28, 2024
ac0de9e
Merge pull request #188 from jules-timmerman/master
palmskog Aug 28, 2024
ec3b81e
Fixed RISC-V lifter issue with zero register
didriklundberg Sep 13, 2024
c4b43b0
Update src/tools/lifter/bir_inst_liftingLib.sml
didriklundberg Sep 13, 2024
ddd015c
Fixed typo
didriklundberg Sep 13, 2024
2a04550
Fix to selftest log, clean-up in bir_riscv_extrasScript
didriklundberg Sep 13, 2024
73aebcd
Merge pull request #189 from kth-step/dev_riscv_zeroreg
palmskog Sep 13, 2024
1468c8b
Add optimizations
andreaslindner Aug 12, 2024
cf2e6db
Fix
andreaslindner Aug 13, 2024
7ef0557
A little cleanup
andreaslindner Aug 13, 2024
83d7296
Fix
andreaslindner Aug 13, 2024
2010840
Move lifter theorem patch to lifter library
andreaslindner Aug 15, 2024
f3c6a21
Fix environment shape in final states after symbolic execution (birs_…
andreaslindner Aug 15, 2024
c1c99d0
prove Pi_thms for isqrt
palmskog Aug 15, 2024
f1ed648
two-end-label generalization of abstract_jgmt_rel-post_bircont_nL the…
palmskog Aug 15, 2024
d19df4c
loop support WIP
palmskog Aug 16, 2024
5c03f11
Refactoring and cleanup
andreaslindner Aug 16, 2024
1252bab
More refactoring and cleanup
andreaslindner Aug 16, 2024
dab1317
boilerplate WIP for isqrt example
palmskog Aug 16, 2024
d4224f9
Fix CI tests
andreaslindner Aug 16, 2024
5dc8424
Fix z3 tests to be z3 version independent
andreaslindner Aug 17, 2024
20ef73f
Add test for smt queries with memory operations
andreaslindner Aug 17, 2024
6fa8f10
Generalize testcase
andreaslindner Aug 17, 2024
63606ee
Add option to select the z3 binary (for testing)
andreaslindner Aug 17, 2024
369ca5f
abstract_jgmt_rel_thm for two end labels
palmskog Aug 17, 2024
e98ee75
contract for isqrt fragment with two end labels
palmskog Aug 17, 2024
6356138
more isqrt boilerplate
palmskog Aug 18, 2024
812147b
generalize backlifting to non-singleton sets, apply to isqrt example
palmskog Aug 18, 2024
3ef3f54
add proper signature for bir_backlifterLib
palmskog Aug 18, 2024
123fc28
remove _sing suffix from backlifting functions since restriction to s…
palmskog Aug 18, 2024
a1d0372
fmap abstract_jgmt_rel boilerplate
palmskog Aug 18, 2024
8469282
Comment the test that our z3 interface currently has problems with bu…
andreaslindner Aug 19, 2024
bcc98b1
add adapted Bernstein ChaCha20 from https://github.com/grigorig/chach…
palmskog Aug 19, 2024
ef5dbed
boilerplate for chacha20 implementation
palmskog Aug 19, 2024
2abc875
boilerplate for symbolic execution of chacha_ivsetup
palmskog Aug 19, 2024
35f92c8
more contract transfer boilerplate
palmskog Aug 21, 2024
cc0b778
Refactor smt library
andreaslindner Aug 21, 2024
3dd92ba
Improve exporter
andreaslindner Aug 21, 2024
c5a4890
Add preprocessing step to exporter
andreaslindner Aug 21, 2024
1e4efad
Add better abbreviation handling, including lookup
andreaslindner Aug 21, 2024
7310f45
Add abbreviation skip for toplevel abbreviations
andreaslindner Aug 21, 2024
13b0ccc
Fix case of multiple abbreviation
andreaslindner Aug 21, 2024
5f2cd20
Fix to enforce bool type for top-level expressions (asserts)
andreaslindner Aug 22, 2024
b91ea38
Update benchmark data
andreaslindner Aug 22, 2024
aba6caf
Fixes
andreaslindner Aug 22, 2024
9816a42
More leeway for CI
andreaslindner Aug 22, 2024
98fe0b7
Make tests more general (so it works with more z3 versions)
andreaslindner Aug 22, 2024
9128400
Add hard-coded parameters to control exporter behavior
andreaslindner Aug 23, 2024
2cb01d9
Make heap more generally accessible
andreaslindner Aug 23, 2024
7e43aff
Change tutorial to also use holba-heap (symbolic execution in tutoria…
andreaslindner Aug 23, 2024
1feb928
Collect all symbolic execution theories and libraries we used for app…
andreaslindner Aug 23, 2024
5ec3c9e
Fixes
andreaslindner Aug 23, 2024
27d5fed
Add debug output
andreaslindner Aug 23, 2024
9862493
Move syntax functions
andreaslindner Aug 23, 2024
772e034
Replace symbolic execution in tutorial
andreaslindner Aug 23, 2024
97740de
Fixes
andreaslindner Aug 23, 2024
81aecc3
Fix
andreaslindner Aug 23, 2024
772c59e
Move smt-related libraries into a subdirectory
andreaslindner Aug 23, 2024
932c124
Faster testing
andreaslindner Aug 23, 2024
145d160
Unify usage of smt solver in src/shared/smt/bir_smtLib
andreaslindner Aug 23, 2024
5270ccc
Fix
andreaslindner Aug 23, 2024
fae2ed8
Fixes (mostly scamv)
andreaslindner Aug 24, 2024
8e1dc55
Refactor transfer test to use symbolic execution library for the exec…
andreaslindner Aug 28, 2024
60d8fc3
.
andreaslindner Aug 28, 2024
0ee7bfc
Include aes in riscv symbolic execution test (but only leightweight c…
andreaslindner Aug 28, 2024
99c3387
Refactor smt library
andreaslindner Aug 28, 2024
c52942f
More refactoring
andreaslindner Aug 28, 2024
d802b68
More refactoring
andreaslindner Aug 28, 2024
ab79b78
Make z3 prelude autogenerated and based on a set of easily adjustable…
andreaslindner Aug 28, 2024
dbbecb3
Fix
andreaslindner Aug 29, 2024
7c85623
Add foundation for faster z3 model importing
andreaslindner Aug 29, 2024
65ba481
make chacha symbolic execution work for ivsetup subroutine
palmskog Sep 11, 2024
2e1e5b9
Merge pull request #190 from kth-step/riscv-symbexec
palmskog Sep 16, 2024
28f26e8
More RISC-V store tests using the zero register, fix to SB
didriklundberg Sep 19, 2024
1fae2bb
Merge pull request #192 from kth-step/dev_zeroreg2
palmskog Sep 20, 2024
9af4695
add poly1305 from https://github.com/grigorig/chachapoly
palmskog Sep 12, 2024
1668b33
basic lifting for pol1305
palmskog Sep 16, 2024
1172769
basic symbolic execution for poly1305 U8TO32 subroutine
palmskog Sep 16, 2024
7526439
split up symbolic execution for chacha
palmskog Sep 17, 2024
c077f36
add experimental ifelse example
palmskog Sep 18, 2024
2f581b6
minimal failing example
palmskog Sep 18, 2024
2186d72
WIP Ott-based definitions for compute
palmskog Sep 15, 2024
8375013
more work on Ott-based definitions for compute
palmskog Sep 19, 2024
b33c5ea
Ott definitions compatible with expression metatheory
palmskog Sep 20, 2024
b156ad4
bir_cv compatibility with Ott-generated bir theory
palmskog Sep 20, 2024
2f6c207
port rest of compute to birTheory
palmskog Sep 20, 2024
fd11bf5
all in on Holmakefiles for compute example
palmskog Sep 21, 2024
510af79
Merge pull request #191 from kth-step/ott-trindemossen
palmskog Sep 21, 2024
e27ff53
exclude aes from default riscv examples build due to taking too long …
palmskog Sep 23, 2024
004edfc
adjust chacha spec
palmskog Sep 23, 2024
6c53efa
add version of poly1305 with U8/U32 functions inlined
palmskog Sep 23, 2024
481d2dd
adjust non-inlined poly1305 spec
palmskog Sep 23, 2024
8ca4cff
WIP proving fmap-based contract transfer
palmskog Sep 23, 2024
7c09de4
move riscv aes test to aes directory for now
palmskog Sep 23, 2024
f8199f6
Enable default m0 models for lifting with lifting interface library
andreaslindner Sep 23, 2024
4094701
Provide faster variable set computation for larger programs
andreaslindner Sep 23, 2024
5ae4ce2
add chachapoly example with lifting
palmskog Sep 23, 2024
9940099
increase CI test timeout
palmskog Sep 23, 2024
a3aa165
Improve (handle program labels with other width and more output)
andreaslindner Sep 23, 2024
7e9317f
Enable run-time switch for smt debug outputs
andreaslindner Sep 24, 2024
0f464ed
Improve speed of property transfer for larger variable sets and states
andreaslindner Sep 24, 2024
b24cd16
bir_symb_transfer_two function in bir_symbLib, applied to isqrt
palmskog Sep 26, 2024
07947a3
more convenient bir_symb_transfer functions that only take thms
palmskog Sep 26, 2024
28943f4
Prepare simplification test
andreaslindner Sep 25, 2024
6d61a8e
Refactor simplification library
andreaslindner Sep 27, 2024
9b3f907
Add little performance tweak
andreaslindner Sep 26, 2024
f0f4dc9
Apply simplification conditionally, only after executing assignment s…
andreaslindner Sep 27, 2024
165cca4
Add crude store-store simplification (usable for prototyping or similar)
andreaslindner Sep 27, 2024
661b759
Disable crude cheat store-store simplification
andreaslindner Sep 27, 2024
c852d32
Z3 version 4.13.0 test
didriklundberg Mar 11, 2024
9fc3a4f
Z3 download link
didriklundberg Mar 11, 2024
2ac727f
Z3 file suffix in yaml
didriklundberg Mar 11, 2024
dbd9671
Ubuntu version
didriklundberg Mar 11, 2024
6e49035
Revert Ubuntu version, new Z3 suffix
didriklundberg Mar 11, 2024
ec25671
Z3 4.12.2
didriklundberg Mar 11, 2024
647488c
Typo
didriklundberg Mar 11, 2024
62c579b
Enable prepackaged polyml
andreaslindner Aug 22, 2024
b12a4d2
Fix
andreaslindner Aug 22, 2024
1eba69c
Update to z3 version 4.13.0
andreaslindner Aug 22, 2024
eb73de2
Fixes
andreaslindner Sep 27, 2024
07830e7
Make simplifications parameterizable
andreaslindner Sep 27, 2024
5b5c083
Prepare architecture specific simplifications
andreaslindner Sep 27, 2024
7dde07d
Fix profile function wrapping
andreaslindner Sep 27, 2024
6961d06
Refactor reusable caching function
andreaslindner Sep 29, 2024
c6477d9
Allow usage of speedy cheating store-store simplifications
andreaslindner Sep 29, 2024
aff2307
Refactor
andreaslindner Sep 29, 2024
1080f79
Start a library to collect functions to obtain variables of bir and b…
andreaslindner Sep 29, 2024
8ae2e63
Refactor
andreaslindner Sep 29, 2024
03accef
Refactor more
andreaslindner Sep 29, 2024
1358b7f
Refactor free symbol definition
andreaslindner Sep 30, 2024
d07fb89
Introduce sound structure predicate for BIR directly
andreaslindner Sep 30, 2024
f476adc
Fix transfer from symbexec to contract
andreaslindner Sep 30, 2024
4995462
Fix CI
andreaslindner Sep 30, 2024
d6cf066
Refactor for better structure and division among composeLib, vars_ofL…
andreaslindner Sep 30, 2024
6ca624c
Refactor for cleaner and simpler code
andreaslindner Oct 1, 2024
741b41b
Refactor and fix more
andreaslindner Oct 1, 2024
4983864
Fix CI
andreaslindner Oct 2, 2024
45d3a43
Add functions for state merging
andreaslindner Oct 3, 2024
f3fee04
Add refined merging for store operations
andreaslindner Oct 6, 2024
8e37086
Fix merging for balrob_ends_merge example
andreaslindner Oct 7, 2024
2c37cb9
A bit into debugging
andreaslindner Oct 7, 2024
b57c5b7
Add option for additional symbol in initial path condition when runni…
andreaslindner Oct 7, 2024
de49bb4
Add comment to support debugging of property transfer for riscv incr …
andreaslindner Oct 7, 2024
22c84f9
Progress on instantiation (and split libraries)
andreaslindner Oct 12, 2024
a2c440c
Various fixes
andreaslindner Oct 12, 2024
c08bd34
Add oracle fix to compare environments for equality syntactically
andreaslindner Oct 12, 2024
a112245
Clean up instantiation map
andreaslindner Oct 12, 2024
32240f9
Found unhandled export case (negation of multibit word) bir_smtlibLib
andreaslindner Oct 12, 2024
73a8ed5
Reorganize a bit
andreaslindner Oct 12, 2024
a20a5c9
Deactivate the failing test input for now
andreaslindner Oct 12, 2024
fdd91c6
Fixes and improvements
andreaslindner Oct 12, 2024
3d5bca7
Add interval prototype
andreaslindner Oct 13, 2024
2b2f0dc
Fixes
andreaslindner Oct 13, 2024
f5e3d58
Fixes
andreaslindner Oct 13, 2024
8ae9790
Fix handling of BExp_IntervalPred
andreaslindner Oct 13, 2024
126770e
Fix
andreaslindner Oct 14, 2024
0222b44
Small fixes and cleanup
andreaslindner Oct 14, 2024
e66f301
Add checks, profiling and cleanup a bit
andreaslindner Oct 16, 2024
395ec57
More cleanup
andreaslindner Oct 16, 2024
7915fd5
Fix simplifications
andreaslindner Oct 16, 2024
4959ee2
Add core functionality to enable the reuse of previous execution results
andreaslindner Oct 17, 2024
83dd54c
Refactoring cleanup
andreaslindner Oct 17, 2024
42ac97a
Fix
andreaslindner Oct 18, 2024
0f849e3
Big refactoring
andreaslindner Oct 18, 2024
2aed001
Refactor symbolic execution and integration with, enabling refined sy…
andreaslindner Oct 18, 2024
5c7669e
Fix
andreaslindner Oct 19, 2024
087eb8a
Generalize symbolic execution transfer with parameter for generic sym…
andreaslindner Oct 19, 2024
bfcde33
Fix (untested)
andreaslindner Oct 19, 2024
b6eb479
Add instantiation of summaries during symbolic execution
andreaslindner Oct 21, 2024
089e2b0
Fix CI
andreaslindner Oct 21, 2024
1f8de93
Fix for interval unification
andreaslindner Oct 22, 2024
db3a8b4
reduce metaprogramming in incr example
palmskog Oct 30, 2024
7f59ecd
basic chacha round spec and symbexec
palmskog Oct 30, 2024
f6a6d5b
spec of chacha20 inspired by EasyCrypt spec
palmskog Oct 30, 2024
c986f42
fixed and validated chacha round spec
palmskog Oct 30, 2024
e753c0b
test for 20 rounds of chacha
palmskog Oct 30, 2024
ff853e4
more chacha20 high level specs
palmskog Oct 31, 2024
686f11d
Merge pull request #193 from kth-step/riscv-symbexec
palmskog Nov 1, 2024
55521e9
Small fix to tutorial Makefile
didriklundberg Nov 22, 2024
72c6787
Merge pull request #194 from kth-step/dev_tutorial_fix
didriklundberg Nov 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 16 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI Build

on:
schedule:
- cron: "0 3 * * 0"
push:
branches: [ '**' ]
pull_request:
Expand All @@ -13,26 +15,33 @@ env:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}

strategy:
matrix:
polyml: ['v5.7.1', 'v5.8.1']
os: ['ubuntu-22.04']
polyml: [{version: 'PREPACKAGED'}, {version: 'v5.9.1', heapless: '1'}]
z3: ['4.13.0']
hol4: ['trindemossen-1']

env:
HOLBA_POLYML_VERSION: ${{ matrix.polyml }}
HOLBA_POLYML_VERSION: ${{ matrix.polyml.version }}
HOLBA_POLYML_HEAPLESS: ${{ matrix.polyml.heapless }}
HOLBA_Z3_VERSION: ${{ matrix.z3 }}
HOLBA_Z3_ASSET_SUFFIX: '-x64-glibc-2.35.zip'
HOLBA_HOL4_VERSION: ${{ matrix.hol4 }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: |
${{ env.HOLBA_OPT_DIR }}
key: os-${{ runner.os }}_polyml-${{ matrix.polyml }}_hol4-k14
key: os-${{ matrix.os }}_polyml-${{ matrix.polyml.version }}_z3-${{ matrix.z3 }}_hol4-${{ matrix.hol4 }}

- name: Static analysis
timeout-minutes: 5
Expand All @@ -49,10 +58,10 @@ jobs:
timeout-minutes: 35
run: |
./configure.sh
./scripts/ci/run_make.sh main
./scripts/ci/run_holmake.sh

- name: Run tests
timeout-minutes: 35
timeout-minutes: 55
run: |
./scripts/ci/run_make.sh tests

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
*.exe
*-heap

# Generated Holmake files
Holmakefile

# Makefile related stuff
Makefile.local
holba-tests.log
Expand Down
1 change: 1 addition & 0 deletions .holpath
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HOLBADIR
File renamed without changes.
91 changes: 39 additions & 52 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,54 @@
## Coding style
# Contribution guide for the HolBA library

* like HOL source code
- Spaces, no tabs
- No unicode
- `snake_case` (e.g. `bir_number_of_mem_splits_def`)
## Coding style

Like HOL4 source code:

## Branch policy
- Spaces, no tabs
- No unicode
- `snake_case` (e.g., `bir_number_of_mem_splits_def`)

### `master` branch
## Branch and tag policy

`master` is the branch where every feature is available, but not necessarily finalized:
- Can cheat, but has to be avoided (cheats are reported by the CI in Pull Requests)
- You must explicitely say why you cheated if it's not too obvious
- Code should not be be commented out
- Our CI must pass
- **Holmake must work** (i.e. must correctly compile)
- All tests must succeed
- Bug-fixing commits are ok
- At least 1 accepting review is needed in order to merge into `master`
- The `master` is the branch where every feature is available, but not necessarily finalized
- No development happens on the `master` branch, but rather on separate topic branches,
either inside the repository or in repository forks
- When your changes are ready to be integrated into `master`, open a Pull Request (PR)

Notice:
- **No development happens on the `master` branch**, but rather on separate feature branches
- **In order to prevent mayhem**, define good interfaces for your code (so that development won't break existing code)

Follow these instructions whenever you merge to master:
- `grep` for "cheat"
- Check that the `README` is up to date (especially tool status)
- Find a reviewer for your Pull Request
### `master` branch

### tags
PRs to `master` must abide by the following rules:

tags are like `master` and on top of this:
- Should have as many **completed features** as possible
- The `README` must be up to date, **especially in presence of cheat**
- HolBA Continuous Integration (CI) must pass
- Running `Holmake` must work (i.e., the changes must correctly compile)
- All tests run in CI must succeed
- Use of `cheat` should be a last resort (cheats are reported by the CI in PRs)
- You must explicitly say why you used `cheat` if it's not obvious
- `grep` for unexpected occurrences of `cheat` before submitting your PR
- Code should not be be commented out
- PRs that only fix bugs are welcome but should be documented as such
- At least one accepting review is needed in order to merge into `master`
- Standard ML code should come with interfaces (`.sig` files), so that new development won't easily break existing code
- `README.md` must be up to date (especially w.r.t. tool status)

### Feature branches
### Tags

Every "somewhat" working tool should be available in the `master` branch, but new
features or any development must go on new branches prefixed with `dev_`, fixes with `fix_`.
Tags are like the `master` branch with the following additional rules:

Guidelines:
- Branch names must be short and explicit (prefer explicit over short)
- Every feature branch should involve small developments
- **Rebase** feature branches on `master` **often**, by using `git rebase` or `git merge`: work on small features
- Commits in a feature branch should compile, unless explicitly stated in commit message (with the prefix `[WIP] ...` for instance)
- Further subbranch to do implementation experiments (keep them small)
- A tag should have as many **completed features** as possible
- `README.md` must be up to date, in particular if there are uses of `cheat`

If you want to violate the rules for temporary development or experiments (only for feature branches):
1. Fork
2. Do a good mess
3. Merge in feature branch after history rewrite
### Topic branches

### Merging pull requests with GitHub
1. Preferably and if possible, rebase the changes for a cleaner and more readable history. And to avoid merging overhead for ongoing work later.
2. Have somebody review the pull request, especially if the change is more involving or around the core parts.
3. Make sure that one of the CI tasks that build and run the tests completes successfully. One is allowed to timeout for unclear PolyML/HOL4 reasons.
4. Merge the pull request with a merge commit to enable a standard GitHub commit message with reference to the pull request it belongs to.
- Features or other new developments should go in new branches prefixed with `dev_`
- Branch names should be short and explicit (prefer explicit over short)
- Try to keep changes in feature branches as small as possible
- **Rebase** feature branches on top of `master` **often**, by using `git rebase` or `git merge`
- Commits in a feature branch should compile, unless explicitly stated in the commit message (with the prefix `[WIP] ...` for instance)

### CI > Static analysis
## Merging branches on GitHub

This CI performs basic static analysis on the code:
- locates all the places where `cheat` is used.
- locates all the places where `TODO` or `FIXME` appear.

It then post the results as a comment on the Pull Request (and in the CI logs as well). However, the CI **cannot** post a comment on the PR if the PR comes from a fork, for security reasons. In this case, there will be no comment posted. See #58 for more history.
1. Preferably and if possible, rebase the changes against the target branch for a cleaner and more readable history, and to avoid merging overhead for later work.
2. Have somebody review the PR, especially if changes are extensive or affect core modules of HolBA.
3. Make sure that CI builds and runs the tests successfully. It is allowed to timeout for unclear PolyML/HOL4 reasons.
4. Merge the PR with a merge commit to enable a standard GitHub commit message with reference to the pull request it belongs to.
30 changes: 30 additions & 0 deletions Holmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CLINE_OPTIONS = -r

INCLUDES = $(HOLBADIR)/src/extra \
$(HOLBADIR)/src/shared \
$(HOLBADIR)/src/shared/smt \
$(HOLBADIR)/src/theory/bir \
$(HOLBADIR)/src/theory/bir-support \
$(HOLBADIR)/src/theory/models/l3mod \
$(HOLBADIR)/src/theory/program_logic \
$(HOLBADIR)/src/theory/tools/lifter \
$(HOLBADIR)/src/theory/tools/wp \
$(HOLBADIR)/src/theory/tools/comp \
$(HOLBADIR)/src/theory/tools/backlifter \
$(HOLBADIR)/src/theory/tools/symbexec \
$(HOLBADIR)/src/tools/lifter \
$(HOLBADIR)/src/tools/wp \
$(HOLBADIR)/src/tools/comp \
$(HOLBADIR)/src/tools/cfg \
$(HOLBADIR)/src/tools/backlifter \
$(HOLBADIR)/src/tools/exec \
$(HOLBADIR)/src/tools/pass \
$(HOLBADIR)/src/tools/scamv \
$(HOLBADIR)/src/tools/scamv/obsmodel \
$(HOLBADIR)/src/tools/scamv/persistence \
$(HOLBADIR)/src/tools/scamv/symbexec \
$(HOLBADIR)/src/tools/scamv/proggen \
$(HOLBADIR)/src/tools/symbexec

all: $(DEFAULT_TARGETS)
.PHONY: all
File renamed without changes.
26 changes: 10 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ BENCHMARKS = $(SRCDIR)/tools/lifter/benchmark \
# recursive wildcard function
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))

HOLMAKEFILE_GENS = $(call rwildcard,$(SRCDIR)/,Holmakefile.gen) \
$(call rwildcard,$(EXSDIR)/,Holmakefile.gen)
HOLMAKEFILES = $(HOLMAKEFILE_GENS:.gen=)

HOLMAKEFILES = $(call rwildcard,$(SRCDIR)/,Holmakefile) \
$(call rwildcard,$(EXSDIR)/,Holmakefile)

ifdef HOLBA_HOLMAKE
HOLMAKEFILE_DIRS = $(patsubst %/,%,$(sort $(foreach file,$(HOLMAKEFILE_GENS),$(dir $(file)))))
HOLMAKEFILE_DIRS = $(patsubst %/,%,$(sort $(foreach file,$(HOLMAKEFILES),$(dir $(file)))))

HOLMAKEFILE_CLEANS = $(foreach holmfld,$(HOLMAKEFILE_DIRS),$(holmfld)_clean)

SML_RUNS = $(foreach sml,$(call rwildcard,$(SRCDIR)/,*.sml),$(sml)_run) \
$(foreach sml,$(call rwildcard,$(EXSDIR)/,*.sml),$(sml)_run)
Expand All @@ -55,7 +55,6 @@ all: show-rules

show-rules:
@echo 'Available rules:'
@echo ' - Holmakefiles: generates `Holmakefile`s from `Holmakefile.gen` files.'
ifdef HOLBA_HOLMAKE
@echo ' - theory: builds only src/theory/'
@echo ' - main: builds HolBA, but without the examples or documentation'
Expand All @@ -69,17 +68,13 @@ endif

##########################################################

%Holmakefile: %Holmakefile.gen $(SRCDIR)/Holmakefile.inc
@./scripts/gen_Holmakefiles.py $<

Holmakefiles: $(HOLMAKEFILES)


$(HOLMAKEFILE_DIRS): Holmakefiles
$(HOLMAKEFILE_DIRS): $(HOLMAKEFILES)
source ./scripts/setup/env_derive.sh && cd $@ && $(HOLBA_HOLMAKE) $(HOLBA_HOLMAKE_OPTS)

$(HOLMAKEFILE_CLEANS):
cd $(patsubst %_clean,%,$@) && $(HOLBA_HOLMAKE) clean && $(HOLBA_HOLMAKE) cleanAll

%.exe: %.sml Holmakefiles
%.exe: %.sml $(HOLMAKEFILES)
@/usr/bin/env HOLBA_HOLMAKE="$(HOLBA_HOLMAKE)" ./scripts/mk-exe.sh $(@:.exe=.sml)

# this is a target for all sml files to run as scripts,
Expand All @@ -105,6 +100,7 @@ main: $(SRCDIR)
examples-base: main $(EXAMPLES_BASE)
examples-all: main $(EXAMPLES_ALL)
benchmarks: main $(BENCHMARKS)
riscv: main src/tools/symbexec/examples/riscv


tests: $(TEST_EXES) $(TEST_DIRS)
Expand All @@ -124,8 +120,6 @@ cleanslate:

##########################################################

.PHONY: Holmakefiles

ifdef HOLBA_HOLMAKE
.PHONY: $(HOLMAKEFILE_DIRS)
.PHONY: $(SML_RUNS)
Expand Down
Loading