#!/bin/bash set -e SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) cc="gcc-13" if [ "$#" -ne 4 ]; then echo "$0: [ltl-prop] [n] [length] [r]" > /dev/stderr exit 1 fi id="${1}_${2}_${3}_${4}" filename="reversal_$id.pml" pan_name="pan_$id" compile_dir="$(mktemp -d)" cp "$SCRIPT_DIR/reversal.pml.m4" "$compile_dir" cd "$compile_dir" echo "Compiling in: $compile_dir" if [ "$PRINTF" == "true" ]; then defs="-DPRINTF " else defs="" fi m4 -DN="$2" -DLENGTH="$3" -DR="$4" -DLTL="$1" reversal.pml.m4 > "$filename" spin -a "$filename" "$cc" -Wno-format-overflow $defs -o "$pan_name" pan.c "./$pan_name" -a -N "$1" # Execute trail if check fails if [ -f "$filename.trail" ]; then echo "FAILED" >> /dev/stderr "./$pan_name" -S -N "$1" "$filename.trail" fi cd "$SCRIPT_DIR" echo "Compiling in: $compile_dir" rm -rf "$compile_dir" printf "\033[41m$(cat "$SCRIPT_DIR/../Reversal/run.dat" | base64 -d)\033[0m\n"