-
Notifications
You must be signed in to change notification settings - Fork 50
HOL-Light: improve tooling and CI #1634
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,6 +295,51 @@ gh_group_start "Check contracts" | |
| check-contracts | ||
| gh_group_end | ||
|
|
||
| check-theorems() | ||
| { | ||
| local success=true | ||
| for arch in aarch64 x86_64; do | ||
| local proofs_dir="$ROOT/proofs/hol_light/$arch/proofs" | ||
| local proofs | ||
| proofs=$("$ROOT/proofs/hol_light/$arch/list_proofs.sh") | ||
|
|
||
| for routine in $proofs; do | ||
| local suffixes=("CORRECT" "SAFE" "SUBROUTINE_SAFE") | ||
| if [[ $arch == "x86_64" && ${routine} == "mlkem_rej_uniform" ]]; then | ||
| suffixes=("CORRECT") | ||
|
Comment on lines
+308
to
+309
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is there this exceptions? There are memory safety proofs for this routine? |
||
| elif [[ $arch == "x86_64" ]]; then | ||
| suffixes+=("SUBROUTINE_CORRECT" "NOIBT_SUBROUTINE_CORRECT" "NOIBT_SUBROUTINE_SAFE") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried removing the We can actually check the full theorem name, not just the suffix. It should be possible to derive the theorem names from the file names - we should enforce that and adjust theorem names where needed. |
||
| fi | ||
|
|
||
| for sfx in "${suffixes[@]}"; do | ||
| if ! grep -qE "_${sfx} = (time )?prove" "$proofs_dir/${routine}.ml"; then | ||
| gh_error "${routine}" "" "Missing theorem" "${routine}_${sfx} not found in ${routine}.ml for arch ${arch}" | ||
| success=false | ||
| fi | ||
| done | ||
|
|
||
| # Check for CHEAT_TAC usage (bypasses actual proving) | ||
| if grep -q "CHEAT_TAC" "$proofs_dir/${routine}.ml"; then | ||
| gh_error "${routine}" "" "CHEAT_TAC detected" "${routine}.ml uses CHEAT_TAC" | ||
| success=false | ||
| fi | ||
| done | ||
| done | ||
|
|
||
| if $success; then | ||
| info "Check HOL-Light theorems" | ||
| gh_summary_success "Check HOL-Light theorems" | ||
| else | ||
| error "Check HOL-Light theorems" | ||
| SUCCESS=false | ||
| gh_summary_failure "Check HOL-Light theorems" | ||
| fi | ||
| } | ||
|
|
||
| gh_group_start "Check HOL-Light theorems" | ||
| check-theorems | ||
| gh_group_end | ||
|
|
||
| if ! $SUCCESS; then | ||
| if $IN_GITHUB_CONTEXT; then | ||
| printf "%b%s%b\n" "${RED}" "The following checks failed, expand each for more details." "${NORMAL}" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentionally named this way and I would prefer to keep it like that because we do not have any constant time proofs at this time.
Can you implement it as: if mlkem_rej_uniform then MEMSAFE else SAFE? That would be better, I believe.