#!/usr/bin/env bash set -euo pipefail # Target-scoped fallback: frame_tx_contract requests Bitwuzla, which is not in # the minimal Debian image. Use Z3 only for this target and emit a solver map. repo="${1:?source repository path}" work="${2:?formal work root}" solver="${3:-z3}" depth="${4:-64}" mkdir -p "$work" src="$repo/tests/formal/frame_tx_contract.sby" tmp="$work/frame_tx_contract-z3.sby" sed -e "s/^smtbmc bitwuzla$/smtbmc $solver/" -e "s/^depth [0-9][0-9]*/depth $depth/" "$src" > "$tmp" 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" cd "$repo/tests/formal" exec /usr/local/bin/sby -f -d "$work/frame_tx_contract" "$tmp" bmc