Skip to content

Instantly share code, notes, and snippets.

@aterga
Created July 2, 2020 23:37
Show Gist options
  • Save aterga/d8d50a11e75d9f9f85aabf8f908fbaec to your computer and use it in GitHub Desktop.
Save aterga/d8d50a11e75d9f9f85aabf8f908fbaec to your computer and use it in GitHub Desktop.
# Simple commands for collecting basic SMT statistics
# Get file names
for f in $(for file in group_*/*.smt2; do ls $file | xargs -n 1 basename; done); do printf ",$f"; done > stat.csv
echo >> stat.csv
# Get the logic
for f in $(for file in group_*/*.smt2; do cat $file | grep -oP "(?<=\(set-logic )(.*)(?=\))"; done); do printf ",$f"; done >> stat.csv
echo >> stat.csv
# Get the origins
for file in group_*/*.smt2; do cat $file | grep -oP "(?<=\(set-info :source \|)(.*)(?=\|\))" | sed 's/,/;/g'; done | tr "\n" "," >> stat.csv
#for file in group_*/*.smt2; do cat $file | grep -oP "(?<=\(set-info :source \|)(.*)(?=\|\))"; done | tr '\n' ',' >> stat.csv
echo >> stat.csv
# Get the file size
for file in group_*/*.smt2; do stat --printf=",%s" $file; done >> stat.csv
echo >> stat.csv
# Cound the assertions
for f in $(for file in group_*/*.smt2; do cat $file | grep "(assert " | wc -l; done); do printf ",$f"; done >> stat.csvecho >> stat.csv
echo >> stat.csv
# Cound the quantifiers
for f in $(for file in group_*/*.smt2; do cat $file | grep "(forall " | wc -l; done); do printf ",$f"; done >> stat.csv
echo >> stat.csv
# Count the patterns
for f in $(for file in group_*/*.smt2; do cat $file | grep ":pattern " | wc -l; done); do printf ",$f"; done >> stat.csv
echo >> stat.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment