aboutsummaryrefslogtreecommitdiffstats
path: root/src/lfsc/tests/cvc4tocoq
blob: 72251bd0e79402bc4f0b131f605fd5bdc5bf26b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e

name=${1%.*}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

gnudate() {
    if hash gdate 2>/dev/null; then
        gdate "$@"
    else
        date "$@"
    fi
}

echo -n "Running CVC4... "
T0=$(gnudate +%s.%N)
cvc4 --proof --dump-proof --no-simplification --fewer-preprocessing-holes --no-bv-eq --no-bv-ineq --no-bv-algebraic --allow-empty-dependencies $1 > $name.lfsc
T1=$(gnudate +%s.%N)
CVC4TIME=$(echo "$T1 - $T0" | bc)
echo "Done [$CVC4TIME s]"

# sed -i -e '1d' $name.lfsc

 cat > ${name}_lfsc.v <<EOF
 Require Import SMTCoq Bool List.
 Import ListNotations BVList.BITVECTOR_LIST FArray.
 Local Open Scope list_scope.
 Local Open Scope farray_scope.
 Local Open Scope bv_scope.

 Section File.
   Lfsc_Checker "$name.smt2" "$name.lfsc".
 End File.
EOF

echo "Checking LFSC proof with Coq directly."
coqc -q -R $DIR/../.. SMTCoq ${name}_lfsc.v

exit 0