Commit 5cd1b159 authored by Sylvain Schmitz's avatar Sylvain Schmitz

TeX output of coverage by size and axis step

parent 223383e2
all: dist.dat axis-count.tex size-gte-100.tex matrices xslt.dat xqy.dat
all: dist.dat axis-count.tex size-gte-100.tex matrices xslt.dat xqy.dat coverage-size.tex coverage-axis-step.tex
BENCHMARKS=benchmarks-all.xml \
benchmarks-xslt-full.xml benchmarks-xslt.xml \
......@@ -64,13 +64,19 @@ benchmarks-xquery-full.xml: benchmarks-all-full.xml
grep -v 'type="xslt"' $< > $@
contingency-size.dat: contingency-size.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./contingency-size.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > contingency-size.dat
./contingency-size.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > $@
chisquare-size: contingency-size.dat chisquare.R
./chisquare.R contingency-size.dat
contingency-axis-step.dat: contingency-axis-step.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./contingency-axis-step.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > contingency-axis-step.dat
./contingency-axis-step.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > $@
chisquare-axis-step: contingency-axis-step.dat chisquare.R
./chisquare.R contingency-axis-step.dat
coverage-size.tex: coverage-size.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./$< `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > $@
coverage-axis-step.tex: coverage-axis-step.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./$< `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > $@
#!/bin/bash
# compute coverage according to the presence of at least one axis step
# with rows = `accepted by at least one full fragment'
# using list of files provided on command-line
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
full="(@schema=\"${fragments[0]}\")"
for ((f = 1; f < ${#fragments[@]}; ++f))
do
full="$full or (@schema=\"${fragments[f]}\")"
done
# head
printf '\\begin{tabular}{lrr}\n'
printf '\\toprule\n'
printf '& $\\geq 1$ axis step & no axis step\\\\\n'
printf '\\midrule\n'
printf 'coverage '
# at least one axis step
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast//xqx:xpathAxis) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
total=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast//xqx:xpathAxis)])" $file`
total=$((count + total))
done
percent=`echo "scale=2; 100*$value/$total" | bc`
printf "& $percent\\%% "
# no axis step
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
total=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis)])" $file`
total=$((count + total))
done
percent=`echo "scale=2; 100*$value/$total" | bc`
printf "& $percent\\%%"
printf '\\\\\n'
printf '\\bottomrule\n'
printf '\\end{tabular}\n'
#!/bin/bash
# compute coverage table of benchmark results by size
# with rows = `accepted by at least one full fragment'
# and cols = `query size'
# using list of files provided on command-line
MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
step=4
cutoff=48
full="(@schema=\"${fragments[0]}\")"
for ((f = 1; f < ${#fragments[@]}; ++f))
do
full="$full or (@schema=\"${fragments[f]}\")"
done
# header
printf '\\begin{tabular}{l'
for ((i = 1; i < $cutoff; i+=$step))
do
printf 'r'
done
printf 'r}\n\\topline'
printf 'sizes '
for ((i = 1; i < $cutoff; i+=$step))
do
printf "& $i--$((i+step-1)) "
done
printf "& $\ge $i$"
printf '\\\\\n'
printf '\\medline\n'
# number of queries of each size
printf 'queries '
for ((i = 1; i < $cutoff; i+=$step))
do
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i and @size < ($i+$step)])])" $file`
value=$((count + value))
done
array[$i]=$value
printf "& ${array[i]} "
done
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i])])" $file`
value=$((count + value))
done
array[$i]=$value
printf "& $value"
printf '\\\\\n'
# first row: accepted
printf 'coverage '
for ((i = 1; i < $cutoff; i+=$step))
do
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i and @size < ($i+$step)]) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
percent=`echo "scale=2; 100*$value/${array[i]}" | bc`
printf "& $percent\\%% "
done
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i]) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
percent=`echo "scale=2; 100*$value/${array[i]}" | bc`
printf "& $percent\\%% "
printf '\\\\\n'
printf '\\bottomline\n'
printf '\\end{tabular}\n'
#!/bin/bash
# count the number of queries of each size
# argument: the size of blocks of queries, 1 by default
if [ "$#" -ne 1 ]
then
step=1
else
step=$1
fi
fragments=`grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
for ((i = 1; i < $MAX; ++i))
for ((i = 1; i < $MAX; i+=$step))
do
C=`grep "ast depth=.* size=\"$i\"" ../../benchmark/*-full.xml | wc -l`
C=0
for ((j = $i; j < $i+$step; ++j))
do
G=`grep "ast depth=.* size=\"$j\"" $fragments | wc -l`
C=$((C + G))
done
echo "$i $C"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment