Skip to content

Instantly share code, notes, and snippets.

@lembergerth
lembergerth / verdict_to_yml.py
Last active July 10, 2020 16:13
Transform sv-benchmark ldv-multiproperty tasks to yml format
#!/usr/bin/env python3
import argparse
import os
import shutil
import sys
PROP_DIR = 'properties'
PREFIX = 'reach_error_linux_'
@lembergerth
lembergerth / gist:2c4e0dc4b224860565aafec4340919ce
Created November 7, 2019 08:15
Benchmark tasks removed from Test-Comp'20 due to duplicates in corresponding sets
# MemSafety-Arrays.set
array-memsafety/add_last-alloca-1.yml
array-memsafety/add_last_unsafe.yml
array-memsafety/array01-alloca-2.yml
array-memsafety/array02-alloca-2.yml
array-memsafety/array03-alloca-2.yml
array-memsafety/bubblesort-alloca-2.yml
array-memsafety/count_down-alloca-1.yml
array-memsafety/count_down_unsafe.yml
array-memsafety/cstrcat-alloca-2.yml
#!/bin/bash
# Requires `yq`.
# Execute from directory `sv-benchmarks/c`.
echo > candidates.txt
for i in $(grep -l "coverage-" **/*.yml); do
inp=$(yq --raw-output '.input_files' $i)
if egrep -q "=.*__VERIFIER_nondet_pointer" $(dirname $i)/$inp; then
echo "$i"
#!/usr/bin/env python3
## Usage: Run from directory `sv-benchmarks/c`.
## The script will scan all subdirectories for yml-Files and rename them if they contain any
## property or are duplicates.
import glob
import os
NAME_TO_PROP_AND_SUBPROP = {
@lembergerth
lembergerth / cross-check.sh
Last active January 12, 2021 10:27
Scripts for modifying coverage-properties of sv-benchmarks
#!/bin/bash
## Usage: Run from directory `sv-benchmarks/c`.
echo "Tasks that have a coverage-error-call property, but that are not in selection (may be empty if everything is ok):"
find . -iname '*.yml' | xargs grep -l coverage-error-call.prp | cut -d"/" -f 2- | grep -xvf candidates_error-coverage.txt
echo "Tasks that have a coverage-branches property, but that are not in selection (may be empty if everything is ok):"
find . -iname '*.yml' | xargs grep -l coverage-branches.prp | cut -d"/" -f 2- | grep -xvf candidates_coverage.txt
echo "Tasks that are in selection, but do not have a coverage-error-call property (may be empty if everything is ok):"
find . -iname '*.yml' | xargs grep -L coverage-error-call.prp | grep -f candidates_error-coverage.txt
#!/usr/bin/env python3
import glob
import os
import re
CHANGE_FILE_NAME = True
"""Whether to shorten file names by removing the verdicts, if possible without collisions."""
INCLUDE_PROPERTY_AS_REQUIRED_FILE = False
"""Whether to include property files as required files in task definition."""