#!/bin/sh

set -e

this=why+coq
indir=debian/tests/why
outdir=${ADT_ARTIFACTS}/${this}
mkdir -p ${outdir}

for infile in $indir/minimum.why
do
    base=$(basename $infile)
    whyoutfile=$outdir/${base%.why}
    coqinfile=${whyoutfile}_proof.v
    why --coq --no-coq-use-dp --output $whyoutfile $infile
    sed -e 's/(\* FILL PROOF HERE \*)/intros; subst; auto using min_ax./' \
	< ${whyoutfile}_why.v > ${coqinfile}
    coqc ${coqinfile}
done
