<commit_before>#!/bin/bash

# creduce ./scripts/privPrecCompare-creduce.sh ./pfscan_comb.c

set -e

gcc -c -Werror=implicit-function-declaration ./iowarrior.c

# OPTS="./pfscan_comb.c --enable custom_libc"
OPTS="./iowarrior.c --enable ana.sv-comp.functions"
# PRIVS=(global global-read global-history mine-W mine-lazy mine-global)
PRIVS=(global mine-W)
INTERESTING="mine-W: (Unknown int([0,64]))"
OUTDIR="privPrecCompare-creduce"
GOBLINTDIR="/home/simmo/dev/goblint/sv-comp/goblint"

mkdir -p $OUTDIR

for PRIV in "${PRIVS[@]}"; do
    echo $PRIV
    PRIVDUMP="$OUTDIR/$PRIV"
    rm -f $PRIVDUMP
    $GOBLINTDIR/goblint --sets exp.privatization $PRIV --sets exp.priv-prec-dump $PRIVDUMP $OPTS
done

PRIVDUMPS=("${PRIVS[*]/#/$OUTDIR/}") # why [*] here?
$GOBLINTDIR/_build/default/src/privPrecCompare.exe $PRIVDUMPS 2>&1 | tee "$OUTDIR/compare.txt"
<commit_msg>Add function definition check to privPrecCompare-creduce<commit_after>#!/bin/bash

# creduce ./scripts/privPrecCompare-creduce.sh ./pfscan_comb.c

set -e

gcc -c -Werror=implicit-function-declaration ./pfscan.c

# OPTS="./pfscan_comb.c --enable custom_libc"
OPTS="./pfscan.c --enable custom_libc"
# PRIVS=(global global-read global-history mine-W mine-lazy mine-global)
PRIVS=(global mine-W)
INTERESTING="(Unknown int([-31,31])) instead of (Not {0}([-31,31]))"
OUTDIR="privPrecCompare-creduce"
GOBLINTDIR="/home/simmo/dev/goblint/sv-comp/goblint"

mkdir -p $OUTDIR

for PRIV in "${PRIVS[@]}"; do
    echo $PRIV
    PRIVDUMP="$OUTDIR/$PRIV"
    LOG="$OUTDIR/$PRIV.log"
    rm -f $PRIVDUMP
    $GOBLINTDIR/goblint --sets exp.privatization $PRIV --sets exp.priv-prec-dump $PRIVDUMP $OPTS -v --enable dbg.debug &> $LOG
    grep -F "Function definition missing" $LOG && exit 1
done

PRIVDUMPS=("${PRIVS[*]/#/$OUTDIR/}") # why [*] here?
$GOBLINTDIR/_build/default/src/privPrecCompare.exe $PRIVDUMPS 2>&1 | tee "$OUTDIR/compare.txt"

{'fraction_non_alphanumeric': 0.176657824933687, 'fraction_numerical': 0.009018567639257295, 'mean_word_length': 4.357954545454546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5917800', 'n_tokens_mistral': 775, 'n_tokens_neox': 747, 'n_words': 141}