run-formal-with-solver-map.sh 818 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. # Target-scoped fallback: frame_tx_contract requests Bitwuzla, which is not in
  4. # the minimal Debian image. Use Z3 only for this target and emit a solver map.
  5. repo="${1:?source repository path}"
  6. work="${2:?formal work root}"
  7. solver="${3:-z3}"
  8. depth="${4:-64}"
  9. mkdir -p "$work"
  10. src="$repo/tests/formal/frame_tx_contract.sby"
  11. tmp="$work/frame_tx_contract-z3.sby"
  12. sed -e "s/^smtbmc bitwuzla$/smtbmc $solver/" -e "s/^depth [0-9][0-9]*/depth $depth/" "$src" > "$tmp"
  13. printf '%s\n' "{\"schema\":\"prod2u-solver-map-v1\",\"target\":\"frame_tx_contract\",\"requested\":\"bitwuzla\",\"selected\":\"$solver\",\"depth\":$depth,\"reason\":\"target-scoped solver selection\"}" > "$work/solver-map.json"
  14. cd "$repo/tests/formal"
  15. exec /usr/local/bin/sby -f -d "$work/frame_tx_contract" "$tmp" bmc