3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-14 16:25:11 +00:00
z3/fstar/extract.sh
copilot-swe-agent[bot] e5acaf0c28
fstar: add extract.sh script and fstar-extract.yml GHA workflow for Meta-F* extraction
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/680146e3-e241-487e-a0d7-a7e23b5f1634

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-04-05 02:45:56 +00:00

47 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# extract.sh
#
# Run the Meta-F* reflection-based extraction to generate C++ rewrite rules
# from the F* lemmas in this directory.
#
# Usage (from the fstar/ directory):
# ./extract.sh
#
# Usage (from the repo root):
# fstar/extract.sh
#
# Output:
# Prints the generated C++ rules to stdout.
# Exits non-zero if F* typechecking or tactic execution fails.
#
# Requirements:
# fstar.exe on PATH (F* 2024.09.05 or later recommended).
# The three source files must be present:
# IEEE754.fst, FPARewriterRules.fst, RewriteCodeGen.fst
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
if ! command -v fstar.exe &>/dev/null; then
echo "ERROR: fstar.exe not found on PATH." >&2
echo "Install F* 2024.09.05+ from https://github.com/FStarLang/FStar/releases" >&2
exit 1
fi
echo "=== F* version ===" >&2
fstar.exe --version >&2
echo "" >&2
echo "=== Running Meta-F* extraction ===" >&2
# F* writes tactic print() output to stdout.
# Verification progress and errors go to stderr.
fstar.exe --include . \
IEEE754.fst \
FPARewriterRules.fst \
RewriteCodeGen.fst
echo "" >&2
echo "=== Extraction complete ===" >&2