Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1297 commits
Select commit Hold shift + click to select a range
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
e45808c
Updates
andreaslindner Nov 4, 2024
dd01d30
Fix smt export for unary operations on bitvectors (for example binary…
andreaslindner Nov 5, 2024
3bb7a1d
some poly1305 high-level specs
palmskog Nov 18, 2024
e21dfd1
Enable simplification additions: static and dynamic
andreaslindner Nov 10, 2024
3dced77
Fix order
andreaslindner Nov 10, 2024
827fd10
Cleanup and optimize aux_setLib a bit
andreaslindner Nov 18, 2024
65456e6
More cleanup
andreaslindner Nov 18, 2024
371221d
Fix
andreaslindner Nov 19, 2024
fb152cf
alternative C code with quarterround as a function
palmskog Nov 19, 2024
c559ddb
boilerplate for chacha quarterround transfer
palmskog Nov 19, 2024
f968b6f
Merge branch 'riscv-symbexec' of github.com:kth-step/HolBA into riscv…
palmskog Nov 19, 2024
aeb4a53
first part of quarterround
palmskog Nov 19, 2024
c946031
increase ci timeout
palmskog Nov 19, 2024
78d8f18
parameterize chacha quarterround spec
palmskog Nov 19, 2024
1caeae8
Add instrumentation
andreaslindner Nov 18, 2024
f851829
Optimize bir_vars_ofLib a bit
andreaslindner Nov 19, 2024
12738ab
More optimization in bir_vars_ofLib
andreaslindner Nov 19, 2024
8ecb29b
Refactor to reduce code duplication (should use the new cache wrapper…
andreaslindner Nov 19, 2024
19c21de
Various small optimizations and output improvements
andreaslindner Nov 21, 2024
9bc8bc5
Various improvements
andreaslindner Nov 21, 2024
017ee8d
Avoid reproving halt-free program
andreaslindner Nov 21, 2024
97e8c62
Fix unoptimized aes binary example
andreaslindner Nov 21, 2024
9078d41
More improvements
andreaslindner Nov 21, 2024
96db35c
Cleanup after benchmark
andreaslindner Nov 22, 2024
66065ab
Fix CI
andreaslindner Nov 22, 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
9738430
work on chacha spec
palmskog Nov 25, 2024
f82fb4d
validate chacha specification template
palmskog Nov 25, 2024
9f648ea
work on chacha spec simplification
palmskog Nov 26, 2024
2402ad1
more friendly round definitions
palmskog Nov 27, 2024
67bb34d
rol-free chacha spec
palmskog Nov 27, 2024
713d1de
simplified chacha line spec
palmskog Nov 27, 2024
119115a
simplified chacha line spec
palmskog Nov 27, 2024
199e89e
reorganize chacha spec
palmskog Nov 27, 2024
760b9c1
more chacha spec done
palmskog Nov 27, 2024
4b0bde6
small chacha spec reorganization
palmskog Nov 28, 2024
5c6f559
factor chacha line spec
palmskog Nov 28, 2024
83914d9
better names for chacha specs
palmskog Nov 28, 2024
3c0af25
first quarter round setup
palmskog Nov 28, 2024
47ae9de
proof of postcondition for whole quarter round
palmskog Nov 28, 2024
a0389ed
add basic lifting boilerplate for separation kernel with uncompressed…
palmskog Nov 29, 2024
a4629ff
chacha round bir spec
palmskog Dec 2, 2024
26c5108
Changed installation script to install branch from kth-step fork instead
didriklundberg Oct 21, 2020
d7eca9e
Bugfix for alternate branch-specific HOL4, small changes in RISC-V se…
didriklundberg Oct 27, 2020
41a1c37
Small changes to selftests, some work on CSR instruction lifting
didriklundberg Oct 28, 2020
4d178e4
CSRRW, CSRRS, CSRRC, CSRRWI, CSRRSI and CSRRCI instructions now lifti…
didriklundberg Oct 28, 2020
10ace80
Typos
didriklundberg Oct 28, 2020
cae4f3e
Fixing rebase typo
didriklundberg Dec 2, 2024
f922ca7
Typo fix + backlifter fix for latest RISC-V L3 model
didriklundberg Dec 2, 2024
adcdc95
unify chacha line spec
palmskog Dec 3, 2024
f11ad1d
spec and symbexec for chacha round loop body
palmskog Dec 4, 2024
6d5cc57
double round symbexec WIP
palmskog Dec 4, 2024
a26bfd3
double round transfer boilerplate
palmskog Dec 5, 2024
7c8e6d8
prove column round
palmskog Dec 5, 2024
6a11ebe
prove contract for chacha diagonal round
palmskog Dec 5, 2024
9a76df9
Added support for more CSR registers in RISC-V lifter and backlifter
didriklundberg Dec 5, 2024
541d525
bundled version of l3 riscv model and step from trindemossen-1
palmskog Dec 5, 2024
caf07c3
Added the capability of executing CSR instructions to riscv_stepLib
didriklundberg Dec 5, 2024
9cc7ffb
Changed CSR addresses and names in the RISC-V L3 model to agree with …
didriklundberg Dec 5, 2024
b99b4f4
use Holmakefile path relative to HOLBADIR
palmskog Dec 5, 2024
537ad23
Merge pull request #196 from kth-step/dev_riscv_l3_lifter_t1
palmskog Dec 5, 2024
60d1af3
Failing results in selftest logs now in order of occurrence
didriklundberg Dec 5, 2024
4e934d6
Merge pull request #195 from kth-step/l3-riscv
didriklundberg Dec 5, 2024
cbf60f4
new kernel.da from Henrik Karlsson
palmskog Dec 6, 2024
439e1b6
sliced lifting of kernel trap_handler
palmskog Dec 9, 2024
4f885f2
slice kernel disassembly to avoid problematic instructions
palmskog Dec 11, 2024
61e2074
kernel trap entry subroutine lifts fully
palmskog Dec 17, 2024
d83ea18
more consistent naming of kernel programs
palmskog Dec 17, 2024
f51a82a
chacha double round symbexec takes too long in one go
palmskog Dec 23, 2024
a3f281e
make BIR LaTeX typesetting more readable
palmskog Sep 23, 2024
4cca774
compute BIR program definitions in Ott
palmskog Sep 27, 2024
face38a
more statement-related definitions in Ott file
palmskog Oct 3, 2024
bbbb723
move theorems away from Ott file
palmskog Oct 14, 2024
fef5438
fix increment example
palmskog Oct 14, 2024
229c64f
compute benchmarks are not tests
palmskog Oct 14, 2024
aff8bea
migrate words from metavars to rules in Ott
palmskog Dec 30, 2024
1dd81f4
bir_eval_binexp_imm in Ott, documentation fixes
palmskog Jan 2, 2025
1e51a9a
bir_eval_unaryexp_imm in Ott
palmskog Jan 2, 2025
8a58fa1
bir_eval_binpred_imm in Ott
palmskog Jan 2, 2025
a262a3a
bir_eval_binpred in Ott
palmskog Jan 2, 2025
ef24eca
bir_eval_binexp in Ott
palmskog Jan 2, 2025
a0a2afb
bir_eval_unaryexp in Ott
palmskog Jan 2, 2025
07c4bf6
bir_eval_ifthenelse in Ott
palmskog Jan 2, 2025
f0fe329
fix up test-compute
palmskog Jan 3, 2025
a8557a8
Merge pull request #197 from kth-step/bir-ott
palmskog Jan 7, 2025
7342846
Fixed typo in RISC-V step theory, updates to RISC-V selftest
didriklundberg Jan 9, 2025
239e4ba
Speedup and cleanup expression typechecking
andreaslindner Nov 22, 2024
c2ea8af
Various improvements
andreaslindner Nov 24, 2024
5dc745d
Speedup
andreaslindner Nov 25, 2024
c1ad31f
More speedup
andreaslindner Nov 25, 2024
2cefac1
Even more speedup
andreaslindner Nov 25, 2024
6e5ed30
Add hook for external concretization function
andreaslindner Dec 2, 2024
6897440
Update libraries
andreaslindner Jan 10, 2025
5d23a44
Filter correctly when merging stores
andreaslindner Jan 10, 2025
ec2407b
Refactor store unification
andreaslindner Jan 12, 2025
b32d16c
Fix merging of store expressions (traverse store syntax instead of su…
andreaslindner Jan 12, 2025
b678804
Fix preprocessing bug
andreaslindner Jan 15, 2025
aac1a8e
ensure some cheats are not used
andreaslindner Jan 19, 2025
14d03fe
Merge branch 'collected_fixes' into riscv-symbexec
andreaslindner Jan 19, 2025
26593a6
remove superfluous kernel example
palmskog Jan 20, 2025
b405814
Merge pull request #198 from kth-step/dev_riscv_step
palmskog Jan 20, 2025
25f0a7f
setup up symbexec for kernel trap
palmskog Jan 20, 2025
2763220
basic symbexec boilerplate for kernel-trap
palmskog Jan 20, 2025
8b8e5f4
bump CI time limit
palmskog Jan 20, 2025
3ca8c95
fiddle with kernel trap path conditions
palmskog Jan 20, 2025
1cefb4e
symbolic execution works for everything in kernel-trap
palmskog Jan 21, 2025
fdb3fb7
simplify kernel trap preconditions
palmskog Jan 21, 2025
b6e8ae2
basic property proof for kernel-trap
palmskog Jan 21, 2025
8e07da9
kernel trap spec
palmskog Jan 22, 2025
82be8d1
stronger trap_entry postcondition
palmskog Jan 23, 2025
d0183b5
add trap_return boilerplate
palmskog Jan 23, 2025
6fd8eaf
add unused dummy instruction at end of trap_return to make symbexec t…
palmskog Jan 24, 2025
9fb3b1e
strengthen postcondition of trap_return
palmskog Jan 24, 2025
902cac0
complete proven spec of trap_return at BIR level
palmskog Jan 26, 2025
e0f2d99
trap_entry BIR level register storage
palmskog Jan 26, 2025
b9f5ed2
hopefully finish proven spec of trap_entry
palmskog Jan 26, 2025
6d860ac
riscv spec for trap_return
palmskog Jan 26, 2025
28ab5fc
nearly complete riscv spec for trap_entry
palmskog Jan 26, 2025
f4513f2
backlifting boilerplate for kernel-trap
palmskog Jan 27, 2025
0767c1d
backlifting kernel_trap works
palmskog Jan 27, 2025
fd3d585
riscv spec boilerplate
palmskog Jan 27, 2025
97a4bd0
full QED for quarter round
palmskog Jan 27, 2025
a2f23bc
chacha spec adjustments
palmskog Jan 27, 2025
d814ede
column round boilerplate
palmskog Jan 27, 2025
c875ed0
chacha spec cleanup
palmskog Jan 27, 2025
3b13281
column round boilerplate
palmskog Jan 27, 2025
87e0420
reorganize chacha results
palmskog Jan 27, 2025
f0ed874
kernel_trap_return riscv lifting stuff
palmskog Jan 28, 2025
6ec6443
CI adjustment
palmskog Jan 28, 2025
030ef4a
utility lemmas for bir_post_bir_to_riscv
palmskog Jan 28, 2025
acf61d0
prove kernel_trap_entry riscv postcondition implication
palmskog Jan 28, 2025
6c0faf1
helper lemmas for preconditions
palmskog Jan 29, 2025
20048f0
kernel_trap_return QED
palmskog Jan 29, 2025
614f9e9
kernel_trap_entry QED
palmskog Jan 29, 2025
742d411
boilerplate for chacha diagonal round
palmskog Jan 29, 2025
c78ee48
general approach for postconditions
palmskog Jan 29, 2025
9786628
chacha_column_round QED
palmskog Jan 29, 2025
78bc087
chacha_diagonal_round QED
palmskog Jan 29, 2025
b66627e
spec equivalence theorem
palmskog Jan 29, 2025
7da9b87
Merge pull request #199 from kth-step/riscv-symbexec
palmskog Jan 30, 2025
85e63e0
Add needed birs instance theorems
andreaslindner Jan 20, 2025
30f4d95
Development in symbexec libraries for new instance theorems
andreaslindner Jan 19, 2025
a26c0d0
Fix to z3 exporter (failing type unification)
andreaslindner Jan 23, 2025
fb4dfe3
Add more control to z3 interface
andreaslindner Jan 31, 2025
3e11b8e
Improve theory
andreaslindner Jan 25, 2025
d046241
Add label set approximation and other developments in symbexec libraries
andreaslindner Jan 24, 2025
9686953
Add rule rename free
andreaslindner Jan 26, 2025
822aa30
Development in symbexec libraries
andreaslindner Jan 26, 2025
a3d7037
Add code to support debugging and functions to allow forgetting parts…
andreaslindner Jan 29, 2025
5fdd209
Improve simplifier
andreaslindner Jan 30, 2025
db61ce3
add function to forget a mapping altogether
andreaslindner Jan 30, 2025
ba87114
Add option to run L approximated and cheated
andreaslindner Jan 30, 2025
bf11d34
Fix freesymboling without substitution
andreaslindner Jan 30, 2025
a0d0bf9
Improvements
andreaslindner Jan 31, 2025
4f4bc67
Merge branch 'collected_fixes' into riscv-symbexec
andreaslindner Jan 31, 2025
ee762f6
Update example scripts to utilize all optimizations
andreaslindner Jan 31, 2025
2c0d089
Fix CI tests
andreaslindner Jan 31, 2025
bae5bbe
Make generic conversions available in shared/convs
andreaslindner Feb 1, 2025
ea468a2
Make more generic conversions available
andreaslindner Feb 1, 2025
05b58d2
Fix slow backlifter
andreaslindner Feb 1, 2025
1cfb272
Fix CI tests
andreaslindner Feb 1, 2025
72487c8
Fix
andreaslindner Feb 1, 2025
a41b4bc
More fix
andreaslindner Feb 1, 2025
ae63165
Fix dominant bottleneck in symbolic result transfer
andreaslindner Feb 1, 2025
0d9df35
Add some extra timing outputs and profiling
andreaslindner Feb 1, 2025
6a66494
upgrade deprecated GitHub Action cache version
palmskog Feb 1, 2025
556cf9e
Fix
andreaslindner Feb 5, 2025
e41a56e
improve bir-riscv utility lemma placement, simplify chacha proofs
palmskog Feb 2, 2025
d2b4191
switch to Z3 4.13.4 and fix issues in README.md
palmskog Feb 2, 2025
fd4a34c
transfer for more utility lemmas to bir_exp_equiv
palmskog Feb 2, 2025
7f0cc81
Z3 version fix
palmskog Feb 3, 2025
0074efc
increase CI prep time
palmskog Feb 3, 2025
c2d049f
chacha20 double round symbexec in separate directory
palmskog Feb 6, 2025
d440dba
Merge pull request #200 from kth-step/riscv-symbexec
palmskog Feb 7, 2025
a6bab49
reorganize chacha20 example
palmskog Feb 8, 2025
5558a43
reorganize general chacha definitions
palmskog Feb 8, 2025
8ae48ee
column round spec-model connection
palmskog Feb 10, 2025
0cc36f3
finish equivalence of chacha column round with spec
palmskog Feb 10, 2025
9eb0c35
equivalence of chacha diagonal round to spec
palmskog Feb 10, 2025
2101083
update README.md
palmskog Feb 14, 2025
16e15e3
add missing .PHONY
palmskog Feb 15, 2025
765f9cd
full validation for chacha double round
palmskog Feb 15, 2025
bd083fc
move riscv examples general lemmas to library theories
palmskog Feb 17, 2025
f982e75
Merge branch 'riscv-symbexec' of github.com:kth-step/HolBA into riscv…
palmskog Feb 17, 2025
2d24aa0
simplify swap bir-riscv proofs
palmskog Feb 18, 2025
f14f400
more general riscv theorems and simplifications
palmskog Feb 18, 2025
a431ee1
squash some isqrt bir-riscv cheats
palmskog Feb 19, 2025
96f291f
revise bir_post_bir_to_arm8 and bir_post_bir_to_riscv to allow connec…
palmskog Feb 19, 2025
22bdebb
Merge pull request #201 from kth-step/riscv-symbexec
palmskog Feb 19, 2025
76ede22
strengthen bir_post_bir_to_arch with BST_Running to allow PC connection
palmskog Feb 20, 2025
1c2122e
QED for isqrt contracts
palmskog Feb 20, 2025
53068e9
Merge pull request #202 from kth-step/riscv-symbexec
palmskog Feb 21, 2025
6eb65ed
add riscv utility theorems to bir_riscv_extras
palmskog Feb 21, 2025
4e055a3
utility theorems for all riscv registers for completeness
palmskog Feb 21, 2025
84d6fc4
separate theories for riscv and bir spec in swap
palmskog Feb 22, 2025
46d932d
simplify mod2 proofs
palmskog Feb 22, 2025
d6f1084
separate theories for riscv and bir spec in mod2
palmskog Feb 22, 2025
6866435
separate theories for riscv and bir spec in chacha20
palmskog Feb 22, 2025
f8b8926
chacha20 bir lemmas in same theory
palmskog Feb 22, 2025
a3816f5
simplify some chacha20 proofs
palmskog Feb 22, 2025
804dd1e
small reorganization of incr
palmskog Mar 5, 2025
875f2a1
skip HL step for incr example
palmskog Mar 5, 2025
df6f9f9
update RISC-V verification example
palmskog Mar 5, 2025
f2edee5
reorganize spec in kernel-trap example
palmskog Mar 5, 2025
d348ad5
move bir stuff to separate file in kernel-trap example
palmskog Mar 5, 2025
f0e1b99
fix test-riscv.sml
palmskog Mar 5, 2025
c42724b
Merge pull request #203 from kth-step/riscv-symbexec
palmskog Mar 25, 2025
753d9a3
Update to Poly/ML 5.9.2
didriklundberg Aug 15, 2025
b18e3a2
Upgrade HOL4 to trindemossen-2
didriklundberg Aug 15, 2025
d0840a5
Make HolBA compile under trindemossen-2
didriklundberg Aug 18, 2025
7638076
Add subdirectory for HOL4's internal files to .gitignore
didriklundberg Aug 18, 2025
2c940b7
Use ASCII backticks
didriklundberg Aug 18, 2025
e67ada1
Use ASCII backticks
didriklundberg Aug 18, 2025
9baf0e6
Adjust ottLib.sml for trindemossen-2
didriklundberg Aug 18, 2025
745af96
Fix to usage of "at" when using heap
didriklundberg Aug 19, 2025
a9b7e3e
Fix to overloading of "Num"
didriklundberg Aug 19, 2025
9da47d8
Adjusting for new DB.find return value type and additional cv_auto_tr…
didriklundberg Aug 19, 2025
9b288e8
Adjusting for new trace names and new HOL_ERR type
didriklundberg Aug 19, 2025
4731241
Update src/tools/comp/bir_compositionLib.sml
didriklundberg Aug 19, 2025
8c7924d
Update src/tools/comp/bir_compositionLib.sml
didriklundberg Aug 19, 2025
e0cad95
Remove .hol temporary files from .gitignore
didriklundberg Aug 19, 2025
c22f47d
Merge pull request #204 from kth-step/dev_trindemossen-2
didriklundberg Aug 20, 2025
bb50441
Embedding theorem for partial correctness
didriklundberg Sep 5, 2025
03999c5
Change quotation marks to grave accents in program_logic directory
didriklundberg Sep 6, 2025
994ae6c
Added barebones theories of eventual-encounter and global-encounter p…
didriklundberg Sep 8, 2025
6cb8f36
Fix terminology and clean-up comments in program logic scripts
didriklundberg Sep 20, 2025
fd68ef3
Merge pull request #205 from kth-step/dev_logic_extras
didriklundberg Sep 20, 2025
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
  •  
  •  
  •  
29 changes: 19 additions & 10 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,46 +15,53 @@ 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.2', heapless: '1'}]
z3: ['4.13.4']
hol4: ['trindemossen-2']

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
uses: actions/cache@v3
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
run: |
./scripts/ci/static-analysis.sh || echo "Static-analysis failed with status $?."

- name: Prepare cached dependencies
timeout-minutes: 35
timeout-minutes: 45
run: |
./scripts/setup/install_base.sh
./scripts/setup/install_z3.sh

- name: Configure and compile
timeout-minutes: 35
timeout-minutes: 55
run: |
./configure.sh
./scripts/ci/run_make.sh main
./scripts/ci/run_holmake.sh

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

Expand Down
11 changes: 1 addition & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
# Compiled HOL files
.HOLMK
.hollogs
*Theory.dat
*Theory.sig
*Theory.sml
*.ui
*.uo
*~
*.exe
*-heap

# Generated Holmake files
Holmakefile
.hol/

# Makefile related stuff
Makefile.local
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