Allow to pass ProofGenerator to arithmetic inference manager. (#5488)
[cvc5.git] / contrib / sygus-v1-to-v2.sh
1 #!/bin/bash
2 # This is a simple script for converting v1 sygus files to v2.
3
4 # Show how to use the script
5 if [[ "$#" < 3 || ! -f "$1" || ! -f "$2" ]]; then
6 echo "Usage: $0 [<path to cvc4>] [<path to sygus file>] [<path to output file>] [<additional cvc4 options>*]"
7 exit 1
8 fi
9
10 output=$("$1" "$2" --lang=sygus1 --dump-to="$3" --output-lang=sygus2 --dump=raw-benchmark --preprocess-only "${@:4}" 2>&1)
11
12 exitCode=$?
13
14 if [[ "$exitCode" == 0 ]]; then
15 # Remove incremental and produce-models options
16 sed -i '/(set-option :incremental false)/d' "$3"
17 sed -i '/(set-option :produce-models "true")/d' "$3"
18 else
19 echo "$1 failed with exit code $exitCode:"
20 echo "$output"
21 fi