diff --git a/ACSL-by-Example.pdf b/ACSL-by-Example.pdf index d55fe3f..e87a82d 100644 Binary files a/ACSL-by-Example.pdf and b/ACSL-by-Example.pdf differ diff --git a/README.md b/README.md index 32f32ad..7472da4 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,15 @@ The directory contains the complete C source code including ACSL annotations of the examples. This version of *ACSL by Example* is intended for -Frama-C 19.0 and relies among others on the following sofware packages. +Frama-C 19.1 and relies among others on the following sofware packages. *Package* | *Version* --------- | --------- Why3 | 1.2.0 - Alt-Ergo | 2.0.0 + Alt-Ergo | 2.3.0 CVC4 | 1.6 CVC3 | 2.4.1 - Z3 | 4.8.4 + Z3 | 4.8.6 E Prover | 2.3 Coq | 8.9.1 diff --git a/StandardAlgorithms/.gitignore b/StandardAlgorithms/.gitignore index 8ab1634..2c954d6 100644 --- a/StandardAlgorithms/.gitignore +++ b/StandardAlgorithms/.gitignore @@ -1,4 +1,15 @@ + *_test *.tex coq/driver astraver.why3.conf + +*.simple.c +*.simple.h + +*.separated.c +*.separated.h + +*.union.c +*.union.h + diff --git a/StandardAlgorithms/All/Makefile b/StandardAlgorithms/All/Makefile deleted file mode 100644 index 42bfdb4..0000000 --- a/StandardAlgorithms/All/Makefile +++ /dev/null @@ -1,274 +0,0 @@ - -MAKEFLAGS += --silent --no-print-directory - -SHELL=/bin/bash -#Variables for counting invalid and valid proof goals; used in make-report targets - -export TOP_DIR=.. -export SCRIPT_DIR=$(TOP_DIR)/Scripts -export DRIVER_DIR=$(TOP_DIR)/drivers - -NONMUTATING = $(TOP_DIR)/nonmutating -NONMUTATING_EXAMPLES = find2 find_first_of adjacent_find mismatch equal -#search search_n find_end count find -NONMUTATING_DIRS = $(addprefix $(NONMUTATING)/, $(NONMUTATING_EXAMPLES)) - -#MAXMIN = $(TOP_DIR)/maxmin -#MAXMIN_EXAMPLES = operators max_element2 min_element max_seq -# max_element -#MAXMIN_DIRS = $(addprefix $(MAXMIN)/, $(MAXMIN_EXAMPLES)) - -#BINARYSEARCH=$(TOP_DIR)/binarysearch -#BINARYSEARCH_EXAMPLES = lower_bound upper_bound equal_range binary_search -#equal_range2 binary_search2 -#BINARYSEARCH_DIRS = $(addprefix $(BINARYSEARCH)/, $(BINARYSEARCH_EXAMPLES)) - -#MUTATING = $(TOP_DIR)/mutating -#MUTATING_EXAMPLES = fill swap swap_ranges copy replace_copy copy_backward reverse_copy reverse replace rotate_copy rotate remove remove_copy random_shuffle -#remove_copy2 -#MUTATING_DIRS = $(addprefix $(MUTATING)/, $(MUTATING_EXAMPLES)) - -#NUMERIC = $(TOP_DIR)/numeric -#NUMERIC_EXAMPLES = iota accumulate inner_product partial_sum adjacent_difference partial_sum_inv adjacent_difference_inv -#NUMERIC_DIRS = $(addprefix $(NUMERIC)/, $(NUMERIC_EXAMPLES)) - -#HEAP = $(TOP_DIR)/heap -#HEAP_EXAMPLES = is_heap push_heap make_heap sort_heap -#HEAP_DIRS = $(addprefix $(HEAP)/, $(HEAP_EXAMPLES)) - -#CLASSIC_SORTING = $(TOP_DIR)/classic-sorting -#CLASSIC_SORTING_EXAMPLES = selection_sort insertion_sort heap_sort -#CLASSIC_SORTING_DIRS = $(addprefix $(CLASSIC_SORTING)/, $(CLASSIC_SORTING_EXAMPLES)) - -#STACK = $(TOP_DIR)/stack -#STACK_EXAMPLES = stack_init stack_equal stack_size stack_empty stack_full stack_top stack_push stack_pop -#STACK_DIRS = $(addprefix $(STACK)/, $(STACK_EXAMPLES)) - -#STACK_WD = $(TOP_DIR)/stack_wd -#STACK_WD_EXAMPLES = stack_size_wd stack_empty_wd stack_top_wd stack_push_wd stack_pop_wd -#STACK_WD_DIRS = $(addprefix $(STACK_WD)/, $(STACK_WD_EXAMPLES)) - -#STACK_AXIOM = $(TOP_DIR)/stack_axiom -#STACK_AXIOM_EXAMPLES = axiom_size_of_init axiom_top_of_push axiom_size_of_push axiom_size_of_pop axiom_push_of_pop_top axiom_pop_of_push -#STACK_AXIOM_DIRS = $(addprefix $(STACK_AXIOM)/, $(STACK_AXIOM_EXAMPLES)) - -VPATH = $(TOP_DIR) -VPATH += $(TOP_DIR)/Logic -VPATH += $(NONMUTATING_DIRS) -VPATH += $(MAXMIN_DIRS) -VPATH += $(BINARYSEARCH_DIRS) -VPATH += $(MUTATING_DIRS) -VPATH += $(NUMERIC_DIRS) -VPATH += $(HEAP_DIRS) -VPATH += $(CLASSIC_SORTING_DIRS) -VPATH += $(STACK_DIRS) -VPATH += $(STACK_WD_DIRS) -VPATH += $(STACK_AXIOM_DIRS) - -EXAMPLES = $(NONMUTATING_EXAMPLES) -EXAMPLES += $(MAXMIN_EXAMPLES) -EXAMPLES += $(BINARYSEARCH_EXAMPLES) -EXAMPLES += $(MUTATING_EXAMPLES) -EXAMPLES += $(NUMERIC_EXAMPLES) -EXAMPLES += $(HEAP_EXAMPLES) -EXAMPLES += $(CLASSIC_SORTING_EXAMPLES) -EXAMPLES += $(STACK_EXAMPLES) -EXAMPLES += $(STACK_WD_EXAMPLES) -EXAMPLES += $(STACK_AXIOM_EXAMPLES) - -SRC=$(addsuffix .c, $(EXAMPLES)) - -list: $(SRC) - @echo $(SRC) - @echo $(VPATH) - @ls $^ - -CPPFLAGS += $(addprefix -I, $(VPATH)) - -#setup some basic flags -INCLUDES = $(CPPFLAGS) - -# PREPROCESSOR - -SHARED_FLAGS=-Wall -pedantic -Werror -CFLAGS=-x c++ -std=c++14 $(SHARED_FLAGS) -CXXFLAGS=-std=c++14 $(SHARED_FLAGS) - -#setup wp -export WP_TIMEOUT ?= 10 -export WP_COQ_TIMEOUT ?= 10 -export WP_ALT_ERGO_STEPS ?= 10000 -export WP_PROCESSES ?= 1 - -# flags for when we invoke Frama C directly instead of going -# through script_functions.sh -WP_TIME_FLAGS= \ - -wp-timeout $(WP_TIMEOUT) \ - -wp-coq-timeout $(WP_COQ_TIMEOUT) \ - -wp-steps $(WP_ALT_ERGO_STEPS) \ - -wp-par $(WP_PROCESSES) - -#setup coq -SCRIPT?='$(TOP_DIR)/wp0.script' # default script -DRIVER=$(DRIVER_DIR)/driver - -# having this as a separate variable allows us to override it in -# algorithm makefiles -WP_RTE_FLAGS ?= -warn-unsigned-overflow -warn-unsigned-downcast - -# We differentiate between two types of WP options: -# 1) in WP_FLAGS we collect the general options -# 2) in WP_PROVER_FLAGS we collect the ones where we select the provers -# This allows us, for example, to start the gui very quickly and then -# run the prover(s) on select proof obligtions. - -WP_BASE_FLAGS += -pp-annot -WP_BASE_FLAGS += -no-unicode -WP_BASE_FLAGS += -wp -WP_BASE_FLAGS += -wp-rte $(WP_RTE_FLAGS) -#WP_BASE_FLAGS += -wp-split - -WP_FLAGS = $(WP_BASE_FLAGS) - -WP_FLAGS += -wp-driver $(DRIVER_DIR)/external.driver -WP_FLAGS += -wp-script $(SCRIPT) -WP_FLAGS += -wp-model Typed+ref - -#WP_PROVER_FLAGS += -wp-steps $(WP_ALT_ERGO_STEPS) - -# provers -WP_PROVER_FLAGS += -wp-prover alt-ergo -WP_PROVER_FLAGS += -wp-prover cvc4-15 -WP_PROVER_FLAGS += -wp-prover cvc3 -WP_PROVER_FLAGS += -wp-prover z3 -WP_PROVER_FLAGS += -wp-prover eprover -#WP_PROVER_FLAGS += -wp-prover coq - - -#WP_PROVER_FLAGS += -wp-prover gappa -#WP_PROVER_FLAGS += -wp-prover metis - -# link binary metit to metitarski -#WP_PROVER_FLAGS += -wp-prover metitarski - -#WP_PROVER_FLAGS += -wp-prover princess -#WP_PROVER_FLAGS += -wp-prover psyche - -# onnly ppc binary for available for macOS ... -#WP_PROVER_FLAGS += -wp-prover simplify -#WP_PROVER_FLAGS += -wp-prover spass -#WP_PROVER_FLAGS += -wp-prover verit - -# yices (version 2.* does not support quantifiers ...) -#WP_PROVER_FLAGS += -wp-prover Yices - -export WP=frama-c -export WPGUI=frama-c-gui -export WP_PROVER_FLAGS -export WP_C_FLAGS = -cpp-extra-args="$(INCLUDES)" $(WP_FLAGS) -export WP_CXX_FLAGS = -cxx-clang-command="framaCIRGen $(INCLUDES)" $(WP_FLAGS) -export WP_C_REPORT=$(WP) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par 1 - -TESTOBJ = $(FILE)_test.o $(FILE).o - - -$(DRIVER): FORCE - @(cd $(DRIVER_DIR) && $(MAKE) compile) - -foo: $(DRIVER) - - -$(FILE)_test: $(TESTOBJ) FORCE - @$(CXX) $(LDFLAGS) -o $@ $(TESTOBJ) - -test: $(FILE)_test FORCE - @./$(FILE)_test - -%.cpp:%.c - cp $< $@ - -abs.why3:abs.c FORCE - @($(WP) $(WP_C_FLAGS) $(WP_TIME_FLAGS) -wp-prover why3 -wp-gen -wp-out $(patsubst %.c,%.wp, $<) $<) - -%.why3:%.c driver FORCE - @($(WP) $(WP_C_FLAGS) $(WP_TIME_FLAGS) -wp-prover why3 -wp-gen -wp-out $(patsubst %.c,%.wp, $<) $<) - -%.wp_runner:%.c FORCE - @${SCRIPT_DIR}/wp_runner.sh $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par $(WP_PROCESSES) - -%.wpscript:%.c FORCE - @${SCRIPT_DIR}/wpscript.sh $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) - -%.vs:%.c FORCE - @${SCRIPT_DIR}/vs.sh $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) - -%.wp:%.c FORCE - @$(WP) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.c,%.wp, $<) $< - -%.wpgui:%.c FORCE - @$(WPGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.c,%.wp, $<) $< - -# start WP GUI and run provers - -examples.wpgui: $(SRC) - @$(WPGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out all.wp $^ - -examples.wp: $(SRC) - @$(RM) -rf all.wp - @$(WP) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out all.wp $^ - -examples.why: $(SRC) - @$(RM) -rf all.wp - @$(WP) $(WP_C_FLAGS) -wp-out all.wp -wp-prover why3 -wp-gen $^ - -all.clean: $(FORCE) - $(RM) -rf all.wp - -all.wp: $(FORCE) examples.wp - -all.why: $(FORCE) examples.why - - -$(TOP_DIR)/Results/$(FILE).report: $(FILE).c - . ${SCRIPT_DIR}/script_functions.sh; extract_data_Wp $(basename $<) $(CMD) $(SEC) >$@ - -$(TOP_DIR)/Results/$(FILE).preport: $(FILE).c - @. ${SCRIPT_DIR}/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(basename $<) $(CMD) $(SEC) >$@ - -%.report-wp: $(TOP_DIR)/Results/$(FILE).report - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -report: $(TOP_DIR)/Results/$(FILE).report - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -preport: $(TOP_DIR)/Results/$(FILE).preport - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -%.check:%.c - @$(WP) $(WP_C_FLAGS) -wp-check -wp-out $(patsubst %.c,%.wp, $<) $< - - -# cleanup - -clean:: FORCE - @(cd $(DRIVER_DIR) && $(MAKE) -s clean) - @$(RM) *.o - @$(RM) *.back - @$(RM) *.orig - @$(RM) *.exe - @$(RM) .lia.cache - @$(RM) -rf *.debug - @$(RM) -rf .frama-c - @$(RM) -rf *.jessie - @$(RM) -rf *.wp - @$(RM) -rf *.wp++ - @$(RM) -rf *.ml - @$(RM) $(FILE).cpp - @$(RM) $(FILE)_test - @$(RM) $(FILE).tex - @$(RM) $(FILE).sav - - -all: clean test report - -FORCE: diff --git a/StandardAlgorithms/All/ZeroC/Client.cpp b/StandardAlgorithms/All/ZeroC/Client.cpp deleted file mode 100644 index 0e7f3ad..0000000 --- a/StandardAlgorithms/All/ZeroC/Client.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include -#include -#include - -using namespace Demo; - -int -main(int argc, char* argv[]) -{ - try { - Ice::CommunicatorHolder ich(argc, argv); - auto base = ich->stringToProxy("SimplePrinter:default -p 10000"); - auto printer = Ice::checkedCast(base); - if (!printer) { - throw std::runtime_error("Invalid proxy"); - } - - printer->printString("Hello World!"); - } - catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - return 1; - } - return 0; -} - diff --git a/StandardAlgorithms/All/ZeroC/Makefile b/StandardAlgorithms/All/ZeroC/Makefile deleted file mode 100644 index c4016c5..0000000 --- a/StandardAlgorithms/All/ZeroC/Makefile +++ /dev/null @@ -1,47 +0,0 @@ - -CXX=c++ -CPPFLAGS= -I. -DICE_CPP11_MAPPING -CXXFLAGS= --std=c++14 - -all: Printer.cpp client server - -Printer.cpp: Printer.ice - slice2cpp $< - -Printer_ice.py: Printer.ice - slice2py $< - - -Printer.o: Printer.cpp - -client: Client.o Printer.o - $(CXX) -o $@ $^ -lIce++11 - -server: Server.o Printer.o - $(CXX) -o $@ $^ -lIce++11 - -clean: - @$(RM) *.orig - @$(RM) *.o - @$(RM) Printer.cpp - @$(RM) Printer.h - @$(RM) client - @$(RM) server - -ASTYLEOPTIONS += -A3 -ASTYLEOPTIONS += --indent=spaces=4 -ASTYLEOPTIONS += --indent-col1-comments -ASTYLEOPTIONS += --min-conditional-indent=0 -ASTYLEOPTIONS += --lineend=linux -ASTYLEOPTIONS += --break-closing-braces -ASTYLEOPTIONS += --add-braces -ASTYLEOPTIONS += --pad-oper -ASTYLEOPTIONS += --pad-header - -format: FORCE - @astyle $(ASTYLEOPTIONS) *.cpp - - - -FORCE: - diff --git a/StandardAlgorithms/All/ZeroC/Printer.ice b/StandardAlgorithms/All/ZeroC/Printer.ice deleted file mode 100644 index ce20a52..0000000 --- a/StandardAlgorithms/All/ZeroC/Printer.ice +++ /dev/null @@ -1,9 +0,0 @@ - -module Demo -{ - interface Printer - { - void printString(string s); - } -} - diff --git a/StandardAlgorithms/All/ZeroC/Server.cpp b/StandardAlgorithms/All/ZeroC/Server.cpp deleted file mode 100644 index aa36fa9..0000000 --- a/StandardAlgorithms/All/ZeroC/Server.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -using namespace Demo; - -class PrinterI : public Printer -{ -public: - virtual void printString(std::string s, const Ice::Current&) override - { - std::cout << s << std::endl; - } -}; - - -int -main(int argc, char* argv[]) -{ - try { - Ice::CommunicatorHolder ich(argc, argv); - auto adapter = ich->createObjectAdapterWithEndpoints("SimplePrinterAdapter", "default -p 10000"); - auto servant = std::make_shared(); - adapter->add(servant, Ice::stringToIdentity("SimplePrinter")); - adapter->activate(); - ich->waitForShutdown(); - } - catch (const std::exception& e) { - std::cerr << e.what() << std::endl; - return 1; - } - return 0; -} - diff --git a/StandardAlgorithms/All/abs.c b/StandardAlgorithms/All/abs.c deleted file mode 100644 index dcc35a8..0000000 --- a/StandardAlgorithms/All/abs.c +++ /dev/null @@ -1,10 +0,0 @@ - -// frama-c -wp -wp-rte -wp-prover why3 -wp-gen -wp-out abs.wp abs.c - -#include "abs.h" - -int abs(int x) -{ - return (x >= 0) ? x : -x; -} - diff --git a/StandardAlgorithms/All/abs.h b/StandardAlgorithms/All/abs.h deleted file mode 100644 index 4fd6889..0000000 --- a/StandardAlgorithms/All/abs.h +++ /dev/null @@ -1,14 +0,0 @@ - -#include "limits.h" - -/*@ - //requires x > INT_MIN; - - assigns \nothing; - - ensures x >= 0 ==> \result == x; - ensures x < 0 ==> \result == -x; -*/ -int abs(int x); - - diff --git a/StandardAlgorithms/All/foo.sh b/StandardAlgorithms/All/foo.sh deleted file mode 100644 index e4db6f8..0000000 --- a/StandardAlgorithms/All/foo.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -cd Tmp -pwd -rm -rf all.wp - diff --git a/StandardAlgorithms/All/server.sh b/StandardAlgorithms/All/server.sh deleted file mode 100755 index 6b7254a..0000000 --- a/StandardAlgorithms/All/server.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash - -set -e - -# For each verification condition, generate task strings that can be -# passed to xargs for parallel execution. -generate_tasks() { - #echo $wpdir - # there may not be any why file in $wpdir/typed_ref_external, so enable - # nullglob and pass /dev/null so grep doesn't consider stdin if - # no file matches. - shopt -s nullglob - for whyfile in $wpdir/typed_ref_external/*.why - do - sed -n \ - -e 's/^theory \(VC.*\)$/\1/p' \ - -e 's/^lemma \(Q_.*\):$/\1/p' \ - $whyfile | while read -r theory - do - for prover in $provers - do - # Qed is invoked directly by WP, not by us - [ $prover = Qed ] && continue - echo $whyfile:$theory:$prover - done - done - done -} - - -# This function takes a why file, and a verification conditon in this -# why file and validates it. -do_proof() { - wpdir=$1 - IFS=: read -r whyfile vc prover - goalopt= - - case $vc in - VC*) - theory=$vc - theoryname=typed_ref_external_${theory#VC} - ;; - Q_*) - theory=${whyfile##*/} - theory=${theory%.why} - theoryname=typed_ref_external_lemma_${vc#Q_} - goalopt="-G $vc" - ;; - *) - echo Unrecognized verification condition $vc >&2 - exit 1 - esac - - outname=$wpdir/typed_ref_external/${theoryname}_Why3_$prover - set +e - ( - case $prover in - coq) call_coqc $why ;; - *) call_why3 $whyfile ;; - esac - ) 3>&1 >$outname.out 2>$outname.err - status=$? - set -e - - if [ $status -ne 0 ] - then - result="Error $status" - elif [ -s $outname.out ] - then - result="$(sed -n -e "s/ WP / /" \ - -e "s/^.* [[:alnum:]_]* : \\([[:alnum:]]*\\) .*$/\\1/p" $outname.out)" - else - result=Unknown - fi - - # TODO: Extract success/failure information - printf "[wprunner] [%s] Goal %s : %s\n" "$prover" "$theoryname" "$result" -} - - -# invoke why3 with $* as its arguments. If ULIMIT_TIMEOUT is set, -# the prover's timeout will be set by configuring an appropriate ulimit -# otherwise by passing an appropriate -t option. - -call_why3() { - trap "exit $timeout_status" XCPU - - - if [ ${ULIMIT_TIMEOUT:-0} != 0 ] && [ ${WP_TIMEOUT:-0} -gt 0 ] - then - ulimit -S -t $WP_TIMEOUT - WP_TIMEOUT=0 - fi - - # fix later - WP_TIMEOUT=10 - - why3 prove "$@" \ - -t $WP_TIMEOUT \ - --extra-config $FRAMAC_SHARE/wp/why3/why3.conf \ - -L $wpdir/typed_ref_external \ - -L $FRAMAC_SHARE/wp/why3/ \ - -T $theory \ - -P $prover \ - $goalopt -} - - -# read the logfile $log, compute the number of proved goals and generate -# a report line showing how many goals have been proven. -proved_goals() { - # first count how many goals we found - goals=`sed -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : .*$/\1/p' $log | sort -u | wc -l` - - # next, extract goal names and count how many were found to be valid - valid=`sed -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : Valid$/\1/p' $log | sort -u | wc -l` - - printf '[wprunner] Proved goals: %3d /%3d\n' $valid $goals -} - -# compute how many proof obligations prover $1 managed to verify and -# print a line for the statistics -goals_by_prover() { - prover=$1 - - set +e - count=`grep -c -E '^\[wp(runner)?] \['$prover'] .* : Valid$' $log` - set -e - - printf " %-15s%3d\n" $prover: $count -} - - -# this script generates the same .wp directory frama-c -wp-proof-trace -# would generate. The first argument to this script is the source file -# to verify, the remaining arguments are passed to frama-c. -# -# a first argument of -r (for recursive) indicates that we are being -# called recursively to prove a single task. See do_proof for details. -# -# If the script runs with -r, the arguments have the following meaning: -# $1: -r -# $2: wpdir -# $3: $whyfile:$theory:$prover - -if [ $1 = '-r' ] -then - # if there are no proof obligations, do_proof will be called - # once without a proof obligation. Catch that case. - [ $# -lt 3 ] && exit - - echo "$3" | do_proof $2 - exit -fi - - -wpdir=all.wp -provers="Qed alt-ergo cvc4 cvc3 z3 eprover" -log=$wpdir/wp_runner.log - -WP_TIMEOUT=10 - -if [ -z "$NPROC" ] -then - if [ -z "$WP_PROCESSES" ] - then - case `uname -s` in - Linux) NPROC=`nproc`;; - Darwin|FreeBSD) NPROC=`sysctl -n hw.ncpu`;; - *) NPROC=1;; - esac - else - NPROC=$WP_PROCESSES - fi -fi - -#echo $NPROC >&2 - -#??? -generate_tasks | xargs -P $NPROC -n 1 -- $0 -r $wpdir | tee -a $log - - -# print statistics -proved_goals -for prover in $provers -do - goals_by_prover $prover -done - diff --git a/StandardAlgorithms/All/some-results.txt b/StandardAlgorithms/All/some-results.txt deleted file mode 100644 index 634ea40..0000000 --- a/StandardAlgorithms/All/some-results.txt +++ /dev/null @@ -1,68 +0,0 @@ -# 1 processes macOS - -[wp] 1307 goals scheduled -[wp] Proved goals: 1307 / 1307 - Qed: 562 (0.23ms-10ms-314ms) - Alt-Ergo: 663 (8ms-272ms-9.2s) (7401) (interrupted: 76) (unknown: 6) - Coq: 5 - cvc3: 5 (4.7s-6.4s-9.6s) (interrupted: 41) (unknown: 3) - cvc4-15: 33 (200ms-1.7s-8.1s) (interrupted: 49) - eprover: 34 (90ms-105ms-130ms) (interrupted: 5) - z3: 5 (270ms-560ms-920ms) (interrupted: 39) - -real 45m25.120s -user 18m29.913s -sys 0m29.812s - -============================================ - -# 4 processes macOS - -[wp] 1307 goals scheduled -[wp] Proved goals: 1307 / 1307 - Qed: 562 (0.15ms-11ms-325ms) - Alt-Ergo: 624 (9ms-110ms-5s) (3739) (interrupted: 43) (unknown: 3) - Coq: 5 - cvc3: 14 (130ms-1.8s-5.5s) (interrupted: 37) - cvc4-15: 54 (190ms-954ms-4.9s) (interrupted: 41) - eprover: 39 (100ms-119ms-150ms) - z3: 16 (110ms-811ms-3.6s) (interrupted: 37) - -real 17m4.317s -user 14m13.604s -sys 1m12.297s - - -============================================ - -# 4 processes Linux - - Qed: 562 (4ms-14ms-312ms) - Alt-Ergo: 611 (4ms-62ms-1s) (985) (interrupted: 85) (unknown: 6) - Coq: 5 - cvc3: 23 (50ms-526ms-3.1s) (interrupted: 5) - cvc4-15: 46 (120ms-439ms-1.7s) (interrupted: 6) - eprover: 62 (80ms-110ms-220ms) - z3: 9 (80ms-522ms-1.4s) (interrupted: 5) - -real 9m27.929s -user 10m11.304s -sys 0m46.340s - - -============================================ - -# 16 processes Linux - -[wp] Proved goals: 1307 / 1307 - Qed: 562 (4ms-21ms-588ms) - Alt-Ergo: 596 (12ms-89ms-856ms) (918) (interrupted: 10) (unknown: 3) - Coq: 5 (unknown: 22) - cvc3: 33 (70ms-232ms-750ms) (failed: 8) - cvc4-15: 29 (130ms-299ms-900ms) (failed: 10) - eprover: 146 (80ms-171ms-240ms) (failed: 4) - z3: 16 (50ms-199ms-760ms) (failed: 7) - -real 4m29.552s -user 16m34.292s -sys 1m48.712s diff --git a/StandardAlgorithms/All/transfer.txt b/StandardAlgorithms/All/transfer.txt deleted file mode 100644 index e85bade..0000000 --- a/StandardAlgorithms/All/transfer.txt +++ /dev/null @@ -1,9 +0,0 @@ - -# copy recursivly -scp -r all.wp jens@192.168.2.108:Tmp - -rsync -r -e ssh all.wp jens@192.168.2.108:Tmp - -# execute script 'local' script 'foo.sh' on remote machine -ssh jens@192.168.2.108 'bash -s' < foo.sh - diff --git a/StandardAlgorithms/Logic/ConstantRange.spec b/StandardAlgorithms/Logic/ConstantRange.spec index 6904b35..2b3c3bf 100644 --- a/StandardAlgorithms/Logic/ConstantRange.spec +++ b/StandardAlgorithms/Logic/ConstantRange.spec @@ -6,12 +6,12 @@ /*@ predicate - ConstantRange(value_type* a, integer first, integer last, value_type v) = - \forall integer i; first <= i < last ==> a[i] == v; + ConstantRange(value_type* a, integer m, integer n, value_type v) = + \forall integer i; m <= i < n ==> a[i] == v; predicate - ConstantRange(value_type* a, integer first, integer last) = - ConstantRange(a, first, last, a[first]); + ConstantRange(value_type* a, integer m, integer n) = + ConstantRange(a, m, n, a[m]); predicate ConstantRange(value_type* a, integer n, value_type v) = diff --git a/StandardAlgorithms/Logic/HasConstantSubRange.spec b/StandardAlgorithms/Logic/HasConstantSubRange.spec index 296f7de..db32331 100644 --- a/StandardAlgorithms/Logic/HasConstantSubRange.spec +++ b/StandardAlgorithms/Logic/HasConstantSubRange.spec @@ -6,14 +6,17 @@ /*@ predicate - HasConstantSubRange{A}(value_type* a, integer m, integer n, value_type b) = - \exists integer i; 0 <= i <= m-n && ConstantRange(a, i, i+n, b); + HasConstantSubRange{L}(value_type* a, integer m, integer n, value_type v, integer p) = + \exists integer k; m <= k <= n-p && ConstantRange(a, k, k+p, v); + predicate + HasConstantSubRange{L}(value_type* a, integer n, value_type v, integer p) = + HasConstantSubRange(a, 0, n, v, p); lemma HasConstantSubRangeSizes: - \forall value_type *a, v, integer m, n; - HasConstantSubRange(a, m, n, v) ==> n <= m; + \forall value_type *a, v, integer n, p; + HasConstantSubRange(a, n, v, p) ==> p <= n; */ #endif /* HASCONSTANTSUBRANGE_SPEC_INCLUDED */ diff --git a/StandardAlgorithms/Logic/HasSubRange.spec b/StandardAlgorithms/Logic/HasSubRange.spec index f54806e..b97da62 100644 --- a/StandardAlgorithms/Logic/HasSubRange.spec +++ b/StandardAlgorithms/Logic/HasSubRange.spec @@ -6,17 +6,17 @@ /*@ predicate - HasSubRange{A}(value_type* a, integer f, integer l, value_type* b, integer n) = - \exists integer k; (f <= k <= l-n) && EqualRanges{A,A}(a+k, n, b); + HasSubRange{L}(value_type* a, integer m, integer n, value_type* b, integer p) = + \exists integer k; (m <= k <= n-p) && EqualRanges{L,L}(a+k, p, b); predicate - HasSubRange{A}(value_type* a, integer m, value_type* b, integer n) = - HasSubRange{A}(a, 0, m, b, n); + HasSubRange{L}(value_type* a, integer n, value_type* b, integer p) = + HasSubRange{L}(a, 0, n, b, p); lemma HasSubRangeSizes: - \forall value_type *a, *b, integer f, t, n; - HasSubRange(a, f, t, b, n) ==> n <= t-f; + \forall value_type *a, *b, integer m, n, p; + HasSubRange(a, m, n, b, p) ==> p <= n-m; */ #endif /* HASSUBRANGE_SPEC_INCLUDED */ diff --git a/StandardAlgorithms/Logic/HeapMaximumChild.spec b/StandardAlgorithms/Logic/HeapChildMax.spec similarity index 68% rename from StandardAlgorithms/Logic/HeapMaximumChild.spec rename to StandardAlgorithms/Logic/HeapChildMax.spec index d1fd2fe..967a84a 100644 --- a/StandardAlgorithms/Logic/HeapMaximumChild.spec +++ b/StandardAlgorithms/Logic/HeapChildMax.spec @@ -1,13 +1,13 @@ -#ifndef HEAPMAXIMUMCHILD_SPEC_INCLUDED -#define HEAPMAXIMUMCHILD_SPEC_INCLUDED +#ifndef HEAPCHILDMAX_SPEC_INCLUDED +#define HEAPCHILDMAX_SPEC_INCLUDED #include "Heap.spec" #include "limits.h" /*@ predicate - HeapMaximumChild{L}(value_type* a, integer n, + HeapChildMax{L}(value_type* a, integer n, integer p, integer c) = 0 <= p < n-1 && (p < (SIZE_TYPE_MAX-1)/2 ==> p == HeapParent(c)) && @@ -15,5 +15,5 @@ (HeapRight(p) < n-1 ==> a[HeapRight(p)] <= a[c]); */ -#endif /* HEAPMAXIMUMCHILD_SPEC_INCLUDED */ +#endif /* HEAPCHILDMAX_SPEC_INCLUDED */ diff --git a/StandardAlgorithms/Logic/MultisetAddDistinct.spec b/StandardAlgorithms/Logic/MultisetAddDistinct.spec index 6ac641d..062cb43 100644 --- a/StandardAlgorithms/Logic/MultisetAddDistinct.spec +++ b/StandardAlgorithms/Logic/MultisetAddDistinct.spec @@ -2,6 +2,7 @@ #ifndef MULTISETADDDISTINCT_SPEC_INCLUDED #define MULTISETADDDISTINCT_SPEC_INCLUDED +#include "MultisetUnchanged.spec" #include "MultisetAdd.spec" /*@ diff --git a/StandardAlgorithms/Logic/PopHeapUpdate.spec b/StandardAlgorithms/Logic/PopHeapUpdate.spec index 83ba240..7a60841 100644 --- a/StandardAlgorithms/Logic/PopHeapUpdate.spec +++ b/StandardAlgorithms/Logic/PopHeapUpdate.spec @@ -2,7 +2,7 @@ #ifndef POPHEAPUPDATE_SPEC_INCLUDED #define POPHEAPUPDATE_SPEC_INCLUDED -#include "HeapMaximumChild.spec" +#include "HeapChildMax.spec" #include "Unchanged.spec" #include "IsHeap.spec" @@ -12,7 +12,7 @@ \forall value_type* a, integer p, c, n; IsHeap{K}(a, n) ==> 0 < p < c < n-1 ==> - HeapMaximumChild{K}(a, n, p, c) ==> + HeapChildMax{K}(a, n, p, c) ==> \at(a[p] == a[c],L) ==> Unchanged{K,L}(a, 0, p) ==> Unchanged{K,L}(a, p+1, n) ==> diff --git a/StandardAlgorithms/Logic/RandomNumberModulo.spec b/StandardAlgorithms/Logic/RandomNumberModulo.spec new file mode 100644 index 0000000..b0c6785 --- /dev/null +++ b/StandardAlgorithms/Logic/RandomNumberModulo.spec @@ -0,0 +1,12 @@ + +#ifndef RANDOMNUMBERMODULO_SPEC_INCLUDED +#define RANDOMNUMBERMODULO_SPEC_INCLUDED + +/*@ + lemma + RandomNumberModulo: + \forall unsigned long long a; + (a % (1ull << 48)) < (1ull << 48); +*/ + +#endif /* RANDOMNUMBERMODULO_SPEC_INCLUDED */ diff --git a/StandardAlgorithms/Logic/Remove.spec b/StandardAlgorithms/Logic/Remove.spec index b0fa6ea..8ca01ac 100644 --- a/StandardAlgorithms/Logic/Remove.spec +++ b/StandardAlgorithms/Logic/Remove.spec @@ -6,14 +6,10 @@ /*@ predicate - Remove{A,B}(value_type* a, integer m, integer n, + Remove{A,B}(value_type* a, integer n, value_type* b, value_type v) = - \forall integer k; m <= k < RemoveSize{A}(a, m, n, v) ==> - \at(b[k],B) == \at(a[RemovePartition(a, m, n, v, k)],A); - - predicate - Remove{A,B}(value_type* a, integer n, value_type* b, value_type v) = - Remove{A,B}(a, 0, n, b, v); + \forall integer k; 0 <= k < RemoveSize{A}(a, n, v) ==> + \at(b[k],B) == \at(a[RemovePartition(a, n, v, k)],A); predicate Remove{A,B}(value_type* a, integer n, value_type v) = diff --git a/StandardAlgorithms/Logic/RemovePartition.spec b/StandardAlgorithms/Logic/RemovePartition.spec index b03ea41..7801e72 100644 --- a/StandardAlgorithms/Logic/RemovePartition.spec +++ b/StandardAlgorithms/Logic/RemovePartition.spec @@ -10,57 +10,50 @@ axiomatic RemovePartitionAxiomatic { logic integer - RemovePartition(value_type* a, integer m, integer n, - value_type v, integer p) reads a[m..n-1]; + RemovePartition(value_type* a, integer n, + value_type v, integer p) reads a[0..n-1]; axiom RemovePartitionEmpty: - \forall value_type *a, v, integer m, n, p; - n <= m ==> RemovePartition(a, m, n, v, p) == m; + \forall value_type *a, v, integer n, p; + n <= 0 ==> RemovePartition(a, n, v, p) == 0; axiom RemovePartitionLeft: - \forall value_type *a, v, integer m, n, p; - p < m < n ==> RemovePartition(a, m, n, v, p) == m; + \forall value_type *a, v, integer n, p; + p < 0 < n ==> RemovePartition(a, n, v, p) == 0; axiom RemovePartitionRight: - \forall value_type *a, v, integer m, n, p; - m < n ==> RemoveSize(a, m, n, v) <= p ==> - RemovePartition(a, m, n, v, p) == n; + \forall value_type *a, v, integer n, p; + 0 < n ==> RemoveSize(a, n, v) <= p ==> RemovePartition(a, n, v, p) == n; axiom RemovePartitionMonotone: - \forall value_type *a, v, integer m, n, p, q; - m <= p < q <= RemoveSize(a, m, n, v) ==> - m <= RemovePartition(a, m, n, v, p) < RemovePartition(a, m, n, v, q) < n; + \forall value_type *a, v, integer n, p, q; + 0 <= p < q <= RemoveSize(a, n, v) ==> + 0 <= RemovePartition(a, n, v, p) < RemovePartition(a, n, v, q) < n; axiom RemovePartitionSegment: - \forall value_type *a, v, integer i, m, n, p; - m <= p < RemoveSize(a, m, n, v) ==> - RemovePartition(a, m, n, v, p) < i < RemovePartition(a, m, n, v, p+1) - ==> a[i] == v; + \forall value_type *a, v, integer i, n, p; + 0 <= p < RemoveSize(a, n, v) ==> + RemovePartition(a, n, v, p) < i < RemovePartition(a, n, v, p+1) + ==> a[i] == v; axiom RemovePartitionInitial: \forall value_type *a, v, integer i, m, n, p; - m <= i < RemovePartition(a, m, n, v, m) ==> a[i] == v; + 0 <= i < RemovePartition(a, n, v, m) ==> a[i] == v; axiom RemovePartitionNotValue: - \forall value_type *a, v, integer m, n, p; - m <= p < RemoveSize(a, m, n, v) ==> - a[RemovePartition(a, m, n, v, p)] != v; + \forall value_type *a, v, integer n, p; + 0 <= p < RemoveSize(a, n, v) ==> a[RemovePartition(a, n, v, p)] != v; axiom RemovePartitionEqual: - \forall value_type *a, v, integer m, n1, n2, p; - m <= n1 < n2 ==> - m <= p < RemoveSize(a, n1, v) ==> - RemovePartition(a, m, n1, v, p) == RemovePartition(a, m, n2, v, p); + \forall value_type *a, v, integer n1, n2, p; + 0 <= n1 < n2 ==> 0 <= p < RemoveSize(a, n1, v) ==> + RemovePartition(a, n1, v, p) == RemovePartition(a, n2, v, p); axiom RemovePartitionRead{K,L}: - \forall value_type *a, v, integer m, n, p; - Unchanged{K,L}(a, m, n) ==> - RemovePartition{K}(a, m, n, v, p) == RemovePartition{L}(a, m, n, v, p); - } - - logic integer - RemovePartition(value_type* a, integer n, value_type v, integer p) - = RemovePartition(a, 0, n, v, p); + \forall value_type *a, v, integer n, p; + Unchanged{K,L}(a, n) ==> + RemovePartition{K}(a, n, v, p) == RemovePartition{L}(a, n, v, p); + } */ #endif /* REMOVEPARTITION_H_INCLUDED */ diff --git a/StandardAlgorithms/Logic/RemoveSize.spec b/StandardAlgorithms/Logic/RemoveSize.spec index 42fe87d..69fb6e9 100644 --- a/StandardAlgorithms/Logic/RemoveSize.spec +++ b/StandardAlgorithms/Logic/RemoveSize.spec @@ -6,33 +6,30 @@ /*@ logic integer - RemoveSize(value_type* a, integer m, integer n, value_type v) = n - m - Count(a, m, n, v); - - logic integer - RemoveSize(value_type* a, integer n, value_type v) = RemoveSize(a, 0, n, v); + RemoveSize(value_type* a, integer n, value_type v) = n - Count(a, n, v); lemma RemoveSizeEmpty: - \forall value_type *a, v, integer m, n; - n <= m ==> RemoveSize(a, m, n, v) == n - m; + \forall value_type *a, v, integer n; + n <= 0 ==> RemoveSize(a, n, v) == n; lemma RemoveSizeHit: - \forall value_type *a, v, integer m, n; - m <= n ==> a[n] == v ==> - RemoveSize(a, m, n+1, v) == RemoveSize(a, m, n, v); + \forall value_type *a, v, integer n; + 0 <= n ==> a[n] == v ==> + RemoveSize(a, n+1, v) == RemoveSize(a, n, v); lemma RemoveSizeMiss: - \forall value_type *a, v, integer m, n; - m <= n ==> a[n] != v ==> - RemoveSize(a, m, n+1, v) == RemoveSize(a, m, n, v) + 1; + \forall value_type *a, v, integer n; + 0 <= n ==> a[n] != v ==> + RemoveSize(a, n+1, v) == RemoveSize(a, n, v) + 1; lemma RemoveSizeRead{L1,L2}: - \forall value_type *a, v, integer m, n; - Unchanged{L1,L2}(a, m, n) ==> - RemoveSize{L1}(a, m, n, v) == RemoveSize{L2}(a, m, n, v); + \forall value_type *a, v, integer n; + Unchanged{L1,L2}(a, n) ==> + RemoveSize{L1}(a, n, v) == RemoveSize{L2}(a, n, v); */ #endif /* REMOVESIZE_H_INCLUDED */ diff --git a/StandardAlgorithms/Logic/SizeTypePairTrivial.spec b/StandardAlgorithms/Logic/SizeTypePairTrivial.spec new file mode 100644 index 0000000..46352a5 --- /dev/null +++ b/StandardAlgorithms/Logic/SizeTypePairTrivial.spec @@ -0,0 +1,10 @@ + +#ifndef SIZETYPEPAIR_SPEC_INCLUDED +#define SIZETYPEPAIR_SPEC_INCLUDED + +// dummy logic file that incluede size_type_pair.h + +#include "size_type_pair.h" + +#endif /* SIZETYPEPAIR_SPEC_INCLUDED */ + diff --git a/StandardAlgorithms/Logic/SortedDownIsHeap.spec b/StandardAlgorithms/Logic/SortedDownIsHeap.spec deleted file mode 100644 index bb4fa7a..0000000 --- a/StandardAlgorithms/Logic/SortedDownIsHeap.spec +++ /dev/null @@ -1,21 +0,0 @@ - -#ifndef SORTEDDOWNISHEAP_SPEC_INCLUDED -#define SORTEDDOWNISHEAP_SPEC_INCLUDED - -#include "IsHeap.spec" - -/*@ - predicate - SortedDown{L}(value_type* a, integer n) = - \forall integer i, j; - 0 <= i <= j < n ==> a[i] >= a[j]; - - - lemma - SortedDownIsHeap{L}: - \forall value_type *a, integer n; - SortedDown(a, n) ==> IsHeap(a, n); -*/ - -#endif /* SORTEDDOWNISHEAP_SPEC_INCLUDED */ - diff --git a/StandardAlgorithms/Logic/StackCapacitySizeTop.spec b/StandardAlgorithms/Logic/StackCapacitySizeTop.spec index 4cb290d..d3d2403 100644 --- a/StandardAlgorithms/Logic/StackCapacitySizeTop.spec +++ b/StandardAlgorithms/Logic/StackCapacitySizeTop.spec @@ -2,7 +2,7 @@ #ifndef STACKCAPACITYSIZETOP_SPEC_INCLUDED #define STACKCAPACITYSIZETOP_SPEC_INCLUDED -#include "stack/stack_definition.h" +#include "stack.h" /*@ logic integer Capacity{L}(Stack* s) = s->capacity; diff --git a/StandardAlgorithms/Logic/StackEmptyFull.spec b/StandardAlgorithms/Logic/StackEmptyFull.spec index 846b8a7..2de2363 100644 --- a/StandardAlgorithms/Logic/StackEmptyFull.spec +++ b/StandardAlgorithms/Logic/StackEmptyFull.spec @@ -2,7 +2,7 @@ #ifndef STACKEMPTYFULL_SPEC_INCLUDED #define STACKEMPTYFULL_SPEC_INCLUDED -#include "stack/stack_definition.h" +#include "StackCapacitySizeTop.spec" /*@ predicate diff --git a/StandardAlgorithms/Logic/StackLogic.spec b/StandardAlgorithms/Logic/StackLogic.spec new file mode 100644 index 0000000..7a3db8e --- /dev/null +++ b/StandardAlgorithms/Logic/StackLogic.spec @@ -0,0 +1,16 @@ + +#ifndef STACKLOGIC_SPEC_INCLUDED +#define STACKLOGIC_SPEC_INCLUDED + +#include "stack.h" + +#include "StackCapacitySizeTop.spec" +#include "StackEmptyFull.spec" +#include "StackInvariant.spec" +#include "StackEqual.spec" +#include "StackEquivalence.spec" +#include "StackSeparated.spec" +#include "Unchanged.spec" + +#endif /* STACKLOGIC_SPEC_INCLUDED */ + diff --git a/StandardAlgorithms/Logic/StackSeparated.spec b/StandardAlgorithms/Logic/StackSeparated.spec index 26c9c12..be7615b 100644 --- a/StandardAlgorithms/Logic/StackSeparated.spec +++ b/StandardAlgorithms/Logic/StackSeparated.spec @@ -2,7 +2,7 @@ #ifndef STACKSEPARATED_SPEC_INCLUDED #define STACKSEPARATED_SPEC_INCLUDED -#include "stack/stack_definition.h" +#include "stack.h" /*@ predicate diff --git a/StandardAlgorithms/Logic/UniquePartitionLemmas.spec b/StandardAlgorithms/Logic/UniquePartitionLemmas.spec index 5374d15..334f429 100644 --- a/StandardAlgorithms/Logic/UniquePartitionLemmas.spec +++ b/StandardAlgorithms/Logic/UniquePartitionLemmas.spec @@ -12,20 +12,16 @@ lemma UniquePartitionLowerBound: \forall value_type *a, integer n, i; - 0 < n ==> - 0 <= i < UniqueSize(a, n) ==> - 0 <= UniquePartition(a, n, i); + 0 < n ==> 0 <= i < UniqueSize(a, n) ==> 0 <= UniquePartition(a, n, i); lemma UniquePartitionUpperBound: \forall value_type *a, integer n, i; - 0 < n ==> - 0 <= i < UniqueSize(a, n) ==> - UniquePartition(a, n, i) < n; + 0 < n ==> 0 <= i < UniqueSize(a, n) ==> UniquePartition(a, n, i) < n; lemma UniquePartitionDiffer: \forall value_type *a, integer i, k, n; - UniquePartition(a, n, k-1) < i <= UniquePartition(a, n, k) - ==> a[i-1] != a[i] ==> i == UniquePartition(a, n, k); + UniquePartition(a, n, k-1) < i <= UniquePartition(a, n, k) ==> + a[i-1] != a[i] ==> i == UniquePartition(a, n, k); */ #endif /* UNIQUEPARTITIONLEMMAS_SPEC_INCLUDED */ diff --git a/StandardAlgorithms/Makefile b/StandardAlgorithms/Makefile index e6aadb3..c3c63de 100644 --- a/StandardAlgorithms/Makefile +++ b/StandardAlgorithms/Makefile @@ -8,19 +8,14 @@ it: lib clean: @($(RM) -rf errorlogs) - $(RM) *.back - $(RM) astraver.why3.conf + @$(RM) *.back + @$(RM) astraver.why3.conf + @ $(MAKE) -f all-action.mk clean @for i in drivers $(EXAMPLES);\ do \ (echo "clean $$i"; $(MAKE) clean -sC $$i);\ done -generate: - @for i in $(EXAMPLES);\ - do \ - (echo "generate $$i"; $(MAKE) generate -sC $$i);\ - done - report: @for i in $(EXAMPLES);\ do \ @@ -28,7 +23,10 @@ report: done report-clean: - @rm -f Results/*.report + @for i in $(EXAMPLES);\ + do \ + (echo "report clean $$i"; $(MAKE) report-clean -sC $$i);\ + done preport: @for i in $(EXAMPLES);\ @@ -37,7 +35,10 @@ preport: done preport-clean: - @rm -f Results/*.preport + @for i in $(EXAMPLES);\ + do \ + (echo "preport clean $$i"; $(MAKE) preport-clean -sC $$i);\ + done areport: @for i in $(EXAMPLES);\ @@ -51,7 +52,7 @@ areport-clean: test: lib @for i in $(EXAMPLES);\ do \ - (echo "test $$i"; cd "$$i"; $(MAKE) -s test || break);\ + (echo "test $$i"; $(MAKE) test -sC $$i || break);\ done lib: @@ -60,6 +61,52 @@ lib: (echo "make lib $$i"; $(MAKE) lib -sC $$i);\ done +group-files: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) group-files -sC $$i);\ + done + +group-report: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) group-report -sC $$i);\ + done + +group-report-clean: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) group-report-clean -sC $$i);\ + done + +group-preport: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) group-preport -sC $$i);\ + done + +group-preport-clean: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) group-preport-clean -sC $$i);\ + done + + +all-files: group-files + $(MAKE) -f all-action.mk source header + +all-report: all-files + $(MAKE) -f all-action.mk report + +all-report-clean: + $(MAKE) -f all-action.mk report-clean + +all-preport: all-files + $(MAKE) -f all-action.mk preport + +all-preport-clean: + $(MAKE) -f all-action.mk preport-clean + format: @for i in $(EXAMPLES);\ do \ diff --git a/StandardAlgorithms/Makefile.group b/StandardAlgorithms/Makefile.group deleted file mode 100644 index 7db3748..0000000 --- a/StandardAlgorithms/Makefile.group +++ /dev/null @@ -1,93 +0,0 @@ - -MAKEFLAGS += --silent --no-print-directory - -FILELIST := filelist.path -SCRIPT_DIR := ../Scripts -DIR := $(shell pwd)/ -FILE := $(shell cat $(FILELIST)) - -ifndef OBJ - OBJ := $(join $(addsuffix /,$(FILE)),$(addsuffix .o,$(FILE))) -endif - - -test:: lib - @for i in $(FILE);\ - do \ - (cd "$$i"; $(MAKE) -s test || break);\ - done - - -obj: FORCE - for i in $(FILE);\ - do \ - ($(MAKE) obj -sC $$i);\ - done - -clean:: FORCE - @for i in $(FILE);\ - do \ - (cd "$$i"; $(MAKE) -s clean);\ - done - -generate: - @for i in $(FILE);\ - do \ - ($(MAKE) generate -sC $$i);\ - done - -report: - @for i in $(FILE);\ - do \ - ($(MAKE) report -sC $$i);\ - done - -report-clean: - @for i in $(FILE);\ - do \ - ($(MAKE) report-clean -sC $$i);\ - done - -preport: - @for i in $(FILE);\ - do \ - ($(MAKE) preport -sC $$i);\ - done - -preport-clean: - @for i in $(FILE);\ - do \ - ($(MAKE) preport-clean -sC $$i);\ - done - -areport: - @for i in $(FILE);\ - do \ - ($(MAKE) areport -sC $$i);\ - done - -areport-clean: - @for i in $(FILE);\ - do \ - ($(MAKE) areport-clean -sC $$i);\ - done - -format: - @for i in $(FILE);\ - do \ - ( $(MAKE) format -sC $$i);\ - done - -vs-pipe: - @for i in $(FILE);\ - do \ - ( $(MAKE) vs-pipe -sC $$i);\ - done - -vs-par: - @for i in $(FILE);\ - do \ - ( $(MAKE) vs-par -sC $$i);\ - done - -FORCE: diff --git a/StandardAlgorithms/Makefile.template b/StandardAlgorithms/Makefile.template deleted file mode 100644 index 27ee3dc..0000000 --- a/StandardAlgorithms/Makefile.template +++ /dev/null @@ -1,327 +0,0 @@ - -MAKEFLAGS += --silent --no-print-directory - -SHELL=/bin/bash - -export FRAMAC_SHARE:=$(shell frama-c -print-share-path) - -export TOP_DIR:=../.. -export SCRIPT_DIR:=$(TOP_DIR)/Scripts -export VS_DIR:=$(TOP_DIR)/../Misc/VerificationService -export DRIVER_DIR:=$(TOP_DIR)/drivers - -CPPFLAGS := -I$(TOP_DIR) -CPPFLAGS += -I$(TOP_DIR)/Logic - -VPATH += $(TOP_DIR)/nonmutating -CPPFLAGS += -I$(TOP_DIR)/nonmutating -LDFLAGS += -L$(TOP_DIR)/nonmutating - -VPATH += $(TOP_DIR)/maxmin -CPPFLAGS += -I$(TOP_DIR)/maxmin -LDFLAGS += -L$(TOP_DIR)/maxmin - -VPATH += $(TOP_DIR)/binarysearch -CPPFLAGS += -I$(TOP_DIR)/binarysearch -LDFLAGS += -L$(TOP_DIR)/binarysearch - -VPATH += $(TOP_DIR)/mutating -CPPFLAGS += -I$(TOP_DIR)/mutating -LDFLAGS += -L$(TOP_DIR)/mutating - -VPATH += $(TOP_DIR)/unique -CPPFLAG += -I$(TOP_DIR)/unique -LDFLAGS += -L$(TOP_DIR)/unique - -VPATH += $(TOP_DIR)/heap -CPPFLAGS += -I$(TOP_DIR)/heap -LDFLAGS += -L$(TOP_DIR)/heap - -VPATH += $(TOP_DIR)/numeric -CPPFLAGS += -I$(TOP_DIR)/numeric -LDFLAGS += -L$(TOP_DIR)/numeric - -VPATH += $(TOP_DIR)/stack -CPPFLAGS += -I$(TOP_DIR)/stack -LDFLAGS += -L$(TOP_DIR)/stack - -VPATH += $(TOP_DIR)/stack_axiom -CPPFLAGS += -I$(TOP_DIR)/stack_axiom -#LDFLAGS += -L$(TOP_DIR)/stack_axiom - -VPATH += $(TOP_DIR)/stack_wd -CPPFLAGS += -I$(TOP_DIR)/stack_wd -LDFLAGS += -L$(TOP_DIR)/stack_wd - -#setup some basic flags -INCLUDES := $(CPPFLAGS) - -# PREPROCESSOR - -SHARED_FLAGS=-Wall -pedantic -Werror -O2 -CFLAGS=-x c++ -std=c++14 $(SHARED_FLAGS) -CXXFLAGS=-std=c++14 $(SHARED_FLAGS) - -export TIMEOUT ?= 10 -export PROCESSES ?= 1 - -#setup wp -export WP_TIMEOUT ?= $(TIMEOUT) -export WP_COQ_TIMEOUT ?= $(TIMEOUT) -export WP_ALT_ERGO_STEPS ?= 10000 -export WP_PROCESSES ?= $(PROCESSES) - -#setup av -export AV_TIMEOUT ?= $(TIMEOUT) -export AV_PROCESSES ?= $(PROCESSES) - -# flags for when we invoke Frama C directly instead of going -# through script_functions.sh -WP_TIME_FLAGS= \ - -wp-timeout $(WP_TIMEOUT) \ - -wp-coq-timeout $(WP_COQ_TIMEOUT) \ - -wp-steps $(WP_ALT_ERGO_STEPS) \ - -wp-par $(WP_PROCESSES) - -#setup coq -SCRIPT?='$(TOP_DIR)/wp0.script' # default script -DRIVER=$(DRIVER_DIR)/driver - -# having this as a separate variable allows us to override it in -# algorithm makefiles -WP_RTE_FLAGS ?= -warn-unsigned-overflow -warn-unsigned-downcast - -# We differentiate between two types of WP options: -# 1) in WP_FLAGS we collect the general options -# 2) in WP_PROVER_FLAGS we collect the ones where we select the provers -# This allows us, for example, to start the gui very quickly and then -# run the prover(s) on select proof obligtions. - -BASE_FLAGS := -pp-annot -BASE_FLAGS += -no-unicode - -WP_BASE_FLAGS := $(BASE_FLAGS) -WP_BASE_FLAGS += -wp -WP_BASE_FLAGS += -wp-rte $(WP_RTE_FLAGS) - -AV_BASE_FLAGS := $(BASE_FLAGS) -AV_BASE_FLAGS += -av - -WP_FLAGS := $(WP_BASE_FLAGS) -WP_FLAGS += -wp-driver $(DRIVER_DIR)/external.driver -WP_FLAGS += -wp-script $(SCRIPT) -WP_FLAGS += -wp-model Typed+ref - -AV_FLAGS := $(AV_BASE_FLAGS) -av-extract all_annot -AV_WHY3_CONF := $(shell realpath $(TOP_DIR))/astraver.why3.conf - -WP_PROVER_FLAGS += -wp-steps $(WP_ALT_ERGO_STEPS) - -# provers -WP_PROVER_FLAGS += -wp-prover alt-ergo -WP_PROVER_FLAGS += -wp-prover cvc4 -WP_PROVER_FLAGS += -wp-prover z3 -WP_PROVER_FLAGS += -wp-prover coq -WP_PROVER_FLAGS += -wp-prover cvc3 -WP_PROVER_FLAGS += -wp-prover eprover - - -#WP_PROVER_FLAGS += -wp-prover gappa -#WP_PROVER_FLAGS += -wp-prover metis - -# link binary metit to metitarski -#WP_PROVER_FLAGS += -wp-prover metitarski - -#WP_PROVER_FLAGS += -wp-prover princess -#WP_PROVER_FLAGS += -wp-prover psyche - -# only ppc binary for available for macOS ... -#WP_PROVER_FLAGS += -wp-prover simplify -#WP_PROVER_FLAGS += -wp-prover spass -#WP_PROVER_FLAGS += -wp-prover verit - -# yices (version 2.* does not support quantifiers ...) -#WP_PROVER_FLAGS += -wp-prover Yices - -export FR := frama-c -export FRGUI := frama-c-gui - -export WP_PROVER_FLAGS -export WP_C_FLAGS = -cpp-extra-args="$(INCLUDES)" $(WP_FLAGS) -export WP_CXX_FLAGS = -cxx-clang-command="framaCIRGen $(INCLUDES)" $(WP_FLAGS) -export WP_C_REPORT = $(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par $(WP_PROCESSES) - -export AV_C_FLAGS := -cpp-extra-args="$(INCLUDES)" $(AV_FLAGS) -export AV_STRATEGY = acslbyexample -export AV_C_REPORT = $(FR) $(AV_C_FLAGS) -av-target why3sprove -av-why3-opt " --extra-config $(AV_WHY3_CONF) --no-save-session --strategy $(AV_STRATEGY) " - -export PERL=perl - -ifndef FILE - FILE := $(shell basename $$(pwd)) -endif - -TESTOBJ = $(FILE)_test.o $(FILE).o - -$(DRIVER): FORCE - @(cd $(DRIVER_DIR) && $(MAKE) compile) - -define av_why3conf -[main] -running_provers_max = $(AV_PROCESSES) - -[strategy] -code = " -start: - c Alt-Ergo,, 1 2000 - c CVC4,,noBV 1 2000 - c Z3,, 1 2000 - c CVC3,, 1 2000 - c Eprover,, 1 2000 - t split_goal_wp start - t introduce_premises next1 -next1: - t inline_all next2 -next2: - t eliminate_if next3 -next3: - t remove_triggers start - c Alt-Ergo,, $(AV_TIMEOUT) 4000 - c CVC4,,noBV $(AV_TIMEOUT) 4000 - c Z3,, $(AV_TIMEOUT) 4000 - c CVC3,, $(AV_TIMEOUT) 4000 - c Eprover,, $(AV_TIMEOUT) 4000" -desc = "Default strategy for ACSL-By-Example" -name = "acslbyexample" -endef -export av_why3conf - -$(AV_WHY3_CONF): FORCE - @if [ -f $@ ]; then \ - tfile=$(shell mktemp); \ - echo "$$av_why3conf" > $$tfile; \ - diff -q $@ $$tfile > /dev/null || mv $$tfile $@; \ - else echo "$$av_why3conf" > $@; fi - -$(FILE)_test: $(TESTOBJ) FORCE - @$(CXX) $(LDFLAGS) -o $@ $(TESTOBJ) - -test: $(FILE)_test FORCE - @./$(FILE)_test $(TEST_DATA) - -%.cpp:%.c - cp $< $@ - -# only generate proof obligations for why3 -%.why3:%.c FORCE - @$(FR) $(WP_C_FLAGS) $(WP_TIME_FLAGS) -wp-prover why3 -wp-gen -wp-out $(patsubst %.c,%.wp, $<) $< - -# start FR on command line and run provers -%.wp:%.c $(DRIVER) FORCE - @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $< - -%.wp++:%.cpp FORCE - @$(FR) $(WP_CXX_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $< - -%.vs-par:%.c FORCE - @${VS_DIR}/vs.sh -p $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) - -%.vs-pipe:%.c FORCE - @${VS_DIR}/vs.sh -d $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) - -vs-par: $(FILE).vs-par - -vs-pipe: $(FILE).vs-pipe - -%.wprunner:%.c FORCE - @${SCRIPT_DIR}/wp_runner.sh $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par $(WP_PROCESSES) - -%.av:%.c $(AV_WHY3_CONF) FORCE - @$(AV_C_REPORT) -av-out $@ $< - -# GUI -%.avgui:%.c $(AV_WHY3_CONF) FORCE - @$(FR) $(AV_C_FLAGS) -av-why3-opt " --extra-config $(AV_WHY3_CONF) " -av-out $(patsubst %.c,%.av, $<) $< - -# start FR GUI and run provers -%.wpgui:%.c $(DRIVER) FORCE - @($(FRGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.c,%.wp, $<) $< &) - -%.wpgui++:%.cpp FORCE - @($(FRGUI) $(WP_CXX_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.cpp,%.wp++, $<) $< ) - -%.normal.c : %.c FORCE - @$(FR) $(WP_C_FLAGS) -wp-no-rte -wp-check -wp-prover none $< -print |\ - $(PERL) -e 'my $$f = join("", <>); $$f =~ s!\A.*(?=/\*@.*\*/[^/]*$*\([^)]++\)\s*+\{)!!s; print $$f;' > $@ - -%.normal-rte.c : %.c FORCE - @$(FR) $(WP_C_FLAGS) -wp-check -wp-prover none $< -print |\ - $(PERL) -e 'my $$f = join("", <>); $$f =~ s!\A.*(?=/\*@.*\*/[^/]*$*\([^)]++\)\s*+\{)!!s; print $$f;' > $@ - -$(TOP_DIR)/Results/$(FILE).report: $(FILE).c - . ${SCRIPT_DIR}/script_functions.sh; extract_data_Wp $(FILE) $(CMD) $(SEC) > $@ - -$(TOP_DIR)/Results/$(FILE).preport: $(FILE).c - @. ${SCRIPT_DIR}/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(basename $<) $(CMD) $(SEC) > $@ - -$(TOP_DIR)/Results/$(FILE).areport: $(AV_WHY3_CONF) $(FILE).c - . ${SCRIPT_DIR}/script_functions.sh; extract_data_Av $(FILE) $(CMD) $(SEC) > $@ - -generate: $(FILE).why3 - -report: $(TOP_DIR)/Results/$(FILE).report - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -report-clean: clean - @$(RM) $(TOP_DIR)/Results/$(FILE).report - -preport: $(TOP_DIR)/Results/$(FILE).preport - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -preport-clean: - @$(RM) $(TOP_DIR)/Results/$(FILE).preport - -areport: $(TOP_DIR)/Results/$(FILE).areport - @. ${SCRIPT_DIR}/script_functions.sh; prettyPrintReport $< - -areport-clean: - @$(RM) $(TOP_DIR)/Results/$(FILE).areport - -%.check:%.c - @$(FR) $(WP_C_FLAGS) -wp-check -wp-out $(patsubst %.c,%.wp, $<) $< - -# display saved results by FRAMA-C GUI -load: - @frama-c-gui -load $(FILE).sav - -obj: $(FILE).o - -# cleanup - -clean:: FORCE - @(cd $(DRIVER_DIR) && $(MAKE) -s clean) - @$(RM) *.o *.pp.c *.pp.h *.back *.orig *.exe .lia.cache $(FILE).cpp $(FILE)_test $(FILE).tex $(FILE).sav - @$(RM) -rf *.debug .frama-c *.jessie *.av *.wp *.wp++ *.ml - -ASTYLEOPTIONS += --quiet -ASTYLEOPTIONS += -A4 -ASTYLEOPTIONS += --indent=spaces=2 -ASTYLEOPTIONS += --indent-col1-comments -ASTYLEOPTIONS += --min-conditional-indent=0 -ASTYLEOPTIONS += --lineend=linux -ASTYLEOPTIONS += --break-return-type -ASTYLEOPTIONS += --break-return-type-decl -ASTYLEOPTIONS += --add-braces -ASTYLEOPTIONS += --break-closing-braces -ASTYLEOPTIONS += --break-one-line-headers -ASTYLEOPTIONS += --break-blocks -ASTYLEOPTIONS += --delete-empty-lines -ASTYLEOPTIONS += --pad-oper -ASTYLEOPTIONS += --pad-header - -format: FORCE - @astyle $(ASTYLEOPTIONS) *.c *.cpp *.h - -all: clean test report - -FORCE: diff --git a/StandardAlgorithms/Results/accumulate.areport b/StandardAlgorithms/Results/accumulate.areport index 81c5c23..cc9242c 100644 --- a/StandardAlgorithms/Results/accumulate.areport +++ b/StandardAlgorithms/Results/accumulate.areport @@ -1,4 +1,4 @@ -alg='accumulate' +example='accumulate' goal_count='7' valid='6' valid_qed='0' diff --git a/StandardAlgorithms/Results/accumulate.preport b/StandardAlgorithms/Results/accumulate.preport index 2a13790..8293688 100644 --- a/StandardAlgorithms/Results/accumulate.preport +++ b/StandardAlgorithms/Results/accumulate.preport @@ -1,4 +1,4 @@ -alg='accumulate' +example='accumulate' goal_count='19' valid='14' valid_qed='6' diff --git a/StandardAlgorithms/Results/accumulate.report b/StandardAlgorithms/Results/accumulate.report index edf08a8..7f80b42 100644 --- a/StandardAlgorithms/Results/accumulate.report +++ b/StandardAlgorithms/Results/accumulate.report @@ -1,4 +1,4 @@ -alg='accumulate' +example='accumulate' goal_count='19' valid='19' valid_qed='6' diff --git a/StandardAlgorithms/Results/adjacent_difference.areport b/StandardAlgorithms/Results/adjacent_difference.areport index 97eed29..b740d38 100644 --- a/StandardAlgorithms/Results/adjacent_difference.areport +++ b/StandardAlgorithms/Results/adjacent_difference.areport @@ -1,4 +1,4 @@ -alg='adjacent_difference' +example='adjacent_difference' goal_count='11' valid='11' valid_qed='0' diff --git a/StandardAlgorithms/Results/adjacent_difference.preport b/StandardAlgorithms/Results/adjacent_difference.preport index 6273beb..0435928 100644 --- a/StandardAlgorithms/Results/adjacent_difference.preport +++ b/StandardAlgorithms/Results/adjacent_difference.preport @@ -1,11 +1,11 @@ -alg='adjacent_difference' +example='adjacent_difference' goal_count='33' valid='30' valid_qed='11' -valid_alt_ergo='19' +valid_alt_ergo='18' valid_cvc4='19' valid_cvc3='18' -valid_z3='17' +valid_z3='19' valid_eprover='2' valid_coq='0' invalid='3' diff --git a/StandardAlgorithms/Results/adjacent_difference.report b/StandardAlgorithms/Results/adjacent_difference.report index 2165145..2fddaef 100644 --- a/StandardAlgorithms/Results/adjacent_difference.report +++ b/StandardAlgorithms/Results/adjacent_difference.report @@ -1,9 +1,9 @@ -alg='adjacent_difference' +example='adjacent_difference' goal_count='33' valid='33' valid_qed='11' -valid_alt_ergo='22' -valid_cvc4='0' +valid_alt_ergo='20' +valid_cvc4='2' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/adjacent_difference_inv.areport b/StandardAlgorithms/Results/adjacent_difference_inv.areport index e4941f8..d7e297f 100644 --- a/StandardAlgorithms/Results/adjacent_difference_inv.areport +++ b/StandardAlgorithms/Results/adjacent_difference_inv.areport @@ -1,14 +1,14 @@ -alg='adjacent_difference_inv' +example='adjacent_difference_inv' goal_count='22' valid='19' valid_qed='0' -valid_alt_ergo='16' +valid_alt_ergo='17' valid_cvc4='1' valid_cvc3='0' -valid_z3='2' +valid_z3='1' valid_eprover='0' valid_coq='0' invalid='3' percent='86' cmd='\adjacentdifferenceinv' -sec='sec:inverting-adjacentdifference' +sec='sec:adjacentdifferenceinv' diff --git a/StandardAlgorithms/Results/adjacent_difference_inv.preport b/StandardAlgorithms/Results/adjacent_difference_inv.preport index 9c22ce1..17048ac 100644 --- a/StandardAlgorithms/Results/adjacent_difference_inv.preport +++ b/StandardAlgorithms/Results/adjacent_difference_inv.preport @@ -1,14 +1,14 @@ -alg='adjacent_difference_inv' +example='adjacent_difference_inv' goal_count='28' valid='12' valid_qed='7' valid_alt_ergo='5' valid_cvc4='5' valid_cvc3='5' -valid_z3='4' +valid_z3='5' valid_eprover='4' valid_coq='0' invalid='16' percent='42' cmd='\adjacentdifferenceinv' -sec='sec:inverting-adjacentdifference' +sec='sec:adjacentdifferenceinv' diff --git a/StandardAlgorithms/Results/adjacent_difference_inv.report b/StandardAlgorithms/Results/adjacent_difference_inv.report index 16c443b..c2c7523 100644 --- a/StandardAlgorithms/Results/adjacent_difference_inv.report +++ b/StandardAlgorithms/Results/adjacent_difference_inv.report @@ -1,9 +1,9 @@ -alg='adjacent_difference_inv' +example='adjacent_difference_inv' goal_count='28' valid='27' valid_qed='7' -valid_alt_ergo='18' -valid_cvc4='0' +valid_alt_ergo='15' +valid_cvc4='3' valid_cvc3='0' valid_z3='0' valid_eprover='0' @@ -11,4 +11,4 @@ valid_coq='2' invalid='1' percent='96' cmd='\adjacentdifferenceinv' -sec='sec:inverting-adjacentdifference' +sec='sec:adjacentdifferenceinv' diff --git a/StandardAlgorithms/Results/adjacent_find.areport b/StandardAlgorithms/Results/adjacent_find.areport index f6b4117..c9bcc0a 100644 --- a/StandardAlgorithms/Results/adjacent_find.areport +++ b/StandardAlgorithms/Results/adjacent_find.areport @@ -1,4 +1,4 @@ -alg='adjacent_find' +example='adjacent_find' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/adjacent_find.preport b/StandardAlgorithms/Results/adjacent_find.preport index 9f39c61..c8676a2 100644 --- a/StandardAlgorithms/Results/adjacent_find.preport +++ b/StandardAlgorithms/Results/adjacent_find.preport @@ -1,11 +1,11 @@ -alg='adjacent_find' +example='adjacent_find' goal_count='22' valid='22' valid_qed='10' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='12' -valid_z3='8' +valid_z3='12' valid_eprover='1' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/adjacent_find.report b/StandardAlgorithms/Results/adjacent_find.report index 0794340..f3e3b35 100644 --- a/StandardAlgorithms/Results/adjacent_find.report +++ b/StandardAlgorithms/Results/adjacent_find.report @@ -1,4 +1,4 @@ -alg='adjacent_find' +example='adjacent_find' goal_count='22' valid='22' valid_qed='10' diff --git a/StandardAlgorithms/Results/all.union.preport b/StandardAlgorithms/Results/all.union.preport new file mode 100644 index 0000000..be44fcd --- /dev/null +++ b/StandardAlgorithms/Results/all.union.preport @@ -0,0 +1,14 @@ +alg='all.gen' +goal_count='1839' +valid='1680' +valid_qed='821' +valid_alt_ergo='791' +valid_cvc4='812' +valid_cvc3='786' +valid_z3='565' +valid_eprover='244' +valid_coq='0' +invalid='159' +percent='91' +cmd='all.gen' +sec='cha:Introduction' diff --git a/StandardAlgorithms/Results/all.union.report b/StandardAlgorithms/Results/all.union.report new file mode 100644 index 0000000..6687186 --- /dev/null +++ b/StandardAlgorithms/Results/all.union.report @@ -0,0 +1,14 @@ +alg='all.gen' +goal_count='1839' +valid='1773' +valid_qed='821' +valid_alt_ergo='624' +valid_cvc4='56' +valid_cvc3='148' +valid_z3='74' +valid_eprover='26' +valid_coq='24' +invalid='66' +percent='96' +cmd='all.gen' +sec='cha:Introduction' diff --git a/StandardAlgorithms/Results/axiom_pop_of_push.areport b/StandardAlgorithms/Results/axiom_pop_of_push.areport index ec2b6b8..89f2b7a 100644 --- a/StandardAlgorithms/Results/axiom_pop_of_push.areport +++ b/StandardAlgorithms/Results/axiom_pop_of_push.areport @@ -1,4 +1,4 @@ -alg='axiom_pop_of_push' +example='axiom_pop_of_push' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_pop_of_push.preport b/StandardAlgorithms/Results/axiom_pop_of_push.preport index 6c59de3..dbcd004 100644 --- a/StandardAlgorithms/Results/axiom_pop_of_push.preport +++ b/StandardAlgorithms/Results/axiom_pop_of_push.preport @@ -1,4 +1,4 @@ -alg='axiom_pop_of_push' +example='axiom_pop_of_push' goal_count='10' valid='7' valid_qed='6' diff --git a/StandardAlgorithms/Results/axiom_pop_of_push.report b/StandardAlgorithms/Results/axiom_pop_of_push.report index d8344ca..4c45077 100644 --- a/StandardAlgorithms/Results/axiom_pop_of_push.report +++ b/StandardAlgorithms/Results/axiom_pop_of_push.report @@ -1,4 +1,4 @@ -alg='axiom_pop_of_push' +example='axiom_pop_of_push' goal_count='10' valid='10' valid_qed='6' diff --git a/StandardAlgorithms/Results/axiom_push_of_pop_top.areport b/StandardAlgorithms/Results/axiom_push_of_pop_top.areport index 3cbbebb..896403b 100644 --- a/StandardAlgorithms/Results/axiom_push_of_pop_top.areport +++ b/StandardAlgorithms/Results/axiom_push_of_pop_top.areport @@ -1,4 +1,4 @@ -alg='axiom_push_of_pop_top' +example='axiom_push_of_pop_top' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_push_of_pop_top.preport b/StandardAlgorithms/Results/axiom_push_of_pop_top.preport index 6dbd049..374b829 100644 --- a/StandardAlgorithms/Results/axiom_push_of_pop_top.preport +++ b/StandardAlgorithms/Results/axiom_push_of_pop_top.preport @@ -1,11 +1,11 @@ -alg='axiom_push_of_pop_top' +example='axiom_push_of_pop_top' goal_count='15' valid='12' valid_qed='9' valid_alt_ergo='3' valid_cvc4='3' valid_cvc3='3' -valid_z3='3' +valid_z3='1' valid_eprover='2' valid_coq='0' invalid='3' diff --git a/StandardAlgorithms/Results/axiom_push_of_pop_top.report b/StandardAlgorithms/Results/axiom_push_of_pop_top.report index 9261554..7871891 100644 --- a/StandardAlgorithms/Results/axiom_push_of_pop_top.report +++ b/StandardAlgorithms/Results/axiom_push_of_pop_top.report @@ -1,4 +1,4 @@ -alg='axiom_push_of_pop_top' +example='axiom_push_of_pop_top' goal_count='15' valid='15' valid_qed='9' diff --git a/StandardAlgorithms/Results/axiom_size_of_init.areport b/StandardAlgorithms/Results/axiom_size_of_init.areport index 7d6f169..87f43f4 100644 --- a/StandardAlgorithms/Results/axiom_size_of_init.areport +++ b/StandardAlgorithms/Results/axiom_size_of_init.areport @@ -1,4 +1,4 @@ -alg='axiom_size_of_init' +example='axiom_size_of_init' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_size_of_init.preport b/StandardAlgorithms/Results/axiom_size_of_init.preport index 0ae11b5..69d8613 100644 --- a/StandardAlgorithms/Results/axiom_size_of_init.preport +++ b/StandardAlgorithms/Results/axiom_size_of_init.preport @@ -1,4 +1,4 @@ -alg='axiom_size_of_init' +example='axiom_size_of_init' goal_count='15' valid='12' valid_qed='11' diff --git a/StandardAlgorithms/Results/axiom_size_of_init.report b/StandardAlgorithms/Results/axiom_size_of_init.report index 9ac91ac..561e4b5 100644 --- a/StandardAlgorithms/Results/axiom_size_of_init.report +++ b/StandardAlgorithms/Results/axiom_size_of_init.report @@ -1,4 +1,4 @@ -alg='axiom_size_of_init' +example='axiom_size_of_init' goal_count='15' valid='15' valid_qed='11' diff --git a/StandardAlgorithms/Results/axiom_size_of_pop.areport b/StandardAlgorithms/Results/axiom_size_of_pop.areport index 62a5ed7..1eee383 100644 --- a/StandardAlgorithms/Results/axiom_size_of_pop.areport +++ b/StandardAlgorithms/Results/axiom_size_of_pop.areport @@ -1,4 +1,4 @@ -alg='axiom_size_of_pop' +example='axiom_size_of_pop' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_size_of_pop.preport b/StandardAlgorithms/Results/axiom_size_of_pop.preport index 29f3e20..776684b 100644 --- a/StandardAlgorithms/Results/axiom_size_of_pop.preport +++ b/StandardAlgorithms/Results/axiom_size_of_pop.preport @@ -1,4 +1,4 @@ -alg='axiom_size_of_pop' +example='axiom_size_of_pop' goal_count='11' valid='8' valid_qed='8' diff --git a/StandardAlgorithms/Results/axiom_size_of_pop.report b/StandardAlgorithms/Results/axiom_size_of_pop.report index f9139f0..ecb38f7 100644 --- a/StandardAlgorithms/Results/axiom_size_of_pop.report +++ b/StandardAlgorithms/Results/axiom_size_of_pop.report @@ -1,4 +1,4 @@ -alg='axiom_size_of_pop' +example='axiom_size_of_pop' goal_count='11' valid='11' valid_qed='8' diff --git a/StandardAlgorithms/Results/axiom_size_of_push.areport b/StandardAlgorithms/Results/axiom_size_of_push.areport index 9f3e5b2..ce3e404 100644 --- a/StandardAlgorithms/Results/axiom_size_of_push.areport +++ b/StandardAlgorithms/Results/axiom_size_of_push.areport @@ -1,4 +1,4 @@ -alg='axiom_size_of_push' +example='axiom_size_of_push' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_size_of_push.preport b/StandardAlgorithms/Results/axiom_size_of_push.preport index ca74878..c676e1a 100644 --- a/StandardAlgorithms/Results/axiom_size_of_push.preport +++ b/StandardAlgorithms/Results/axiom_size_of_push.preport @@ -1,4 +1,4 @@ -alg='axiom_size_of_push' +example='axiom_size_of_push' goal_count='12' valid='9' valid_qed='9' diff --git a/StandardAlgorithms/Results/axiom_size_of_push.report b/StandardAlgorithms/Results/axiom_size_of_push.report index 3f5f6c4..aa08774 100644 --- a/StandardAlgorithms/Results/axiom_size_of_push.report +++ b/StandardAlgorithms/Results/axiom_size_of_push.report @@ -1,4 +1,4 @@ -alg='axiom_size_of_push' +example='axiom_size_of_push' goal_count='12' valid='12' valid_qed='9' diff --git a/StandardAlgorithms/Results/axiom_top_of_push.areport b/StandardAlgorithms/Results/axiom_top_of_push.areport index a0c9a2e..0ddb7fa 100644 --- a/StandardAlgorithms/Results/axiom_top_of_push.areport +++ b/StandardAlgorithms/Results/axiom_top_of_push.areport @@ -1,4 +1,4 @@ -alg='axiom_top_of_push' +example='axiom_top_of_push' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/axiom_top_of_push.preport b/StandardAlgorithms/Results/axiom_top_of_push.preport index 6bce68c..53de7d1 100644 --- a/StandardAlgorithms/Results/axiom_top_of_push.preport +++ b/StandardAlgorithms/Results/axiom_top_of_push.preport @@ -1,4 +1,4 @@ -alg='axiom_top_of_push' +example='axiom_top_of_push' goal_count='11' valid='8' valid_qed='8' diff --git a/StandardAlgorithms/Results/axiom_top_of_push.report b/StandardAlgorithms/Results/axiom_top_of_push.report index f6798ce..b026c04 100644 --- a/StandardAlgorithms/Results/axiom_top_of_push.report +++ b/StandardAlgorithms/Results/axiom_top_of_push.report @@ -1,4 +1,4 @@ -alg='axiom_top_of_push' +example='axiom_top_of_push' goal_count='11' valid='11' valid_qed='8' diff --git a/StandardAlgorithms/Results/binary_search.areport b/StandardAlgorithms/Results/binary_search.areport index afa70f9..c04fb17 100644 --- a/StandardAlgorithms/Results/binary_search.areport +++ b/StandardAlgorithms/Results/binary_search.areport @@ -1,4 +1,4 @@ -alg='binary_search' +example='binary_search' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/binary_search.preport b/StandardAlgorithms/Results/binary_search.preport index cd08783..b3b9d21 100644 --- a/StandardAlgorithms/Results/binary_search.preport +++ b/StandardAlgorithms/Results/binary_search.preport @@ -1,11 +1,11 @@ -alg='binary_search' +example='binary_search' goal_count='10' valid='10' valid_qed='8' valid_alt_ergo='2' valid_cvc4='2' valid_cvc3='2' -valid_z3='1' +valid_z3='2' valid_eprover='0' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/binary_search.report b/StandardAlgorithms/Results/binary_search.report index 367d484..7985fe0 100644 --- a/StandardAlgorithms/Results/binary_search.report +++ b/StandardAlgorithms/Results/binary_search.report @@ -1,4 +1,4 @@ -alg='binary_search' +example='binary_search' goal_count='10' valid='10' valid_qed='8' diff --git a/StandardAlgorithms/Results/binary_search2.areport b/StandardAlgorithms/Results/binary_search2.areport index 8abd153..0a06727 100644 --- a/StandardAlgorithms/Results/binary_search2.areport +++ b/StandardAlgorithms/Results/binary_search2.areport @@ -1,4 +1,4 @@ -alg='binary_search2' +example='binary_search2' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/binary_search2.preport b/StandardAlgorithms/Results/binary_search2.preport index e4165cd..cc74194 100644 --- a/StandardAlgorithms/Results/binary_search2.preport +++ b/StandardAlgorithms/Results/binary_search2.preport @@ -1,11 +1,11 @@ -alg='binary_search2' +example='binary_search2' goal_count='10' valid='10' valid_qed='8' valid_alt_ergo='2' valid_cvc4='2' valid_cvc3='2' -valid_z3='1' +valid_z3='2' valid_eprover='0' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/binary_search2.report b/StandardAlgorithms/Results/binary_search2.report index a99ca0b..882e765 100644 --- a/StandardAlgorithms/Results/binary_search2.report +++ b/StandardAlgorithms/Results/binary_search2.report @@ -1,4 +1,4 @@ -alg='binary_search2' +example='binary_search2' goal_count='10' valid='10' valid_qed='8' diff --git a/StandardAlgorithms/Results/binarysearch.separate.report b/StandardAlgorithms/Results/binarysearch.separate.report new file mode 100644 index 0000000..6481906 --- /dev/null +++ b/StandardAlgorithms/Results/binarysearch.separate.report @@ -0,0 +1,14 @@ +example='binarysearch.separate' +goal_count='146' +valid='143' +valid_qed='73' +valid_alt_ergo='69' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='1' +valid_eprover='0' +valid_coq='0' +invalid='3' +percent='97' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/binarysearch.simple.report b/StandardAlgorithms/Results/binarysearch.simple.report new file mode 100644 index 0000000..6140fa7 --- /dev/null +++ b/StandardAlgorithms/Results/binarysearch.simple.report @@ -0,0 +1,14 @@ +example='binarysearch.simple' +goal_count='118' +valid='111' +valid_qed='49' +valid_alt_ergo='58' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='1' +valid_eprover='0' +valid_coq='3' +invalid='7' +percent='94' +cmd='inarysearch' +sec='cha:binarysearch' diff --git a/StandardAlgorithms/Results/binarysearch.union.preport b/StandardAlgorithms/Results/binarysearch.union.preport new file mode 100644 index 0000000..660ada5 --- /dev/null +++ b/StandardAlgorithms/Results/binarysearch.union.preport @@ -0,0 +1,14 @@ +alg='binarysearch.gen' +goal_count='138' +valid='133' +valid_qed='65' +valid_alt_ergo='67' +valid_cvc4='68' +valid_cvc3='61' +valid_z3='48' +valid_eprover='11' +valid_coq='0' +invalid='5' +percent='96' +cmd='inarysearch' +sec='cha:binarysearch' diff --git a/StandardAlgorithms/Results/binarysearch.union.report b/StandardAlgorithms/Results/binarysearch.union.report new file mode 100644 index 0000000..de7ef41 --- /dev/null +++ b/StandardAlgorithms/Results/binarysearch.union.report @@ -0,0 +1,14 @@ +example='binarysearch.union' +goal_count='138' +valid='138' +valid_qed='65' +valid_alt_ergo='69' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='1' +valid_eprover='0' +valid_coq='3' +invalid='0' +percent='100' +cmd='inarysearch' +sec='cha:binarysearch' diff --git a/StandardAlgorithms/Results/clamp.areport b/StandardAlgorithms/Results/clamp.areport new file mode 100644 index 0000000..0ca63b3 --- /dev/null +++ b/StandardAlgorithms/Results/clamp.areport @@ -0,0 +1,14 @@ +example='clamp' +goal_count='5' +valid='5' +valid_qed='0' +valid_alt_ergo='5' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\clamp' +sec='sec:clamp' diff --git a/StandardAlgorithms/Results/clamp.preport b/StandardAlgorithms/Results/clamp.preport new file mode 100644 index 0000000..9dbb13a --- /dev/null +++ b/StandardAlgorithms/Results/clamp.preport @@ -0,0 +1,14 @@ +example='clamp' +goal_count='22' +valid='22' +valid_qed='18' +valid_alt_ergo='4' +valid_cvc4='4' +valid_cvc3='4' +valid_z3='4' +valid_eprover='3' +valid_coq='0' +invalid='0' +percent='100' +cmd='\clamp' +sec='sec:clamp' diff --git a/StandardAlgorithms/Results/clamp.report b/StandardAlgorithms/Results/clamp.report new file mode 100644 index 0000000..d3222e6 --- /dev/null +++ b/StandardAlgorithms/Results/clamp.report @@ -0,0 +1,14 @@ +example='clamp' +goal_count='22' +valid='22' +valid_qed='18' +valid_alt_ergo='4' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\clamp' +sec='sec:clamp' diff --git a/StandardAlgorithms/Results/copy.areport b/StandardAlgorithms/Results/copy.areport index 36c8d95..a7e6dea 100644 --- a/StandardAlgorithms/Results/copy.areport +++ b/StandardAlgorithms/Results/copy.areport @@ -1,4 +1,4 @@ -alg='copy' +example='copy' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/copy.preport b/StandardAlgorithms/Results/copy.preport index ee92e50..9d73a4e 100644 --- a/StandardAlgorithms/Results/copy.preport +++ b/StandardAlgorithms/Results/copy.preport @@ -1,11 +1,11 @@ -alg='copy' +example='copy' goal_count='15' valid='15' valid_qed='4' valid_alt_ergo='11' valid_cvc4='11' valid_cvc3='11' -valid_z3='10' +valid_z3='11' valid_eprover='4' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/copy.report b/StandardAlgorithms/Results/copy.report index 7151037..07aa1b3 100644 --- a/StandardAlgorithms/Results/copy.report +++ b/StandardAlgorithms/Results/copy.report @@ -1,4 +1,4 @@ -alg='copy' +example='copy' goal_count='15' valid='15' valid_qed='4' diff --git a/StandardAlgorithms/Results/copy_backward.areport b/StandardAlgorithms/Results/copy_backward.areport index 2bb7a1c..121f11e 100644 --- a/StandardAlgorithms/Results/copy_backward.areport +++ b/StandardAlgorithms/Results/copy_backward.areport @@ -1,4 +1,4 @@ -alg='copy_backward' +example='copy_backward' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/copy_backward.preport b/StandardAlgorithms/Results/copy_backward.preport index 08e0a27..685494a 100644 --- a/StandardAlgorithms/Results/copy_backward.preport +++ b/StandardAlgorithms/Results/copy_backward.preport @@ -1,11 +1,11 @@ -alg='copy_backward' +example='copy_backward' goal_count='17' valid='17' valid_qed='7' valid_alt_ergo='10' valid_cvc4='10' valid_cvc3='10' -valid_z3='7' +valid_z3='10' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/copy_backward.report b/StandardAlgorithms/Results/copy_backward.report index 8b01dac..de57ab3 100644 --- a/StandardAlgorithms/Results/copy_backward.report +++ b/StandardAlgorithms/Results/copy_backward.report @@ -1,4 +1,4 @@ -alg='copy_backward' +example='copy_backward' goal_count='17' valid='17' valid_qed='7' diff --git a/StandardAlgorithms/Results/count.areport b/StandardAlgorithms/Results/count.areport index 5d7f320..4fcb4f8 100644 --- a/StandardAlgorithms/Results/count.areport +++ b/StandardAlgorithms/Results/count.areport @@ -1,4 +1,4 @@ -alg='count' +example='count' goal_count='15' valid='10' valid_qed='0' diff --git a/StandardAlgorithms/Results/count.preport b/StandardAlgorithms/Results/count.preport index f3e95e2..a5c50d7 100644 --- a/StandardAlgorithms/Results/count.preport +++ b/StandardAlgorithms/Results/count.preport @@ -1,4 +1,4 @@ -alg='count' +example='count' goal_count='28' valid='15' valid_qed='7' diff --git a/StandardAlgorithms/Results/count.report b/StandardAlgorithms/Results/count.report index ca1066d..cb868d2 100644 --- a/StandardAlgorithms/Results/count.report +++ b/StandardAlgorithms/Results/count.report @@ -1,13 +1,13 @@ -alg='count' +example='count' goal_count='28' valid='28' valid_qed='7' -valid_alt_ergo='17' +valid_alt_ergo='16' valid_cvc4='0' valid_cvc3='0' valid_z3='0' valid_eprover='0' -valid_coq='4' +valid_coq='5' invalid='0' percent='100' cmd='\cnt' diff --git a/StandardAlgorithms/Results/count2.areport b/StandardAlgorithms/Results/count2.areport index 197620f..c1b7e6f 100644 --- a/StandardAlgorithms/Results/count2.areport +++ b/StandardAlgorithms/Results/count2.areport @@ -1,4 +1,4 @@ -alg='count2' +example='count2' goal_count='21' valid='17' valid_qed='0' diff --git a/StandardAlgorithms/Results/count2.preport b/StandardAlgorithms/Results/count2.preport index 2e990b2..5c3eb7c 100644 --- a/StandardAlgorithms/Results/count2.preport +++ b/StandardAlgorithms/Results/count2.preport @@ -1,11 +1,11 @@ -alg='count2' +example='count2' goal_count='31' valid='15' valid_qed='7' valid_alt_ergo='8' valid_cvc4='7' valid_cvc3='7' -valid_z3='8' +valid_z3='7' valid_eprover='3' valid_coq='0' invalid='16' diff --git a/StandardAlgorithms/Results/count2.report b/StandardAlgorithms/Results/count2.report index 4dd4090..5ff1d3e 100644 --- a/StandardAlgorithms/Results/count2.report +++ b/StandardAlgorithms/Results/count2.report @@ -1,4 +1,4 @@ -alg='count2' +example='count2' goal_count='31' valid='31' valid_qed='7' diff --git a/StandardAlgorithms/Results/equal.areport b/StandardAlgorithms/Results/equal.areport index 6e71499..7d9b44a 100644 --- a/StandardAlgorithms/Results/equal.areport +++ b/StandardAlgorithms/Results/equal.areport @@ -1,4 +1,4 @@ -alg='equal' +example='equal' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/equal.preport b/StandardAlgorithms/Results/equal.preport index 641342b..30452d1 100644 --- a/StandardAlgorithms/Results/equal.preport +++ b/StandardAlgorithms/Results/equal.preport @@ -1,4 +1,4 @@ -alg='equal' +example='equal' goal_count='7' valid='7' valid_qed='6' diff --git a/StandardAlgorithms/Results/equal.report b/StandardAlgorithms/Results/equal.report index 22baad5..8bab00b 100644 --- a/StandardAlgorithms/Results/equal.report +++ b/StandardAlgorithms/Results/equal.report @@ -1,4 +1,4 @@ -alg='equal' +example='equal' goal_count='7' valid='7' valid_qed='6' diff --git a/StandardAlgorithms/Results/equal_range.areport b/StandardAlgorithms/Results/equal_range.areport index 0a874dc..66a9077 100644 --- a/StandardAlgorithms/Results/equal_range.areport +++ b/StandardAlgorithms/Results/equal_range.areport @@ -1,4 +1,4 @@ -alg='equal_range' +example='equal_range' goal_count='13' valid='12' valid_qed='0' diff --git a/StandardAlgorithms/Results/equal_range.preport b/StandardAlgorithms/Results/equal_range.preport index 5bf9231..a55bf17 100644 --- a/StandardAlgorithms/Results/equal_range.preport +++ b/StandardAlgorithms/Results/equal_range.preport @@ -1,11 +1,11 @@ -alg='equal_range' +example='equal_range' goal_count='20' valid='20' valid_qed='17' valid_alt_ergo='3' valid_cvc4='3' valid_cvc3='3' -valid_z3='2' +valid_z3='3' valid_eprover='0' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/equal_range.report b/StandardAlgorithms/Results/equal_range.report index 35e363b..d179477 100644 --- a/StandardAlgorithms/Results/equal_range.report +++ b/StandardAlgorithms/Results/equal_range.report @@ -1,4 +1,4 @@ -alg='equal_range' +example='equal_range' goal_count='20' valid='20' valid_qed='17' diff --git a/StandardAlgorithms/Results/equal_range2.areport b/StandardAlgorithms/Results/equal_range2.areport index 028fd9a..947f63a 100644 --- a/StandardAlgorithms/Results/equal_range2.areport +++ b/StandardAlgorithms/Results/equal_range2.areport @@ -1,9 +1,9 @@ -alg='equal_range2' +example='equal_range2' goal_count='162' valid='158' valid_qed='0' -valid_alt_ergo='153' -valid_cvc4='5' +valid_alt_ergo='155' +valid_cvc4='3' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/equal_range2.preport b/StandardAlgorithms/Results/equal_range2.preport index 7b22902..73c0a6c 100644 --- a/StandardAlgorithms/Results/equal_range2.preport +++ b/StandardAlgorithms/Results/equal_range2.preport @@ -1,11 +1,11 @@ -alg='equal_range2' +example='equal_range2' goal_count='64' valid='59' valid_qed='24' -valid_alt_ergo='35' +valid_alt_ergo='34' valid_cvc4='35' valid_cvc3='32' -valid_z3='22' +valid_z3='35' valid_eprover='5' valid_coq='0' invalid='5' diff --git a/StandardAlgorithms/Results/equal_range2.report b/StandardAlgorithms/Results/equal_range2.report index da37c31..8c66a4b 100644 --- a/StandardAlgorithms/Results/equal_range2.report +++ b/StandardAlgorithms/Results/equal_range2.report @@ -1,13 +1,13 @@ -alg='equal_range2' +example='equal_range2' goal_count='64' valid='64' valid_qed='24' -valid_alt_ergo='36' -valid_cvc4='0' +valid_alt_ergo='35' +valid_cvc4='1' valid_cvc3='0' -valid_z3='1' +valid_z3='0' valid_eprover='0' -valid_coq='3' +valid_coq='4' invalid='0' percent='100' cmd='\equalrangetwo' diff --git a/StandardAlgorithms/Results/fill.areport b/StandardAlgorithms/Results/fill.areport index 99f9fb6..c9f8973 100644 --- a/StandardAlgorithms/Results/fill.areport +++ b/StandardAlgorithms/Results/fill.areport @@ -1,4 +1,4 @@ -alg='fill' +example='fill' goal_count='7' valid='6' valid_qed='0' diff --git a/StandardAlgorithms/Results/fill.preport b/StandardAlgorithms/Results/fill.preport index 6bef98f..3c5d789 100644 --- a/StandardAlgorithms/Results/fill.preport +++ b/StandardAlgorithms/Results/fill.preport @@ -1,11 +1,11 @@ -alg='fill' +example='fill' goal_count='12' valid='12' valid_qed='4' valid_alt_ergo='8' valid_cvc4='8' valid_cvc3='8' -valid_z3='6' +valid_z3='8' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/fill.report b/StandardAlgorithms/Results/fill.report index dd72371..a75bebb 100644 --- a/StandardAlgorithms/Results/fill.report +++ b/StandardAlgorithms/Results/fill.report @@ -1,4 +1,4 @@ -alg='fill' +example='fill' goal_count='12' valid='12' valid_qed='4' diff --git a/StandardAlgorithms/Results/find.areport b/StandardAlgorithms/Results/find.areport index 4e11f26..ed42814 100644 --- a/StandardAlgorithms/Results/find.areport +++ b/StandardAlgorithms/Results/find.areport @@ -1,4 +1,4 @@ -alg='find' +example='find' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/find.preport b/StandardAlgorithms/Results/find.preport index 5c4994b..130766c 100644 --- a/StandardAlgorithms/Results/find.preport +++ b/StandardAlgorithms/Results/find.preport @@ -1,4 +1,4 @@ -alg='find' +example='find' goal_count='19' valid='19' valid_qed='10' diff --git a/StandardAlgorithms/Results/find.report b/StandardAlgorithms/Results/find.report index 7ab038b..e00c52c 100644 --- a/StandardAlgorithms/Results/find.report +++ b/StandardAlgorithms/Results/find.report @@ -1,4 +1,4 @@ -alg='find' +example='find' goal_count='19' valid='19' valid_qed='10' diff --git a/StandardAlgorithms/Results/find2.areport b/StandardAlgorithms/Results/find2.areport index c21c6bc..8565b69 100644 --- a/StandardAlgorithms/Results/find2.areport +++ b/StandardAlgorithms/Results/find2.areport @@ -1,4 +1,4 @@ -alg='find2' +example='find2' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/find2.preport b/StandardAlgorithms/Results/find2.preport index dd69502..0e4639d 100644 --- a/StandardAlgorithms/Results/find2.preport +++ b/StandardAlgorithms/Results/find2.preport @@ -1,11 +1,11 @@ -alg='find2' +example='find2' goal_count='19' valid='19' valid_qed='10' valid_alt_ergo='9' valid_cvc4='9' valid_cvc3='9' -valid_z3='6' +valid_z3='9' valid_eprover='5' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/find2.report b/StandardAlgorithms/Results/find2.report index 90828dc..c2d9b5b 100644 --- a/StandardAlgorithms/Results/find2.report +++ b/StandardAlgorithms/Results/find2.report @@ -1,4 +1,4 @@ -alg='find2' +example='find2' goal_count='19' valid='19' valid_qed='10' diff --git a/StandardAlgorithms/Results/find_end.areport b/StandardAlgorithms/Results/find_end.areport index 6277ede..cd1ecdd 100644 --- a/StandardAlgorithms/Results/find_end.areport +++ b/StandardAlgorithms/Results/find_end.areport @@ -1,4 +1,4 @@ -alg='find_end' +example='find_end' goal_count='5' valid='5' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\findend' -sec='sec:find_end' +sec='sec:findend' diff --git a/StandardAlgorithms/Results/find_end.preport b/StandardAlgorithms/Results/find_end.preport index 2b07f63..c4ee156 100644 --- a/StandardAlgorithms/Results/find_end.preport +++ b/StandardAlgorithms/Results/find_end.preport @@ -1,14 +1,14 @@ -alg='find_end' +example='find_end' goal_count='28' valid='27' valid_qed='15' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='12' -valid_z3='6' +valid_z3='12' valid_eprover='3' valid_coq='0' invalid='1' percent='96' cmd='\findend' -sec='sec:find_end' +sec='sec:findend' diff --git a/StandardAlgorithms/Results/find_end.report b/StandardAlgorithms/Results/find_end.report index 47a78d5..76be77f 100644 --- a/StandardAlgorithms/Results/find_end.report +++ b/StandardAlgorithms/Results/find_end.report @@ -1,4 +1,4 @@ -alg='find_end' +example='find_end' goal_count='28' valid='28' valid_qed='15' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\findend' -sec='sec:find_end' +sec='sec:findend' diff --git a/StandardAlgorithms/Results/find_first_of.areport b/StandardAlgorithms/Results/find_first_of.areport index 9e632a6..880ac21 100644 --- a/StandardAlgorithms/Results/find_first_of.areport +++ b/StandardAlgorithms/Results/find_first_of.areport @@ -1,4 +1,4 @@ -alg='find_first_of' +example='find_first_of' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/find_first_of.preport b/StandardAlgorithms/Results/find_first_of.preport index c54210f..39d52db 100644 --- a/StandardAlgorithms/Results/find_first_of.preport +++ b/StandardAlgorithms/Results/find_first_of.preport @@ -1,11 +1,11 @@ -alg='find_first_of' +example='find_first_of' goal_count='25' valid='25' valid_qed='16' valid_alt_ergo='9' valid_cvc4='9' valid_cvc3='9' -valid_z3='5' +valid_z3='9' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/find_first_of.report b/StandardAlgorithms/Results/find_first_of.report index 27150c5..350329e 100644 --- a/StandardAlgorithms/Results/find_first_of.report +++ b/StandardAlgorithms/Results/find_first_of.report @@ -1,4 +1,4 @@ -alg='find_first_of' +example='find_first_of' goal_count='25' valid='25' valid_qed='16' diff --git a/StandardAlgorithms/Results/heap.separate.report b/StandardAlgorithms/Results/heap.separate.report new file mode 100644 index 0000000..4c30048 --- /dev/null +++ b/StandardAlgorithms/Results/heap.separate.report @@ -0,0 +1,14 @@ +alg='heap.separate' +goal_count='277' +valid='269' +valid_qed='129' +valid_alt_ergo='119' +valid_cvc4='14' +valid_cvc3='1' +valid_z3='4' +valid_eprover='0' +valid_coq='2' +invalid='8' +percent='97' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/heap.simple.report b/StandardAlgorithms/Results/heap.simple.report new file mode 100644 index 0000000..4f221c3 --- /dev/null +++ b/StandardAlgorithms/Results/heap.simple.report @@ -0,0 +1,14 @@ +alg='heap.simple' +goal_count='258' +valid='251' +valid_qed='119' +valid_alt_ergo='110' +valid_cvc4='14' +valid_cvc3='2' +valid_z3='3' +valid_eprover='0' +valid_coq='3' +invalid='7' +percent='97' +cmd='\heap' +sec='cha:heap' diff --git a/StandardAlgorithms/Results/heap.union.preport b/StandardAlgorithms/Results/heap.union.preport new file mode 100644 index 0000000..fb9e4f1 --- /dev/null +++ b/StandardAlgorithms/Results/heap.union.preport @@ -0,0 +1,14 @@ +alg='heap.gen' +goal_count='258' +valid='225' +valid_qed='119' +valid_alt_ergo='95' +valid_cvc4='96' +valid_cvc3='91' +valid_z3='79' +valid_eprover='25' +valid_coq='0' +invalid='33' +percent='87' +cmd='\heap' +sec='cha:heap' diff --git a/StandardAlgorithms/Results/heap.union.report b/StandardAlgorithms/Results/heap.union.report new file mode 100644 index 0000000..74bdecf --- /dev/null +++ b/StandardAlgorithms/Results/heap.union.report @@ -0,0 +1,14 @@ +alg='heap.union' +goal_count='258' +valid='252' +valid_qed='119' +valid_alt_ergo='110' +valid_cvc4='15' +valid_cvc3='1' +valid_z3='4' +valid_eprover='0' +valid_coq='3' +invalid='6' +percent='97' +cmd='\heap' +sec='cha:heap' diff --git a/StandardAlgorithms/Results/heap_child_max.areport b/StandardAlgorithms/Results/heap_child_max.areport new file mode 100644 index 0000000..6bfa5bc --- /dev/null +++ b/StandardAlgorithms/Results/heap_child_max.areport @@ -0,0 +1,14 @@ +example='heap_child_max' +goal_count='8' +valid='8' +valid_qed='0' +valid_alt_ergo='7' +valid_cvc4='0' +valid_cvc3='1' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\heapchildmax' +sec='sec:heapchildmax' diff --git a/StandardAlgorithms/Results/heap_child_max.preport b/StandardAlgorithms/Results/heap_child_max.preport new file mode 100644 index 0000000..3742f25 --- /dev/null +++ b/StandardAlgorithms/Results/heap_child_max.preport @@ -0,0 +1,14 @@ +example='heap_child_max' +goal_count='22' +valid='16' +valid_qed='8' +valid_alt_ergo='8' +valid_cvc4='8' +valid_cvc3='8' +valid_z3='8' +valid_eprover='3' +valid_coq='0' +invalid='6' +percent='72' +cmd='\heapchildmax' +sec='sec:heapchildmax' diff --git a/StandardAlgorithms/Results/heap_child_max.report b/StandardAlgorithms/Results/heap_child_max.report new file mode 100644 index 0000000..8450b60 --- /dev/null +++ b/StandardAlgorithms/Results/heap_child_max.report @@ -0,0 +1,14 @@ +example='heap_child_max' +goal_count='22' +valid='22' +valid_qed='8' +valid_alt_ergo='14' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\heapchildmax' +sec='sec:heapchildmax' diff --git a/StandardAlgorithms/Results/heap_parent.areport b/StandardAlgorithms/Results/heap_parent.areport new file mode 100644 index 0000000..ed3e5bd --- /dev/null +++ b/StandardAlgorithms/Results/heap_parent.areport @@ -0,0 +1,14 @@ +example='heap_parent' +goal_count='8' +valid='8' +valid_qed='0' +valid_alt_ergo='8' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\heapparent' +sec='sec:heapparent' diff --git a/StandardAlgorithms/Results/heap_parent.preport b/StandardAlgorithms/Results/heap_parent.preport new file mode 100644 index 0000000..e8787bb --- /dev/null +++ b/StandardAlgorithms/Results/heap_parent.preport @@ -0,0 +1,14 @@ +example='heap_parent' +goal_count='9' +valid='3' +valid_qed='2' +valid_alt_ergo='1' +valid_cvc4='1' +valid_cvc3='1' +valid_z3='1' +valid_eprover='1' +valid_coq='0' +invalid='6' +percent='33' +cmd='\heapparent' +sec='sec:heapparent' diff --git a/StandardAlgorithms/Results/heap_parent.report b/StandardAlgorithms/Results/heap_parent.report new file mode 100644 index 0000000..47b3d51 --- /dev/null +++ b/StandardAlgorithms/Results/heap_parent.report @@ -0,0 +1,14 @@ +example='heap_parent' +goal_count='9' +valid='9' +valid_qed='2' +valid_alt_ergo='7' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\heapparent' +sec='sec:heapparent' diff --git a/StandardAlgorithms/Results/heap_sort.areport b/StandardAlgorithms/Results/heap_sort.areport index e731229..1cc5b02 100644 --- a/StandardAlgorithms/Results/heap_sort.areport +++ b/StandardAlgorithms/Results/heap_sort.areport @@ -1,4 +1,4 @@ -alg='heap_sort' +example='heap_sort' goal_count='16' valid='15' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='1' percent='93' cmd='\heapsort' -sec='sec:heap_sort' +sec='sec:heapsort' diff --git a/StandardAlgorithms/Results/heap_sort.preport b/StandardAlgorithms/Results/heap_sort.preport index f97bafc..6dab0a0 100644 --- a/StandardAlgorithms/Results/heap_sort.preport +++ b/StandardAlgorithms/Results/heap_sort.preport @@ -1,4 +1,4 @@ -alg='heap_sort' +example='heap_sort' goal_count='23' valid='9' valid_qed='8' @@ -11,4 +11,4 @@ valid_coq='0' invalid='14' percent='39' cmd='\heapsort' -sec='sec:heap_sort' +sec='sec:heapsort' diff --git a/StandardAlgorithms/Results/heap_sort.report b/StandardAlgorithms/Results/heap_sort.report index 377b18a..9159f08 100644 --- a/StandardAlgorithms/Results/heap_sort.report +++ b/StandardAlgorithms/Results/heap_sort.report @@ -1,4 +1,4 @@ -alg='heap_sort' +example='heap_sort' goal_count='23' valid='23' valid_qed='8' @@ -11,4 +11,4 @@ valid_coq='1' invalid='0' percent='100' cmd='\heapsort' -sec='sec:heap_sort' +sec='sec:heapsort' diff --git a/StandardAlgorithms/Results/inner_product.areport b/StandardAlgorithms/Results/inner_product.areport index 698f832..aa7c5fc 100644 --- a/StandardAlgorithms/Results/inner_product.areport +++ b/StandardAlgorithms/Results/inner_product.areport @@ -1,4 +1,4 @@ -alg='inner_product' +example='inner_product' goal_count='3' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/inner_product.preport b/StandardAlgorithms/Results/inner_product.preport index 56416e8..77bd0f6 100644 --- a/StandardAlgorithms/Results/inner_product.preport +++ b/StandardAlgorithms/Results/inner_product.preport @@ -1,4 +1,4 @@ -alg='inner_product' +example='inner_product' goal_count='20' valid='19' valid_qed='6' diff --git a/StandardAlgorithms/Results/inner_product.report b/StandardAlgorithms/Results/inner_product.report index 44c9b83..ca0b21c 100644 --- a/StandardAlgorithms/Results/inner_product.report +++ b/StandardAlgorithms/Results/inner_product.report @@ -1,4 +1,4 @@ -alg='inner_product' +example='inner_product' goal_count='20' valid='20' valid_qed='6' diff --git a/StandardAlgorithms/Results/insertion_sort.areport b/StandardAlgorithms/Results/insertion_sort.areport index bd34fb2..c6fdf9f 100644 --- a/StandardAlgorithms/Results/insertion_sort.areport +++ b/StandardAlgorithms/Results/insertion_sort.areport @@ -1,14 +1,14 @@ -alg='insertion_sort' +example='insertion_sort' goal_count='36' valid='26' valid_qed='0' -valid_alt_ergo='19' +valid_alt_ergo='18' valid_cvc4='7' -valid_cvc3='0' +valid_cvc3='1' valid_z3='0' valid_eprover='0' valid_coq='0' invalid='10' percent='72' cmd='\insertionsort' -sec='sec:insertion_sort' +sec='sec:insertionsort' diff --git a/StandardAlgorithms/Results/insertion_sort.preport b/StandardAlgorithms/Results/insertion_sort.preport index 7b3ee91..368fbd9 100644 --- a/StandardAlgorithms/Results/insertion_sort.preport +++ b/StandardAlgorithms/Results/insertion_sort.preport @@ -1,14 +1,14 @@ -alg='insertion_sort' +example='insertion_sort' goal_count='67' valid='48' valid_qed='18' -valid_alt_ergo='29' +valid_alt_ergo='28' valid_cvc4='26' valid_cvc3='28' -valid_z3='19' +valid_z3='29' valid_eprover='8' valid_coq='0' invalid='19' percent='71' cmd='\insertionsort' -sec='sec:insertion_sort' +sec='sec:insertionsort' diff --git a/StandardAlgorithms/Results/insertion_sort.report b/StandardAlgorithms/Results/insertion_sort.report index 8f7abc3..8b11a4c 100644 --- a/StandardAlgorithms/Results/insertion_sort.report +++ b/StandardAlgorithms/Results/insertion_sort.report @@ -1,14 +1,14 @@ -alg='insertion_sort' +example='insertion_sort' goal_count='67' valid='67' valid_qed='18' valid_alt_ergo='41' -valid_cvc4='2' -valid_cvc3='1' +valid_cvc4='1' +valid_cvc3='2' valid_z3='0' valid_eprover='0' valid_coq='5' invalid='0' percent='100' cmd='\insertionsort' -sec='sec:insertion_sort' +sec='sec:insertionsort' diff --git a/StandardAlgorithms/Results/iota.areport b/StandardAlgorithms/Results/iota.areport index 16613b4..47a534c 100644 --- a/StandardAlgorithms/Results/iota.areport +++ b/StandardAlgorithms/Results/iota.areport @@ -1,4 +1,4 @@ -alg='iota' +example='iota' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/iota.preport b/StandardAlgorithms/Results/iota.preport index 3331fd4..e5c2807 100644 --- a/StandardAlgorithms/Results/iota.preport +++ b/StandardAlgorithms/Results/iota.preport @@ -1,11 +1,11 @@ -alg='iota' +example='iota' goal_count='16' valid='16' valid_qed='7' valid_alt_ergo='9' valid_cvc4='9' valid_cvc3='9' -valid_z3='7' +valid_z3='9' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/iota.report b/StandardAlgorithms/Results/iota.report index ebbebb6..3e0993f 100644 --- a/StandardAlgorithms/Results/iota.report +++ b/StandardAlgorithms/Results/iota.report @@ -1,4 +1,4 @@ -alg='iota' +example='iota' goal_count='16' valid='16' valid_qed='7' diff --git a/StandardAlgorithms/Results/is_heap.areport b/StandardAlgorithms/Results/is_heap.areport index 3bf0a38..2f3178b 100644 --- a/StandardAlgorithms/Results/is_heap.areport +++ b/StandardAlgorithms/Results/is_heap.areport @@ -1,4 +1,4 @@ -alg='is_heap' +example='is_heap' goal_count='13' valid='12' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='1' percent='92' cmd='\isheap' -sec='sec:is_heap' +sec='sec:isheap' diff --git a/StandardAlgorithms/Results/is_heap.preport b/StandardAlgorithms/Results/is_heap.preport index 862d32b..8633ad1 100644 --- a/StandardAlgorithms/Results/is_heap.preport +++ b/StandardAlgorithms/Results/is_heap.preport @@ -1,14 +1,14 @@ -alg='is_heap' -goal_count='24' -valid='17' -valid_qed='6' -valid_alt_ergo='11' -valid_cvc4='11' -valid_cvc3='11' -valid_z3='11' -valid_eprover='3' +example='is_heap' +goal_count='12' +valid='6' +valid_qed='5' +valid_alt_ergo='1' +valid_cvc4='1' +valid_cvc3='1' +valid_z3='1' +valid_eprover='1' valid_coq='0' -invalid='7' -percent='70' +invalid='6' +percent='50' cmd='\isheap' -sec='sec:is_heap' +sec='sec:isheap' diff --git a/StandardAlgorithms/Results/is_heap.report b/StandardAlgorithms/Results/is_heap.report index ffbfe7f..10ec16c 100644 --- a/StandardAlgorithms/Results/is_heap.report +++ b/StandardAlgorithms/Results/is_heap.report @@ -1,8 +1,8 @@ -alg='is_heap' -goal_count='24' -valid='24' -valid_qed='6' -valid_alt_ergo='18' +example='is_heap' +goal_count='12' +valid='12' +valid_qed='5' +valid_alt_ergo='7' valid_cvc4='0' valid_cvc3='0' valid_z3='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\isheap' -sec='sec:is_heap' +sec='sec:isheap' diff --git a/StandardAlgorithms/Results/is_heap_until.preport b/StandardAlgorithms/Results/is_heap_until.preport new file mode 100644 index 0000000..21c2be8 --- /dev/null +++ b/StandardAlgorithms/Results/is_heap_until.preport @@ -0,0 +1,14 @@ +example='is_heap_until' +goal_count='27' +valid='21' +valid_qed='6' +valid_alt_ergo='15' +valid_cvc4='13' +valid_cvc3='15' +valid_z3='15' +valid_eprover='5' +valid_coq='0' +invalid='6' +percent='77' +cmd='\isheapuntil' +sec='sec:isheapuntil' diff --git a/StandardAlgorithms/Results/is_heap_until.report b/StandardAlgorithms/Results/is_heap_until.report new file mode 100644 index 0000000..045d2e1 --- /dev/null +++ b/StandardAlgorithms/Results/is_heap_until.report @@ -0,0 +1,14 @@ +example='is_heap_until' +goal_count='27' +valid='27' +valid_qed='6' +valid_alt_ergo='21' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\isheapuntil' +sec='sec:isheapuntil' diff --git a/StandardAlgorithms/Results/is_sorted.areport b/StandardAlgorithms/Results/is_sorted.areport index 096e995..3c7f8dc 100644 --- a/StandardAlgorithms/Results/is_sorted.areport +++ b/StandardAlgorithms/Results/is_sorted.areport @@ -1,4 +1,4 @@ -alg='is_sorted' +example='is_sorted' goal_count='4' valid='3' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='1' percent='75' cmd='\issorted' -sec='sec:is_sorted' +sec='sec:issorted' diff --git a/StandardAlgorithms/Results/is_sorted.preport b/StandardAlgorithms/Results/is_sorted.preport index 2ef4792..f8dbe30 100644 --- a/StandardAlgorithms/Results/is_sorted.preport +++ b/StandardAlgorithms/Results/is_sorted.preport @@ -1,14 +1,14 @@ -alg='is_sorted' +example='is_sorted' goal_count='16' valid='14' valid_qed='7' valid_alt_ergo='7' valid_cvc4='7' valid_cvc3='7' -valid_z3='5' +valid_z3='7' valid_eprover='0' valid_coq='0' invalid='2' percent='87' cmd='\issorted' -sec='sec:is_sorted' +sec='sec:issorted' diff --git a/StandardAlgorithms/Results/is_sorted.report b/StandardAlgorithms/Results/is_sorted.report index aaf84ba..051c78c 100644 --- a/StandardAlgorithms/Results/is_sorted.report +++ b/StandardAlgorithms/Results/is_sorted.report @@ -1,4 +1,4 @@ -alg='is_sorted' +example='is_sorted' goal_count='16' valid='16' valid_qed='7' @@ -11,4 +11,4 @@ valid_coq='1' invalid='0' percent='100' cmd='\issorted' -sec='sec:is_sorted' +sec='sec:issorted' diff --git a/StandardAlgorithms/Results/lower_bound.areport b/StandardAlgorithms/Results/lower_bound.areport index 33b6cbf..3ae029a 100644 --- a/StandardAlgorithms/Results/lower_bound.areport +++ b/StandardAlgorithms/Results/lower_bound.areport @@ -1,4 +1,4 @@ -alg='lower_bound' +example='lower_bound' goal_count='13' valid='13' valid_qed='0' diff --git a/StandardAlgorithms/Results/lower_bound.preport b/StandardAlgorithms/Results/lower_bound.preport index 582128c..98d3f67 100644 --- a/StandardAlgorithms/Results/lower_bound.preport +++ b/StandardAlgorithms/Results/lower_bound.preport @@ -1,11 +1,11 @@ -alg='lower_bound' +example='lower_bound' goal_count='19' valid='19' valid_qed='5' valid_alt_ergo='14' valid_cvc4='14' valid_cvc3='12' -valid_z3='11' +valid_z3='14' valid_eprover='4' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/lower_bound.report b/StandardAlgorithms/Results/lower_bound.report index d8a7783..c7d1ad6 100644 --- a/StandardAlgorithms/Results/lower_bound.report +++ b/StandardAlgorithms/Results/lower_bound.report @@ -1,4 +1,4 @@ -alg='lower_bound' +example='lower_bound' goal_count='19' valid='19' valid_qed='5' diff --git a/StandardAlgorithms/Results/make_heap.areport b/StandardAlgorithms/Results/make_heap.areport index 802eb1b..6720e4e 100644 --- a/StandardAlgorithms/Results/make_heap.areport +++ b/StandardAlgorithms/Results/make_heap.areport @@ -1,4 +1,4 @@ -alg='make_heap' +example='make_heap' goal_count='28' valid='25' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='3' percent='89' cmd='\makeheap' -sec='sec:make_heap' +sec='sec:makeheap' diff --git a/StandardAlgorithms/Results/make_heap.preport b/StandardAlgorithms/Results/make_heap.preport index e45ce71..45622a0 100644 --- a/StandardAlgorithms/Results/make_heap.preport +++ b/StandardAlgorithms/Results/make_heap.preport @@ -1,14 +1,14 @@ -alg='make_heap' +example='make_heap' goal_count='38' valid='24' valid_qed='15' valid_alt_ergo='8' valid_cvc4='9' valid_cvc3='8' -valid_z3='7' +valid_z3='9' valid_eprover='3' valid_coq='0' invalid='14' percent='63' cmd='\makeheap' -sec='sec:make_heap' +sec='sec:makeheap' diff --git a/StandardAlgorithms/Results/make_heap.report b/StandardAlgorithms/Results/make_heap.report index 31db22e..f05c5f5 100644 --- a/StandardAlgorithms/Results/make_heap.report +++ b/StandardAlgorithms/Results/make_heap.report @@ -1,4 +1,4 @@ -alg='make_heap' +example='make_heap' goal_count='38' valid='38' valid_qed='15' @@ -11,4 +11,4 @@ valid_coq='1' invalid='0' percent='100' cmd='\makeheap' -sec='sec:make_heap' +sec='sec:makeheap' diff --git a/StandardAlgorithms/Results/make_pair.areport b/StandardAlgorithms/Results/make_pair.areport new file mode 100644 index 0000000..cf0abd4 --- /dev/null +++ b/StandardAlgorithms/Results/make_pair.areport @@ -0,0 +1,14 @@ +example='make_pair' +goal_count='2' +valid='2' +valid_qed='0' +valid_alt_ergo='2' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\makepair' +sec='sec:makepair' diff --git a/StandardAlgorithms/Results/make_pair.preport b/StandardAlgorithms/Results/make_pair.preport new file mode 100644 index 0000000..302f0de --- /dev/null +++ b/StandardAlgorithms/Results/make_pair.preport @@ -0,0 +1,14 @@ +example='make_pair' +goal_count='4' +valid='4' +valid_qed='4' +valid_alt_ergo='0' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\makepair' +sec='sec:makepair' diff --git a/StandardAlgorithms/Results/make_pair.report b/StandardAlgorithms/Results/make_pair.report new file mode 100644 index 0000000..302f0de --- /dev/null +++ b/StandardAlgorithms/Results/make_pair.report @@ -0,0 +1,14 @@ +example='make_pair' +goal_count='4' +valid='4' +valid_qed='4' +valid_alt_ergo='0' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\makepair' +sec='sec:makepair' diff --git a/StandardAlgorithms/Results/max_element.areport b/StandardAlgorithms/Results/max_element.areport index 9c36101..83e2b2e 100644 --- a/StandardAlgorithms/Results/max_element.areport +++ b/StandardAlgorithms/Results/max_element.areport @@ -1,4 +1,4 @@ -alg='max_element' +example='max_element' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/max_element.preport b/StandardAlgorithms/Results/max_element.preport index cca3495..2ee89a9 100644 --- a/StandardAlgorithms/Results/max_element.preport +++ b/StandardAlgorithms/Results/max_element.preport @@ -1,4 +1,4 @@ -alg='max_element' +example='max_element' goal_count='24' valid='24' valid_qed='13' diff --git a/StandardAlgorithms/Results/max_element.report b/StandardAlgorithms/Results/max_element.report index 987155d..2dbff3e 100644 --- a/StandardAlgorithms/Results/max_element.report +++ b/StandardAlgorithms/Results/max_element.report @@ -1,4 +1,4 @@ -alg='max_element' +example='max_element' goal_count='24' valid='24' valid_qed='13' diff --git a/StandardAlgorithms/Results/max_element2.areport b/StandardAlgorithms/Results/max_element2.areport index 125f3f7..65027cb 100644 --- a/StandardAlgorithms/Results/max_element2.areport +++ b/StandardAlgorithms/Results/max_element2.areport @@ -1,4 +1,4 @@ -alg='max_element2' +example='max_element2' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/max_element2.preport b/StandardAlgorithms/Results/max_element2.preport index 163308c..ec44015 100644 --- a/StandardAlgorithms/Results/max_element2.preport +++ b/StandardAlgorithms/Results/max_element2.preport @@ -1,11 +1,11 @@ -alg='max_element2' +example='max_element2' goal_count='24' valid='24' valid_qed='12' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='12' -valid_z3='9' +valid_z3='12' valid_eprover='5' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/max_element2.report b/StandardAlgorithms/Results/max_element2.report index 4f196cf..a6d8627 100644 --- a/StandardAlgorithms/Results/max_element2.report +++ b/StandardAlgorithms/Results/max_element2.report @@ -1,4 +1,4 @@ -alg='max_element2' +example='max_element2' goal_count='24' valid='24' valid_qed='12' diff --git a/StandardAlgorithms/Results/max_seq.areport b/StandardAlgorithms/Results/max_seq.areport index 13a033e..b418374 100644 --- a/StandardAlgorithms/Results/max_seq.areport +++ b/StandardAlgorithms/Results/max_seq.areport @@ -1,4 +1,4 @@ -alg='max_seq' +example='max_seq' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/max_seq.preport b/StandardAlgorithms/Results/max_seq.preport index 04fb6ca..d925262 100644 --- a/StandardAlgorithms/Results/max_seq.preport +++ b/StandardAlgorithms/Results/max_seq.preport @@ -1,4 +1,4 @@ -alg='max_seq' +example='max_seq' goal_count='8' valid='8' valid_qed='5' diff --git a/StandardAlgorithms/Results/max_seq.report b/StandardAlgorithms/Results/max_seq.report index 7990274..06b5cce 100644 --- a/StandardAlgorithms/Results/max_seq.report +++ b/StandardAlgorithms/Results/max_seq.report @@ -1,4 +1,4 @@ -alg='max_seq' +example='max_seq' goal_count='8' valid='8' valid_qed='5' diff --git a/StandardAlgorithms/Results/maxmin.separate.report b/StandardAlgorithms/Results/maxmin.separate.report new file mode 100644 index 0000000..e1beea7 --- /dev/null +++ b/StandardAlgorithms/Results/maxmin.separate.report @@ -0,0 +1,14 @@ +example='maxmin.separate' +goal_count='86' +valid='86' +valid_qed='46' +valid_alt_ergo='40' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/maxmin.simple.report b/StandardAlgorithms/Results/maxmin.simple.report new file mode 100644 index 0000000..4620ff3 --- /dev/null +++ b/StandardAlgorithms/Results/maxmin.simple.report @@ -0,0 +1,14 @@ +alg='maxmin.simple' +goal_count='86' +valid='86' +valid_qed='46' +valid_alt_ergo='40' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\maxmin' +sec='cha:maxmin' diff --git a/StandardAlgorithms/Results/maxmin.union.preport b/StandardAlgorithms/Results/maxmin.union.preport new file mode 100644 index 0000000..cf3808e --- /dev/null +++ b/StandardAlgorithms/Results/maxmin.union.preport @@ -0,0 +1,14 @@ +alg='maxmin.gen' +goal_count='86' +valid='84' +valid_qed='46' +valid_alt_ergo='38' +valid_cvc4='38' +valid_cvc3='38' +valid_z3='33' +valid_eprover='17' +valid_coq='0' +invalid='2' +percent='97' +cmd='\maxmin' +sec='cha:maxmin' diff --git a/StandardAlgorithms/Results/maxmin.union.report b/StandardAlgorithms/Results/maxmin.union.report new file mode 100644 index 0000000..bb7aaa3 --- /dev/null +++ b/StandardAlgorithms/Results/maxmin.union.report @@ -0,0 +1,14 @@ +alg='maxmin.union' +goal_count='86' +valid='86' +valid_qed='46' +valid_alt_ergo='40' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\maxmin' +sec='cha:maxmin' diff --git a/StandardAlgorithms/Results/merge.areport b/StandardAlgorithms/Results/merge.areport index ad2539b..f39d1bd 100644 --- a/StandardAlgorithms/Results/merge.areport +++ b/StandardAlgorithms/Results/merge.areport @@ -1,9 +1,9 @@ -alg='merge' +example='merge' goal_count='121' valid='116' valid_qed='0' -valid_alt_ergo='102' -valid_cvc4='14' +valid_alt_ergo='101' +valid_cvc4='15' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/merge.preport b/StandardAlgorithms/Results/merge.preport index 4cf7c53..a4fdb9c 100644 --- a/StandardAlgorithms/Results/merge.preport +++ b/StandardAlgorithms/Results/merge.preport @@ -1,11 +1,11 @@ -alg='merge' +example='merge' goal_count='268' valid='262' valid_qed='185' -valid_alt_ergo='66' +valid_alt_ergo='67' valid_cvc4='77' valid_cvc3='61' -valid_z3='49' +valid_z3='74' valid_eprover='28' valid_coq='0' invalid='6' diff --git a/StandardAlgorithms/Results/merge.report b/StandardAlgorithms/Results/merge.report index 9828627..3f7be2b 100644 --- a/StandardAlgorithms/Results/merge.report +++ b/StandardAlgorithms/Results/merge.report @@ -1,9 +1,9 @@ -alg='merge' +example='merge' goal_count='268' valid='268' valid_qed='185' -valid_alt_ergo='67' -valid_cvc4='14' +valid_alt_ergo='71' +valid_cvc4='10' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/min_element.areport b/StandardAlgorithms/Results/min_element.areport index 516ee2b..cbf371e 100644 --- a/StandardAlgorithms/Results/min_element.areport +++ b/StandardAlgorithms/Results/min_element.areport @@ -1,4 +1,4 @@ -alg='min_element' +example='min_element' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/min_element.preport b/StandardAlgorithms/Results/min_element.preport index 2644d2c..90da81c 100644 --- a/StandardAlgorithms/Results/min_element.preport +++ b/StandardAlgorithms/Results/min_element.preport @@ -1,11 +1,11 @@ -alg='min_element' +example='min_element' goal_count='24' valid='24' valid_qed='12' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='12' -valid_z3='9' +valid_z3='12' valid_eprover='5' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/min_element.report b/StandardAlgorithms/Results/min_element.report index f682167..4021c7b 100644 --- a/StandardAlgorithms/Results/min_element.report +++ b/StandardAlgorithms/Results/min_element.report @@ -1,4 +1,4 @@ -alg='min_element' +example='min_element' goal_count='24' valid='24' valid_qed='12' diff --git a/StandardAlgorithms/Results/minmax_element.areport b/StandardAlgorithms/Results/minmax_element.areport new file mode 100644 index 0000000..8f62b36 --- /dev/null +++ b/StandardAlgorithms/Results/minmax_element.areport @@ -0,0 +1,14 @@ +example='minmax_element' +goal_count='90' +valid='88' +valid_qed='0' +valid_alt_ergo='82' +valid_cvc4='5' +valid_cvc3='1' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='2' +percent='97' +cmd='\minmaxelement' +sec='sec:minmaxelement' diff --git a/StandardAlgorithms/Results/minmax_element.preport b/StandardAlgorithms/Results/minmax_element.preport new file mode 100644 index 0000000..d6b752e --- /dev/null +++ b/StandardAlgorithms/Results/minmax_element.preport @@ -0,0 +1,14 @@ +example='minmax_element' +goal_count='44' +valid='44' +valid_qed='27' +valid_alt_ergo='17' +valid_cvc4='17' +valid_cvc3='17' +valid_z3='17' +valid_eprover='5' +valid_coq='0' +invalid='0' +percent='100' +cmd='\minmaxelement' +sec='sec:minmaxelement' diff --git a/StandardAlgorithms/Results/minmax_element.report b/StandardAlgorithms/Results/minmax_element.report new file mode 100644 index 0000000..8058254 --- /dev/null +++ b/StandardAlgorithms/Results/minmax_element.report @@ -0,0 +1,14 @@ +example='minmax_element' +goal_count='44' +valid='44' +valid_qed='27' +valid_alt_ergo='17' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\minmaxelement' +sec='sec:minmaxelement' diff --git a/StandardAlgorithms/Results/mismatch.areport b/StandardAlgorithms/Results/mismatch.areport index 45cfd06..7b5c39d 100644 --- a/StandardAlgorithms/Results/mismatch.areport +++ b/StandardAlgorithms/Results/mismatch.areport @@ -1,4 +1,4 @@ -alg='mismatch' +example='mismatch' goal_count='4' valid='4' valid_qed='0' diff --git a/StandardAlgorithms/Results/mismatch.preport b/StandardAlgorithms/Results/mismatch.preport index 0f9baef..b7c6c47 100644 --- a/StandardAlgorithms/Results/mismatch.preport +++ b/StandardAlgorithms/Results/mismatch.preport @@ -1,11 +1,11 @@ -alg='mismatch' +example='mismatch' goal_count='20' valid='20' valid_qed='10' valid_alt_ergo='10' valid_cvc4='10' valid_cvc3='10' -valid_z3='7' +valid_z3='10' valid_eprover='5' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/mismatch.report b/StandardAlgorithms/Results/mismatch.report index 2e97e6d..ff5ca5c 100644 --- a/StandardAlgorithms/Results/mismatch.report +++ b/StandardAlgorithms/Results/mismatch.report @@ -1,4 +1,4 @@ -alg='mismatch' +example='mismatch' goal_count='20' valid='20' valid_qed='10' diff --git a/StandardAlgorithms/Results/mutating.separate.report b/StandardAlgorithms/Results/mutating.separate.report new file mode 100644 index 0000000..bb758b1 --- /dev/null +++ b/StandardAlgorithms/Results/mutating.separate.report @@ -0,0 +1,14 @@ +alg='mutating.separate' +goal_count='372' +valid='368' +valid_qed='130' +valid_alt_ergo='213' +valid_cvc4='8' +valid_cvc3='2' +valid_z3='11' +valid_eprover='3' +valid_coq='1' +invalid='4' +percent='98' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/mutating.simple.report b/StandardAlgorithms/Results/mutating.simple.report new file mode 100644 index 0000000..ef48e59 --- /dev/null +++ b/StandardAlgorithms/Results/mutating.simple.report @@ -0,0 +1,14 @@ +alg='mutating.simple' +goal_count='348' +valid='337' +valid_qed='117' +valid_alt_ergo='203' +valid_cvc4='8' +valid_cvc3='2' +valid_z3='2' +valid_eprover='3' +valid_coq='2' +invalid='11' +percent='96' +cmd='\mutating' +sec='cha:mutating' diff --git a/StandardAlgorithms/Results/mutating.union.preport b/StandardAlgorithms/Results/mutating.union.preport new file mode 100644 index 0000000..e2ba967 --- /dev/null +++ b/StandardAlgorithms/Results/mutating.union.preport @@ -0,0 +1,14 @@ +alg='mutating.gen' +goal_count='358' +valid='336' +valid_qed='123' +valid_alt_ergo='201' +valid_cvc4='204' +valid_cvc3='198' +valid_z3='169' +valid_eprover='56' +valid_coq='0' +invalid='22' +percent='93' +cmd='\mutating' +sec='cha:mutating' diff --git a/StandardAlgorithms/Results/mutating.union.report b/StandardAlgorithms/Results/mutating.union.report new file mode 100644 index 0000000..104284d --- /dev/null +++ b/StandardAlgorithms/Results/mutating.union.report @@ -0,0 +1,14 @@ +alg='mutating.union' +goal_count='358' +valid='355' +valid_qed='123' +valid_alt_ergo='212' +valid_cvc4='10' +valid_cvc3='3' +valid_z3='2' +valid_eprover='3' +valid_coq='2' +invalid='3' +percent='99' +cmd='\mutating' +sec='cha:mutating' diff --git a/StandardAlgorithms/Results/nonmutating.separate.report b/StandardAlgorithms/Results/nonmutating.separate.report new file mode 100644 index 0000000..90598fa --- /dev/null +++ b/StandardAlgorithms/Results/nonmutating.separate.report @@ -0,0 +1,14 @@ +alg='nonmutating.separate' +goal_count='249' +valid='248' +valid_qed='120' +valid_alt_ergo='121' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='7' +invalid='1' +percent='99' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/nonmutating.simple.report b/StandardAlgorithms/Results/nonmutating.simple.report new file mode 100644 index 0000000..ca721ce --- /dev/null +++ b/StandardAlgorithms/Results/nonmutating.simple.report @@ -0,0 +1,15 @@ +alg='nonmutating.simple' +goal_count='249' +valid='248' +valid_qed='120' +valid_alt_ergo='121' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='7' +invalid='1' +percent='99' +cmd=' +onmutating' +sec='cha:nonmutating' diff --git a/StandardAlgorithms/Results/nonmutating.union.preport b/StandardAlgorithms/Results/nonmutating.union.preport new file mode 100644 index 0000000..644ae81 --- /dev/null +++ b/StandardAlgorithms/Results/nonmutating.union.preport @@ -0,0 +1,15 @@ +alg='nonmutating.gen' +goal_count='249' +valid='224' +valid_qed='120' +valid_alt_ergo='104' +valid_cvc4='100' +valid_cvc3='100' +valid_z3='81' +valid_eprover='36' +valid_coq='0' +invalid='25' +percent='89' +cmd=' +onmutating' +sec='cha:nonmutating' diff --git a/StandardAlgorithms/Results/nonmutating.union.report b/StandardAlgorithms/Results/nonmutating.union.report new file mode 100644 index 0000000..ecc0ef2 --- /dev/null +++ b/StandardAlgorithms/Results/nonmutating.union.report @@ -0,0 +1,15 @@ +alg='nonmutating.union' +goal_count='249' +valid='246' +valid_qed='120' +valid_alt_ergo='121' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='5' +invalid='3' +percent='98' +cmd=' +onmutating' +sec='cha:nonmutating' diff --git a/StandardAlgorithms/Results/numeric.separate.report b/StandardAlgorithms/Results/numeric.separate.report new file mode 100644 index 0000000..c9692ae --- /dev/null +++ b/StandardAlgorithms/Results/numeric.separate.report @@ -0,0 +1,14 @@ +alg='numeric.separate' +goal_count='152' +valid='145' +valid_qed='54' +valid_alt_ergo='83' +valid_cvc4='5' +valid_cvc3='0' +valid_z3='1' +valid_eprover='0' +valid_coq='2' +invalid='7' +percent='95' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/numeric.simple.report b/StandardAlgorithms/Results/numeric.simple.report new file mode 100644 index 0000000..0006e38 --- /dev/null +++ b/StandardAlgorithms/Results/numeric.simple.report @@ -0,0 +1,15 @@ +alg='numeric.simple' +goal_count='152' +valid='148' +valid_qed='54' +valid_alt_ergo='85' +valid_cvc4='7' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='2' +invalid='4' +percent='97' +cmd=' +umeric' +sec='cha:numeric' diff --git a/StandardAlgorithms/Results/numeric.union.preport b/StandardAlgorithms/Results/numeric.union.preport new file mode 100644 index 0000000..2d621f9 --- /dev/null +++ b/StandardAlgorithms/Results/numeric.union.preport @@ -0,0 +1,15 @@ +alg='numeric.gen' +goal_count='152' +valid='133' +valid_qed='54' +valid_alt_ergo='70' +valid_cvc4='79' +valid_cvc3='75' +valid_z3='56' +valid_eprover='24' +valid_coq='0' +invalid='19' +percent='87' +cmd=' +umeric' +sec='cha:numeric' diff --git a/StandardAlgorithms/Results/numeric.union.report b/StandardAlgorithms/Results/numeric.union.report new file mode 100644 index 0000000..6df53d1 --- /dev/null +++ b/StandardAlgorithms/Results/numeric.union.report @@ -0,0 +1,15 @@ +alg='numeric.union' +goal_count='152' +valid='149' +valid_qed='54' +valid_alt_ergo='85' +valid_cvc4='8' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='2' +invalid='3' +percent='98' +cmd=' +umeric' +sec='cha:numeric' diff --git a/StandardAlgorithms/Results/operators.areport b/StandardAlgorithms/Results/operators.areport index 6382e01..942e73a 100644 --- a/StandardAlgorithms/Results/operators.areport +++ b/StandardAlgorithms/Results/operators.areport @@ -1,4 +1,4 @@ -alg='operators' +example='operators' goal_count='6' valid='6' valid_qed='0' diff --git a/StandardAlgorithms/Results/operators.preport b/StandardAlgorithms/Results/operators.preport index 82015e0..be85dd5 100644 --- a/StandardAlgorithms/Results/operators.preport +++ b/StandardAlgorithms/Results/operators.preport @@ -1,4 +1,4 @@ -alg='operators' +example='operators' goal_count='6' valid='4' valid_qed='4' diff --git a/StandardAlgorithms/Results/operators.report b/StandardAlgorithms/Results/operators.report index 6baaddc..04e64bc 100644 --- a/StandardAlgorithms/Results/operators.report +++ b/StandardAlgorithms/Results/operators.report @@ -1,4 +1,4 @@ -alg='operators' +example='operators' goal_count='6' valid='6' valid_qed='4' diff --git a/StandardAlgorithms/Results/partial_sort.areport b/StandardAlgorithms/Results/partial_sort.areport index f229878..6006bad 100644 --- a/StandardAlgorithms/Results/partial_sort.areport +++ b/StandardAlgorithms/Results/partial_sort.areport @@ -1,14 +1,14 @@ -alg='partial_sort' -goal_count='94' -valid='76' +example='partial_sort' +goal_count='91' +valid='74' valid_qed='0' -valid_alt_ergo='61' -valid_cvc4='15' +valid_alt_ergo='58' +valid_cvc4='16' valid_cvc3='0' valid_z3='0' valid_eprover='0' valid_coq='0' -invalid='18' -percent='80' +invalid='17' +percent='81' cmd='\partialsort' -sec='sec:partial_sort' +sec='sec:partialsort' diff --git a/StandardAlgorithms/Results/partial_sort.preport b/StandardAlgorithms/Results/partial_sort.preport index 27d535e..1252c77 100644 --- a/StandardAlgorithms/Results/partial_sort.preport +++ b/StandardAlgorithms/Results/partial_sort.preport @@ -1,14 +1,14 @@ -alg='partial_sort' -goal_count='118' -valid='83' -valid_qed='40' -valid_alt_ergo='42' +example='partial_sort' +goal_count='117' +valid='82' +valid_qed='39' +valid_alt_ergo='39' valid_cvc4='39' valid_cvc3='40' -valid_z3='24' -valid_eprover='4' +valid_z3='28' +valid_eprover='6' valid_coq='0' invalid='35' percent='70' cmd='\partialsort' -sec='sec:partial_sort' +sec='sec:partialsort' diff --git a/StandardAlgorithms/Results/partial_sort.report b/StandardAlgorithms/Results/partial_sort.report index f260a7d..a1b5d9b 100644 --- a/StandardAlgorithms/Results/partial_sort.report +++ b/StandardAlgorithms/Results/partial_sort.report @@ -1,14 +1,14 @@ -alg='partial_sort' -goal_count='118' -valid='118' -valid_qed='40' -valid_alt_ergo='64' -valid_cvc4='3' +example='partial_sort' +goal_count='117' +valid='117' +valid_qed='39' +valid_alt_ergo='59' +valid_cvc4='7' valid_cvc3='0' valid_z3='0' valid_eprover='0' -valid_coq='11' +valid_coq='12' invalid='0' percent='100' cmd='\partialsort' -sec='sec:partial_sort' +sec='sec:partialsort' diff --git a/StandardAlgorithms/Results/partial_sum.areport b/StandardAlgorithms/Results/partial_sum.areport index 6d51d18..95b8a3d 100644 --- a/StandardAlgorithms/Results/partial_sum.areport +++ b/StandardAlgorithms/Results/partial_sum.areport @@ -1,11 +1,11 @@ -alg='partial_sum' +example='partial_sum' goal_count='22' valid='21' valid_qed='0' -valid_alt_ergo='16' +valid_alt_ergo='17' valid_cvc4='3' valid_cvc3='0' -valid_z3='2' +valid_z3='1' valid_eprover='0' valid_coq='0' invalid='1' diff --git a/StandardAlgorithms/Results/partial_sum.preport b/StandardAlgorithms/Results/partial_sum.preport index 46a0fd4..285ba88 100644 --- a/StandardAlgorithms/Results/partial_sum.preport +++ b/StandardAlgorithms/Results/partial_sum.preport @@ -1,14 +1,14 @@ -alg='partial_sum' +example='partial_sum' goal_count='39' -valid='28' +valid='30' valid_qed='9' valid_alt_ergo='19' -valid_cvc4='19' +valid_cvc4='21' valid_cvc3='19' -valid_z3='11' +valid_z3='17' valid_eprover='4' valid_coq='0' -invalid='11' -percent='71' +invalid='9' +percent='76' cmd='\partialsum' sec='sec:partialsum' diff --git a/StandardAlgorithms/Results/partial_sum.report b/StandardAlgorithms/Results/partial_sum.report index 52a7040..d3ea2c8 100644 --- a/StandardAlgorithms/Results/partial_sum.report +++ b/StandardAlgorithms/Results/partial_sum.report @@ -1,9 +1,9 @@ -alg='partial_sum' +example='partial_sum' goal_count='39' valid='39' valid_qed='9' -valid_alt_ergo='29' -valid_cvc4='0' +valid_alt_ergo='25' +valid_cvc4='4' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/partial_sum_inv.areport b/StandardAlgorithms/Results/partial_sum_inv.areport index a284f7a..0449187 100644 --- a/StandardAlgorithms/Results/partial_sum_inv.areport +++ b/StandardAlgorithms/Results/partial_sum_inv.areport @@ -1,4 +1,4 @@ -alg='partial_sum_inv' +example='partial_sum_inv' goal_count='9' valid='8' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='1' percent='88' cmd='\partialsuminv' -sec='sec:inverting-partialsum' +sec='sec:partialsuminv' diff --git a/StandardAlgorithms/Results/partial_sum_inv.preport b/StandardAlgorithms/Results/partial_sum_inv.preport index ad6ce12..7c55e7e 100644 --- a/StandardAlgorithms/Results/partial_sum_inv.preport +++ b/StandardAlgorithms/Results/partial_sum_inv.preport @@ -1,14 +1,14 @@ -alg='partial_sum_inv' +example='partial_sum_inv' goal_count='20' valid='12' valid_qed='8' valid_alt_ergo='4' valid_cvc4='4' valid_cvc3='4' -valid_z3='3' +valid_z3='4' valid_eprover='3' valid_coq='0' invalid='8' percent='60' cmd='\partialsuminv' -sec='sec:inverting-partialsum' +sec='sec:partialsuminv' diff --git a/StandardAlgorithms/Results/partial_sum_inv.report b/StandardAlgorithms/Results/partial_sum_inv.report index b1e6b7e..0b91d8c 100644 --- a/StandardAlgorithms/Results/partial_sum_inv.report +++ b/StandardAlgorithms/Results/partial_sum_inv.report @@ -1,9 +1,9 @@ -alg='partial_sum_inv' +example='partial_sum_inv' goal_count='20' valid='19' valid_qed='8' -valid_alt_ergo='10' -valid_cvc4='0' +valid_alt_ergo='9' +valid_cvc4='1' valid_cvc3='0' valid_z3='0' valid_eprover='0' @@ -11,4 +11,4 @@ valid_coq='1' invalid='1' percent='95' cmd='\partialsuminv' -sec='sec:inverting-partialsum' +sec='sec:partialsuminv' diff --git a/StandardAlgorithms/Results/pop_heap.areport b/StandardAlgorithms/Results/pop_heap.areport index 9dfd81a..4f77231 100644 --- a/StandardAlgorithms/Results/pop_heap.areport +++ b/StandardAlgorithms/Results/pop_heap.areport @@ -1,4 +1,4 @@ -alg='pop_heap' +example='pop_heap' goal_count='60' valid='56' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='4' percent='93' cmd='\popheap' -sec='sec:pop_heap' +sec='sec:popheap' diff --git a/StandardAlgorithms/Results/pop_heap.preport b/StandardAlgorithms/Results/pop_heap.preport index 3abf52d..2af9e78 100644 --- a/StandardAlgorithms/Results/pop_heap.preport +++ b/StandardAlgorithms/Results/pop_heap.preport @@ -1,14 +1,14 @@ -alg='pop_heap' +example='pop_heap' goal_count='97' valid='80' valid_qed='49' -valid_alt_ergo='30' +valid_alt_ergo='27' valid_cvc4='31' valid_cvc3='28' -valid_z3='24' +valid_z3='29' valid_eprover='7' valid_coq='0' invalid='17' percent='82' cmd='\popheap' -sec='sec:pop_heap' +sec='sec:popheap' diff --git a/StandardAlgorithms/Results/pop_heap.report b/StandardAlgorithms/Results/pop_heap.report index 5937819..1df8c7e 100644 --- a/StandardAlgorithms/Results/pop_heap.report +++ b/StandardAlgorithms/Results/pop_heap.report @@ -1,9 +1,9 @@ -alg='pop_heap' +example='pop_heap' goal_count='97' valid='96' valid_qed='49' -valid_alt_ergo='43' -valid_cvc4='2' +valid_alt_ergo='41' +valid_cvc4='4' valid_cvc3='0' valid_z3='0' valid_eprover='0' @@ -11,4 +11,4 @@ valid_coq='2' invalid='1' percent='98' cmd='\popheap' -sec='sec:pop_heap' +sec='sec:popheap' diff --git a/StandardAlgorithms/Results/push_heap.areport b/StandardAlgorithms/Results/push_heap.areport index 4e069c9..644d5fa 100644 --- a/StandardAlgorithms/Results/push_heap.areport +++ b/StandardAlgorithms/Results/push_heap.areport @@ -1,14 +1,14 @@ -alg='push_heap' +example='push_heap' goal_count='93' -valid='84' +valid='83' valid_qed='0' -valid_alt_ergo='62' +valid_alt_ergo='63' valid_cvc4='17' -valid_cvc3='4' -valid_z3='1' +valid_cvc3='3' +valid_z3='0' valid_eprover='0' valid_coq='0' -invalid='9' -percent='90' +invalid='10' +percent='89' cmd='\pushheap' -sec='sec:push_heap' +sec='sec:pushheap' diff --git a/StandardAlgorithms/Results/push_heap.preport b/StandardAlgorithms/Results/push_heap.preport index 9075a8c..1d25d11 100644 --- a/StandardAlgorithms/Results/push_heap.preport +++ b/StandardAlgorithms/Results/push_heap.preport @@ -1,14 +1,14 @@ -alg='push_heap' +example='push_heap' goal_count='100' valid='75' valid_qed='33' -valid_alt_ergo='37' -valid_cvc4='38' -valid_cvc3='32' -valid_z3='27' -valid_eprover='6' +valid_alt_ergo='34' +valid_cvc4='40' +valid_cvc3='33' +valid_z3='36' +valid_eprover='8' valid_coq='0' invalid='25' percent='75' cmd='\pushheap' -sec='sec:push_heap' +sec='sec:pushheap' diff --git a/StandardAlgorithms/Results/push_heap.report b/StandardAlgorithms/Results/push_heap.report index ca7d116..85a44e2 100644 --- a/StandardAlgorithms/Results/push_heap.report +++ b/StandardAlgorithms/Results/push_heap.report @@ -1,9 +1,9 @@ -alg='push_heap' +example='push_heap' goal_count='100' valid='100' valid_qed='33' -valid_alt_ergo='59' -valid_cvc4='6' +valid_alt_ergo='52' +valid_cvc4='13' valid_cvc3='0' valid_z3='0' valid_eprover='0' @@ -11,4 +11,4 @@ valid_coq='2' invalid='0' percent='100' cmd='\pushheap' -sec='sec:push_heap' +sec='sec:pushheap' diff --git a/StandardAlgorithms/Results/random_number.areport b/StandardAlgorithms/Results/random_number.areport new file mode 100644 index 0000000..05267d5 --- /dev/null +++ b/StandardAlgorithms/Results/random_number.areport @@ -0,0 +1,14 @@ +example='random_number' +goal_count='34' +valid='31' +valid_qed='0' +valid_alt_ergo='24' +valid_cvc4='4' +valid_cvc3='0' +valid_z3='3' +valid_eprover='0' +valid_coq='0' +invalid='3' +percent='91' +cmd='\randomnumber' +sec='sec:randomnumber' diff --git a/StandardAlgorithms/Results/random_number.preport b/StandardAlgorithms/Results/random_number.preport new file mode 100644 index 0000000..6003a11 --- /dev/null +++ b/StandardAlgorithms/Results/random_number.preport @@ -0,0 +1,14 @@ +example='random_number' +goal_count='23' +valid='22' +valid_qed='13' +valid_alt_ergo='4' +valid_cvc4='4' +valid_cvc3='4' +valid_z3='6' +valid_eprover='8' +valid_coq='0' +invalid='1' +percent='95' +cmd='\randomnumber' +sec='sec:randomnumber' diff --git a/StandardAlgorithms/Results/random_number.report b/StandardAlgorithms/Results/random_number.report new file mode 100644 index 0000000..322586f --- /dev/null +++ b/StandardAlgorithms/Results/random_number.report @@ -0,0 +1,14 @@ +example='random_number' +goal_count='23' +valid='23' +valid_qed='13' +valid_alt_ergo='5' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='2' +valid_eprover='3' +valid_coq='0' +invalid='0' +percent='100' +cmd='\randomnumber' +sec='sec:randomnumber' diff --git a/StandardAlgorithms/Results/random_shuffle.areport b/StandardAlgorithms/Results/random_shuffle.areport index 0bbffe7..542a4de 100644 --- a/StandardAlgorithms/Results/random_shuffle.areport +++ b/StandardAlgorithms/Results/random_shuffle.areport @@ -1,4 +1,4 @@ -alg='random_shuffle' +example='random_shuffle' goal_count='59' valid='53' valid_qed='0' diff --git a/StandardAlgorithms/Results/random_shuffle.preport b/StandardAlgorithms/Results/random_shuffle.preport index b8829cc..304f707 100644 --- a/StandardAlgorithms/Results/random_shuffle.preport +++ b/StandardAlgorithms/Results/random_shuffle.preport @@ -1,11 +1,11 @@ -alg='random_shuffle' +example='random_shuffle' goal_count='60' valid='47' valid_qed='24' valid_alt_ergo='16' valid_cvc4='17' valid_cvc3='17' -valid_z3='19' +valid_z3='17' valid_eprover='11' valid_coq='0' invalid='13' diff --git a/StandardAlgorithms/Results/random_shuffle.report b/StandardAlgorithms/Results/random_shuffle.report index 5e0c8b5..42df12c 100644 --- a/StandardAlgorithms/Results/random_shuffle.report +++ b/StandardAlgorithms/Results/random_shuffle.report @@ -1,12 +1,12 @@ -alg='random_shuffle' +example='random_shuffle' goal_count='60' valid='60' valid_qed='24' -valid_alt_ergo='28' -valid_cvc4='0' -valid_cvc3='1' -valid_z3='5' -valid_eprover='0' +valid_alt_ergo='27' +valid_cvc4='2' +valid_cvc3='0' +valid_z3='0' +valid_eprover='5' valid_coq='2' invalid='0' percent='100' diff --git a/StandardAlgorithms/Results/remove.areport b/StandardAlgorithms/Results/remove.areport index 1684ffe..6f1a1fd 100644 --- a/StandardAlgorithms/Results/remove.areport +++ b/StandardAlgorithms/Results/remove.areport @@ -1,14 +1,14 @@ -alg='remove' -goal_count='32' -valid='31' +example='remove' +goal_count='18' +valid='17' valid_qed='0' -valid_alt_ergo='24' -valid_cvc4='6' +valid_alt_ergo='13' +valid_cvc4='4' valid_cvc3='0' -valid_z3='1' +valid_z3='0' valid_eprover='0' valid_coq='0' invalid='1' -percent='96' +percent='94' cmd='\remove' sec='sec:remove' diff --git a/StandardAlgorithms/Results/remove.preport b/StandardAlgorithms/Results/remove.preport index b640e91..6f7c57a 100644 --- a/StandardAlgorithms/Results/remove.preport +++ b/StandardAlgorithms/Results/remove.preport @@ -1,14 +1,14 @@ -alg='remove' -goal_count='38' -valid='25' +example='remove' +goal_count='39' +valid='26' valid_qed='9' -valid_alt_ergo='14' -valid_cvc4='16' -valid_cvc3='13' -valid_z3='12' -valid_eprover='4' +valid_alt_ergo='15' +valid_cvc4='17' +valid_cvc3='14' +valid_z3='17' +valid_eprover='5' valid_coq='0' invalid='13' -percent='65' +percent='66' cmd='\remove' sec='sec:remove' diff --git a/StandardAlgorithms/Results/remove.report b/StandardAlgorithms/Results/remove.report index 33ee7be..b9b8efc 100644 --- a/StandardAlgorithms/Results/remove.report +++ b/StandardAlgorithms/Results/remove.report @@ -1,8 +1,8 @@ -alg='remove' -goal_count='38' -valid='38' +example='remove' +goal_count='39' +valid='39' valid_qed='9' -valid_alt_ergo='25' +valid_alt_ergo='26' valid_cvc4='3' valid_cvc3='0' valid_z3='0' diff --git a/StandardAlgorithms/Results/remove_copy.areport b/StandardAlgorithms/Results/remove_copy.areport index b428a7e..272e721 100644 --- a/StandardAlgorithms/Results/remove_copy.areport +++ b/StandardAlgorithms/Results/remove_copy.areport @@ -1,4 +1,4 @@ -alg='remove_copy' +example='remove_copy' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/remove_copy.preport b/StandardAlgorithms/Results/remove_copy.preport index f150b71..cbd7ae8 100644 --- a/StandardAlgorithms/Results/remove_copy.preport +++ b/StandardAlgorithms/Results/remove_copy.preport @@ -1,11 +1,11 @@ -alg='remove_copy' -goal_count='20' -valid='20' +example='remove_copy' +goal_count='21' +valid='21' valid_qed='9' -valid_alt_ergo='11' -valid_cvc4='11' -valid_cvc3='11' -valid_z3='9' +valid_alt_ergo='12' +valid_cvc4='12' +valid_cvc3='12' +valid_z3='12' valid_eprover='2' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/remove_copy.report b/StandardAlgorithms/Results/remove_copy.report index fe65aa9..c3bfa5f 100644 --- a/StandardAlgorithms/Results/remove_copy.report +++ b/StandardAlgorithms/Results/remove_copy.report @@ -1,8 +1,8 @@ -alg='remove_copy' -goal_count='20' -valid='20' +example='remove_copy' +goal_count='21' +valid='21' valid_qed='9' -valid_alt_ergo='11' +valid_alt_ergo='12' valid_cvc4='0' valid_cvc3='0' valid_z3='0' diff --git a/StandardAlgorithms/Results/remove_copy2.areport b/StandardAlgorithms/Results/remove_copy2.areport index 699ccc4..4d5ae77 100644 --- a/StandardAlgorithms/Results/remove_copy2.areport +++ b/StandardAlgorithms/Results/remove_copy2.areport @@ -1,14 +1,14 @@ -alg='remove_copy2' -goal_count='18' -valid='17' +example='remove_copy2' +goal_count='15' +valid='14' valid_qed='0' -valid_alt_ergo='15' -valid_cvc4='2' -valid_cvc3='0' +valid_alt_ergo='12' +valid_cvc4='1' +valid_cvc3='1' valid_z3='0' valid_eprover='0' valid_coq='0' invalid='1' -percent='94' +percent='93' cmd='\removecopytwo' sec='sec:removecopy2' diff --git a/StandardAlgorithms/Results/remove_copy2.preport b/StandardAlgorithms/Results/remove_copy2.preport index 6854365..0d98c11 100644 --- a/StandardAlgorithms/Results/remove_copy2.preport +++ b/StandardAlgorithms/Results/remove_copy2.preport @@ -1,14 +1,14 @@ -alg='remove_copy2' -goal_count='36' -valid='23' +example='remove_copy2' +goal_count='39' +valid='26' valid_qed='9' -valid_alt_ergo='14' -valid_cvc4='13' -valid_cvc3='13' -valid_z3='12' -valid_eprover='4' +valid_alt_ergo='16' +valid_cvc4='17' +valid_cvc3='16' +valid_z3='17' +valid_eprover='5' valid_coq='0' invalid='13' -percent='63' +percent='66' cmd='\removecopytwo' sec='sec:removecopy2' diff --git a/StandardAlgorithms/Results/remove_copy2.report b/StandardAlgorithms/Results/remove_copy2.report index a22f9e4..94fd6e9 100644 --- a/StandardAlgorithms/Results/remove_copy2.report +++ b/StandardAlgorithms/Results/remove_copy2.report @@ -1,9 +1,9 @@ -alg='remove_copy2' -goal_count='36' -valid='36' +example='remove_copy2' +goal_count='39' +valid='39' valid_qed='9' -valid_alt_ergo='26' -valid_cvc4='0' +valid_alt_ergo='28' +valid_cvc4='1' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/remove_copy3.areport b/StandardAlgorithms/Results/remove_copy3.areport index 5220985..6845405 100644 --- a/StandardAlgorithms/Results/remove_copy3.areport +++ b/StandardAlgorithms/Results/remove_copy3.areport @@ -1,14 +1,14 @@ -alg='remove_copy3' -goal_count='28' -valid='27' +example='remove_copy3' +goal_count='20' +valid='19' valid_qed='0' -valid_alt_ergo='23' -valid_cvc4='2' +valid_alt_ergo='16' +valid_cvc4='3' valid_cvc3='0' -valid_z3='1' -valid_eprover='1' +valid_z3='0' +valid_eprover='0' valid_coq='0' invalid='1' -percent='96' -cmd='\removecopy(3)' +percent='95' +cmd='\removecopythree' sec='sec:removecopy3' diff --git a/StandardAlgorithms/Results/remove_copy3.preport b/StandardAlgorithms/Results/remove_copy3.preport index 78d9259..d688e26 100644 --- a/StandardAlgorithms/Results/remove_copy3.preport +++ b/StandardAlgorithms/Results/remove_copy3.preport @@ -1,14 +1,14 @@ -alg='remove_copy3' -goal_count='43' -valid='29' +example='remove_copy3' +goal_count='44' +valid='30' valid_qed='10' -valid_alt_ergo='16' -valid_cvc4='19' +valid_alt_ergo='19' +valid_cvc4='20' valid_cvc3='15' -valid_z3='14' -valid_eprover='5' +valid_z3='20' +valid_eprover='6' valid_coq='0' invalid='14' -percent='67' -cmd='\removecopy(3)' +percent='68' +cmd='\removecopythree' sec='sec:removecopy3' diff --git a/StandardAlgorithms/Results/remove_copy3.report b/StandardAlgorithms/Results/remove_copy3.report index a1ba54f..04d9a47 100644 --- a/StandardAlgorithms/Results/remove_copy3.report +++ b/StandardAlgorithms/Results/remove_copy3.report @@ -1,14 +1,14 @@ -alg='remove_copy3' -goal_count='43' -valid='43' +example='remove_copy3' +goal_count='44' +valid='44' valid_qed='10' -valid_alt_ergo='28' -valid_cvc4='4' +valid_alt_ergo='31' +valid_cvc4='2' valid_cvc3='0' valid_z3='0' valid_eprover='0' valid_coq='1' invalid='0' percent='100' -cmd='\removecopy(3)' +cmd='\removecopythree' sec='sec:removecopy3' diff --git a/StandardAlgorithms/Results/replace.areport b/StandardAlgorithms/Results/replace.areport index 38bb481..600683b 100644 --- a/StandardAlgorithms/Results/replace.areport +++ b/StandardAlgorithms/Results/replace.areport @@ -1,4 +1,4 @@ -alg='replace' +example='replace' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/replace.preport b/StandardAlgorithms/Results/replace.preport index 58cfb44..7024adb 100644 --- a/StandardAlgorithms/Results/replace.preport +++ b/StandardAlgorithms/Results/replace.preport @@ -1,11 +1,11 @@ -alg='replace' +example='replace' goal_count='15' valid='15' valid_qed='4' valid_alt_ergo='11' valid_cvc4='11' valid_cvc3='11' -valid_z3='8' +valid_z3='11' valid_eprover='5' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/replace.report b/StandardAlgorithms/Results/replace.report index 5124f0c..de9f43d 100644 --- a/StandardAlgorithms/Results/replace.report +++ b/StandardAlgorithms/Results/replace.report @@ -1,4 +1,4 @@ -alg='replace' +example='replace' goal_count='15' valid='15' valid_qed='4' diff --git a/StandardAlgorithms/Results/replace_copy.areport b/StandardAlgorithms/Results/replace_copy.areport index d1e10cb..4d465ff 100644 --- a/StandardAlgorithms/Results/replace_copy.areport +++ b/StandardAlgorithms/Results/replace_copy.areport @@ -1,10 +1,10 @@ -alg='replace_copy' +example='replace_copy' goal_count='2' valid='2' valid_qed='0' valid_alt_ergo='1' -valid_cvc4='0' -valid_cvc3='1' +valid_cvc4='1' +valid_cvc3='0' valid_z3='0' valid_eprover='0' valid_coq='0' diff --git a/StandardAlgorithms/Results/replace_copy.preport b/StandardAlgorithms/Results/replace_copy.preport index d49845f..2c52dd1 100644 --- a/StandardAlgorithms/Results/replace_copy.preport +++ b/StandardAlgorithms/Results/replace_copy.preport @@ -1,12 +1,12 @@ -alg='replace_copy' -goal_count='20' -valid='20' +example='replace_copy' +goal_count='19' +valid='19' valid_qed='7' -valid_alt_ergo='13' -valid_cvc4='13' -valid_cvc3='13' -valid_z3='10' -valid_eprover='4' +valid_alt_ergo='12' +valid_cvc4='12' +valid_cvc3='12' +valid_z3='12' +valid_eprover='3' valid_coq='0' invalid='0' percent='100' diff --git a/StandardAlgorithms/Results/replace_copy.report b/StandardAlgorithms/Results/replace_copy.report index 64ea938..60fb42d 100644 --- a/StandardAlgorithms/Results/replace_copy.report +++ b/StandardAlgorithms/Results/replace_copy.report @@ -1,8 +1,8 @@ -alg='replace_copy' -goal_count='20' -valid='20' +example='replace_copy' +goal_count='19' +valid='19' valid_qed='7' -valid_alt_ergo='13' +valid_alt_ergo='12' valid_cvc4='0' valid_cvc3='0' valid_z3='0' diff --git a/StandardAlgorithms/Results/reverse.areport b/StandardAlgorithms/Results/reverse.areport index ad65675..910b6ef 100644 --- a/StandardAlgorithms/Results/reverse.areport +++ b/StandardAlgorithms/Results/reverse.areport @@ -1,4 +1,4 @@ -alg='reverse' +example='reverse' goal_count='13' valid='13' valid_qed='0' diff --git a/StandardAlgorithms/Results/reverse.preport b/StandardAlgorithms/Results/reverse.preport index 50ba4e8..550e411 100644 --- a/StandardAlgorithms/Results/reverse.preport +++ b/StandardAlgorithms/Results/reverse.preport @@ -1,11 +1,11 @@ -alg='reverse' +example='reverse' goal_count='24' valid='24' valid_qed='5' -valid_alt_ergo='17' +valid_alt_ergo='19' valid_cvc4='17' valid_cvc3='18' -valid_z3='15' +valid_z3='19' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/reverse.report b/StandardAlgorithms/Results/reverse.report index 102d9e0..e447e29 100644 --- a/StandardAlgorithms/Results/reverse.report +++ b/StandardAlgorithms/Results/reverse.report @@ -1,10 +1,10 @@ -alg='reverse' +example='reverse' goal_count='24' valid='24' valid_qed='5' -valid_alt_ergo='17' +valid_alt_ergo='19' valid_cvc4='0' -valid_cvc3='2' +valid_cvc3='0' valid_z3='0' valid_eprover='0' valid_coq='0' diff --git a/StandardAlgorithms/Results/reverse_copy.areport b/StandardAlgorithms/Results/reverse_copy.areport index c7b6735..8816be8 100644 --- a/StandardAlgorithms/Results/reverse_copy.areport +++ b/StandardAlgorithms/Results/reverse_copy.areport @@ -1,4 +1,4 @@ -alg='reverse_copy' +example='reverse_copy' goal_count='7' valid='7' valid_qed='0' diff --git a/StandardAlgorithms/Results/reverse_copy.preport b/StandardAlgorithms/Results/reverse_copy.preport index 056c67d..ea58766 100644 --- a/StandardAlgorithms/Results/reverse_copy.preport +++ b/StandardAlgorithms/Results/reverse_copy.preport @@ -1,11 +1,11 @@ -alg='reverse_copy' +example='reverse_copy' goal_count='17' valid='17' valid_qed='4' valid_alt_ergo='13' valid_cvc4='12' valid_cvc3='13' -valid_z3='11' +valid_z3='13' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/reverse_copy.report b/StandardAlgorithms/Results/reverse_copy.report index 654cbd2..aedc53f 100644 --- a/StandardAlgorithms/Results/reverse_copy.report +++ b/StandardAlgorithms/Results/reverse_copy.report @@ -1,4 +1,4 @@ -alg='reverse_copy' +example='reverse_copy' goal_count='17' valid='17' valid_qed='4' diff --git a/StandardAlgorithms/Results/rotate.areport b/StandardAlgorithms/Results/rotate.areport index 3fe2e81..37440f7 100644 --- a/StandardAlgorithms/Results/rotate.areport +++ b/StandardAlgorithms/Results/rotate.areport @@ -1,11 +1,11 @@ -alg='rotate' +example='rotate' goal_count='18' valid='17' valid_qed='0' -valid_alt_ergo='11' +valid_alt_ergo='12' valid_cvc4='5' valid_cvc3='0' -valid_z3='1' +valid_z3='0' valid_eprover='0' valid_coq='0' invalid='1' diff --git a/StandardAlgorithms/Results/rotate.preport b/StandardAlgorithms/Results/rotate.preport index 2ab9b7e..d6f56aa 100644 --- a/StandardAlgorithms/Results/rotate.preport +++ b/StandardAlgorithms/Results/rotate.preport @@ -1,11 +1,11 @@ -alg='rotate' +example='rotate' goal_count='24' valid='24' valid_qed='10' valid_alt_ergo='14' valid_cvc4='13' valid_cvc3='14' -valid_z3='6' +valid_z3='14' valid_eprover='0' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/rotate.report b/StandardAlgorithms/Results/rotate.report index fb78d3e..fef4c86 100644 --- a/StandardAlgorithms/Results/rotate.report +++ b/StandardAlgorithms/Results/rotate.report @@ -1,4 +1,4 @@ -alg='rotate' +example='rotate' goal_count='24' valid='24' valid_qed='10' diff --git a/StandardAlgorithms/Results/rotate_copy.areport b/StandardAlgorithms/Results/rotate_copy.areport index 6af752c..c29c2ff 100644 --- a/StandardAlgorithms/Results/rotate_copy.areport +++ b/StandardAlgorithms/Results/rotate_copy.areport @@ -1,4 +1,4 @@ -alg='rotate_copy' +example='rotate_copy' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/rotate_copy.preport b/StandardAlgorithms/Results/rotate_copy.preport index c02e75a..d5d2527 100644 --- a/StandardAlgorithms/Results/rotate_copy.preport +++ b/StandardAlgorithms/Results/rotate_copy.preport @@ -1,11 +1,11 @@ -alg='rotate_copy' +example='rotate_copy' goal_count='17' valid='17' valid_qed='5' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='11' -valid_z3='11' +valid_z3='12' valid_eprover='0' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/rotate_copy.report b/StandardAlgorithms/Results/rotate_copy.report index c7c9e48..eb2b6a8 100644 --- a/StandardAlgorithms/Results/rotate_copy.report +++ b/StandardAlgorithms/Results/rotate_copy.report @@ -1,4 +1,4 @@ -alg='rotate_copy' +example='rotate_copy' goal_count='17' valid='17' valid_qed='5' diff --git a/StandardAlgorithms/Results/search.areport b/StandardAlgorithms/Results/search.areport index f07bcc2..5b59248 100644 --- a/StandardAlgorithms/Results/search.areport +++ b/StandardAlgorithms/Results/search.areport @@ -1,4 +1,4 @@ -alg='search' +example='search' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/search.preport b/StandardAlgorithms/Results/search.preport index d5ceae8..3a48087 100644 --- a/StandardAlgorithms/Results/search.preport +++ b/StandardAlgorithms/Results/search.preport @@ -1,11 +1,11 @@ -alg='search' +example='search' goal_count='30' valid='29' valid_qed='18' valid_alt_ergo='11' valid_cvc4='11' valid_cvc3='11' -valid_z3='8' +valid_z3='11' valid_eprover='5' valid_coq='0' invalid='1' diff --git a/StandardAlgorithms/Results/search.report b/StandardAlgorithms/Results/search.report index 3103ef2..43cc971 100644 --- a/StandardAlgorithms/Results/search.report +++ b/StandardAlgorithms/Results/search.report @@ -1,4 +1,4 @@ -alg='search' +example='search' goal_count='30' valid='30' valid_qed='18' diff --git a/StandardAlgorithms/Results/search_n.areport b/StandardAlgorithms/Results/search_n.areport index 09193f4..a499cc3 100644 --- a/StandardAlgorithms/Results/search_n.areport +++ b/StandardAlgorithms/Results/search_n.areport @@ -1,14 +1,14 @@ -alg='search_n' -goal_count='22' -valid='20' +example='search_n' +goal_count='28' +valid='28' valid_qed='0' -valid_alt_ergo='19' +valid_alt_ergo='27' valid_cvc4='1' valid_cvc3='0' valid_z3='0' valid_eprover='0' valid_coq='0' -invalid='2' -percent='90' +invalid='0' +percent='100' cmd='\searchn' -sec='sec:search_n' +sec='sec:searchn' diff --git a/StandardAlgorithms/Results/search_n.preport b/StandardAlgorithms/Results/search_n.preport index 91422b4..653eef9 100644 --- a/StandardAlgorithms/Results/search_n.preport +++ b/StandardAlgorithms/Results/search_n.preport @@ -1,14 +1,14 @@ -alg='search_n' -goal_count='29' -valid='26' -valid_qed='11' -valid_alt_ergo='15' -valid_cvc4='12' -valid_cvc3='12' -valid_z3='11' -valid_eprover='2' +example='search_n' +goal_count='91' +valid='90' +valid_qed='62' +valid_alt_ergo='28' +valid_cvc4='23' +valid_cvc3='22' +valid_z3='28' +valid_eprover='14' valid_coq='0' -invalid='3' -percent='89' +invalid='1' +percent='98' cmd='\searchn' -sec='sec:search_n' +sec='sec:searchn' diff --git a/StandardAlgorithms/Results/search_n.report b/StandardAlgorithms/Results/search_n.report index f351d41..606714a 100644 --- a/StandardAlgorithms/Results/search_n.report +++ b/StandardAlgorithms/Results/search_n.report @@ -1,8 +1,8 @@ -alg='search_n' -goal_count='29' -valid='29' -valid_qed='11' -valid_alt_ergo='18' +example='search_n' +goal_count='91' +valid='91' +valid_qed='62' +valid_alt_ergo='29' valid_cvc4='0' valid_cvc3='0' valid_z3='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\searchn' -sec='sec:search_n' +sec='sec:searchn' diff --git a/StandardAlgorithms/Results/selection_sort.areport b/StandardAlgorithms/Results/selection_sort.areport index f9034d3..431e707 100644 --- a/StandardAlgorithms/Results/selection_sort.areport +++ b/StandardAlgorithms/Results/selection_sort.areport @@ -1,4 +1,4 @@ -alg='selection_sort' +example='selection_sort' goal_count='38' valid='32' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='6' percent='84' cmd='\selectionsort' -sec='sec:selection_sort' +sec='sec:selectionsort' diff --git a/StandardAlgorithms/Results/selection_sort.preport b/StandardAlgorithms/Results/selection_sort.preport index a275f4d..4365bd7 100644 --- a/StandardAlgorithms/Results/selection_sort.preport +++ b/StandardAlgorithms/Results/selection_sort.preport @@ -1,14 +1,14 @@ -alg='selection_sort' +example='selection_sort' goal_count='58' valid='37' valid_qed='17' -valid_alt_ergo='20' +valid_alt_ergo='19' valid_cvc4='17' valid_cvc3='19' -valid_z3='16' +valid_z3='17' valid_eprover='5' valid_coq='0' invalid='21' percent='63' cmd='\selectionsort' -sec='sec:selection_sort' +sec='sec:selectionsort' diff --git a/StandardAlgorithms/Results/selection_sort.report b/StandardAlgorithms/Results/selection_sort.report index 1078ab2..7b508df 100644 --- a/StandardAlgorithms/Results/selection_sort.report +++ b/StandardAlgorithms/Results/selection_sort.report @@ -1,14 +1,14 @@ -alg='selection_sort' +example='selection_sort' goal_count='58' valid='58' valid_qed='17' valid_alt_ergo='33' valid_cvc4='2' valid_cvc3='0' -valid_z3='3' +valid_z3='0' valid_eprover='0' -valid_coq='3' +valid_coq='6' invalid='0' percent='100' cmd='\selectionsort' -sec='sec:selection_sort' +sec='sec:selectionsort' diff --git a/StandardAlgorithms/Results/sort_heap.areport b/StandardAlgorithms/Results/sort_heap.areport index 0c306b6..19b3cee 100644 --- a/StandardAlgorithms/Results/sort_heap.areport +++ b/StandardAlgorithms/Results/sort_heap.areport @@ -1,4 +1,4 @@ -alg='sort_heap' +example='sort_heap' goal_count='33' valid='29' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='4' percent='87' cmd='\sortheap' -sec='sec:sort_heap' +sec='sec:sortheap' diff --git a/StandardAlgorithms/Results/sort_heap.preport b/StandardAlgorithms/Results/sort_heap.preport index d13cfd3..521c03c 100644 --- a/StandardAlgorithms/Results/sort_heap.preport +++ b/StandardAlgorithms/Results/sort_heap.preport @@ -1,14 +1,14 @@ -alg='sort_heap' +example='sort_heap' goal_count='54' valid='32' valid_qed='16' valid_alt_ergo='16' valid_cvc4='16' valid_cvc3='15' -valid_z3='11' -valid_eprover='6' +valid_z3='16' +valid_eprover='7' valid_coq='0' invalid='22' percent='59' cmd='\sortheap' -sec='sec:sort_heap' +sec='sec:sortheap' diff --git a/StandardAlgorithms/Results/sort_heap.report b/StandardAlgorithms/Results/sort_heap.report index 99a97f6..2728d82 100644 --- a/StandardAlgorithms/Results/sort_heap.report +++ b/StandardAlgorithms/Results/sort_heap.report @@ -1,4 +1,4 @@ -alg='sort_heap' +example='sort_heap' goal_count='54' valid='54' valid_qed='16' @@ -11,4 +11,4 @@ valid_coq='2' invalid='0' percent='100' cmd='\sortheap' -sec='sec:sort_heap' +sec='sec:sortheap' diff --git a/StandardAlgorithms/Results/sorting.separate.report b/StandardAlgorithms/Results/sorting.separate.report new file mode 100644 index 0000000..60c74b7 --- /dev/null +++ b/StandardAlgorithms/Results/sorting.separate.report @@ -0,0 +1,14 @@ +alg='sorting.separate' +goal_count='308' +valid='295' +valid_qed='109' +valid_alt_ergo='144' +valid_cvc4='21' +valid_cvc3='5' +valid_z3='4' +valid_eprover='0' +valid_coq='12' +invalid='13' +percent='95' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/sorting.simple.report b/StandardAlgorithms/Results/sorting.simple.report new file mode 100644 index 0000000..4dd467a --- /dev/null +++ b/StandardAlgorithms/Results/sorting.simple.report @@ -0,0 +1,14 @@ +alg='sorting.simple' +goal_count='308' +valid='297' +valid_qed='109' +valid_alt_ergo='142' +valid_cvc4='19' +valid_cvc3='5' +valid_z3='6' +valid_eprover='0' +valid_coq='16' +invalid='11' +percent='96' +cmd='\sorting' +sec='cha:sorting' diff --git a/StandardAlgorithms/Results/sorting.union.preport b/StandardAlgorithms/Results/sorting.union.preport new file mode 100644 index 0000000..e655615 --- /dev/null +++ b/StandardAlgorithms/Results/sorting.union.preport @@ -0,0 +1,14 @@ +alg='sorting.gen' +goal_count='336' +valid='277' +valid_qed='123' +valid_alt_ergo='141' +valid_cvc4='143' +valid_cvc3='139' +valid_z3='108' +valid_eprover='33' +valid_coq='0' +invalid='59' +percent='82' +cmd='\sorting' +sec='cha:sorting' diff --git a/StandardAlgorithms/Results/sorting.union.report b/StandardAlgorithms/Results/sorting.union.report new file mode 100644 index 0000000..71fd004 --- /dev/null +++ b/StandardAlgorithms/Results/sorting.union.report @@ -0,0 +1,14 @@ +alg='sorting.union' +goal_count='336' +valid='324' +valid_qed='123' +valid_alt_ergo='159' +valid_cvc4='14' +valid_cvc3='7' +valid_z3='4' +valid_eprover='0' +valid_coq='17' +invalid='12' +percent='96' +cmd='\sorting' +sec='cha:sorting' diff --git a/StandardAlgorithms/Results/stack.separate.report b/StandardAlgorithms/Results/stack.separate.report new file mode 100644 index 0000000..8caadb3 --- /dev/null +++ b/StandardAlgorithms/Results/stack.separate.report @@ -0,0 +1,14 @@ +alg='stack.separate' +goal_count='130' +valid='130' +valid_qed='76' +valid_alt_ergo='54' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/stack.simple.report b/StandardAlgorithms/Results/stack.simple.report new file mode 100644 index 0000000..8f4318a --- /dev/null +++ b/StandardAlgorithms/Results/stack.simple.report @@ -0,0 +1,14 @@ +alg='stack.simple' +goal_count='130' +valid='130' +valid_qed='76' +valid_alt_ergo='54' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\stack' +sec='cha:stack' diff --git a/StandardAlgorithms/Results/stack.union.preport b/StandardAlgorithms/Results/stack.union.preport new file mode 100644 index 0000000..f95a1d6 --- /dev/null +++ b/StandardAlgorithms/Results/stack.union.preport @@ -0,0 +1,14 @@ +alg='stack.gen' +goal_count='140' +valid='127' +valid_qed='76' +valid_alt_ergo='51' +valid_cvc4='51' +valid_cvc3='51' +valid_z3='49' +valid_eprover='15' +valid_coq='0' +invalid='13' +percent='90' +cmd='\stack' +sec='cha:stack' diff --git a/StandardAlgorithms/Results/stack.union.report b/StandardAlgorithms/Results/stack.union.report new file mode 100644 index 0000000..9e72692 --- /dev/null +++ b/StandardAlgorithms/Results/stack.union.report @@ -0,0 +1,14 @@ +alg='stack.union' +goal_count='140' +valid='140' +valid_qed='76' +valid_alt_ergo='63' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='1' +invalid='0' +percent='100' +cmd='\stack' +sec='cha:stack' diff --git a/StandardAlgorithms/Results/stack_axiom.separate.report b/StandardAlgorithms/Results/stack_axiom.separate.report new file mode 100644 index 0000000..6dcd4c0 --- /dev/null +++ b/StandardAlgorithms/Results/stack_axiom.separate.report @@ -0,0 +1,14 @@ +alg='stack_axiom.separate' +goal_count='59' +valid='59' +valid_qed='51' +valid_alt_ergo='8' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/stack_axiom.simple.report b/StandardAlgorithms/Results/stack_axiom.simple.report new file mode 100644 index 0000000..83c0a7b --- /dev/null +++ b/StandardAlgorithms/Results/stack_axiom.simple.report @@ -0,0 +1,14 @@ +alg='stack_axiom.simple' +goal_count='59' +valid='59' +valid_qed='51' +valid_alt_ergo='8' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\stack_axiom' +sec='cha:stack_axiom' diff --git a/StandardAlgorithms/Results/stack_axiom.union.preport b/StandardAlgorithms/Results/stack_axiom.union.preport new file mode 100644 index 0000000..e3db57d --- /dev/null +++ b/StandardAlgorithms/Results/stack_axiom.union.preport @@ -0,0 +1,14 @@ +alg='stack_axiom.gen' +goal_count='59' +valid='56' +valid_qed='51' +valid_alt_ergo='5' +valid_cvc4='5' +valid_cvc3='5' +valid_z3='5' +valid_eprover='3' +valid_coq='0' +invalid='3' +percent='94' +cmd='\stack_axiom' +sec='cha:stack_axiom' diff --git a/StandardAlgorithms/Results/stack_axiom.union.report b/StandardAlgorithms/Results/stack_axiom.union.report new file mode 100644 index 0000000..b28d8a7 --- /dev/null +++ b/StandardAlgorithms/Results/stack_axiom.union.report @@ -0,0 +1,14 @@ +alg='stack_axiom.union' +goal_count='59' +valid='59' +valid_qed='51' +valid_alt_ergo='8' +valid_cvc4='0' +valid_cvc3='0' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\stack_axiom' +sec='cha:stack_axiom' diff --git a/StandardAlgorithms/Results/stack_empty.areport b/StandardAlgorithms/Results/stack_empty.areport index 6c25117..4b2b3de 100644 --- a/StandardAlgorithms/Results/stack_empty.areport +++ b/StandardAlgorithms/Results/stack_empty.areport @@ -1,4 +1,4 @@ -alg='stack_empty' +example='stack_empty' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_empty.preport b/StandardAlgorithms/Results/stack_empty.preport index f0a5e00..917cc30 100644 --- a/StandardAlgorithms/Results/stack_empty.preport +++ b/StandardAlgorithms/Results/stack_empty.preport @@ -1,4 +1,4 @@ -alg='stack_empty' +example='stack_empty' goal_count='10' valid='7' valid_qed='5' diff --git a/StandardAlgorithms/Results/stack_empty.report b/StandardAlgorithms/Results/stack_empty.report index b79d214..a5fede7 100644 --- a/StandardAlgorithms/Results/stack_empty.report +++ b/StandardAlgorithms/Results/stack_empty.report @@ -1,4 +1,4 @@ -alg='stack_empty' +example='stack_empty' goal_count='10' valid='10' valid_qed='5' diff --git a/StandardAlgorithms/Results/stack_empty_wd.areport b/StandardAlgorithms/Results/stack_empty_wd.areport index d2267bc..821d2de 100644 --- a/StandardAlgorithms/Results/stack_empty_wd.areport +++ b/StandardAlgorithms/Results/stack_empty_wd.areport @@ -1,4 +1,4 @@ -alg='stack_empty_wd' +example='stack_empty_wd' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_empty_wd.preport b/StandardAlgorithms/Results/stack_empty_wd.preport index 0a8735d..1ff81ad 100644 --- a/StandardAlgorithms/Results/stack_empty_wd.preport +++ b/StandardAlgorithms/Results/stack_empty_wd.preport @@ -1,4 +1,4 @@ -alg='stack_empty_wd' +example='stack_empty_wd' goal_count='12' valid='9' valid_qed='8' diff --git a/StandardAlgorithms/Results/stack_empty_wd.report b/StandardAlgorithms/Results/stack_empty_wd.report index c5306bb..d20e11d 100644 --- a/StandardAlgorithms/Results/stack_empty_wd.report +++ b/StandardAlgorithms/Results/stack_empty_wd.report @@ -1,4 +1,4 @@ -alg='stack_empty_wd' +example='stack_empty_wd' goal_count='12' valid='12' valid_qed='8' diff --git a/StandardAlgorithms/Results/stack_equal.areport b/StandardAlgorithms/Results/stack_equal.areport index 63bc21b..ab57e8f 100644 --- a/StandardAlgorithms/Results/stack_equal.areport +++ b/StandardAlgorithms/Results/stack_equal.areport @@ -1,4 +1,4 @@ -alg='stack_equal' +example='stack_equal' goal_count='5' valid='5' valid_qed='0' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\stackequal' -sec='sec:stack-runtime-equality' +sec='sec:stackequal' diff --git a/StandardAlgorithms/Results/stack_equal.preport b/StandardAlgorithms/Results/stack_equal.preport index bad3428..82f41f2 100644 --- a/StandardAlgorithms/Results/stack_equal.preport +++ b/StandardAlgorithms/Results/stack_equal.preport @@ -1,14 +1,14 @@ -alg='stack_equal' +example='stack_equal' goal_count='18' valid='15' valid_qed='7' valid_alt_ergo='8' valid_cvc4='8' valid_cvc3='8' -valid_z3='6' +valid_z3='8' valid_eprover='2' valid_coq='0' invalid='3' percent='83' cmd='\stackequal' -sec='sec:stack-runtime-equality' +sec='sec:stackequal' diff --git a/StandardAlgorithms/Results/stack_equal.report b/StandardAlgorithms/Results/stack_equal.report index 372ff4c..842cd43 100644 --- a/StandardAlgorithms/Results/stack_equal.report +++ b/StandardAlgorithms/Results/stack_equal.report @@ -1,4 +1,4 @@ -alg='stack_equal' +example='stack_equal' goal_count='18' valid='18' valid_qed='7' @@ -11,4 +11,4 @@ valid_coq='0' invalid='0' percent='100' cmd='\stackequal' -sec='sec:stack-runtime-equality' +sec='sec:stackequal' diff --git a/StandardAlgorithms/Results/stack_full.areport b/StandardAlgorithms/Results/stack_full.areport index b9f0ae0..30814ff 100644 --- a/StandardAlgorithms/Results/stack_full.areport +++ b/StandardAlgorithms/Results/stack_full.areport @@ -1,4 +1,4 @@ -alg='stack_full' +example='stack_full' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_full.preport b/StandardAlgorithms/Results/stack_full.preport index ad806b0..cac87ed 100644 --- a/StandardAlgorithms/Results/stack_full.preport +++ b/StandardAlgorithms/Results/stack_full.preport @@ -1,4 +1,4 @@ -alg='stack_full' +example='stack_full' goal_count='11' valid='8' valid_qed='5' diff --git a/StandardAlgorithms/Results/stack_full.report b/StandardAlgorithms/Results/stack_full.report index a91abfa..2ff2495 100644 --- a/StandardAlgorithms/Results/stack_full.report +++ b/StandardAlgorithms/Results/stack_full.report @@ -1,4 +1,4 @@ -alg='stack_full' +example='stack_full' goal_count='11' valid='11' valid_qed='5' diff --git a/StandardAlgorithms/Results/stack_init.areport b/StandardAlgorithms/Results/stack_init.areport index 03abdcb..abdf750 100644 --- a/StandardAlgorithms/Results/stack_init.areport +++ b/StandardAlgorithms/Results/stack_init.areport @@ -1,4 +1,4 @@ -alg='stack_init' +example='stack_init' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_init.preport b/StandardAlgorithms/Results/stack_init.preport index 919c94e..7aef5e6 100644 --- a/StandardAlgorithms/Results/stack_init.preport +++ b/StandardAlgorithms/Results/stack_init.preport @@ -1,4 +1,4 @@ -alg='stack_init' +example='stack_init' goal_count='14' valid='11' valid_qed='4' diff --git a/StandardAlgorithms/Results/stack_init.report b/StandardAlgorithms/Results/stack_init.report index 6d49d44..0c55b67 100644 --- a/StandardAlgorithms/Results/stack_init.report +++ b/StandardAlgorithms/Results/stack_init.report @@ -1,4 +1,4 @@ -alg='stack_init' +example='stack_init' goal_count='14' valid='14' valid_qed='4' diff --git a/StandardAlgorithms/Results/stack_pop.areport b/StandardAlgorithms/Results/stack_pop.areport index b8b7d27..f4f1711 100644 --- a/StandardAlgorithms/Results/stack_pop.areport +++ b/StandardAlgorithms/Results/stack_pop.areport @@ -1,4 +1,4 @@ -alg='stack_pop' +example='stack_pop' goal_count='7' valid='7' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_pop.preport b/StandardAlgorithms/Results/stack_pop.preport index 8aab905..3713a13 100644 --- a/StandardAlgorithms/Results/stack_pop.preport +++ b/StandardAlgorithms/Results/stack_pop.preport @@ -1,4 +1,4 @@ -alg='stack_pop' +example='stack_pop' goal_count='32' valid='29' valid_qed='20' diff --git a/StandardAlgorithms/Results/stack_pop.report b/StandardAlgorithms/Results/stack_pop.report index 9067bc8..3ef6ad1 100644 --- a/StandardAlgorithms/Results/stack_pop.report +++ b/StandardAlgorithms/Results/stack_pop.report @@ -1,4 +1,4 @@ -alg='stack_pop' +example='stack_pop' goal_count='32' valid='32' valid_qed='20' diff --git a/StandardAlgorithms/Results/stack_pop_wd.areport b/StandardAlgorithms/Results/stack_pop_wd.areport index 7d83da3..ff8ae99 100644 --- a/StandardAlgorithms/Results/stack_pop_wd.areport +++ b/StandardAlgorithms/Results/stack_pop_wd.areport @@ -1,4 +1,4 @@ -alg='stack_pop_wd' +example='stack_pop_wd' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_pop_wd.preport b/StandardAlgorithms/Results/stack_pop_wd.preport index e34c47d..6492622 100644 --- a/StandardAlgorithms/Results/stack_pop_wd.preport +++ b/StandardAlgorithms/Results/stack_pop_wd.preport @@ -1,11 +1,11 @@ -alg='stack_pop_wd' +example='stack_pop_wd' goal_count='12' valid='9' valid_qed='6' valid_alt_ergo='3' valid_cvc4='3' valid_cvc3='3' -valid_z3='2' +valid_z3='3' valid_eprover='0' valid_coq='0' invalid='3' diff --git a/StandardAlgorithms/Results/stack_pop_wd.report b/StandardAlgorithms/Results/stack_pop_wd.report index 2251d01..66bb359 100644 --- a/StandardAlgorithms/Results/stack_pop_wd.report +++ b/StandardAlgorithms/Results/stack_pop_wd.report @@ -1,4 +1,4 @@ -alg='stack_pop_wd' +example='stack_pop_wd' goal_count='12' valid='12' valid_qed='6' diff --git a/StandardAlgorithms/Results/stack_push.areport b/StandardAlgorithms/Results/stack_push.areport index 680bae8..2c54997 100644 --- a/StandardAlgorithms/Results/stack_push.areport +++ b/StandardAlgorithms/Results/stack_push.areport @@ -1,4 +1,4 @@ -alg='stack_push' +example='stack_push' goal_count='7' valid='7' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_push.preport b/StandardAlgorithms/Results/stack_push.preport index 80c2d9f..d1f40c8 100644 --- a/StandardAlgorithms/Results/stack_push.preport +++ b/StandardAlgorithms/Results/stack_push.preport @@ -1,4 +1,4 @@ -alg='stack_push' +example='stack_push' goal_count='44' valid='41' valid_qed='28' diff --git a/StandardAlgorithms/Results/stack_push.report b/StandardAlgorithms/Results/stack_push.report index 0aeba91..d7970f6 100644 --- a/StandardAlgorithms/Results/stack_push.report +++ b/StandardAlgorithms/Results/stack_push.report @@ -1,4 +1,4 @@ -alg='stack_push' +example='stack_push' goal_count='44' valid='44' valid_qed='28' diff --git a/StandardAlgorithms/Results/stack_push_wd.areport b/StandardAlgorithms/Results/stack_push_wd.areport index e3b16fe..6d611bf 100644 --- a/StandardAlgorithms/Results/stack_push_wd.areport +++ b/StandardAlgorithms/Results/stack_push_wd.areport @@ -1,4 +1,4 @@ -alg='stack_push_wd' +example='stack_push_wd' goal_count='6' valid='6' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_push_wd.preport b/StandardAlgorithms/Results/stack_push_wd.preport index 47fa0d2..1cde4af 100644 --- a/StandardAlgorithms/Results/stack_push_wd.preport +++ b/StandardAlgorithms/Results/stack_push_wd.preport @@ -1,11 +1,11 @@ -alg='stack_push_wd' +example='stack_push_wd' goal_count='15' valid='11' valid_qed='3' -valid_alt_ergo='6' +valid_alt_ergo='8' valid_cvc4='8' valid_cvc3='7' -valid_z3='2' +valid_z3='3' valid_eprover='0' valid_coq='0' invalid='4' diff --git a/StandardAlgorithms/Results/stack_push_wd.report b/StandardAlgorithms/Results/stack_push_wd.report index e7cab3c..1b6baef 100644 --- a/StandardAlgorithms/Results/stack_push_wd.report +++ b/StandardAlgorithms/Results/stack_push_wd.report @@ -1,9 +1,9 @@ -alg='stack_push_wd' +example='stack_push_wd' goal_count='15' valid='15' valid_qed='3' -valid_alt_ergo='8' -valid_cvc4='4' +valid_alt_ergo='12' +valid_cvc4='0' valid_cvc3='0' valid_z3='0' valid_eprover='0' diff --git a/StandardAlgorithms/Results/stack_size.areport b/StandardAlgorithms/Results/stack_size.areport index 49dba38..12c4395 100644 --- a/StandardAlgorithms/Results/stack_size.areport +++ b/StandardAlgorithms/Results/stack_size.areport @@ -1,4 +1,4 @@ -alg='stack_size' +example='stack_size' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_size.preport b/StandardAlgorithms/Results/stack_size.preport index 2bfec11..282806f 100644 --- a/StandardAlgorithms/Results/stack_size.preport +++ b/StandardAlgorithms/Results/stack_size.preport @@ -1,4 +1,4 @@ -alg='stack_size' +example='stack_size' goal_count='6' valid='3' valid_qed='1' diff --git a/StandardAlgorithms/Results/stack_size.report b/StandardAlgorithms/Results/stack_size.report index 6586310..81f1c79 100644 --- a/StandardAlgorithms/Results/stack_size.report +++ b/StandardAlgorithms/Results/stack_size.report @@ -1,4 +1,4 @@ -alg='stack_size' +example='stack_size' goal_count='6' valid='6' valid_qed='1' diff --git a/StandardAlgorithms/Results/stack_size_wd.areport b/StandardAlgorithms/Results/stack_size_wd.areport index 4ce7c1c..671700b 100644 --- a/StandardAlgorithms/Results/stack_size_wd.areport +++ b/StandardAlgorithms/Results/stack_size_wd.areport @@ -1,4 +1,4 @@ -alg='stack_size_wd' +example='stack_size_wd' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_size_wd.preport b/StandardAlgorithms/Results/stack_size_wd.preport index 7a1e5ec..eff7276 100644 --- a/StandardAlgorithms/Results/stack_size_wd.preport +++ b/StandardAlgorithms/Results/stack_size_wd.preport @@ -1,4 +1,4 @@ -alg='stack_size_wd' +example='stack_size_wd' goal_count='12' valid='9' valid_qed='8' diff --git a/StandardAlgorithms/Results/stack_size_wd.report b/StandardAlgorithms/Results/stack_size_wd.report index 9612c1e..cc1e2a5 100644 --- a/StandardAlgorithms/Results/stack_size_wd.report +++ b/StandardAlgorithms/Results/stack_size_wd.report @@ -1,4 +1,4 @@ -alg='stack_size_wd' +example='stack_size_wd' goal_count='12' valid='12' valid_qed='8' diff --git a/StandardAlgorithms/Results/stack_top.areport b/StandardAlgorithms/Results/stack_top.areport index 5bfbf75..4f64a13 100644 --- a/StandardAlgorithms/Results/stack_top.areport +++ b/StandardAlgorithms/Results/stack_top.areport @@ -1,4 +1,4 @@ -alg='stack_top' +example='stack_top' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_top.preport b/StandardAlgorithms/Results/stack_top.preport index 5a42541..27c7570 100644 --- a/StandardAlgorithms/Results/stack_top.preport +++ b/StandardAlgorithms/Results/stack_top.preport @@ -1,4 +1,4 @@ -alg='stack_top' +example='stack_top' goal_count='16' valid='13' valid_qed='6' diff --git a/StandardAlgorithms/Results/stack_top.report b/StandardAlgorithms/Results/stack_top.report index 72b4338..a5eac02 100644 --- a/StandardAlgorithms/Results/stack_top.report +++ b/StandardAlgorithms/Results/stack_top.report @@ -1,4 +1,4 @@ -alg='stack_top' +example='stack_top' goal_count='16' valid='16' valid_qed='6' diff --git a/StandardAlgorithms/Results/stack_top_wd.areport b/StandardAlgorithms/Results/stack_top_wd.areport index b536677..a514802 100644 --- a/StandardAlgorithms/Results/stack_top_wd.areport +++ b/StandardAlgorithms/Results/stack_top_wd.areport @@ -1,4 +1,4 @@ -alg='stack_top_wd' +example='stack_top_wd' goal_count='5' valid='5' valid_qed='0' diff --git a/StandardAlgorithms/Results/stack_top_wd.preport b/StandardAlgorithms/Results/stack_top_wd.preport index 252136f..a074bc6 100644 --- a/StandardAlgorithms/Results/stack_top_wd.preport +++ b/StandardAlgorithms/Results/stack_top_wd.preport @@ -1,11 +1,11 @@ -alg='stack_top_wd' +example='stack_top_wd' goal_count='12' valid='9' valid_qed='8' valid_alt_ergo='1' valid_cvc4='1' valid_cvc3='1' -valid_z3='0' +valid_z3='1' valid_eprover='0' valid_coq='0' invalid='3' diff --git a/StandardAlgorithms/Results/stack_top_wd.report b/StandardAlgorithms/Results/stack_top_wd.report index 89120cd..c2f83db 100644 --- a/StandardAlgorithms/Results/stack_top_wd.report +++ b/StandardAlgorithms/Results/stack_top_wd.report @@ -1,4 +1,4 @@ -alg='stack_top_wd' +example='stack_top_wd' goal_count='12' valid='12' valid_qed='8' diff --git a/StandardAlgorithms/Results/stack_wd.separate.report b/StandardAlgorithms/Results/stack_wd.separate.report new file mode 100644 index 0000000..9858825 --- /dev/null +++ b/StandardAlgorithms/Results/stack_wd.separate.report @@ -0,0 +1,14 @@ +alg='stack_wd.separate' +goal_count='51' +valid='51' +valid_qed='33' +valid_alt_ergo='12' +valid_cvc4='5' +valid_cvc3='1' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/stack_wd.simple.report b/StandardAlgorithms/Results/stack_wd.simple.report new file mode 100644 index 0000000..d0aded9 --- /dev/null +++ b/StandardAlgorithms/Results/stack_wd.simple.report @@ -0,0 +1,14 @@ +alg='stack_wd.simple' +goal_count='51' +valid='51' +valid_qed='33' +valid_alt_ergo='11' +valid_cvc4='6' +valid_cvc3='1' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\stack_wd' +sec='cha:stack_wd' diff --git a/StandardAlgorithms/Results/stack_wd.union.preport b/StandardAlgorithms/Results/stack_wd.union.preport new file mode 100644 index 0000000..e219566 --- /dev/null +++ b/StandardAlgorithms/Results/stack_wd.union.preport @@ -0,0 +1,14 @@ +alg='stack_wd.gen' +goal_count='51' +valid='47' +valid_qed='33' +valid_alt_ergo='11' +valid_cvc4='14' +valid_cvc3='13' +valid_z3='7' +valid_eprover='1' +valid_coq='0' +invalid='4' +percent='92' +cmd='\stack_wd' +sec='cha:stack_wd' diff --git a/StandardAlgorithms/Results/stack_wd.union.report b/StandardAlgorithms/Results/stack_wd.union.report new file mode 100644 index 0000000..22a33fe --- /dev/null +++ b/StandardAlgorithms/Results/stack_wd.union.report @@ -0,0 +1,14 @@ +alg='stack_wd.union' +goal_count='51' +valid='51' +valid_qed='33' +valid_alt_ergo='11' +valid_cvc4='6' +valid_cvc3='1' +valid_z3='0' +valid_eprover='0' +valid_coq='0' +invalid='0' +percent='100' +cmd='\stack_wd' +sec='cha:stack_wd' diff --git a/StandardAlgorithms/Results/swap.areport b/StandardAlgorithms/Results/swap.areport index 91ea4b7..6b7fa27 100644 --- a/StandardAlgorithms/Results/swap.areport +++ b/StandardAlgorithms/Results/swap.areport @@ -1,4 +1,4 @@ -alg='swap' +example='swap' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/swap.preport b/StandardAlgorithms/Results/swap.preport index e5fad4e..be396c1 100644 --- a/StandardAlgorithms/Results/swap.preport +++ b/StandardAlgorithms/Results/swap.preport @@ -1,4 +1,4 @@ -alg='swap' +example='swap' goal_count='7' valid='7' valid_qed='7' diff --git a/StandardAlgorithms/Results/swap.report b/StandardAlgorithms/Results/swap.report index e5fad4e..be396c1 100644 --- a/StandardAlgorithms/Results/swap.report +++ b/StandardAlgorithms/Results/swap.report @@ -1,4 +1,4 @@ -alg='swap' +example='swap' goal_count='7' valid='7' valid_qed='7' diff --git a/StandardAlgorithms/Results/swap_ranges.areport b/StandardAlgorithms/Results/swap_ranges.areport index 07067e8..44a70b0 100644 --- a/StandardAlgorithms/Results/swap_ranges.areport +++ b/StandardAlgorithms/Results/swap_ranges.areport @@ -1,4 +1,4 @@ -alg='swap_ranges' +example='swap_ranges' goal_count='11' valid='11' valid_qed='0' diff --git a/StandardAlgorithms/Results/swap_ranges.preport b/StandardAlgorithms/Results/swap_ranges.preport index a8481e5..a7d4e12 100644 --- a/StandardAlgorithms/Results/swap_ranges.preport +++ b/StandardAlgorithms/Results/swap_ranges.preport @@ -1,11 +1,11 @@ -alg='swap_ranges' +example='swap_ranges' goal_count='22' valid='22' valid_qed='5' valid_alt_ergo='17' valid_cvc4='17' valid_cvc3='17' -valid_z3='11' +valid_z3='17' valid_eprover='8' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/swap_ranges.report b/StandardAlgorithms/Results/swap_ranges.report index a2575c2..1a454f2 100644 --- a/StandardAlgorithms/Results/swap_ranges.report +++ b/StandardAlgorithms/Results/swap_ranges.report @@ -1,4 +1,4 @@ -alg='swap_ranges' +example='swap_ranges' goal_count='22' valid='22' valid_qed='5' diff --git a/StandardAlgorithms/Results/unique.separate.report b/StandardAlgorithms/Results/unique.separate.report new file mode 100644 index 0000000..7eee0cc --- /dev/null +++ b/StandardAlgorithms/Results/unique.separate.report @@ -0,0 +1,14 @@ +alg='unique.separate' +goal_count='109' +valid='106' +valid_qed='25' +valid_alt_ergo='62' +valid_cvc4='12' +valid_cvc3='0' +valid_z3='2' +valid_eprover='0' +valid_coq='5' +invalid='3' +percent='97' +cmd='0' +sec='0' diff --git a/StandardAlgorithms/Results/unique.simple.report b/StandardAlgorithms/Results/unique.simple.report new file mode 100644 index 0000000..f3f16c7 --- /dev/null +++ b/StandardAlgorithms/Results/unique.simple.report @@ -0,0 +1,14 @@ +alg='unique.simple' +goal_count='109' +valid='106' +valid_qed='25' +valid_alt_ergo='65' +valid_cvc4='9' +valid_cvc3='1' +valid_z3='1' +valid_eprover='0' +valid_coq='5' +invalid='3' +percent='97' +cmd='\unique' +sec='cha:unique' diff --git a/StandardAlgorithms/Results/unique.union.preport b/StandardAlgorithms/Results/unique.union.preport new file mode 100644 index 0000000..d2d4e91 --- /dev/null +++ b/StandardAlgorithms/Results/unique.union.preport @@ -0,0 +1,14 @@ +alg='unique.gen' +goal_count='109' +valid='95' +valid_qed='25' +valid_alt_ergo='62' +valid_cvc4='67' +valid_cvc3='65' +valid_z3='58' +valid_eprover='18' +valid_coq='0' +invalid='14' +percent='87' +cmd='\unique' +sec='cha:unique' diff --git a/StandardAlgorithms/Results/unique.union.report b/StandardAlgorithms/Results/unique.union.report new file mode 100644 index 0000000..f10f232 --- /dev/null +++ b/StandardAlgorithms/Results/unique.union.report @@ -0,0 +1,14 @@ +alg='unique.union' +goal_count='109' +valid='106' +valid_qed='25' +valid_alt_ergo='65' +valid_cvc4='9' +valid_cvc3='1' +valid_z3='1' +valid_eprover='0' +valid_coq='5' +invalid='3' +percent='97' +cmd='\unique' +sec='cha:unique' diff --git a/StandardAlgorithms/Results/unique_copy2.areport b/StandardAlgorithms/Results/unique_copy2.areport index 7114c0d..d30486e 100644 --- a/StandardAlgorithms/Results/unique_copy2.areport +++ b/StandardAlgorithms/Results/unique_copy2.areport @@ -1,4 +1,4 @@ -alg='unique_copy2' +example='unique_copy2' goal_count='2' valid='2' valid_qed='0' diff --git a/StandardAlgorithms/Results/unique_copy2.preport b/StandardAlgorithms/Results/unique_copy2.preport index 3cc2797..1376928 100644 --- a/StandardAlgorithms/Results/unique_copy2.preport +++ b/StandardAlgorithms/Results/unique_copy2.preport @@ -1,11 +1,11 @@ -alg='unique_copy2' -goal_count='23' -valid='23' +example='unique_copy2' +goal_count='24' +valid='24' valid_qed='8' -valid_alt_ergo='15' -valid_cvc4='15' -valid_cvc3='15' -valid_z3='14' +valid_alt_ergo='16' +valid_cvc4='16' +valid_cvc3='16' +valid_z3='16' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/unique_copy2.report b/StandardAlgorithms/Results/unique_copy2.report index f7765d8..3d0b6d7 100644 --- a/StandardAlgorithms/Results/unique_copy2.report +++ b/StandardAlgorithms/Results/unique_copy2.report @@ -1,8 +1,8 @@ -alg='unique_copy2' -goal_count='23' -valid='23' +example='unique_copy2' +goal_count='24' +valid='24' valid_qed='8' -valid_alt_ergo='15' +valid_alt_ergo='16' valid_cvc4='0' valid_cvc3='0' valid_z3='0' diff --git a/StandardAlgorithms/Results/unique_copy3.areport b/StandardAlgorithms/Results/unique_copy3.areport index d7c6580..0942fa3 100644 --- a/StandardAlgorithms/Results/unique_copy3.areport +++ b/StandardAlgorithms/Results/unique_copy3.areport @@ -1,4 +1,4 @@ -alg='unique_copy3' +example='unique_copy3' goal_count='12' valid='12' valid_qed='0' diff --git a/StandardAlgorithms/Results/unique_copy3.preport b/StandardAlgorithms/Results/unique_copy3.preport index 5de9506..300ad7c 100644 --- a/StandardAlgorithms/Results/unique_copy3.preport +++ b/StandardAlgorithms/Results/unique_copy3.preport @@ -1,11 +1,11 @@ -alg='unique_copy3' -goal_count='26' -valid='26' +example='unique_copy3' +goal_count='27' +valid='27' valid_qed='8' -valid_alt_ergo='18' -valid_cvc4='18' -valid_cvc3='18' -valid_z3='15' +valid_alt_ergo='19' +valid_cvc4='19' +valid_cvc3='19' +valid_z3='19' valid_eprover='3' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/unique_copy3.report b/StandardAlgorithms/Results/unique_copy3.report index 250fcbd..2be581a 100644 --- a/StandardAlgorithms/Results/unique_copy3.report +++ b/StandardAlgorithms/Results/unique_copy3.report @@ -1,8 +1,8 @@ -alg='unique_copy3' -goal_count='26' -valid='26' +example='unique_copy3' +goal_count='27' +valid='27' valid_qed='8' -valid_alt_ergo='18' +valid_alt_ergo='19' valid_cvc4='0' valid_cvc3='0' valid_z3='0' diff --git a/StandardAlgorithms/Results/unique_copy4.areport b/StandardAlgorithms/Results/unique_copy4.areport index 8647d5d..36ff226 100644 --- a/StandardAlgorithms/Results/unique_copy4.areport +++ b/StandardAlgorithms/Results/unique_copy4.areport @@ -1,14 +1,14 @@ -alg='unique_copy4' -goal_count='37' -valid='32' +example='unique_copy4' +goal_count='42' +valid='37' valid_qed='0' -valid_alt_ergo='22' +valid_alt_ergo='27' valid_cvc4='8' valid_cvc3='1' valid_z3='1' valid_eprover='0' valid_coq='0' invalid='5' -percent='86' +percent='88' cmd='\uniquecopyfour' sec='sec:uniquecopy4' diff --git a/StandardAlgorithms/Results/unique_copy4.preport b/StandardAlgorithms/Results/unique_copy4.preport index e59d790..5fe4cc8 100644 --- a/StandardAlgorithms/Results/unique_copy4.preport +++ b/StandardAlgorithms/Results/unique_copy4.preport @@ -1,14 +1,14 @@ -alg='unique_copy4' -goal_count='57' -valid='43' -valid_qed='9' -valid_alt_ergo='33' -valid_cvc4='32' -valid_cvc3='30' -valid_z3='29' +example='unique_copy4' +goal_count='62' +valid='49' +valid_qed='10' +valid_alt_ergo='37' +valid_cvc4='36' +valid_cvc3='34' +valid_z3='36' valid_eprover='12' valid_coq='0' -invalid='14' -percent='75' +invalid='13' +percent='79' cmd='\uniquecopyfour' sec='sec:uniquecopy4' diff --git a/StandardAlgorithms/Results/unique_copy4.report b/StandardAlgorithms/Results/unique_copy4.report index 44c887f..e5dd263 100644 --- a/StandardAlgorithms/Results/unique_copy4.report +++ b/StandardAlgorithms/Results/unique_copy4.report @@ -1,13 +1,13 @@ -alg='unique_copy4' -goal_count='57' -valid='57' -valid_qed='9' -valid_alt_ergo='38' -valid_cvc4='5' -valid_cvc3='1' +example='unique_copy4' +goal_count='62' +valid='62' +valid_qed='10' +valid_alt_ergo='43' +valid_cvc4='3' +valid_cvc3='2' valid_z3='0' -valid_eprover='0' -valid_coq='4' +valid_eprover='1' +valid_coq='3' invalid='0' percent='100' cmd='\uniquecopyfour' diff --git a/StandardAlgorithms/Results/upper_bound.areport b/StandardAlgorithms/Results/upper_bound.areport index fc9f23c..4c54247 100644 --- a/StandardAlgorithms/Results/upper_bound.areport +++ b/StandardAlgorithms/Results/upper_bound.areport @@ -1,4 +1,4 @@ -alg='upper_bound' +example='upper_bound' goal_count='13' valid='13' valid_qed='0' diff --git a/StandardAlgorithms/Results/upper_bound.preport b/StandardAlgorithms/Results/upper_bound.preport index f32628b..97775cf 100644 --- a/StandardAlgorithms/Results/upper_bound.preport +++ b/StandardAlgorithms/Results/upper_bound.preport @@ -1,11 +1,11 @@ -alg='upper_bound' +example='upper_bound' goal_count='19' valid='19' valid_qed='7' valid_alt_ergo='12' valid_cvc4='12' valid_cvc3='10' -valid_z3='10' +valid_z3='12' valid_eprover='2' valid_coq='0' invalid='0' diff --git a/StandardAlgorithms/Results/upper_bound.report b/StandardAlgorithms/Results/upper_bound.report index 76994c3..551537c 100644 --- a/StandardAlgorithms/Results/upper_bound.report +++ b/StandardAlgorithms/Results/upper_bound.report @@ -1,4 +1,4 @@ -alg='upper_bound' +example='upper_bound' goal_count='19' valid='19' valid_qed='7' diff --git a/StandardAlgorithms/Scripts/check_predicates.pl b/StandardAlgorithms/Scripts/check_logic_definitions.pl similarity index 98% rename from StandardAlgorithms/Scripts/check_predicates.pl rename to StandardAlgorithms/Scripts/check_logic_definitions.pl index 8387029..3521737 100755 --- a/StandardAlgorithms/Scripts/check_predicates.pl +++ b/StandardAlgorithms/Scripts/check_logic_definitions.pl @@ -36,9 +36,9 @@ ($) my ($err_code) = @_; print BOLD . basename(__FILE__) . RESET . - " - Check ACSL logic definitions (from Logic dir) used\n"; + " - Check ACSL logic definitions (from Logic dir) usage\n"; print "Options: \n"; - print "-s|--show-usage - show files and lines where definition used (default: no)\n"; + print "-s|--show-usage - show files and lines where definition are used (default: no)\n"; print "-a|--abs-paths - use absolute paths in output (default: no)\n"; print "--color=WHEN - colorize the output: always|never|auto (default: auto)\n"; print "-l|--license - print the license\n"; diff --git a/StandardAlgorithms/Scripts/reporting.sh b/StandardAlgorithms/Scripts/reporting.sh new file mode 100755 index 0000000..0ac7fd1 --- /dev/null +++ b/StandardAlgorithms/Scripts/reporting.sh @@ -0,0 +1,33 @@ + +#!/bin/bash + +set -e + +gnugrep=/bin/grep +gnused=/bin/sed + +case $OSTYPE in + darwin*) + #printf "running on macOS\n" >&2 + gnugrep=/usr/local/bin/ggrep + gnused=/usr/local/bin/gsed + ;; +esac + +countValid() +{ + $gnugrep "\\[$2\\].*Valid$" $1 | cut -d ' ' -f4 | sort -u | wc -l | tr -d ' \t' +} + +results=$1 + +goal_count=`$gnugrep "goals scheduled" $results | cut -d ' ' -f2` +valid_qed=`countValid $results Qed` +valid_alt_ergo=`countValid $results Alt-Ergo` +valid_cvc4=`countValid $results cvc4` +valid_cvc3=`countValid $results cvc3` +valid_z3=`countValid $results z3` +valid_eprover=`countValid $results eprover` +valid_coq=`countValid $results Coq` + +printf "goal_count = $goal_count\n" diff --git a/StandardAlgorithms/Scripts/script_functions.sh b/StandardAlgorithms/Scripts/script_functions.sh index 24f41a4..b87a593 100755 --- a/StandardAlgorithms/Scripts/script_functions.sh +++ b/StandardAlgorithms/Scripts/script_functions.sh @@ -2,6 +2,19 @@ set -e +gnugrep=/bin/grep +gnused=/bin/sed + +case $OSTYPE in + darwin*) + #printf "running on macOS\n" >&2 + gnugrep=/usr/local/bin/ggrep + gnused=/usr/local/bin/gsed + ;; +esac + + + # adjust the timeout for n cores by increasing it by 20% for each core # after the first one. This compensates for the runtime lost through # the shared memory bandwidth. @@ -20,7 +33,7 @@ adjustTimeout() # $2: Pattern to look for countValid() { - grep "\\[$2\\].*Valid$" $1 | cut -d ' ' -f4 | sort -u | wc -l | tr -d ' \t' + $gnugrep "\\[$2\\].*Valid$" $1 | cut -d ' ' -f4 | sort -u | wc -l | tr -d ' \t' } # depending on whether TRUST_WP is defined, either collect counts @@ -33,13 +46,14 @@ countValid() # $3: tutorial section extract_data_Wp() { + #printf "enter extract_data_Wp\n" >&2 if [ $# -ne 3 ] then echo "please provide exactly three arguments" >&2 exit 1 fi - alg=$1 + example=$1 cmd=$2 sec=$3 @@ -49,6 +63,7 @@ extract_data_Wp() export WP_PROCESSES=${WP_PROCESSES:-1} export WP_TIMEOUT=`adjustTimeout ${WP_TIMEOUT:-0} $WP_PROCESSES` export WP_COQ_TIMEOUT=`adjustTimeout ${WP_COQ_TIMEOUT:-0} $WP_PROCESSES` + export SCRIPT_DIR=${SCRIPT_DIR} REPORT_BACKEND=${REPORT_BACKEND:-default} @@ -61,11 +76,12 @@ extract_data_Wp() case $REPORT_BACKEND in trust_wp|wp_runner|vs-par) extract_statistics ;; - default) extract_raw_data_Wp ;; + default) extract_raw_data_Wp $results ;; *) echo Unknown backend $REPORT_BACKEND ; exit 1 ;; esac rm -f $results + #printf "exit extract_data_Wp\n" >&2 } # $1: name of the algorithm @@ -79,7 +95,7 @@ extract_data_Av() exit 1 fi - alg=$1 + example=$1 cmd=$2 sec=$3 @@ -95,13 +111,18 @@ extract_data_Av() # generate a verification report using WP directly generate_wp() { + # generate directory for examples where everything is verified by Qed + mkdir $example.wp + # generate report local prog="$WP_C_REPORT \ -wp-par $WP_PROCESSES \ -wp-timeout $WP_TIMEOUT \ -wp-coq-timeout $WP_COQ_TIMEOUT \ - -wp-out $alg.wp $alg.c" + -wp-out $example.wp $example.c" eval "$prog" >$results + + cp $results $example.wp/console.log } # generate a verification report using WP directly @@ -109,7 +130,7 @@ generate_av() { # generate report local prog="$AV_C_REPORT \ - -av-out $alg.av $alg.c" + -av-out $example.av $example.c" eval "$prog" >$results } @@ -117,7 +138,7 @@ generate_av() generate_wp_runner() { # assume we run from within an algorithm directory - local prog="../../Scripts/wp_runner.sh $alg.c $WP_C_FLAGS $WP_PROVER_FLAGS -wp-par $WP_PROCESSES" + local prog="$SCRIPT_DIR/wp_runner.sh $example.c $WP_C_FLAGS $WP_PROVER_FLAGS -wp-par $WP_PROCESSES" eval "$prog" >$results } @@ -125,7 +146,7 @@ generate_wp_runner() generate_vs_par() { # assume we run from within an algorithm directory - local prog="../../../Misc/VerificationService/vs.sh -p $alg.c $WP_C_FLAGS $WP_PROVER_FLAGS -wp-par $WP_PROCESSES" + local prog="../../../Misc/VerificationService/vs.sh -p $example.c $WP_C_FLAGS $WP_PROVER_FLAGS -wp-par $WP_PROCESSES" eval "$prog" >$results 2>&1 # use stderr } @@ -133,16 +154,19 @@ generate_vs_par() # through the output of WP and counting lines. extract_raw_data_Wp() { - # pick up the number of generated goals - goal_count=`grep "goals scheduled" $results | cut -d ' ' -f2` - valid_qed=`countValid $results Qed` - valid_alt_ergo=`countValid $results Alt-Ergo` - valid_cvc4=`countValid $results cvc4` - valid_cvc3=`countValid $results cvc3` - valid_z3=`countValid $results z3` - valid_eprover=`countValid $results eprover` - valid_coq=`countValid $results Coq` + local raw_output=$1 + goal_count=`$gnugrep "goals scheduled" $raw_output | cut -d ' ' -f2` + valid_qed=`countValid $raw_output Qed` + # use the following line for native alt_ergo + #valid_alt_ergo=`countValid $raw_output Alt-Ergo` + # use the following line for why3:alt_ergo + valid_alt_ergo=`countValid $raw_output alt-ergo` + valid_cvc4=`countValid $raw_output cvc4` + valid_cvc3=`countValid $raw_output cvc3` + valid_z3=`countValid $raw_output z3` + valid_eprover=`countValid $raw_output eprover` + valid_coq=`countValid $raw_output Coq` #calculate all valid goals valid=$(($valid_qed + $valid_alt_ergo + $valid_cvc4 + $valid_cvc3 + $valid_z3 + $valid_eprover + $valid_coq)) @@ -161,8 +185,11 @@ extract_statistics() local statistics=`mktemp ${TMPDIR-/tmp}/tempStatistics.XXXXXX` + # copy data for debugging + #cp $results results.save + # generate report - sed -e 's,^.*Proved goals: *\([0-9]*\) / *\([0-9]*\),valid=\1;goal_count=\2,p' \ + $gnused -e 's,^.*Proved goals: *\([0-9]*\) / *\([0-9]*\),valid=\1;goal_count=\2,p' \ -e '1,/^valid=/d' \ -e 's/cvc4-[[:digit:]]*/cvc4/g' \ -e 's/^ *\([^:() ]*\) *\(([^:()]*)\)\? *\(([^:()]*)\)\?:[[:space:]]*\([0-9]*\).*$/valid_\1=\4/' \ @@ -170,10 +197,14 @@ extract_statistics() -e '/\/d' $results | tr '[:upper:]-' '[:lower:]_' > $statistics - source $statistics - rm -f $statistics + # copy data for debugging + #cp $statistics statistics.save + . $statistics + + #printf "extract_statistics::valid_alt_ergo = $valid_alt_ergo\n" >&2 print_statistics + rm -f $statistics } # print the statistics extracted by extract_raw_data_Wp and @@ -193,7 +224,7 @@ print_statistics() } # report fields -fields='alg goal_count valid +fields='example goal_count valid valid_qed valid_alt_ergo valid_cvc4 valid_cvc3 valid_z3 valid_eprover valid_coq invalid percent cmd sec' @@ -225,7 +256,7 @@ prettyPrintReport() { parse_report $1 printf " %-30s [%-4d %3d (%3d %3d %3d %3d %3d %3d %3d)] %3d%%\n" \ - $alg $goal_count $valid \ + $example $goal_count $valid \ $valid_qed $valid_alt_ergo $valid_cvc4 $valid_cvc3 $valid_z3 $valid_eprover $valid_coq \ $percent } diff --git a/StandardAlgorithms/Scripts/wp_runner.sh b/StandardAlgorithms/Scripts/wp_runner.sh index 7e31810..e7d735a 100755 --- a/StandardAlgorithms/Scripts/wp_runner.sh +++ b/StandardAlgorithms/Scripts/wp_runner.sh @@ -2,6 +2,27 @@ set -e +gnutime=/usr/bin/time +gnuxargs=/usr/bin/xargs +gnugrep=/bin/grep +gnused=/bin/sed + +case $OSTYPE in + linux*) + #printf "running on Linux\n" >&2 + ;; + darwin*) + #printf "running on macOS\n" >&2 + gnutime=/usr/local/bin/gtime + gnuxargs=/usr/local/bin/gxargs + gnugrep=/usr/local/bin/ggrep + gnused=/usr/local/bin/gsed + ;; + *) + #printf "running on untested $OSTYPE\n" >&2 +esac + + FRAMAC_SHARE=${FRAMAC_SHARE:-$(frama-c -print-share-path)} WP_TIMEOUT=${WP_TIMEOUT:-20} @@ -38,7 +59,7 @@ generate_tasks() { # FIXME "typed_ref_external" depends on memory model and driver for whyfile in $wpdir/typed_ref_external/*.why do - sed -n \ + $gnused -n \ -e 's/^theory \(VC.*\)$/\1/p' \ -e 's/^lemma \(Q_.*\):$/\1/p' \ $whyfile | while read -r theory @@ -93,7 +114,7 @@ do_proof() { result="Error $status" elif [ -s $outname.out ] then - result="$(sed -n -e "s/ WP \?/ /" \ + result="$($gnused -n -e "s/ WP \?/ /" \ -e "s/^.* [[:alnum:]_]* : \\([[:alnum:]]*\\) .*$/\\1/p" $outname.out)" else result=Unknown @@ -150,10 +171,10 @@ call_coqc() { # a report line showing how many goals have been proven. proved_goals() { # first count how many goals we found - goals=`sed -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : .*$/\1/p' $log | sort -u | wc -l` + goals=`$gnused -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : .*$/\1/p' $log | sort -u | wc -l` # next, extract goal names and count how many were found to be valid - valid=`sed -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : Valid$/\1/p' $log | sort -u | wc -l` + valid=`$gnused -n -e 's/^\[wp.*] Goal \([[:alnum:]_]*\) : Valid$/\1/p' $log | sort -u | wc -l` printf '[wprunner] Proved goals: %3d /%3d\n' $valid $goals } @@ -162,9 +183,10 @@ proved_goals() { # print a line for the statistics goals_by_prover() { prover=$1 + #printf "$prover\n" >&2 set +e - count=`grep -c -E '^\[wp(runner)?] \['$prover'] .* : Valid$' $log` + count=`$gnugrep -c -E '^\[wp(runner)?] \['$prover'] .* : Valid$' $log` set -e printf " %-15s%3d\n" $prover: $count @@ -216,7 +238,7 @@ then fi fi -provers=`get_provers "$@" | sed s/why3:// | sort -f` +provers=`get_provers "$@" | $gnused s/why3:// | sort -f` echo [wprunner] Provers: $provers source=$1 wpdir=${source%.c}.wp @@ -230,9 +252,15 @@ mkdir $wpdir echo [wprunner] Generating WP files | tee -a $log echo "WP = $FR" | tee -a $log echo "$@" | tee -a $log -$FR "$@" -wp-out $wpdir -wp-gen $source | tee -a $log +($gnutime -a -o $log -f "\t%e seconds to generate VC" $FR "$@" -wp-out $wpdir -wp-gen $source) | tee -a $log +echo | tee -a $log + echo [wprunner] Running provers on $NPROC CPUs | tee -a $log -generate_tasks | xargs -P $NPROC -n 1 -- $0 -r $wpdir | tee -a $log + +tasks=$(mktemp) +trap "rm -f $tasks" EXIT +eval generate_tasks > $tasks +$gnutime -a -o $log -f "\t%e seconds to discharge VC" $gnuxargs -P $NPROC -n 1 -a $tasks -- $0 -r $wpdir | tee -a $log # print statistics proved_goals @@ -240,3 +268,4 @@ for prover in $provers do goals_by_prover $prover done +#printf "printing proved goals done\n" >&2 diff --git a/StandardAlgorithms/all-action.mk b/StandardAlgorithms/all-action.mk new file mode 100644 index 0000000..263f5f6 --- /dev/null +++ b/StandardAlgorithms/all-action.mk @@ -0,0 +1,91 @@ + +MAKEFLAGS += --silent --no-print-directory + +export TOP_DIR := $(PWD) +export SCRIPT_DIR := $(TOP_DIR)/Scripts +export DRIVER_DIR := $(TOP_DIR)/drivers + +export ALL_DIR ?= $(basename $(TOP_DIR)) + +FILELIST := filelist.path +GROUPS := $(shell cat $(FILELIST)) +GROUP_SOURCES := $(join $(addsuffix /,$(GROUPS)),$(addsuffix .union.c,$(GROUPS))) +GROUP_HEADERS := $(GROUP_SOURCES:.c=.h) + + +CMD:=all.union +SEC:=cha:Introduction + +include config.mk +include frama-c.mk +include rules.mk + +ALL_SOURCE := $(addsuffix .c, $(CMD)) +ALL_HEADER := $(addsuffix .h, $(CMD)) + +ALL_FILE_CAP := $(shell echo $(CMD) | tr '[:lower:]' '[:upper:]') +ALL_GUARD := $(addsuffix _H_INCLUDED, $(subst .,_, $(ALL_FILE_CAP))) + +#CPPFLAGS += $(addprefix -I, $(ALL_DIRS)) + +debug: + echo $(ALL_HEADER) + echo $(GROUP_SOURCES) + +# concatenate example files +$(ALL_SOURCE): $(GROUP_SOURCES) + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ printf "\n" > $@ + @ printf '#include "$(ALL_HEADER)"\n' >> $@ + @ printf "\n" >> $@ + @ cat $^ | tee -a $(TMPF) | grep '^#include[[:space:]]\+".*\.spec"' | sort -u | cat -s >> $@ + @ cat $(TMPF) | grep -v '^#' | cat -s >> $@ + +source: $(ALL_SOURCE) FORCE + +$(ALL_HEADER): $(GROUP_HEADERS) + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ printf "\n#ifndef $(ALL_GUARD)\n" >> $@ + @ printf "#define $(ALL_GUARD)\n\n" >> $@ + @ cat $^ >> $(TMPF) + @ cat $(TMPF) | grep '^#include[[:space:]]\+".*\.spec"' | sort -u >> $@ + @ printf "\n" >> $@ + @ cat $(TMPF) | grep -vE '^#' | cat -s >> $@ + @ printf "\n" >> $@ + @ printf "#endif /* $(ALL_GUARD) */\n\n" >> $@ + +header: $(ALL_HEADER) FORCE + +$(DRIVER): FORCE + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + +$(TOP_DIR)/Results/$(CMD).report: + @. $(SCRIPT_DIR)/script_functions.sh; extract_data_Wp $(CMD) $(CMD) $(SEC) > $@ + +report: $(TOP_DIR)/Results/$(CMD).report + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +report-clean: clean FORCE + @$(RM) $(TOP_DIR)/Results/$(CMD).report + + +$(TOP_DIR)/Results/$(CMD).preport: + @. $(SCRIPT_DIR)/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(CMD) $(CMD) $(SEC) > $@ + +preport: $(TOP_DIR)/Results/$(CMD).preport + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +preport-clean: + @$(RM) $(TOP_DIR)/Results/$(CMD).preport + + +clean:: FORCE + $(RM) .lia.cache + $(RM) $(ALL_SOURCE) + $(RM) $(ALL_HEADER) + $(RM) -r $(CMD).wp + +FORCE: + diff --git a/StandardAlgorithms/astyle.mk b/StandardAlgorithms/astyle.mk new file mode 100644 index 0000000..f9df9ef --- /dev/null +++ b/StandardAlgorithms/astyle.mk @@ -0,0 +1,20 @@ + +ASTYLEOPTIONS += --quiet +ASTYLEOPTIONS += --style=stroustrup +ASTYLEOPTIONS += --indent=spaces=2 +ASTYLEOPTIONS += --indent-col1-comments +ASTYLEOPTIONS += --min-conditional-indent=0 +ASTYLEOPTIONS += --lineend=linux +ASTYLEOPTIONS += --break-return-type +ASTYLEOPTIONS += --break-return-type-decl +ASTYLEOPTIONS += --add-braces +ASTYLEOPTIONS += --break-closing-braces +ASTYLEOPTIONS += --break-one-line-headers +ASTYLEOPTIONS += --break-blocks +#ASTYLEOPTIONS += --delete-empty-lines +ASTYLEOPTIONS += --pad-oper +ASTYLEOPTIONS += --pad-header + +format: FORCE + @astyle $(ASTYLEOPTIONS) *.c *.cpp *.h + diff --git a/StandardAlgorithms/binarysearch/Makefile b/StandardAlgorithms/binarysearch/Makefile index 274e865..e210c33 100644 --- a/StandardAlgorithms/binarysearch/Makefile +++ b/StandardAlgorithms/binarysearch/Makefile @@ -1,12 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libbinarysearch.a - -lib: libbinarysearch.a - -libbinarysearch.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/binarysearch/binary_search/Makefile b/StandardAlgorithms/binarysearch/binary_search/Makefile index 9fadb0d..f52ae30 100644 --- a/StandardAlgorithms/binarysearch/binary_search/Makefile +++ b/StandardAlgorithms/binarysearch/binary_search/Makefile @@ -1,10 +1,5 @@ -CMD=\\binarysearch -SEC=sec:binarysearch - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop @lemma -TESTOBJ += -lbinarysearch - diff --git a/StandardAlgorithms/binarysearch/binary_search/binary_search.c b/StandardAlgorithms/binarysearch/binary_search/binary_search.c index 787172a..1cc1569 100644 --- a/StandardAlgorithms/binarysearch/binary_search/binary_search.c +++ b/StandardAlgorithms/binarysearch/binary_search/binary_search.c @@ -1,6 +1,6 @@ #include "binary_search.h" -#include "../lower_bound/lower_bound.h" +#include "lower_bound.h" bool binary_search(const value_type* a, size_type n, value_type val) diff --git a/StandardAlgorithms/binarysearch/binary_search/depend.mk b/StandardAlgorithms/binarysearch/binary_search/depend.mk new file mode 100644 index 0000000..4b3acc2 --- /dev/null +++ b/StandardAlgorithms/binarysearch/binary_search/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += binarysearch/lower_bound + diff --git a/StandardAlgorithms/binarysearch/binary_search2/Makefile b/StandardAlgorithms/binarysearch/binary_search2/Makefile index 1255e3f..4d3b267 100644 --- a/StandardAlgorithms/binarysearch/binary_search2/Makefile +++ b/StandardAlgorithms/binarysearch/binary_search2/Makefile @@ -2,7 +2,5 @@ CMD=\\binarysearchtwo SEC=sec:binarysearch2 -include ../../Makefile.template - -TESTOBJ += -lbinarysearch +include ../../example.mk diff --git a/StandardAlgorithms/binarysearch/binary_search2/binary_search2.c b/StandardAlgorithms/binarysearch/binary_search2/binary_search2.c index a3b1cf7..8caf5dd 100644 --- a/StandardAlgorithms/binarysearch/binary_search2/binary_search2.c +++ b/StandardAlgorithms/binarysearch/binary_search2/binary_search2.c @@ -1,6 +1,6 @@ #include "binary_search2.h" -#include "../lower_bound/lower_bound.h" +#include "lower_bound.h" bool binary_search2(const value_type* a, size_type n, value_type val) diff --git a/StandardAlgorithms/binarysearch/binary_search2/depend.mk b/StandardAlgorithms/binarysearch/binary_search2/depend.mk new file mode 100644 index 0000000..4b3acc2 --- /dev/null +++ b/StandardAlgorithms/binarysearch/binary_search2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += binarysearch/lower_bound + diff --git a/StandardAlgorithms/binarysearch/equal_range/Makefile b/StandardAlgorithms/binarysearch/equal_range/Makefile index 27fcb28..efea329 100644 --- a/StandardAlgorithms/binarysearch/equal_range/Makefile +++ b/StandardAlgorithms/binarysearch/equal_range/Makefile @@ -1,8 +1,5 @@ -CMD=\\equalrange -SEC=sec:equalrange +include ../../example.mk -include ../../Makefile.template #WP_FLAGS+=-wp-prop right -TESTOBJ += -lbinarysearch diff --git a/StandardAlgorithms/binarysearch/equal_range/depend.mk b/StandardAlgorithms/binarysearch/equal_range/depend.mk new file mode 100644 index 0000000..5c40e2d --- /dev/null +++ b/StandardAlgorithms/binarysearch/equal_range/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += binarysearch/lower_bound +DEPENDENCIES += binarysearch/upper_bound +DEPENDENCIES += maxmin/make_pair + diff --git a/StandardAlgorithms/binarysearch/equal_range/equal_range.c b/StandardAlgorithms/binarysearch/equal_range/equal_range.c index 7264a6f..7874c66 100644 --- a/StandardAlgorithms/binarysearch/equal_range/equal_range.c +++ b/StandardAlgorithms/binarysearch/equal_range/equal_range.c @@ -1,7 +1,8 @@ -#include "../lower_bound/lower_bound.h" -#include "../upper_bound/upper_bound.h" #include "equal_range.h" +#include "lower_bound.h" +#include "upper_bound.h" +#include "make_pair.h" size_type_pair equal_range(const value_type* a, size_type n, value_type val) diff --git a/StandardAlgorithms/binarysearch/equal_range/equal_range.h b/StandardAlgorithms/binarysearch/equal_range/equal_range.h index 8b41a76..baa1793 100644 --- a/StandardAlgorithms/binarysearch/equal_range/equal_range.h +++ b/StandardAlgorithms/binarysearch/equal_range/equal_range.h @@ -2,7 +2,7 @@ #ifndef EQUAL_RANGE_H_INCLUDED #define EQUAL_RANGE_H_INCLUDED -#include "make_pair.h" +#include "SizeTypePairTrivial.spec" #include "Sorted.spec" #include "ConstantRange.spec" #include "StrictUpperBound.spec" diff --git a/StandardAlgorithms/binarysearch/equal_range/make_pair.c b/StandardAlgorithms/binarysearch/equal_range/make_pair.c deleted file mode 100644 index f89dc85..0000000 --- a/StandardAlgorithms/binarysearch/equal_range/make_pair.c +++ /dev/null @@ -1,3 +0,0 @@ - -// dummy file - diff --git a/StandardAlgorithms/binarysearch/equal_range2/Makefile b/StandardAlgorithms/binarysearch/equal_range2/Makefile index 434524d..55064d6 100644 --- a/StandardAlgorithms/binarysearch/equal_range2/Makefile +++ b/StandardAlgorithms/binarysearch/equal_range2/Makefile @@ -2,7 +2,7 @@ CMD=\\equalrangetwo SEC=sec:equalrange2 -include ../../Makefile.template +include ../../example.mk #WP_FLAGS+=-wp-prop right #WP_FLAGS+=-wp-prop StrictLowerBoundExpansion @@ -13,5 +13,3 @@ include ../../Makefile.template #WP_FLAGS+=-wp-prop StrictUpper #WP_FLAGS+=-wp-prop StrictLower -TESTOBJ += -lbinarysearch - diff --git a/StandardAlgorithms/binarysearch/equal_range2/depend.mk b/StandardAlgorithms/binarysearch/equal_range2/depend.mk new file mode 100644 index 0000000..5c40e2d --- /dev/null +++ b/StandardAlgorithms/binarysearch/equal_range2/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += binarysearch/lower_bound +DEPENDENCIES += binarysearch/upper_bound +DEPENDENCIES += maxmin/make_pair + diff --git a/StandardAlgorithms/binarysearch/equal_range2/equal_range2.c b/StandardAlgorithms/binarysearch/equal_range2/equal_range2.c index 2354335..7929bb0 100644 --- a/StandardAlgorithms/binarysearch/equal_range2/equal_range2.c +++ b/StandardAlgorithms/binarysearch/equal_range2/equal_range2.c @@ -1,7 +1,8 @@ #include "equal_range2.h" -#include "../lower_bound/lower_bound.h" -#include "../upper_bound/upper_bound.h" +#include "lower_bound.h" +#include "upper_bound.h" +#include "make_pair.h" #include "ShiftLemmas.spec" size_type_pair diff --git a/StandardAlgorithms/binarysearch/equal_range2/equal_range2.h b/StandardAlgorithms/binarysearch/equal_range2/equal_range2.h index b6c8d45..4ade077 100644 --- a/StandardAlgorithms/binarysearch/equal_range2/equal_range2.h +++ b/StandardAlgorithms/binarysearch/equal_range2/equal_range2.h @@ -2,7 +2,7 @@ #ifndef EQUAL_RANGE_H_INCLUDED #define EQUAL_RANGE_H_INCLUDED -#include "../equal_range/make_pair.h" +#include "SizeTypePairTrivial.spec" #include "Sorted.spec" #include "ConstantRange.spec" #include "StrictUpperBound.spec" diff --git a/StandardAlgorithms/binarysearch/lower_bound/Makefile b/StandardAlgorithms/binarysearch/lower_bound/Makefile index 1b7e7e4..8100c89 100644 --- a/StandardAlgorithms/binarysearch/lower_bound/Makefile +++ b/StandardAlgorithms/binarysearch/lower_bound/Makefile @@ -1,6 +1,3 @@ -CMD=\\lowerbound -SEC=sec:lowerbound - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/binarysearch/lower_bound/depend.mk b/StandardAlgorithms/binarysearch/lower_bound/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/binarysearch/lower_bound/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/binarysearch/upper_bound/Makefile b/StandardAlgorithms/binarysearch/upper_bound/Makefile index 4e5bb35..8100c89 100644 --- a/StandardAlgorithms/binarysearch/upper_bound/Makefile +++ b/StandardAlgorithms/binarysearch/upper_bound/Makefile @@ -1,6 +1,3 @@ -CMD=\\upperbound -SEC=sec:upperbound - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/binarysearch/upper_bound/depend.mk b/StandardAlgorithms/binarysearch/upper_bound/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/binarysearch/upper_bound/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/classic-sorting/Makefile b/StandardAlgorithms/classic-sorting/Makefile deleted file mode 100644 index 2ae513c..0000000 --- a/StandardAlgorithms/classic-sorting/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - - -clean:: FORCE - -include ../Makefile.group - -OBJ := - -lib: - - diff --git a/StandardAlgorithms/classic-sorting/filelist.path b/StandardAlgorithms/classic-sorting/filelist.path deleted file mode 100644 index 0ee8bfa..0000000 --- a/StandardAlgorithms/classic-sorting/filelist.path +++ /dev/null @@ -1,3 +0,0 @@ -selection_sort -insertion_sort -heap_sort diff --git a/StandardAlgorithms/classic-sorting/heap_sort/Makefile b/StandardAlgorithms/classic-sorting/heap_sort/Makefile deleted file mode 100644 index 82d821f..0000000 --- a/StandardAlgorithms/classic-sorting/heap_sort/Makefile +++ /dev/null @@ -1,9 +0,0 @@ - -CMD=\\heapsort -SEC=sec:heap_sort - -include ../../Makefile.template - -TESTOBJ += -lheap - - diff --git a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.c b/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.c deleted file mode 100644 index aaaec12..0000000 --- a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.c +++ /dev/null @@ -1,12 +0,0 @@ - -#include "heap_sort.h" -#include "../heap/make_heap/make_heap.h" -#include "../heap/sort_heap/sort_heap.h" - -void -heap_sort(value_type* a, size_type n) -{ - make_heap(a, n); - sort_heap(a, n); -} - diff --git a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.h b/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.h deleted file mode 100644 index 94fdf5a..0000000 --- a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort.h +++ /dev/null @@ -1,20 +0,0 @@ - -#ifndef HEAP_SORT_H_INCLUDED -#define HEAP_SORT_H_INCLUDED - -#include "MultisetUnchanged.spec" -#include "Sorted.spec" - -/*@ - requires valid: \valid(a + (0..n-1)); - - assigns a[0..n-1]; - - ensures sorted: Sorted(a, n); - ensures reorder: MultisetUnchanged{Old, Here}(a, n); -*/ -void -heap_sort(value_type* a, size_type n); - -#endif /* HEAP_SORT_H_INCLUDED */ - diff --git a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort_test.cpp b/StandardAlgorithms/classic-sorting/heap_sort/heap_sort_test.cpp deleted file mode 100644 index 3bb3154..0000000 --- a/StandardAlgorithms/classic-sorting/heap_sort/heap_sort_test.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "heap_sort.h" -#include -#include -#include -#include -#include - -int -main(int argc, char** argv) -{ - std::vector a{1, 1, 2, 4, 5, 6, 6, 7, 8}; - assert(std::is_sorted(a.begin(), a.end())); - auto b = a; - { - std::random_device rd; - std::mt19937 g(rd()); - std::shuffle(a.begin(), a.end(), g); - } - heap_sort(&a[0], a.size()); - assert(a == b); - std::cout << "\tsuccessful execution of " << argv[0] << "\n"; - return EXIT_SUCCESS; -} - diff --git a/StandardAlgorithms/classic-sorting/insertion_sort/Makefile b/StandardAlgorithms/classic-sorting/insertion_sort/Makefile deleted file mode 100644 index 0dcd2c6..0000000 --- a/StandardAlgorithms/classic-sorting/insertion_sort/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CMD=\\insertionsort -SEC=sec:insertion_sort - - -include ../../Makefile.template - -#WP_FLAGS += -wp-prop=sorted -#WP_FLAGS += -wp-prop=reorder -#WP_FLAGS += -wp-prop=unchanged -#WP_FLAGS += -wp-prop="-@lemma" -#WP_FLAGS += -wp-prop="-@assert" - -TESTOBJ += -lbinarysearch -lmutating - - diff --git a/StandardAlgorithms/classic-sorting/insertion_sort/example.gif b/StandardAlgorithms/classic-sorting/insertion_sort/example.gif deleted file mode 100644 index 46e1349..0000000 Binary files a/StandardAlgorithms/classic-sorting/insertion_sort/example.gif and /dev/null differ diff --git a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.c b/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.c deleted file mode 100644 index 0751df3..0000000 --- a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.c +++ /dev/null @@ -1,47 +0,0 @@ - -#include "insertion_sort.h" -#include "../../binarysearch/upper_bound/upper_bound.h" -#include "../../mutating/rotate/rotate.h" -#include "LowerBound.spec" -#include "MultisetUnchangedLemmas.spec" -#include "EqualRangesPreservesSorted.spec" -#include "RotatePreservesStrictLowerBound.spec" -#include "RotateImpliesMultisetUnchanged.spec" - -void -insertion_sort(value_type* a, size_type n) -{ - /*@ - loop invariant bound: 0 <= i <= n; - loop invariant sorted: Sorted(a, i); - loop invariant reorder: MultisetUnchanged{Pre,Here}(a, 0, i); - loop invariant unchanged: Unchanged{Pre,Here}(a, i, n); - loop assigns i, a[0..n-1]; - loop variant n - i; - */ - for (size_type i = 0u; i < n; ++i) { - const size_type k = upper_bound(a, i, a[i]); - //@ assert bound: 0 <= k <= i; - /*@ - requires sorted: UpperBound(a, k, a[i]); - requires sorted: StrictLowerBound(a, k, i, a[i]); - requires sorted: Sorted(a, k, i); - - assigns a[k..i]; - - ensures unchanged: Unchanged{Old,Here}(a, 0, k); - ensures unchanged: Unchanged{Old,Here}(a, i+1, n); - ensures reorder: MultisetUnchanged{Old,Here}(a, 0, k); - ensures reorder: EqualRanges{Old,Here}(a, k, i, k+1); - ensures reorder: EqualRanges{Old,Here}(a, i, i+1, k); - ensures sorted: Sorted(a, 0, k); - ensures sorted: UpperBound(a, k, a[k]); - */ - rotate(a + k, i - k, i - k + 1u); - //@ assert sorted: Sorted(a, k+1, i+1); - //@ assert sorted: StrictLowerBound(a, k+1, i+1, a[k]); - //@ assert sorted: Sorted(a, i+1); - //@ assert reorder: MultisetUnchanged{Pre,Here}(a, 0, i+1); - } -} - diff --git a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.h b/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.h deleted file mode 100644 index 6d5e005..0000000 --- a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort.h +++ /dev/null @@ -1,20 +0,0 @@ - -#ifndef INSERTION_SORT_H_INCLUDED -#define INSERTION_SORT_H_INCLUDED - -#include "MultisetUnchanged.spec" -#include "Sorted.spec" - -/*@ - requires valid: \valid(a + (0..n-1)); - - assigns a[0..n-1]; - - ensures sorted: Sorted(a, n); - ensures reorder: MultisetUnchanged{Old, Here}(a, n); -*/ -void -insertion_sort(value_type* a, size_type n); - -#endif /* INSERTION_SORT_H_INCLUDED */ - diff --git a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort_test.cpp b/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort_test.cpp deleted file mode 100644 index 5035625..0000000 --- a/StandardAlgorithms/classic-sorting/insertion_sort/insertion_sort_test.cpp +++ /dev/null @@ -1,78 +0,0 @@ - -#include "insertion_sort.h" -#include "../../binarysearch/upper_bound/upper_bound.h" -#include -#include -#include -#include -#include - -std::ostream& -operator<<(std::ostream& stream, const std::vector& a) -{ - stream << '('; - - for (auto i = a.begin(); i != a.end(); ++i) { - stream << *i; - - if (std::next(i) != a.end()) { - stream << ','; - } - else { - stream << ')'; - } - } - - return stream; -} - -template> -void -insertion_sort(FwdIt first, FwdIt last, Compare cmp = Compare{}) -{ - for (auto it = first; it != last; ++it) { - auto const insertion = std::upper_bound(first, it, *it, cmp); - std::rotate(insertion, it, std::next(it)); - assert(std::is_sorted(first, std::next(it), cmp)); - } -} - -// overloaded version for std::vector -void -insertion_sort(std::vector& a) -{ - for (size_t i = 0; i < a.size(); ++i) { - auto it = a.begin() + i; - auto const insertion = std::upper_bound(a.begin(), it, a[i]); - const size_type ins = upper_bound(a.data(), i, a[i]); - assert(insertion == a.begin() + ins); - std::rotate(insertion, it, it + 1); - assert(std::is_sorted(a.begin(), it + 1)); - } -} - - -int -main(int argc, char** argv) -{ - std::vector a{1, 1, 2, 4, 5, 6, 6, 7, 8}; - assert(std::is_sorted(a.begin(), a.end())); - auto save = a; - { - std::random_device rd; - std::mt19937 g(rd()); - std::shuffle(a.begin(), a.end(), g); - } - auto c = a; - //std::cout << c << std::endl; - insertion_sort(c); - //std::cout << c << std::endl; - assert(c == save); - //std::cout << a << std::endl; - insertion_sort(a.data(), a.size()); - //std::cout << a << std::endl; - assert(a == save); - std::cout << "\tsuccessful execution of " << argv[0] << "\n"; - return EXIT_SUCCESS; -} - diff --git a/StandardAlgorithms/classic-sorting/selection_sort/Makefile b/StandardAlgorithms/classic-sorting/selection_sort/Makefile deleted file mode 100644 index 1a38e6f..0000000 --- a/StandardAlgorithms/classic-sorting/selection_sort/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - -CMD=\\selectionsort -SEC=sec:selection_sort - -export WP_TIMEOUT=10 - -include ../../Makefile.template - -#WP_FLAGS += -wp-prop="-@lemma" -#WP_FLAGS += -wp-prop reorder -#WP_FLAGS += -wp-prop sorted -#WP_FLAGS += -wp-prop SwapImpliesMultisetUnchanged -#WP_FLAGS += -wp-prop "UpperBoundShift" -#WP_FLAGS += -wp-prop "StrictUpperBoundShift" - -TESTOBJ += -lmaxmin -lmutating - - diff --git a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.c b/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.c deleted file mode 100644 index dd41386..0000000 --- a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.c +++ /dev/null @@ -1,36 +0,0 @@ - -#include "selection_sort.h" -#include "../../maxmin/min_element/min_element.h" -#include "../../mutating/swap/swap.h" -#include "LowerBound.spec" -#include "ShiftLemmas.spec" -#include "SwapImpliesMultisetUnchanged.spec" - -void -selection_sort(value_type* a, size_type n) -{ - /*@ - loop invariant bound: 0 <= i <= n; - loop invariant sorted: Sorted(a, i); - loop invariant sorted: 0 < i ==> LowerBound(a, i, n, a[i-1]); - loop invariant reorder: MultisetUnchanged{Pre,Here}(a, n); - loop assigns i, a[0..n-1]; - loop variant n - i; - */ - for (size_type i = 0u; i < n; ++i) { - const size_type sel = i + min_element(a + i, n - i); - //@ assert reorder: i <= sel < n; - /*@ - assigns a[sel], a[i]; - - ensures reorder: a[i] == \old(a[sel]); - ensures reorder: a[sel] == \old(a[i]); - ensures reorder: Unchanged{Old,Here}(a, 0, i); - ensures reorder: Unchanged{Old,Here}(a, i+1, sel); - ensures reorder: Unchanged{Old,Here}(a, sel+1, n); - */ - swap(a + sel, a + i); - //@ assert reorder: MultisetUnchanged{Pre,Here}(a, n); - } -} - diff --git a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.h b/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.h deleted file mode 100644 index 41c0125..0000000 --- a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort.h +++ /dev/null @@ -1,20 +0,0 @@ - -#ifndef SELECTION_SORT_H_INCLUDED -#define SELECTION_SORT_H_INCLUDED - -#include "MultisetUnchanged.spec" -#include "Sorted.spec" - -/*@ - requires valid: \valid(a + (0..n-1)); - - assigns a[0..n-1]; - - ensures sorted: Sorted(a, n); - ensures reorder: MultisetUnchanged{Old, Here}(a, n); -*/ -void -selection_sort(value_type* a, size_type n); - -#endif /* SELECTION_SORT_H_INCLUDED */ - diff --git a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort_test.cpp b/StandardAlgorithms/classic-sorting/selection_sort/selection_sort_test.cpp deleted file mode 100644 index ae70a9d..0000000 --- a/StandardAlgorithms/classic-sorting/selection_sort/selection_sort_test.cpp +++ /dev/null @@ -1,78 +0,0 @@ - -#include "selection_sort.h" -#include "../../maxmin/min_element/min_element.h" -#include -#include -#include -#include -#include - -template> -void -cxx(FwdIt first, FwdIt last, Compare cmp = Compare{}) -{ - for (auto it = first; it != last; ++it) { - auto const selection = std::min_element(it, last, cmp); - std::iter_swap(selection, it); - //assert(std::is_sorted(first, std::next(it), cmp)); - } -} - -void -selection_sort(std::vector& a) -{ - for (size_t i = 0; i < a.size(); ++i) { - auto it = a.begin() + i; - auto ptr = a.data() + i; - auto sz = a.size() - i; - const auto min_it = std::min_element(it, a.end()); - const auto min_pos = min_element(ptr, sz); - assert(min_it == a.begin() + min_pos + i); - std::swap(a[i + min_pos], a[i]); - assert(std::is_sorted(a.begin(), std::next(it))); - } -} - -std::ostream& -operator<<(std::ostream& stream, const std::vector& a) -{ - stream << '('; - - for (auto i = a.begin(); i != a.end(); ++i) { - stream << *i; - - if (std::next(i) != a.end()) { - stream << ','; - } - else { - stream << ')'; - } - } - - return stream; -} - -int -main(int argc, char** argv) -{ - std::vector a{1, 1, 2, 4, 5, 6, 6, 7, 8}; - assert(std::is_sorted(a.begin(), a.end())); - auto save = a; - { - std::random_device rd; - std::mt19937 g(rd()); - std::shuffle(a.begin(), a.end(), g); - } - auto c = a; - //std::cout << a << std::endl; - selection_sort(a.data(), a.size()); - //std::cout << a << std::endl; - //std::cout << c << std::endl; - selection_sort(c); - //std::cout << c << std::endl; - assert(c == save); - assert(a == save); - std::cout << "\tsuccessful execution of " << argv[0] << "\n"; - return EXIT_SUCCESS; -} - diff --git a/StandardAlgorithms/config.mk b/StandardAlgorithms/config.mk new file mode 100644 index 0000000..6116076 --- /dev/null +++ b/StandardAlgorithms/config.mk @@ -0,0 +1,25 @@ + + +OS := $(shell uname -s) + +#setup some basic preprocessor flags +CPPFLAGS := -I$(TOP_DIR) +CPPFLAGS += -I$(TOP_DIR)/Logic +INCLUDES = $(CPPFLAGS) + +RANLIBFLAGS = +GNUSED=sed +ifeq ($(OS),Darwin) + RANLIBFLAGS += -no_warning_for_no_symbols + GNUSED=gsed +endif + +LDFLAGS = + + +# compiler flags + +SHARED_FLAGS = -Wall -pedantic -Werror -O2 +CFLAGS = -x c++ -std=c++17 $(SHARED_FLAGS) +CXXFLAGS = -std=c++17 $(SHARED_FLAGS) + diff --git a/StandardAlgorithms/example.mk b/StandardAlgorithms/example.mk new file mode 100644 index 0000000..d730d13 --- /dev/null +++ b/StandardAlgorithms/example.mk @@ -0,0 +1,132 @@ + +MAKEFLAGS += --silent --no-print-directory + +SHELL=/bin/bash + +export TOP_DIR := ../.. +export SCRIPT_DIR := $(TOP_DIR)/Scripts +export DRIVER_DIR := $(TOP_DIR)/drivers +export VS_DIR := $(TOP_DIR)/../Misc/VerificationService + +EXAMPLE := $(shell basename $$(pwd)) + +# latex stuff +CMD ?= $(addprefix \\, $(subst _,,$(EXAMPLE))) +SEC ?= $(addprefix sec:, $(subst _,,$(EXAMPLE))) + + +EXAMPLE_GROUP := $(shell basename $$(cd ..; pwd)) + + + +DEPENDENCIES := + +include ../../config.mk +include ../../frama-c.mk +include ../../rules.mk +include ../../astyle.mk + +include depend.mk + +EXAMPLE_TEST := $(addsuffix _test, $(EXAMPLE)) + +CPPFLAGS += -I. +CPPFLAGS += $(addprefix -I$(TOP_DIR)/, $(DEPENDENCIES)) + +EXAMPLE_LIBS := $(EXAMPLE_GROUP) +EXAMPLE_LIBS += $(subst /, , $(dir $(DEPENDENCIES))) + +LDFLAGS += $(addprefix -L, $(addprefix $(TOP_DIR)/, $(EXAMPLE_LIBS))) +LIBS += $(addprefix -l, $(EXAMPLE_LIBS)) + +export PERL=perl + +$(DRIVER): FORCE + @($(MAKE) compile -sC $(DRIVER_DIR)) + +define av_why3conf +[main] +running_provers_max = $(AV_PROCESSES) + +[strategy] +code = " +start: + c Alt-Ergo,, 1 2000 + c CVC4,,noBV 1 2000 + c Z3,, 1 2000 + c CVC3,, 1 2000 + c Eprover,, 1 2000 + t split_goal_wp start + t introduce_premises next1 +next1: + t inline_all next2 +next2: + t eliminate_if next3 +next3: + t remove_triggers start + c Alt-Ergo,, $(AV_TIMEOUT) 4000 + c CVC4,,noBV $(AV_TIMEOUT) 4000 + c Z3,, $(AV_TIMEOUT) 4000 + c CVC3,, $(AV_TIMEOUT) 4000 + c Eprover,, $(AV_TIMEOUT) 4000" +desc = "Default strategy for ACSL-By-Example" +name = "acslbyexample" +endef +export av_why3conf + +$(AV_WHY3_CONF): FORCE + @if [ -f $@ ]; then \ + tfile=$(shell mktemp); \ + echo "$$av_why3conf" > $$tfile; \ + diff -q $@ $$tfile > /dev/null || mv $$tfile $@; \ + else echo "$$av_why3conf" > $@; fi + +$(EXAMPLE_TEST): $(EXAMPLE_TEST).o + @$(CXX) -o $@ $< $(LDFLAGS) $(LIBS) + +test: $(EXAMPLE_TEST) + @./$(EXAMPLE_TEST) $(TEST_DATA) + +vs-pipe: $(EXAMPLE).vs-pipe + +vs-par: $(EXAMPLE).vs-par + +$(TOP_DIR)/Results/$(EXAMPLE).report: $(EXAMPLE).c + . $(SCRIPT_DIR)/script_functions.sh; extract_data_Wp $(EXAMPLE) $(CMD) $(SEC) > $@ + +$(TOP_DIR)/Results/$(EXAMPLE).preport: $(EXAMPLE).c + @. $(SCRIPT_DIR)/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(basename $<) $(CMD) $(SEC) > $@ + +$(TOP_DIR)/Results/$(EXAMPLE).areport: $(AV_WHY3_CONF) $(EXAMPLE).c + . $(SCRIPT_DIR)/script_functions.sh; extract_data_Av $(EXAMPLE) $(CMD) $(SEC) > $@ + +generate: $(EXAMPLE).why3 + +report: $(TOP_DIR)/Results/$(EXAMPLE).report + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +report-clean: clean + @$(RM) $(TOP_DIR)/Results/$(EXAMPLE).report + +preport: $(TOP_DIR)/Results/$(EXAMPLE).preport + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +preport-clean: clean + @$(RM) $(TOP_DIR)/Results/$(EXAMPLE).preport + +areport: $(TOP_DIR)/Results/$(EXAMPLE).areport + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +areport-clean: + @$(RM) $(TOP_DIR)/Results/$(EXAMPLE).areport + +# cleanup + +clean:: FORCE + @($(MAKE) clean -sC $(DRIVER_DIR)) + @$(RM) $(EXAMPLE_TEST) *.o *.pp.c *.pp.h *.back *.orig .lia.cache + @$(RM) -rf .frama-c *.jessie *.av *.wp *.wp++ *.ml + + +FORCE: + diff --git a/StandardAlgorithms/frama-c.mk b/StandardAlgorithms/frama-c.mk new file mode 100644 index 0000000..4d593eb --- /dev/null +++ b/StandardAlgorithms/frama-c.mk @@ -0,0 +1,79 @@ + +export FRAMAC_SHARE:=$(shell frama-c -print-share-path) + +export TIMEOUT ?= 10 +export PROCESSES ?= 1 + +#setup wp +export WP_TIMEOUT ?= $(TIMEOUT) +export WP_COQ_TIMEOUT ?= $(TIMEOUT) +export WP_ALT_ERGO_STEPS ?= 100000 +export WP_PROCESSES ?= $(PROCESSES) + +#setup av +export AV_TIMEOUT ?= $(TIMEOUT) +export AV_PROCESSES ?= $(PROCESSES) + +# flags for when we invoke Frama C directly instead of going +# through script_functions.sh +WP_TIME_FLAGS= \ + -wp-timeout $(WP_TIMEOUT) \ + -wp-coq-timeout $(WP_COQ_TIMEOUT) \ + -wp-steps $(WP_ALT_ERGO_STEPS) \ + -wp-par $(WP_PROCESSES) + +#setup coq +SCRIPT?='$(TOP_DIR)/wp0.script' # default script +DRIVER=$(DRIVER_DIR)/driver + +# having this as a separate variable allows us to override it in +# algorithm makefiles +WP_RTE_FLAGS ?= -warn-unsigned-overflow -warn-unsigned-downcast + +# We differentiate between two types of WP options: +# 1) in WP_FLAGS we collect the general options +# 2) in WP_PROVER_FLAGS we collect the ones where we select the provers +# This allows us, for example, to start the gui very quickly and then +# run the prover(s) on select proof obligtions. + +BASE_FLAGS := -pp-annot +BASE_FLAGS += -no-unicode + +WP_BASE_FLAGS := $(BASE_FLAGS) +WP_BASE_FLAGS += -wp +WP_BASE_FLAGS += -wp-rte $(WP_RTE_FLAGS) + +AV_BASE_FLAGS := $(BASE_FLAGS) +AV_BASE_FLAGS += -av + +WP_FLAGS := $(WP_BASE_FLAGS) +WP_FLAGS += -wp-driver $(DRIVER_DIR)/external.driver +WP_FLAGS += -wp-script $(SCRIPT) +WP_FLAGS += -wp-model Typed+ref + +AV_FLAGS := $(AV_BASE_FLAGS) -av-extract all_annot +AV_WHY3_CONF := $(shell realpath $(TOP_DIR))/astraver.why3.conf + +WP_PROVER_FLAGS += -wp-steps $(WP_ALT_ERGO_STEPS) + +# provers +WP_PROVER_FLAGS += -wp-prover why3:alt-ergo +WP_PROVER_FLAGS += -wp-prover cvc4 +WP_PROVER_FLAGS += -wp-prover cvc3 +WP_PROVER_FLAGS += -wp-prover z3 +WP_PROVER_FLAGS += -wp-prover eprover +WP_PROVER_FLAGS += -wp-prover coq + + +export FR := frama-c +export FRGUI := frama-c-gui + +export WP_PROVER_FLAGS +export WP_C_FLAGS = -cpp-extra-args="$(INCLUDES)" $(WP_FLAGS) +export WP_CXX_FLAGS = -cxx-clang-command="framaCIRGen $(INCLUDES)" $(WP_FLAGS) +export WP_C_REPORT = $(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par $(WP_PROCESSES) + +export AV_C_FLAGS = -cpp-extra-args="$(INCLUDES)" $(AV_FLAGS) +export AV_STRATEGY = acslbyexample +export AV_C_REPORT = $(FR) $(AV_C_FLAGS) -av-target why3sprove -av-why3-opt " --extra-config $(AV_WHY3_CONF) --no-save-session --strategy $(AV_STRATEGY) " + diff --git a/StandardAlgorithms/group-separate.mk b/StandardAlgorithms/group-separate.mk new file mode 100644 index 0000000..43493f2 --- /dev/null +++ b/StandardAlgorithms/group-separate.mk @@ -0,0 +1,78 @@ + +print-%: ; @echo $*=$($*) + +MAKEFLAGS += --silent --no-print-directory + +export TOP_DIR ?= .. + +export SCRIPT_DIR := $(TOP_DIR)/Scripts +export DRIVER_DIR := $(TOP_DIR)/drivers + +FILELIST := filelist.path +EXAMPLES := $(shell cat $(FILELIST)) +GROUP := $(shell basename $$(pwd)) +GROUP_SOURCES := $(join $(addsuffix /,$(EXAMPLES)),$(addsuffix .c,$(EXAMPLES))) +GROUP_HEADERS := $(GROUP_SOURCES:.c=.h) + +CMD:=\\$(GROUP) +SEC:=cha:$(GROUP) + +GROUP_FILE := $(addsuffix .separate, $(GROUP)) +OUTPUT := $(GROUP_FILE).wp + +DEPENDENCIES := +include $(addsuffix /depend.mk, $(EXAMPLES)) + +include $(TOP_DIR)/config.mk +include $(TOP_DIR)/frama-c.mk +include $(TOP_DIR)/rules.mk + +CPPFLAGS += $(addprefix -I$(TOP_DIR)/$(GROUP)/, $(EXAMPLES)) +CPPFLAGS += $(addprefix -I$(TOP_DIR)/, $(DEPENDENCIES)) + + +$(DRIVER): FORCE + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + +driver: $(DRIVER) + +files: FORCE + +$(OUTPUT): driver FORCE + @$(RM) -r $@ + @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $(GROUP_SOURCES) + +$(GROUP_FILE).wpgui: driver FORCE + @$(RM) -r $(OUTPUT) + @($(FRGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(OUTPUT) $(GROUP_SOURCES) &) + +group-wp: $(OUTPUT) + +group-wpgui: $(GROUP_FILE).wpgui + +$(TOP_DIR)/Results/$(GROUP_FILE).report: + @$(RM) -r $(OUTPUT) + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + @mkdir $(OUTPUT) + @touch $(OUTPUT)/console.log + @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(OUTPUT) $(GROUP_SOURCES) > $(OUTPUT)/console.log + # directly extract WP data + @. $(SCRIPT_DIR)/script_functions.sh; extract_raw_data_Wp $(OUTPUT)/console.log > $@ + # set manuale the 'example' in the report + @$(GNUSED) -i "s/^example.*/example='$(GROUP_FILE)'/" $@ + +report: $(TOP_DIR)/Results/$(GROUP_FILE).report + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +report-clean: clean FORCE + $(RM) $(TOP_DIR)/Results/$(GROUP_FILE).report + + + +clean:: FORCE + @ ($(MAKE) clean -sC $(DRIVER_DIR)) + @ $(RM) .lia.cache + @ $(RM) -r $(OUTPUT) + +FORCE: + diff --git a/StandardAlgorithms/group-simple.mk b/StandardAlgorithms/group-simple.mk new file mode 100644 index 0000000..508e00c --- /dev/null +++ b/StandardAlgorithms/group-simple.mk @@ -0,0 +1,111 @@ + +MAKEFLAGS += --silent --no-print-directory + +export TOP_DIR ?= .. + +export SCRIPT_DIR := $(TOP_DIR)/Scripts +export DRIVER_DIR := $(TOP_DIR)/drivers + +FILELIST := filelist.path +EXAMPLES := $(shell cat $(FILELIST)) +GROUP := $(shell basename $$(pwd)) +GROUP_SOURCES := $(join $(addsuffix /,$(EXAMPLES)),$(addsuffix .c,$(EXAMPLES))) +GROUP_OBJECTS := $(GROUP_SOURCES:.c=.o) + +CMD:=\\$(GROUP) +SEC:=cha:$(GROUP) + +GROUP_FILE := $(addsuffix .simple, $(GROUP)) +GROUP_SRC := $(addsuffix .c, $(GROUP_FILE)) +GROUP_HEADER := $(addsuffix .h, $(GROUP_FILE)) + +GROUP_FILE_CAP := $(shell echo $(GROUP_FILE) | tr '[:lower:]' '[:upper:]') +GROUP_GUARD := $(addsuffix _H_INCLUDED, $(subst .,_, $(GROUP_FILE_CAP))) + +DEPENDENCIES := +include $(addsuffix /depend.mk, $(EXAMPLES)) + +include $(TOP_DIR)/config.mk +include $(TOP_DIR)/frama-c.mk +include $(TOP_DIR)/rules.mk + +CPPFLAGS += $(addprefix -I$(TOP_DIR)/$(GROUP)/, $(EXAMPLES)) +CPPFLAGS += $(addprefix -I$(TOP_DIR)/, $(DEPENDENCIES)) + +show-cpp: FORCE + echo $(CPPFLAGS) + +# concatenate example source files +$(GROUP_SRC): $(GROUP_SOURCES) + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ printf "\n" > $@ + @ printf '#include "$(GROUP_HEADER)"\n' >> $@ + @ cat $^ | tee -a $(TMPF) | grep '^#include[[:space:]]\+".*\.spec"' >> $@ + @ cat $(TMPF) | grep -v '^#' | cat -s >> $@ + +sources: $(GROUP_SRC) FORCE + +# concatenate example header files +$(GROUP_HEADER): FORCE + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ cat $(GROUP_SOURCES) >> $(TMPF) + @ printf "\n#ifndef $(GROUP_GUARD)\n" >> $@ + @ printf "#define $(GROUP_GUARD)\n\n" >> $@ + @ cat $(TMPF) | grep '^#include[[:space:]]\+".*\.h"' | sort -u >> $@ + @ printf "\n" >> $@ + @ printf "#endif /* $(GROUP_GUARD) */\n\n" >> $@ + +header: $(GROUP_HEADER) FORCE + +files: header sources + +$(DRIVER): FORCE + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + +driver: $(DRIVER) + +$(GROUP_FILE).wp: files driver + @$(RM) -r $@ + @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $(GROUP_SRC) + +$(GROUP_FILE).wpgui: files driver + @$(RM) -r $(GROUP_FILE).wp + @$(FRGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(GROUP_FILE).wp $(GROUP_SRC) + +group-wp: $(GROUP_FILE).wp + +group-wpgui: $(GROUP_FILE).wpgui + + +$(TOP_DIR)/Results/$(GROUP_FILE).report: + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + @. $(SCRIPT_DIR)/script_functions.sh; extract_data_Wp $(GROUP_FILE) $(CMD) $(SEC) > $@ + +report: $(TOP_DIR)/Results/$(GROUP_FILE).report + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +report-clean: clean FORCE + @$(RM) $(TOP_DIR)/Results/$(GROUP_FILE).report + + +$(TOP_DIR)/Results/$(GROUP_FILE).preport: + @. $(SCRIPT_DIR)/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(GROUP_FILE) $(CMD) $(SEC) > $@ + +preport: $(TOP_DIR)/Results/$(GROUP_FILE).preport + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +preport-clean: clean FORCE + @$(RM) $(TOP_DIR)/Results/$(GROUP_FILE).preport + + +clean:: FORCE + @ ($(MAKE) clean -sC $(DRIVER_DIR)) + @ $(RM) .lia.cache + @ $(RM) $(GROUP_SRC) + @ $(RM) $(GROUP_HEADER) + @ $(RM) -r $(GROUP_FILE).wp + +FORCE: + diff --git a/StandardAlgorithms/group-union.mk b/StandardAlgorithms/group-union.mk new file mode 100644 index 0000000..6609fad --- /dev/null +++ b/StandardAlgorithms/group-union.mk @@ -0,0 +1,117 @@ + +print-%: ; @echo $*=$($*) + +MAKEFLAGS += --silent --no-print-directory + +export TOP_DIR ?= .. + +export SCRIPT_DIR := $(TOP_DIR)/Scripts +export DRIVER_DIR := $(TOP_DIR)/drivers + +FILELIST := filelist.path +EXAMPLES := $(shell cat $(FILELIST)) +GROUP := $(shell basename $$(pwd)) +GROUP_SOURCES := $(join $(addsuffix /,$(EXAMPLES)),$(addsuffix .c,$(EXAMPLES))) +GROUP_HEADERS := $(GROUP_SOURCES:.c=.h) + +CMD:=\\$(GROUP) +SEC:=cha:$(GROUP) + +GROUP_FILE := $(addsuffix .union, $(GROUP)) +GROUP_SRC := $(addsuffix .c, $(GROUP_FILE)) +GROUP_HEADER := $(addsuffix .h, $(GROUP_FILE)) + +GROUP_FILE_CAP := $(shell echo $(GROUP_FILE) | tr '[:lower:]' '[:upper:]') +GROUP_GUARD := $(addsuffix _H_INCLUDED, $(subst .,_, $(GROUP_FILE_CAP))) + +DEPENDENCIES := +include $(addsuffix /depend.mk, $(EXAMPLES)) +GROUP_DEPENDENCIES = $(sort $(subst /,, $(dir $(DEPENDENCIES)))) +DEPENDENCY_HEADERS = $(addsuffix .union.h, $(GROUP_DEPENDENCIES)) + +include $(TOP_DIR)/config.mk +include $(TOP_DIR)/frama-c.mk +include $(TOP_DIR)/rules.mk + +#CPPFLAGS += $(addprefix -I$(TOP_DIR)/$(GROUP)/, $(EXAMPLES)) +CPPFLAGS += $(addprefix -I$(TOP_DIR)/, $(GROUP_DEPENDENCIES)) + +debug: FORCE + echo $(DEPENDENCY_HEADERS) + +# concatenate example source files +$(GROUP_SRC): $(GROUP_SOURCES) + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ printf "\n" > $@ + @ printf '#include "$(GROUP_HEADER)"\n' >> $@ + (for f in $(DEPENDENCY_HEADERS); do (printf '#include "'; printf $$f; printf '"\n') >> $@ ; done) + @ printf "\n" >> $@ + @ cat $^ | tee -a $(TMPF) | grep '^#include[[:space:]]\+".*\.spec"' | sort -u | cat -s >> $@ + @ cat $(TMPF) | grep -v '^#' | cat -s >> $@ + +sources: $(GROUP_SRC) FORCE + +# concatenate example header files +$(GROUP_HEADER): $(GROUP_HEADERS) + @ $(eval TMPF := $(shell mktemp)) + @ trap 'rm "$(TMPF)"' 0 + @ printf "\n#ifndef $(GROUP_GUARD)\n" >> $@ + @ printf "#define $(GROUP_GUARD)\n\n" >> $@ + @ cat $^ >> $(TMPF) + @ cat $(TMPF) | grep '^#include[[:space:]]\+".*\.spec"' | sort -u >> $@ + @ printf "\n" >> $@ + @ cat $(TMPF) | grep -vE '^#' | cat -s >> $@ + @ printf "\n" >> $@ + @ printf "#endif /* $(GROUP_GUARD) */\n\n" >> $@ + +header: $(GROUP_HEADER) FORCE + +files: header sources + +driver: FORCE + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + +$(GROUP_FILE).wp: files driver + @$(RM) -r $@ + @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $(GROUP_SRC) + +$(GROUP_FILE).wpgui: files driver + @$(RM) -r $(GROUP_FILE).wp + @$(FRGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(GROUP_FILE).wp $(GROUP_SRC) + +group-wp: $(GROUP_FILE).wp + +group-wpgui: $(GROUP_FILE).wpgui + + +$(TOP_DIR)/Results/$(GROUP_FILE).report: + @ ($(MAKE) compile -sC $(DRIVER_DIR)) + @. $(SCRIPT_DIR)/script_functions.sh; extract_data_Wp $(GROUP_FILE) $(CMD) $(SEC) > $@ + +report: $(TOP_DIR)/Results/$(GROUP_FILE).report + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +report-clean: clean FORCE + @$(RM) $(TOP_DIR)/Results/$(GROUP_FILE).report + + +$(TOP_DIR)/Results/$(GROUP_FILE).preport: + @. $(SCRIPT_DIR)/script_functions.sh; REPORT_BACKEND=wp_runner extract_data_Wp $(GROUP_FILE) $(CMD) $(SEC) > $@ + +preport: $(TOP_DIR)/Results/$(GROUP_FILE).preport + @. $(SCRIPT_DIR)/script_functions.sh; prettyPrintReport $< + +preport-clean: clean FORCE + @$(RM) $(TOP_DIR)/Results/$(GROUP_FILE).preport + + +clean:: FORCE + @ ($(MAKE) clean -sC $(DRIVER_DIR)) + @ $(RM) .lia.cache + @ $(RM) $(GROUP_SRC) + @ $(RM) $(GROUP_HEADER) + @ $(RM) -r $(GROUP_FILE).wp + +FORCE: + diff --git a/StandardAlgorithms/group.mk b/StandardAlgorithms/group.mk new file mode 100644 index 0000000..79d9a11 --- /dev/null +++ b/StandardAlgorithms/group.mk @@ -0,0 +1,133 @@ + +MAKEFLAGS += --silent --no-print-directory + +ACTION := group-union +#ACTION := group-separate +#ACTION := group-simple + +export TOP_DIR ?= .. + +FILELIST := filelist.path +GROUP := $(shell basename $$(pwd)) +LIB := $(addprefix lib, $(addsuffix .a, $(GROUP))) +EXAMPLES := $(shell cat $(FILELIST)) +GROUP_SOURCES := $(join $(addsuffix /,$(EXAMPLES)),$(addsuffix .c,$(EXAMPLES))) +GROUP_OBJECTS := $(GROUP_SOURCES:.c=.o) + +DEPENDENCIES := +include $(addsuffix /depend.mk, $(EXAMPLES)) + +include $(TOP_DIR)/config.mk + +CPPFLAGS += $(addprefix -I$(TOP_DIR)/$(GROUP)/, $(EXAMPLES)) +CPPFLAGS += $(addprefix -I$(TOP_DIR)/, $(DEPENDENCIES)) + +EXAMPLE_LIBS := $(GROUP) +EXAMPLE_LIBS += $(subst /, , $(dir $(DEPENDENCIES))) + +LDFLAGS += $(addprefix -L, $(addprefix $(TOP_DIR)/, $(EXAMPLE_LIBS))) + +lib: $(LIB) + +$(LIB): $(GROUP_OBJECTS) + @ar cr $@ $(GROUP_OBJECTS) + @ranlib $(RANLIBFLAGS) $@ + @$(RM) $(GROUP_OBJECTS) + +test:: lib + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) test -sC $$i);\ + done + +clean:: FORCE + $(RM) $(LIB) + @$(RM) $(GROUP_OBJECTS) + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk clean + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) clean -sC $$i);\ + done + +generate: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) generate -sC $$i);\ + done + +report: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) report -sC $$i);\ + done + +report-clean: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) report-clean -sC $$i);\ + done + +preport: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) preport -sC $$i);\ + done + +preport-clean: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) preport-clean -sC $$i);\ + done + +areport: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) areport -sC $$i);\ + done + +areport-clean: + @for i in $(EXAMPLES);\ + do \ + ($(MAKE) areport-clean -sC $$i);\ + done + +format: + @for i in $(EXAMPLES);\ + do \ + ( $(MAKE) format -sC $$i);\ + done + +vs-pipe: + @for i in $(EXAMPLES);\ + do \ + ( $(MAKE) vs-pipe -sC $$i);\ + done + +vs-par: + @for i in $(EXAMPLES);\ + do \ + ( $(MAKE) vs-par -sC $$i);\ + done + +group-files: + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk files + +group-wp: + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk group-wp + +group-wpgui: + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk group-wpgui + +group-report: group-files + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk report + +group-report-clean: + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk report-clean + +group-preport: group-files + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk preport + +group-preport-clean: + $(MAKE) -f $(TOP_DIR)/$(ACTION).mk preport-clean + +FORCE: diff --git a/StandardAlgorithms/heap/Makefile b/StandardAlgorithms/heap/Makefile index 1165a2a..c8215d8 100644 --- a/StandardAlgorithms/heap/Makefile +++ b/StandardAlgorithms/heap/Makefile @@ -5,12 +5,5 @@ clean:: FORCE $(RM) libheap.a - -include ../Makefile.group - -lib: libheap.a - -libheap.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/heap/filelist.path b/StandardAlgorithms/heap/filelist.path index 8436a3e..9582dee 100644 --- a/StandardAlgorithms/heap/filelist.path +++ b/StandardAlgorithms/heap/filelist.path @@ -1,3 +1,6 @@ +heap_parent +heap_child_max +is_heap_until is_heap push_heap pop_heap diff --git a/StandardAlgorithms/heap/heap.h b/StandardAlgorithms/heap/heap.h deleted file mode 100644 index c55931c..0000000 --- a/StandardAlgorithms/heap/heap.h +++ /dev/null @@ -1,12 +0,0 @@ - -#ifndef HEAP_H_INCLUDED -#define HEAP_H_INCLUDED - -#include "is_heap/is_heap.h" -#include "push_heap/push_heap.h" -#include "pop_heap/pop_heap.h" -#include "make_heap/make_heap.h" -#include "sort_heap/sort_heap.h" - -#endif /* HEAP_H_INCLUDED */ - diff --git a/StandardAlgorithms/heap/heap_child_max/Makefile b/StandardAlgorithms/heap/heap_child_max/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/heap/heap_child_max/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/heap/heap_child_max/depend.mk b/StandardAlgorithms/heap/heap_child_max/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/heap/heap_child_max/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/heap/heap_child_max/heap_child_max.c b/StandardAlgorithms/heap/heap_child_max/heap_child_max.c new file mode 100644 index 0000000..35dfe77 --- /dev/null +++ b/StandardAlgorithms/heap/heap_child_max/heap_child_max.c @@ -0,0 +1,4 @@ + +// dummy file +#include "heap_child_max.h" + diff --git a/StandardAlgorithms/heap/pop_heap/maximum_heap_child.h b/StandardAlgorithms/heap/heap_child_max/heap_child_max.h similarity index 74% rename from StandardAlgorithms/heap/pop_heap/maximum_heap_child.h rename to StandardAlgorithms/heap/heap_child_max/heap_child_max.h index 3143506..0eaf0d2 100644 --- a/StandardAlgorithms/heap/pop_heap/maximum_heap_child.h +++ b/StandardAlgorithms/heap/heap_child_max/heap_child_max.h @@ -1,9 +1,9 @@ -#ifndef SELECT_CHILD_H_INCLUDED -#define SELECT_CHILD_H_INCLUDED +#ifndef HEAP_CHILD_MAX_H_INCLUDED +#define HEAP_CHILD_MAX_H_INCLUDED #include "IsHeap.spec" -#include "HeapMaximumChild.spec" +#include "HeapChildMax.spec" /*@ requires bound: 2 <= n; @@ -14,12 +14,12 @@ assigns \nothing; ensures heap: IsHeap(a, n); - ensures max: HeapMaximumChild(a, n, parent, \result); + ensures max: HeapChildMax(a, n, parent, \result); ensures less: parent < \result; ensures less: \result < n - 1 ==> parent == HeapParent(\result); */ static inline size_type -maximum_heap_child(const value_type* a, size_type n, size_type parent) +heap_child_max(const value_type* a, size_type n, size_type parent) { if (parent < (SIZE_TYPE_MAX - 1u) / 2u) { const size_type right = 2u * parent + 2u; @@ -39,5 +39,5 @@ maximum_heap_child(const value_type* a, size_type n, size_type parent) } } -#endif /* SELECT_CHILD_H_INCLUDED */ +#endif /* HEAP_CHILD_MAX_H_INCLUDED */ diff --git a/StandardAlgorithms/heap/heap_child_max/heap_child_max_test.cpp b/StandardAlgorithms/heap/heap_child_max/heap_child_max_test.cpp new file mode 100755 index 0000000..3bc60d1 --- /dev/null +++ b/StandardAlgorithms/heap/heap_child_max/heap_child_max_test.cpp @@ -0,0 +1,10 @@ + +#include + +int +main(int argc, char** argv) +{ + std::cout << "\tsuccessful dummy test of " << argv[0] << std::endl; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/heap/heap_parent/Makefile b/StandardAlgorithms/heap/heap_parent/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/heap/heap_parent/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/heap/heap_parent/depend.mk b/StandardAlgorithms/heap/heap_parent/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/heap/heap_parent/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/heap/heap_parent/heap_parent.c b/StandardAlgorithms/heap/heap_parent/heap_parent.c new file mode 100644 index 0000000..2fe2f3a --- /dev/null +++ b/StandardAlgorithms/heap/heap_parent/heap_parent.c @@ -0,0 +1,4 @@ + +// dummy file +#include "heap_parent.h" + diff --git a/StandardAlgorithms/heap/is_heap/heap_aux.h b/StandardAlgorithms/heap/heap_parent/heap_parent.h similarity index 93% rename from StandardAlgorithms/heap/is_heap/heap_aux.h rename to StandardAlgorithms/heap/heap_parent/heap_parent.h index 0d11990..3129e46 100644 --- a/StandardAlgorithms/heap/is_heap/heap_aux.h +++ b/StandardAlgorithms/heap/heap_parent/heap_parent.h @@ -2,6 +2,8 @@ #ifndef HEAP_AUX_H_INCLUDED #define HEAP_AUX_H_INCLUDED +#include "Heap.spec" + /*@ requires bound: 0 < child; assigns \nothing; diff --git a/StandardAlgorithms/heap/heap_parent/heap_parent_test.cpp b/StandardAlgorithms/heap/heap_parent/heap_parent_test.cpp new file mode 100644 index 0000000..3bc60d1 --- /dev/null +++ b/StandardAlgorithms/heap/heap_parent/heap_parent_test.cpp @@ -0,0 +1,10 @@ + +#include + +int +main(int argc, char** argv) +{ + std::cout << "\tsuccessful dummy test of " << argv[0] << std::endl; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/heap/is_heap/Makefile b/StandardAlgorithms/heap/is_heap/Makefile index 3f197ac..8100c89 100644 --- a/StandardAlgorithms/heap/is_heap/Makefile +++ b/StandardAlgorithms/heap/is_heap/Makefile @@ -1,6 +1,3 @@ -CMD=\\isheap -SEC=sec:is_heap - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/heap/is_heap/depend.mk b/StandardAlgorithms/heap/is_heap/depend.mk new file mode 100644 index 0000000..db1558e --- /dev/null +++ b/StandardAlgorithms/heap/is_heap/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += heap/is_heap_until + diff --git a/StandardAlgorithms/heap/is_heap/heap_aux.c b/StandardAlgorithms/heap/is_heap/heap_aux.c deleted file mode 100644 index f89dc85..0000000 --- a/StandardAlgorithms/heap/is_heap/heap_aux.c +++ /dev/null @@ -1,3 +0,0 @@ - -// dummy file - diff --git a/StandardAlgorithms/heap/is_heap/is_heap.c b/StandardAlgorithms/heap/is_heap/is_heap.c index 5acbedb..a0eb3d0 100644 --- a/StandardAlgorithms/heap/is_heap/is_heap.c +++ b/StandardAlgorithms/heap/is_heap/is_heap.c @@ -1,31 +1,10 @@ #include "is_heap.h" - -#include "SortedDownIsHeap.spec" +#include "is_heap_until.h" bool is_heap(const value_type* a, size_type n) { - size_type parent = 0u; - - /*@ - loop invariant bound: 0 <= parent < child <= n+1; - loop invariant parent: parent == HeapParent(child); - loop invariant heap: IsHeap(a, child); - - loop assigns child, parent; - loop variant n - child; - */ - for (size_type child = 1u; child < n; ++child) { - if (a[parent] < a[child]) { - return false; - } - - if ((child % 2u) == 0u) { - ++parent; - } - } - - return true; + return is_heap_until(a, n) == n; } diff --git a/StandardAlgorithms/heap/is_heap_until/Makefile b/StandardAlgorithms/heap/is_heap_until/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/heap/is_heap_until/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/heap/is_heap_until/depend.mk b/StandardAlgorithms/heap/is_heap_until/depend.mk new file mode 100644 index 0000000..d08c23b --- /dev/null +++ b/StandardAlgorithms/heap/is_heap_until/depend.mk @@ -0,0 +1 @@ +DEPENDANCIES += diff --git a/StandardAlgorithms/heap/is_heap_until/is_heap_until.c b/StandardAlgorithms/heap/is_heap_until/is_heap_until.c new file mode 100644 index 0000000..d09417f --- /dev/null +++ b/StandardAlgorithms/heap/is_heap_until/is_heap_until.c @@ -0,0 +1,30 @@ + +#include "is_heap_until.h" + +size_type +is_heap_until(const value_type* a, size_type n) +{ + size_type parent = 0u; + + /*@ + loop invariant bound: 0 <= parent < child <= n+1; + loop invariant parent: parent == HeapParent(child); + loop invariant heap: IsHeap(a, child); + loop invariant not_heap: a[parent] < a[child] ==> \forall integer i; child < i <= n ==> !IsHeap(a, i); + + loop assigns child, parent; + loop variant n - child; + */ + for (size_type child = 1u; child < n; ++child) { + if (a[parent] < a[child]) { + return child; + } + + if ((child % 2u) == 0u) { + ++parent; + } + } + + return n; +} + diff --git a/StandardAlgorithms/heap/is_heap_until/is_heap_until.h b/StandardAlgorithms/heap/is_heap_until/is_heap_until.h new file mode 100644 index 0000000..6a3742e --- /dev/null +++ b/StandardAlgorithms/heap/is_heap_until/is_heap_until.h @@ -0,0 +1,20 @@ + +#ifndef IS_HEAP_UNTIL_H_INCLUDED +#define IS_HEAP_UNTIL_H_INCLUDED + +#include "IsHeap.spec" + +/*@ + requires valid: \valid_read(a + (0..n-1)); + + assigns \nothing; + + ensures bound: 0 <= \result <= n; + ensures heap: IsHeap(a, \result); + ensures last: \forall integer i; \result < i <= n ==> !IsHeap(a, i); +*/ +size_type +is_heap_until(const value_type* a, size_type n); + +#endif /* IS_HEAP_UNTIL_H_INCLUDED */ + diff --git a/StandardAlgorithms/heap/is_heap_until/is_heap_until_test.cpp b/StandardAlgorithms/heap/is_heap_until/is_heap_until_test.cpp new file mode 100644 index 0000000..6c14a6a --- /dev/null +++ b/StandardAlgorithms/heap/is_heap_until/is_heap_until_test.cpp @@ -0,0 +1,23 @@ + +#include +#include +#include +#include +#include +#include "is_heap_until.h" + + +int +main(int argc, char** argv) +{ + std::vector a(10); + + std::iota(a.begin(), a.end(), 0); + std::make_heap(a.begin(), a.begin() + a.size() / 2); + auto result1 = is_heap_until(a.data(), a.size()); + auto result2 = std::is_heap_until(a.begin(), a.end()); + assert(a.begin() + result1 == result2); + + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; +} + diff --git a/StandardAlgorithms/heap/make_heap/Makefile b/StandardAlgorithms/heap/make_heap/Makefile index a3127fb..4a6b6e8 100644 --- a/StandardAlgorithms/heap/make_heap/Makefile +++ b/StandardAlgorithms/heap/make_heap/Makefile @@ -1,11 +1,7 @@ -CMD=\\makeheap -SEC=sec:make_heap - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop max #WP_FLAGS += -wp-prop @lemma -TESTOBJ += -lheap diff --git a/StandardAlgorithms/heap/make_heap/depend.mk b/StandardAlgorithms/heap/make_heap/depend.mk new file mode 100644 index 0000000..27e17dd --- /dev/null +++ b/StandardAlgorithms/heap/make_heap/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += heap/push_heap +DEPENDENCIES += heap/is_heap + diff --git a/StandardAlgorithms/heap/make_heap/make_heap.c b/StandardAlgorithms/heap/make_heap/make_heap.c index a214fbc..4c3803a 100644 --- a/StandardAlgorithms/heap/make_heap/make_heap.c +++ b/StandardAlgorithms/heap/make_heap/make_heap.c @@ -1,6 +1,6 @@ #include "make_heap.h" -#include "../push_heap/push_heap.h" +#include "push_heap.h" #include "Unchanged.spec" void diff --git a/StandardAlgorithms/heap/make_heap/make_heap_test.cpp b/StandardAlgorithms/heap/make_heap/make_heap_test.cpp index 0d14c0a..df23d7d 100644 --- a/StandardAlgorithms/heap/make_heap/make_heap_test.cpp +++ b/StandardAlgorithms/heap/make_heap/make_heap_test.cpp @@ -4,7 +4,7 @@ #include #include #include "make_heap.h" -#include "../is_heap/is_heap.h" +#include "is_heap.h" int main(int argc, char** argv) diff --git a/StandardAlgorithms/heap/pop_heap/Makefile b/StandardAlgorithms/heap/pop_heap/Makefile index af3c13f..6be6a43 100644 --- a/StandardAlgorithms/heap/pop_heap/Makefile +++ b/StandardAlgorithms/heap/pop_heap/Makefile @@ -1,9 +1,5 @@ -CMD=\\popheap -SEC=sec:pop_heap - - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop PopHeapUpdate #WP_FLAGS += -wp-prop heap diff --git a/StandardAlgorithms/heap/pop_heap/depend.mk b/StandardAlgorithms/heap/pop_heap/depend.mk new file mode 100644 index 0000000..790c1ee --- /dev/null +++ b/StandardAlgorithms/heap/pop_heap/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += heap/heap_child_max +DEPENDENCIES += heap/is_heap + diff --git a/StandardAlgorithms/heap/pop_heap/maximum_heap_child.c b/StandardAlgorithms/heap/pop_heap/maximum_heap_child.c deleted file mode 100644 index f89dc85..0000000 --- a/StandardAlgorithms/heap/pop_heap/maximum_heap_child.c +++ /dev/null @@ -1,3 +0,0 @@ - -// dummy file - diff --git a/StandardAlgorithms/heap/pop_heap/pop_heap.c b/StandardAlgorithms/heap/pop_heap/pop_heap.c index ecc2bda..a53dee9 100644 --- a/StandardAlgorithms/heap/pop_heap/pop_heap.c +++ b/StandardAlgorithms/heap/pop_heap/pop_heap.c @@ -1,6 +1,6 @@ #include "pop_heap.h" -#include "maximum_heap_child.h" +#include "heap_child_max.h" #include "HeapMaximum.spec" void @@ -13,7 +13,7 @@ pop_heap(value_type* a, size_type n) if (a[n - 1u] < v) { // otherwise nothings needs to be done //@ assert bounds: 2 <= n; size_type hole = 0u; - size_type child = maximum_heap_child(a, n, hole); + size_type child = heap_child_max(a, n, hole); //@ assert heap: child < n - 1 ==> hole == HeapParent(child); /*@ @@ -22,7 +22,7 @@ pop_heap(value_type* a, size_type n) loop invariant heap: IsHeap(a, n); loop invariant heap: a[n-1] < a[HeapParent(hole)]; loop invariant heap: child < n - 1 ==> hole == HeapParent(child); - loop invariant child: HeapMaximumChild(a, n, hole, child); + loop invariant child: HeapChildMax(a, n, hole, child); loop invariant max: UpperBound(a, 0, n, v); loop assigns hole, child, a[0..n-2]; loop variant n - hole; @@ -31,11 +31,11 @@ pop_heap(value_type* a, size_type n) a[hole] = a[child]; hole = child; //@ assert heap: IsHeap(a, n); - child = maximum_heap_child(a, n, hole); + child = heap_child_max(a, n, hole); } //@ assert child: child < n-1 ==> a[n-1] >= a[child]; - //@ assert child: HeapMaximumChild(a, n, hole, child); + //@ assert child: HeapChildMax(a, n, hole, child); //@ assert heap: IsHeap(a, n); //@ assert heap: a[n-1] < a[HeapParent(hole)]; a[hole] = a[n - 1u]; diff --git a/StandardAlgorithms/heap/pop_heap/pop_heap_test.cpp b/StandardAlgorithms/heap/pop_heap/pop_heap_test.cpp index 31b5ca4..733d9fd 100644 --- a/StandardAlgorithms/heap/pop_heap/pop_heap_test.cpp +++ b/StandardAlgorithms/heap/pop_heap/pop_heap_test.cpp @@ -5,7 +5,7 @@ #include #include #include "pop_heap.h" -#include "../is_heap/is_heap.h" +#include "is_heap.h" #include "../../support/vector_io.h" void diff --git a/StandardAlgorithms/heap/push_heap/Makefile b/StandardAlgorithms/heap/push_heap/Makefile index 0ec85dd..caa5171 100644 --- a/StandardAlgorithms/heap/push_heap/Makefile +++ b/StandardAlgorithms/heap/push_heap/Makefile @@ -1,9 +1,7 @@ -CMD=\\pushheap -SEC=sec:push_heap +WP_TIMEOUT=15 - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop="@lemma" #WP_FLAGS += -wp-prop="-@lemma" @@ -26,5 +24,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop @assigns #WP_FLAGS += -wp-prop="-@invariant" -TESTOBJ += -lheap - diff --git a/StandardAlgorithms/heap/push_heap/depend.mk b/StandardAlgorithms/heap/push_heap/depend.mk new file mode 100644 index 0000000..80a8a76 --- /dev/null +++ b/StandardAlgorithms/heap/push_heap/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += heap/heap_parent +DEPENDENCIES += heap/is_heap + diff --git a/StandardAlgorithms/heap/push_heap/push_heap.c b/StandardAlgorithms/heap/push_heap/push_heap.c index 034a027..5b489d4 100644 --- a/StandardAlgorithms/heap/push_heap/push_heap.c +++ b/StandardAlgorithms/heap/push_heap/push_heap.c @@ -1,6 +1,6 @@ #include "push_heap.h" -#include "../is_heap/heap_aux.h" +#include "heap_parent.h" #include "CountLemmas.spec" #include "MultisetAdd.spec" #include "MultisetAddDistinct.spec" diff --git a/StandardAlgorithms/heap/push_heap/push_heap_test.cpp b/StandardAlgorithms/heap/push_heap/push_heap_test.cpp index 0a23e8f..ddb73b6 100644 --- a/StandardAlgorithms/heap/push_heap/push_heap_test.cpp +++ b/StandardAlgorithms/heap/push_heap/push_heap_test.cpp @@ -4,7 +4,7 @@ #include #include #include "push_heap.h" -#include "../is_heap/is_heap.h" +#include "is_heap.h" int main(int argc, char** argv) diff --git a/StandardAlgorithms/heap/sort_heap/Makefile b/StandardAlgorithms/heap/sort_heap/Makefile index e7c61b5..00fe5ee 100644 --- a/StandardAlgorithms/heap/sort_heap/Makefile +++ b/StandardAlgorithms/heap/sort_heap/Makefile @@ -1,8 +1,5 @@ -CMD=\\sortheap -SEC=sec:sort_heap - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop reorder #WP_FLAGS += -wp-prop max @@ -12,5 +9,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop HeapBounds #WP_FLAGS += -wp-prop HeapMaximum -TESTOBJ += -lheap - diff --git a/StandardAlgorithms/heap/sort_heap/depend.mk b/StandardAlgorithms/heap/sort_heap/depend.mk new file mode 100644 index 0000000..5f0bc80 --- /dev/null +++ b/StandardAlgorithms/heap/sort_heap/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += heap/pop_heap +DEPENDENCIES += heap/make_heap + diff --git a/StandardAlgorithms/heap/sort_heap/sort_heap.c b/StandardAlgorithms/heap/sort_heap/sort_heap.c index 4c80c49..e249526 100644 --- a/StandardAlgorithms/heap/sort_heap/sort_heap.c +++ b/StandardAlgorithms/heap/sort_heap/sort_heap.c @@ -1,6 +1,6 @@ #include "sort_heap.h" -#include "../pop_heap/pop_heap.h" +#include "pop_heap.h" #include "LowerBound.spec" #include "SortedUpperBound.spec" #include "Unchanged.spec" diff --git a/StandardAlgorithms/heap/sort_heap/sort_heap_test.cpp b/StandardAlgorithms/heap/sort_heap/sort_heap_test.cpp index 5a96e9e..959fd21 100644 --- a/StandardAlgorithms/heap/sort_heap/sort_heap_test.cpp +++ b/StandardAlgorithms/heap/sort_heap/sort_heap_test.cpp @@ -3,7 +3,8 @@ #include #include #include -#include "heap.h" +#include "make_heap.h" +#include "sort_heap.h" int main(int argc, char** argv) diff --git a/StandardAlgorithms/maxmin/Makefile b/StandardAlgorithms/maxmin/Makefile index bf22b28..25c658d 100644 --- a/StandardAlgorithms/maxmin/Makefile +++ b/StandardAlgorithms/maxmin/Makefile @@ -1,13 +1,7 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libmaxmin.a - -lib: libmaxmin.a - -libmaxmin.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk +debug: + echo $(OS) + echo $(RANLIBFLAGS) diff --git a/StandardAlgorithms/maxmin/clamp/Makefile b/StandardAlgorithms/maxmin/clamp/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/maxmin/clamp/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/maxmin/clamp/clamp.c b/StandardAlgorithms/maxmin/clamp/clamp.c new file mode 100644 index 0000000..9ec8246 --- /dev/null +++ b/StandardAlgorithms/maxmin/clamp/clamp.c @@ -0,0 +1,9 @@ + +#include "clamp.h" + +value_type +clamp(value_type v, value_type lower, value_type upper) +{ + return (v < lower) ? lower : (upper < v) ? upper : v; +} + diff --git a/StandardAlgorithms/maxmin/clamp/clamp.h b/StandardAlgorithms/maxmin/clamp/clamp.h new file mode 100644 index 0000000..4f34b38 --- /dev/null +++ b/StandardAlgorithms/maxmin/clamp/clamp.h @@ -0,0 +1,36 @@ + +#ifndef CLAMP_H_INCLUDED +#define CLAMP_H_INCLUDED + +#include "typedefs.h" + +/*@ + requires bound: lower < upper; + + assigns \nothing; + + ensures bound: lower <= \result <= upper; + + behavior lower_bound: + assumes v < lower; + assigns \nothing; + ensures result: \result == lower; + + behavior between: + assumes lower <= v <= upper; + assigns \nothing; + ensures result: \result == v; + + behavior upper_bound: + assumes upper < v; + assigns \nothing; + ensures result: \result == upper; + + complete behaviors lower_bound, upper_bound, between; + disjoint behaviors lower_bound, upper_bound, between; +*/ +value_type +clamp(value_type v, value_type lower, value_type upper); + +#endif /* CLAMP_H_INCLUDED */ + diff --git a/StandardAlgorithms/maxmin/clamp/clamp_test.cpp b/StandardAlgorithms/maxmin/clamp/clamp_test.cpp new file mode 100644 index 0000000..6ef8e27 --- /dev/null +++ b/StandardAlgorithms/maxmin/clamp/clamp_test.cpp @@ -0,0 +1,17 @@ + +#include +#include +#include +#include "clamp.h" + +int +main(int argc, char** argv) +{ + + auto result1 = clamp(20, 10, 100); + auto result2 = std::clamp(20, 10, 100); + assert(result1 == result2); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/maxmin/clamp/depend.mk b/StandardAlgorithms/maxmin/clamp/depend.mk new file mode 100644 index 0000000..0bb237f --- /dev/null +++ b/StandardAlgorithms/maxmin/clamp/depend.mk @@ -0,0 +1,2 @@ + +DEPENDENCIES += diff --git a/StandardAlgorithms/maxmin/filelist.path b/StandardAlgorithms/maxmin/filelist.path index a354e50..56de6ef 100644 --- a/StandardAlgorithms/maxmin/filelist.path +++ b/StandardAlgorithms/maxmin/filelist.path @@ -1,5 +1,8 @@ operators +clamp max_element max_element2 max_seq min_element +make_pair +minmax_element diff --git a/StandardAlgorithms/maxmin/make_pair/Makefile b/StandardAlgorithms/maxmin/make_pair/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/maxmin/make_pair/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/maxmin/make_pair/depend.mk b/StandardAlgorithms/maxmin/make_pair/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/maxmin/make_pair/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/maxmin/make_pair/make_pair.c b/StandardAlgorithms/maxmin/make_pair/make_pair.c new file mode 100644 index 0000000..778afa4 --- /dev/null +++ b/StandardAlgorithms/maxmin/make_pair/make_pair.c @@ -0,0 +1,4 @@ + +// dummy file +#include "make_pair.h" + diff --git a/StandardAlgorithms/binarysearch/equal_range/make_pair.h b/StandardAlgorithms/maxmin/make_pair/make_pair.h similarity index 53% rename from StandardAlgorithms/binarysearch/equal_range/make_pair.h rename to StandardAlgorithms/maxmin/make_pair/make_pair.h index 0b3a700..9fc48ac 100644 --- a/StandardAlgorithms/binarysearch/equal_range/make_pair.h +++ b/StandardAlgorithms/maxmin/make_pair/make_pair.h @@ -1,16 +1,8 @@ -#ifndef SIZE_TYPE_PAIR_H_INCLUDED -#define SIZE_TYPE_PAIR_H_INCLUDED - -#include "typedefs.h" - -struct size_type_pair { - size_type first; - size_type second; -}; - -typedef struct size_type_pair size_type_pair; +#ifndef MAKE_PAIR_H_INCLUDED +#define MAKE_PAIR_H_INCLUDED +#include "SizeTypePairTrivial.spec" /*@ assigns \nothing; @@ -23,10 +15,12 @@ size_type_pair make_pair(size_type first, size_type second) { size_type_pair pair; + pair.first = first; pair.second = second; + return pair; } -#endif // SIZE_TYPE_PAIR_H_INCLUDED +#endif /* MAKE_PAIR_H_INCLUDED */ diff --git a/StandardAlgorithms/maxmin/make_pair/make_pair_test.cpp b/StandardAlgorithms/maxmin/make_pair/make_pair_test.cpp new file mode 100644 index 0000000..8cee776 --- /dev/null +++ b/StandardAlgorithms/maxmin/make_pair/make_pair_test.cpp @@ -0,0 +1,19 @@ + +#include +#include +#include "make_pair.h" + +int +main(int argc, char** argv) +{ + std::pair x(15, 4); + + size_type_pair y = make_pair(x.first, x.second); + + assert(x.first == y.first); + assert(x.second == y.second); + + std::cout << "\tsuccessful execution of " << argv[0] << std::endl; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/maxmin/max_element/Makefile b/StandardAlgorithms/maxmin/max_element/Makefile index c4e2ae9..8100c89 100644 --- a/StandardAlgorithms/maxmin/max_element/Makefile +++ b/StandardAlgorithms/maxmin/max_element/Makefile @@ -1,6 +1,3 @@ -CMD=\\maxelement -SEC=sec:maxelement - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/maxmin/max_element/depend.mk b/StandardAlgorithms/maxmin/max_element/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/maxmin/max_element/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/maxmin/max_element/max_element.c b/StandardAlgorithms/maxmin/max_element/max_element.c index c0071bc..083b403 100644 --- a/StandardAlgorithms/maxmin/max_element/max_element.c +++ b/StandardAlgorithms/maxmin/max_element/max_element.c @@ -11,7 +11,7 @@ max_element(const value_type* a, size_type n) loop invariant bound: 0 <= i <= n; loop invariant max: 0 <= max < n; loop invariant upper: \forall integer k; 0 <= k < i ==> a[k] <= a[max]; - loop invariant strict: \forall integer k; 0 <= k < max ==> a[k] < a[max]; + loop invariant first: \forall integer k; 0 <= k < max ==> a[k] < a[max]; loop assigns max, i; loop variant n-i; */ diff --git a/StandardAlgorithms/maxmin/max_element/max_element.h b/StandardAlgorithms/maxmin/max_element/max_element.h index 3fab2b8..220a0e6 100644 --- a/StandardAlgorithms/maxmin/max_element/max_element.h +++ b/StandardAlgorithms/maxmin/max_element/max_element.h @@ -17,7 +17,7 @@ assumes 0 < n; ensures result: 0 <= \result < n; ensures upper: \forall integer i; 0 <= i < n ==> a[i] <= a[\result]; - ensures strict: \forall integer i; 0 <= i < \result ==> a[i] < a[\result]; + ensures first: \forall integer i; 0 <= i < \result ==> a[i] < a[\result]; complete behaviors; disjoint behaviors; diff --git a/StandardAlgorithms/maxmin/max_element2/Makefile b/StandardAlgorithms/maxmin/max_element2/Makefile index a4820ba..66e89e7 100644 --- a/StandardAlgorithms/maxmin/max_element2/Makefile +++ b/StandardAlgorithms/maxmin/max_element2/Makefile @@ -2,5 +2,5 @@ CMD=\\maxelementtwo SEC=sec:maxelement2 -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/maxmin/max_element2/depend.mk b/StandardAlgorithms/maxmin/max_element2/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/maxmin/max_element2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/maxmin/max_element2/max_element2.c b/StandardAlgorithms/maxmin/max_element2/max_element2.c index 1fcaca9..05ba34b 100644 --- a/StandardAlgorithms/maxmin/max_element2/max_element2.c +++ b/StandardAlgorithms/maxmin/max_element2/max_element2.c @@ -11,7 +11,7 @@ max_element2(const value_type* a, size_type n) loop invariant bound: 0 <= i <= n; loop invariant max: 0 <= max < n; loop invariant upper: UpperBound(a, i, a[max]); - loop invariant strict: StrictUpperBound(a, max, a[max]); + loop invariant first: StrictUpperBound(a, max, a[max]); loop assigns max, i; loop variant n-i; */ diff --git a/StandardAlgorithms/maxmin/max_element2/max_element2.h b/StandardAlgorithms/maxmin/max_element2/max_element2.h index 66eaf6e..98485a1 100644 --- a/StandardAlgorithms/maxmin/max_element2/max_element2.h +++ b/StandardAlgorithms/maxmin/max_element2/max_element2.h @@ -16,9 +16,9 @@ behavior not_empty: assumes 0 < n; - ensures result: 0 <= \result < n; - ensures max: MaxElement(a, n, \result); - ensures strict: StrictUpperBound(a, \result, a[\result]); + ensures result: 0 <= \result < n; + ensures max: MaxElement(a, n, \result); + ensures first: StrictUpperBound(a, \result, a[\result]); complete behaviors; disjoint behaviors; diff --git a/StandardAlgorithms/maxmin/max_seq/Makefile b/StandardAlgorithms/maxmin/max_seq/Makefile index 7949c73..8100c89 100644 --- a/StandardAlgorithms/maxmin/max_seq/Makefile +++ b/StandardAlgorithms/maxmin/max_seq/Makefile @@ -1,8 +1,3 @@ -CMD=\\maxseq -SEC=sec:maxseq - -include ../../Makefile.template - -TESTOBJ += -lmaxmin +include ../../example.mk diff --git a/StandardAlgorithms/maxmin/max_seq/depend.mk b/StandardAlgorithms/maxmin/max_seq/depend.mk new file mode 100644 index 0000000..522874e --- /dev/null +++ b/StandardAlgorithms/maxmin/max_seq/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += maxmin/max_element2 + diff --git a/StandardAlgorithms/maxmin/max_seq/max_seq.c b/StandardAlgorithms/maxmin/max_seq/max_seq.c index fb92a6a..ef84ce9 100644 --- a/StandardAlgorithms/maxmin/max_seq/max_seq.c +++ b/StandardAlgorithms/maxmin/max_seq/max_seq.c @@ -1,6 +1,6 @@ #include "max_seq.h" -#include "../max_element2/max_element2.h" +#include "max_element2.h" value_type max_seq(const value_type* p, size_type n) diff --git a/StandardAlgorithms/maxmin/maxmin.h b/StandardAlgorithms/maxmin/maxmin.h deleted file mode 100644 index c2d65a8..0000000 --- a/StandardAlgorithms/maxmin/maxmin.h +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef MAXMIN_H_INCLUDED -#define MAXMIN_H_INCLUDED - -#include "max_element2/max_element2.h" -#include "min_element/min_element.h" - -#endif /* MAXMIN_H_INCLUDED */ - diff --git a/StandardAlgorithms/maxmin/min_element/Makefile b/StandardAlgorithms/maxmin/min_element/Makefile index 9b4d36a..8100c89 100644 --- a/StandardAlgorithms/maxmin/min_element/Makefile +++ b/StandardAlgorithms/maxmin/min_element/Makefile @@ -1,6 +1,3 @@ -CMD=\\minelement -SEC=sec:minelement - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/maxmin/min_element/depend.mk b/StandardAlgorithms/maxmin/min_element/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/maxmin/min_element/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/maxmin/min_element/min_element.h b/StandardAlgorithms/maxmin/min_element/min_element.h index 87e0001..30dbc30 100644 --- a/StandardAlgorithms/maxmin/min_element/min_element.h +++ b/StandardAlgorithms/maxmin/min_element/min_element.h @@ -16,9 +16,9 @@ behavior not_empty: assumes 0 < n; - ensures result: 0 <= \result < n; - ensures min: MinElement(a, n, \result); - ensures strict: StrictLowerBound(a, \result, a[\result]); + ensures result: 0 <= \result < n; + ensures min: MinElement(a, n, \result); + ensures first: StrictLowerBound(a, \result, a[\result]); complete behaviors; disjoint behaviors; diff --git a/StandardAlgorithms/maxmin/minmax_element/Makefile b/StandardAlgorithms/maxmin/minmax_element/Makefile new file mode 100644 index 0000000..8100c89 --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/Makefile @@ -0,0 +1,3 @@ + +include ../../example.mk + diff --git a/StandardAlgorithms/maxmin/minmax_element/depend.mk b/StandardAlgorithms/maxmin/minmax_element/depend.mk new file mode 100644 index 0000000..62524a1 --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += maxmin/make_pair + diff --git a/StandardAlgorithms/maxmin/minmax_element/minmax_element.c b/StandardAlgorithms/maxmin/minmax_element/minmax_element.c new file mode 100644 index 0000000..5610550 --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/minmax_element.c @@ -0,0 +1,39 @@ + +#include "minmax_element.h" +#include "make_pair.h" + +size_type_pair +minmax_element(const value_type* a, size_type n) +{ + if (0u < n) { + size_type min = 0u; + size_type max = 0u; + + /*@ + loop invariant bound: 0 <= i <= n; + loop invariant min: 0 <= min < n; + loop invariant max: 0 <= max < n; + loop invariant lower: LowerBound(a, i, a[min]); + loop invariant upper: UpperBound(a, i, a[max]); + loop invariant first: StrictLowerBound(a, min, a[min]); + loop invariant last: StrictUpperBound(a, max+1, i, a[max]); + loop assigns min, max, i; + + loop variant n-i; + */ + for (size_type i = 0u; i < n; i++) { + if (a[i] >= a[max]) { + max = i; + } + + if (a[i] < a[min]) { + min = i; + } + } + + return make_pair(min, max); + } + + return make_pair(n, n); +} + diff --git a/StandardAlgorithms/maxmin/minmax_element/minmax_element.cpp b/StandardAlgorithms/maxmin/minmax_element/minmax_element.cpp new file mode 100644 index 0000000..030f815 --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/minmax_element.cpp @@ -0,0 +1,24 @@ + +#include +#include +#include +#include + +#include "minmax_element.h" + +int +main(int argc, char** argv) +{ + std::vector a{1, 1, 2, 4, 5, 6, 6, 7, 8}; + + for (size_t i = 0; i < a.size(); ++i) { + auto min_it = std::min_element(a.begin() + i, a.end()); + auto min_pos = min_element(a.data() + i, a.size() - i); + //std::cout << min_pos << "\t" << min_it - (a.begin() + i) << std::endl; + assert(min_pos == min_it - (a.begin() + i)); + } + + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/maxmin/minmax_element/minmax_element.h b/StandardAlgorithms/maxmin/minmax_element/minmax_element.h new file mode 100644 index 0000000..157b357 --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/minmax_element.h @@ -0,0 +1,38 @@ + +#ifndef MINMAX_ELEMENT_H_INCLUDED +#define MINMAX_ELEMENT_H_INCLUDED + +#include "SizeTypePairTrivial.spec" +#include "MinElement.spec" +#include "MaxElement.spec" +#include "StrictLowerBound.spec" +#include "StrictUpperBound.spec" + +/*@ + requires valid: \valid_read(a + (0..n-1)); + + assigns \nothing; + + ensures result: 0 <= \result.first <= n; + ensures result: 0 <= \result.second <= n; + + behavior empty: + assumes 0 == n; + ensures result: \result.first == 0; + ensures result: \result.second == 0; + + behavior not_empty: + assumes 0 < n; + ensures result: 0 <= \result.first < n; + ensures result: 0 <= \result.second < n; + + ensures min: MinElement(a, n, \result.first); + ensures first: StrictLowerBound(a, \result.first, a[\result.first]); + ensures max: MaxElement(a, n, \result.second); + ensures last: StrictUpperBound(a, \result.second+1, n, a[\result.second]); +*/ +size_type_pair +minmax_element(const value_type* a, size_type n); + +#endif /* MINMAX_ELEMENT_H_INCLUDED */ + diff --git a/StandardAlgorithms/maxmin/minmax_element/minmax_element_test.cpp b/StandardAlgorithms/maxmin/minmax_element/minmax_element_test.cpp new file mode 100644 index 0000000..d88438b --- /dev/null +++ b/StandardAlgorithms/maxmin/minmax_element/minmax_element_test.cpp @@ -0,0 +1,22 @@ + +#include +#include +#include +#include + +#include "minmax_element.h" + +int +main(int argc, char** argv) +{ + std::vector a{2, 1, 8, 1, 5, 6, 8, 7, 7}; + + auto it = std::minmax_element(a.begin(), a.end()); + auto pos = minmax_element(a.data(), a.size()); + assert(a.begin() + pos.first == it.first); + assert(a.begin() + pos.second == it.second); + + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/maxmin/operators/Makefile b/StandardAlgorithms/maxmin/operators/Makefile index 28ecb86..5e5a3a9 100644 --- a/StandardAlgorithms/maxmin/operators/Makefile +++ b/StandardAlgorithms/maxmin/operators/Makefile @@ -1,5 +1,6 @@ + CMD=properties\\\;of\\\;operator\\\;\\inl\{\<\} SEC=sec:relationaloperator -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/maxmin/operators/depend.mk b/StandardAlgorithms/maxmin/operators/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/maxmin/operators/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/Makefile b/StandardAlgorithms/mutating/Makefile index bfd64f9..e210c33 100644 --- a/StandardAlgorithms/mutating/Makefile +++ b/StandardAlgorithms/mutating/Makefile @@ -1,12 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libmutating.a - -lib: libmutating.a - -libmutating.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/mutating/copy/Makefile b/StandardAlgorithms/mutating/copy/Makefile index 492d664..65cde06 100644 --- a/StandardAlgorithms/mutating/copy/Makefile +++ b/StandardAlgorithms/mutating/copy/Makefile @@ -1,6 +1,5 @@ CMD=\\cpy -SEC=sec:copy -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/mutating/copy/copy.c b/StandardAlgorithms/mutating/copy/copy.c index b179c47..e93c172 100644 --- a/StandardAlgorithms/mutating/copy/copy.c +++ b/StandardAlgorithms/mutating/copy/copy.c @@ -1,5 +1,6 @@ #include "copy.h" +#include "Unchanged.spec" void copy(const value_type* a, size_type n, value_type* b) diff --git a/StandardAlgorithms/mutating/copy/copy.h b/StandardAlgorithms/mutating/copy/copy.h index f0d572e..ebb1821 100644 --- a/StandardAlgorithms/mutating/copy/copy.h +++ b/StandardAlgorithms/mutating/copy/copy.h @@ -3,7 +3,6 @@ #define COPY_H_INCLUDED #include "EqualRanges.spec" -#include "Unchanged.spec" /*@ requires valid: \valid_read(a + (0..n-1)); diff --git a/StandardAlgorithms/mutating/copy/depend.mk b/StandardAlgorithms/mutating/copy/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/copy/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/copy_backward/Makefile b/StandardAlgorithms/mutating/copy_backward/Makefile index eed3f77..f41197b 100644 --- a/StandardAlgorithms/mutating/copy_backward/Makefile +++ b/StandardAlgorithms/mutating/copy_backward/Makefile @@ -1,9 +1,5 @@ -CMD=\\copybackward -SEC=sec:copybackward - -include ../../Makefile.template +include ../../example.mk #export WP_FLAGS += -wp-prop equal - diff --git a/StandardAlgorithms/mutating/copy_backward/depend.mk b/StandardAlgorithms/mutating/copy_backward/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/copy_backward/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/filelist.path b/StandardAlgorithms/mutating/filelist.path index ed54fdf..6d4aea7 100644 --- a/StandardAlgorithms/mutating/filelist.path +++ b/StandardAlgorithms/mutating/filelist.path @@ -14,3 +14,4 @@ remove_copy2 remove_copy3 remove random_shuffle +random_number diff --git a/StandardAlgorithms/mutating/fill/Makefile b/StandardAlgorithms/mutating/fill/Makefile index 78d5144..d8cfb29 100644 --- a/StandardAlgorithms/mutating/fill/Makefile +++ b/StandardAlgorithms/mutating/fill/Makefile @@ -1,6 +1,5 @@ CMD=\\fll -SEC=sec:fill -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/mutating/fill/depend.mk b/StandardAlgorithms/mutating/fill/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/fill/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/mutating.h b/StandardAlgorithms/mutating/mutating.h deleted file mode 100644 index 053c680..0000000 --- a/StandardAlgorithms/mutating/mutating.h +++ /dev/null @@ -1,17 +0,0 @@ - -#ifndef MUTATING_H_INCLUDED -#define MUTATING_H_INCLUDED - -#include "fill/fill.h" -#include "swap/swap.h" -#include "swap_ranges/swap_ranges.h" -#include "copy/copy.h" -#include "reverse_copy/reverse_copy.h" -#include "reverse/reverse.h" -#include "rotate_copy/rotate_copy.h" -#include "replace_copy/replace_copy.h" -#include "remove_copy2/remove_copy2.h" -#include "iota/iota.h" - -#endif /* MUTATING_H_INCLUDED */ - diff --git a/StandardAlgorithms/mutating/random_number/Makefile b/StandardAlgorithms/mutating/random_number/Makefile new file mode 100644 index 0000000..7742398 --- /dev/null +++ b/StandardAlgorithms/mutating/random_number/Makefile @@ -0,0 +1,6 @@ + +include ../../example.mk + +# disable -warn-unsigned-overflow +WP_RTE_FLAGS=-warn-unsigned-downcast + diff --git a/StandardAlgorithms/mutating/random_number/depend.mk b/StandardAlgorithms/mutating/random_number/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/random_number/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/random_shuffle/random_number.c b/StandardAlgorithms/mutating/random_number/random_number.c similarity index 87% rename from StandardAlgorithms/mutating/random_shuffle/random_number.c rename to StandardAlgorithms/mutating/random_number/random_number.c index 5d546ad..b37cbd6 100644 --- a/StandardAlgorithms/mutating/random_shuffle/random_number.c +++ b/StandardAlgorithms/mutating/random_number/random_number.c @@ -1,12 +1,6 @@ #include "random_number.h" - -/*@ - lemma - random_number_modulo: - \forall unsigned long long a; - (a % (1ull << 48)) < (1ull << 48); -*/ +#include "RandomNumberModulo.spec" unsigned short random_seed[3] = { 0x243f, 0x6a88, 0x85a3 }; diff --git a/StandardAlgorithms/mutating/random_shuffle/random_number.h b/StandardAlgorithms/mutating/random_number/random_number.h similarity index 100% rename from StandardAlgorithms/mutating/random_shuffle/random_number.h rename to StandardAlgorithms/mutating/random_number/random_number.h diff --git a/StandardAlgorithms/mutating/random_number/random_number_test.cpp b/StandardAlgorithms/mutating/random_number/random_number_test.cpp new file mode 100644 index 0000000..06a34b9 --- /dev/null +++ b/StandardAlgorithms/mutating/random_number/random_number_test.cpp @@ -0,0 +1,16 @@ + +#include "random_number.h" +#include +#include + +int +main(int argc, char** argv) +{ + size_type n = 29; + size_type r = random_number(n); + assert(r < n); + + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; +} + diff --git a/StandardAlgorithms/mutating/random_shuffle/Makefile b/StandardAlgorithms/mutating/random_shuffle/Makefile index e157b6a..8100c89 100644 --- a/StandardAlgorithms/mutating/random_shuffle/Makefile +++ b/StandardAlgorithms/mutating/random_shuffle/Makefile @@ -1,19 +1,3 @@ -CMD=\\randomshuffle -SEC=sec:randomshuffle - - -include ../../Makefile.template - -# disable -warn-unsigned-overflow -WP_RTE_FLAGS=-warn-unsigned-downcast - -#WP_FLAGS += -wp-prop lower -#WP_FLAGS += -wp-prop="-@lemma" -#WP_FLAGS += -wp-split -#WP_FLAGS += -wp-fct random_shuffle -#WP_FLAGS += -wp-prop MultisetTransposition - - -TESTOBJ += -lmutating +include ../../example.mk diff --git a/StandardAlgorithms/mutating/random_shuffle/depend.mk b/StandardAlgorithms/mutating/random_shuffle/depend.mk new file mode 100644 index 0000000..d704bf7 --- /dev/null +++ b/StandardAlgorithms/mutating/random_shuffle/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += mutating/swap +DEPENDENCIES += mutating/random_number + diff --git a/StandardAlgorithms/mutating/random_shuffle/random_shuffle.c b/StandardAlgorithms/mutating/random_shuffle/random_shuffle.c index a62db61..1a3da15 100644 --- a/StandardAlgorithms/mutating/random_shuffle/random_shuffle.c +++ b/StandardAlgorithms/mutating/random_shuffle/random_shuffle.c @@ -1,5 +1,5 @@ -#include "../swap/swap.h" +#include "swap.h" #include "random_shuffle.h" #include "CountLemmas.spec" diff --git a/StandardAlgorithms/mutating/random_shuffle/random_shuffle_test.cpp b/StandardAlgorithms/mutating/random_shuffle/random_shuffle_test.cpp index 3f4e3c2..d0549e5 100644 --- a/StandardAlgorithms/mutating/random_shuffle/random_shuffle_test.cpp +++ b/StandardAlgorithms/mutating/random_shuffle/random_shuffle_test.cpp @@ -12,10 +12,13 @@ main(int argc, char** argv) { std::vector a{8, 2, 43, 4, 43, 6, 7}; auto b = a; - random_shuffle(a.begin(), a.end()); + + // not supported anymore in C++17 ... + // random_shuffle(a.begin(), a.end()); std::sort(a.begin(), a.end()); std::sort(b.begin(), b.end()); assert(a == b); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/mutating/remove/Makefile b/StandardAlgorithms/mutating/remove/Makefile index c2d44a5..e99e9a0 100644 --- a/StandardAlgorithms/mutating/remove/Makefile +++ b/StandardAlgorithms/mutating/remove/Makefile @@ -1,8 +1,5 @@ -CMD=\\remove -SEC=sec:remove - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop RetainAllButOneMiss #WP_FLAGS += -wp-prop retain @@ -13,4 +10,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop remove #WP_FLAGS += -wp-prop @lemma - diff --git a/StandardAlgorithms/mutating/remove/depend.mk b/StandardAlgorithms/mutating/remove/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/remove/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/remove/remove.h b/StandardAlgorithms/mutating/remove/remove.h index 4344710..efacbcd 100644 --- a/StandardAlgorithms/mutating/remove/remove.h +++ b/StandardAlgorithms/mutating/remove/remove.h @@ -13,9 +13,10 @@ assigns a[0..n-1]; - ensures size: \result == RemoveSize{Pre}(a, n, v); + ensures size: \result == RemoveSize{Old}(a, n, v); ensures bound: 0 <= \result <= n; ensures remove: Remove{Old, Here}(a, n, v); + ensures discard: !HasValue{Here}(a, \result, v); ensures unchanged: Unchanged{Old, Here}(a, \result, n); */ size_type diff --git a/StandardAlgorithms/mutating/remove_copy/Makefile b/StandardAlgorithms/mutating/remove_copy/Makefile index e1977e5..a9af4f7 100644 --- a/StandardAlgorithms/mutating/remove_copy/Makefile +++ b/StandardAlgorithms/mutating/remove_copy/Makefile @@ -1,8 +1,5 @@ -CMD=\\removecopy -SEC=sec:removecopy - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop RetainAllButOneMiss #WP_FLAGS += -wp-prop retain diff --git a/StandardAlgorithms/mutating/remove_copy/depend.mk b/StandardAlgorithms/mutating/remove_copy/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/remove_copy/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/remove_copy/remove_copy.h b/StandardAlgorithms/mutating/remove_copy/remove_copy.h index 4b9907f..1dfa351 100644 --- a/StandardAlgorithms/mutating/remove_copy/remove_copy.h +++ b/StandardAlgorithms/mutating/remove_copy/remove_copy.h @@ -13,6 +13,7 @@ ensures bound: 0 <= \result <= n; ensures discard: !HasValue(b, \result, v); + ensures unchanged: Unchanged{Old, Here}(a, n); ensures unchanged: Unchanged{Old, Here}(b, \result, n); */ size_type diff --git a/StandardAlgorithms/mutating/remove_copy2/Makefile b/StandardAlgorithms/mutating/remove_copy2/Makefile index 9ebe335..20f56d8 100644 --- a/StandardAlgorithms/mutating/remove_copy2/Makefile +++ b/StandardAlgorithms/mutating/remove_copy2/Makefile @@ -2,13 +2,15 @@ CMD=\\removecopytwo SEC=sec:removecopy2 -include ../../Makefile.template +include ../../example.mk + +#WP_FLAGS += -wp-prop @lemma +#WP_FLAGS += -wp-prop="-@lemma" #WP_FLAGS += -wp-prop bound #WP_FLAGS += -wp-prop size #WP_FLAGS += -wp-prop unchanged #WP_FLAGS += -wp-bhv not_equal #WP_FLAGS += -wp-prop @assert -#WP_FLAGS += -wp-prop @lemma diff --git a/StandardAlgorithms/mutating/remove_copy2/depend.mk b/StandardAlgorithms/mutating/remove_copy2/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/remove_copy2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/remove_copy2/remove_copy2.c b/StandardAlgorithms/mutating/remove_copy2/remove_copy2.c index bff901b..d538ceb 100644 --- a/StandardAlgorithms/mutating/remove_copy2/remove_copy2.c +++ b/StandardAlgorithms/mutating/remove_copy2/remove_copy2.c @@ -18,6 +18,8 @@ remove_copy2(const value_type* a, size_type n, value_type* b, value_type v) for (size_type i = 0u; i < n; ++i) { if (a[i] != v) { b[k++] = a[i]; + //@ assert unchanged: Unchanged{Pre,Here}(a, i+1); + //@ assert size: k == RemoveSize(a, i+1, v); } } diff --git a/StandardAlgorithms/mutating/remove_copy2/remove_copy2.h b/StandardAlgorithms/mutating/remove_copy2/remove_copy2.h index 08f5bf6..302d066 100644 --- a/StandardAlgorithms/mutating/remove_copy2/remove_copy2.h +++ b/StandardAlgorithms/mutating/remove_copy2/remove_copy2.h @@ -16,6 +16,7 @@ ensures size: \result == RemoveSize(a, n, v); ensures bound: 0 <= \result <= n; ensures discard: !HasValue(b, \result, v); + ensures unchanged: Unchanged{Old, Here}(a, n); ensures unchanged: Unchanged{Old, Here}(b, \result, n); */ size_type diff --git a/StandardAlgorithms/mutating/remove_copy3/Makefile b/StandardAlgorithms/mutating/remove_copy3/Makefile index 11fc886..2796b9c 100644 --- a/StandardAlgorithms/mutating/remove_copy3/Makefile +++ b/StandardAlgorithms/mutating/remove_copy3/Makefile @@ -1,8 +1,8 @@ -CMD=\\removecopy\(3\) +CMD=\\removecopythree SEC=sec:removecopy3 -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop RemovePartitionUpperBound #WP_FLAGS += -wp-prop size diff --git a/StandardAlgorithms/mutating/remove_copy3/depend.mk b/StandardAlgorithms/mutating/remove_copy3/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/remove_copy3/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/remove_copy3/remove_copy3.c b/StandardAlgorithms/mutating/remove_copy3/remove_copy3.c index 7a98953..b205723 100644 --- a/StandardAlgorithms/mutating/remove_copy3/remove_copy3.c +++ b/StandardAlgorithms/mutating/remove_copy3/remove_copy3.c @@ -12,8 +12,8 @@ remove_copy3(const value_type* a, size_type n, value_type* b, value_type v) loop invariant size: k == RemoveSize{Pre}(a, i, v); loop invariant mapping: i <= RemovePartition{Pre}(a, n, v, k); loop invariant remove: Remove{Pre,Here}(a, i, b, v); - loop invariant unchanged: Unchanged{Pre,Here}(a, k-1, n); - loop invariant unchanged: Unchanged{Pre,Here}(b, k, n); + loop invariant unchanged: Unchanged{Pre,Here}(a, n); + loop invariant unchanged: Unchanged{Pre,Here}(b, k, n); loop assigns k, i, b[0..n-1]; loop variant n-i; */ diff --git a/StandardAlgorithms/mutating/remove_copy3/remove_copy3.h b/StandardAlgorithms/mutating/remove_copy3/remove_copy3.h index 286fbc6..0cd3745 100644 --- a/StandardAlgorithms/mutating/remove_copy3/remove_copy3.h +++ b/StandardAlgorithms/mutating/remove_copy3/remove_copy3.h @@ -16,7 +16,8 @@ ensures size: \result == RemoveSize{Old}(a, n, v); ensures bound: 0 <= \result <= n; ensures remove: Remove{Old,Here}(a, n, b, v); - ensures unchanged: Unchanged{Old, Here}(a, \result-1, n); + ensures discard: !HasValue(b, \result, v); + ensures unchanged: Unchanged{Old, Here}(a, n); ensures unchanged: Unchanged{Old, Here}(b, \result, n); */ size_type diff --git a/StandardAlgorithms/mutating/replace/Makefile b/StandardAlgorithms/mutating/replace/Makefile index 33af6b9..3ccc01a 100644 --- a/StandardAlgorithms/mutating/replace/Makefile +++ b/StandardAlgorithms/mutating/replace/Makefile @@ -1,8 +1,5 @@ -CMD=\\replace -SEC=sec:replace - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop replace diff --git a/StandardAlgorithms/mutating/replace/depend.mk b/StandardAlgorithms/mutating/replace/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/replace/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/replace_copy/Makefile b/StandardAlgorithms/mutating/replace_copy/Makefile index eb630bb..8100c89 100644 --- a/StandardAlgorithms/mutating/replace_copy/Makefile +++ b/StandardAlgorithms/mutating/replace_copy/Makefile @@ -1,6 +1,3 @@ -CMD=\\replacecopy -SEC=sec:replacecopy - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/mutating/replace_copy/depend.mk b/StandardAlgorithms/mutating/replace_copy/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/replace_copy/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/replace_copy/replace_copy.c b/StandardAlgorithms/mutating/replace_copy/replace_copy.c index 413acf5..e919fc0 100644 --- a/StandardAlgorithms/mutating/replace_copy/replace_copy.c +++ b/StandardAlgorithms/mutating/replace_copy/replace_copy.c @@ -8,7 +8,6 @@ replace_copy(const value_type* a, size_type n, value_type* b, value_type v, /*@ loop invariant bounds: 0 <= i <= n; loop invariant replace: Replace{Pre,Here}(a, i, b, v, w); - loop invariant unchanged: Unchanged{Pre,Here}(a, i, n); loop assigns i, b[0..n-1]; loop variant n-i; */ diff --git a/StandardAlgorithms/mutating/replace_copy/replace_copy.h b/StandardAlgorithms/mutating/replace_copy/replace_copy.h index 737b33d..dd8d247 100644 --- a/StandardAlgorithms/mutating/replace_copy/replace_copy.h +++ b/StandardAlgorithms/mutating/replace_copy/replace_copy.h @@ -8,12 +8,13 @@ /*@ requires valid: \valid_read(a + (0..n-1)); requires valid: \valid(b + (0..n-1)); - requires sep: \separated(a + (0..n-1), b ); + requires sep: \separated(a + (0..n-1), b + (0..n-1)); assigns b[0..n-1]; ensures result: \result == n; ensures replace: Replace{Old,Here}(a, n, b, v, w); + ensures unchanged: Unchanged{Old,Here}(a, n); */ size_type replace_copy(const value_type* a, size_type n, value_type* b, diff --git a/StandardAlgorithms/mutating/reverse/Makefile b/StandardAlgorithms/mutating/reverse/Makefile index 43af072..897be9a 100644 --- a/StandardAlgorithms/mutating/reverse/Makefile +++ b/StandardAlgorithms/mutating/reverse/Makefile @@ -1,11 +1,5 @@ -CMD=\\reverse -SEC=sec:reverse - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop=right - -TESTOBJ += -lmutating - diff --git a/StandardAlgorithms/mutating/reverse/depend.mk b/StandardAlgorithms/mutating/reverse/depend.mk new file mode 100644 index 0000000..470ea6f --- /dev/null +++ b/StandardAlgorithms/mutating/reverse/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += mutating/swap + diff --git a/StandardAlgorithms/mutating/reverse/reverse.c b/StandardAlgorithms/mutating/reverse/reverse.c index 583d0c8..88b0eba 100644 --- a/StandardAlgorithms/mutating/reverse/reverse.c +++ b/StandardAlgorithms/mutating/reverse/reverse.c @@ -1,7 +1,7 @@ #include "reverse.h" #include "Unchanged.spec" -#include "../swap/swap.h" +#include "swap.h" void reverse(value_type* a, size_type n) diff --git a/StandardAlgorithms/mutating/reverse_copy/Makefile b/StandardAlgorithms/mutating/reverse_copy/Makefile index 9d39178..8100c89 100644 --- a/StandardAlgorithms/mutating/reverse_copy/Makefile +++ b/StandardAlgorithms/mutating/reverse_copy/Makefile @@ -1,5 +1,3 @@ -CMD=\\reversecopy -SEC=sec:reversecopy -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/mutating/reverse_copy/depend.mk b/StandardAlgorithms/mutating/reverse_copy/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/reverse_copy/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/rotate/Makefile b/StandardAlgorithms/mutating/rotate/Makefile index 2716d85..257b12c 100644 --- a/StandardAlgorithms/mutating/rotate/Makefile +++ b/StandardAlgorithms/mutating/rotate/Makefile @@ -1,8 +1,7 @@ CMD=\\ALGrotate -SEC=sec:rotate -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop left #WP_FLAGS += -wp-prop middle @@ -12,5 +11,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-fct rotate -TESTOBJ += -lmutating - diff --git a/StandardAlgorithms/mutating/rotate/depend.mk b/StandardAlgorithms/mutating/rotate/depend.mk new file mode 100644 index 0000000..dd6f224 --- /dev/null +++ b/StandardAlgorithms/mutating/rotate/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += mutating/reverse + diff --git a/StandardAlgorithms/mutating/rotate/rotate.c b/StandardAlgorithms/mutating/rotate/rotate.c index cbacaf6..dda0ebb 100644 --- a/StandardAlgorithms/mutating/rotate/rotate.c +++ b/StandardAlgorithms/mutating/rotate/rotate.c @@ -1,6 +1,6 @@ #include "rotate.h" -#include "../reverse/reverse.h" +#include "reverse.h" size_type rotate(value_type* a, size_type m, size_type n) diff --git a/StandardAlgorithms/mutating/rotate_copy/Makefile b/StandardAlgorithms/mutating/rotate_copy/Makefile index f86ab7d..8100c89 100644 --- a/StandardAlgorithms/mutating/rotate_copy/Makefile +++ b/StandardAlgorithms/mutating/rotate_copy/Makefile @@ -1,8 +1,3 @@ -CMD=\\rotatecopy -SEC=sec:rotatecopy - -include ../../Makefile.template - -TESTOBJ += -lmutating +include ../../example.mk diff --git a/StandardAlgorithms/mutating/rotate_copy/depend.mk b/StandardAlgorithms/mutating/rotate_copy/depend.mk new file mode 100644 index 0000000..f955229 --- /dev/null +++ b/StandardAlgorithms/mutating/rotate_copy/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += mutating/copy + diff --git a/StandardAlgorithms/mutating/rotate_copy/rotate_copy.c b/StandardAlgorithms/mutating/rotate_copy/rotate_copy.c index 3e61f1f..9b6dff1 100644 --- a/StandardAlgorithms/mutating/rotate_copy/rotate_copy.c +++ b/StandardAlgorithms/mutating/rotate_copy/rotate_copy.c @@ -1,6 +1,6 @@ #include "rotate_copy.h" -#include "../copy/copy.h" +#include "copy.h" void rotate_copy(const value_type* a, size_type m, size_type n, value_type* b) diff --git a/StandardAlgorithms/mutating/swap/Makefile b/StandardAlgorithms/mutating/swap/Makefile index e9eebab..8100c89 100644 --- a/StandardAlgorithms/mutating/swap/Makefile +++ b/StandardAlgorithms/mutating/swap/Makefile @@ -1,5 +1,3 @@ -CMD=\\swap -SEC=sec:swap +include ../../example.mk -include ../../Makefile.template diff --git a/StandardAlgorithms/mutating/swap/depend.mk b/StandardAlgorithms/mutating/swap/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/mutating/swap/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/mutating/swap_ranges/Makefile b/StandardAlgorithms/mutating/swap_ranges/Makefile index 7e9a4c4..ad0f3c5 100644 --- a/StandardAlgorithms/mutating/swap_ranges/Makefile +++ b/StandardAlgorithms/mutating/swap_ranges/Makefile @@ -1,10 +1,5 @@ -CMD=\\swapranges -SEC=sec:swapranges - -include ../../Makefile.template - -TESTOBJ += -lmutating +include ../../example.mk #WP_FLAGS += -wp-prop equal_a,@lemma diff --git a/StandardAlgorithms/mutating/swap_ranges/depend.mk b/StandardAlgorithms/mutating/swap_ranges/depend.mk new file mode 100644 index 0000000..470ea6f --- /dev/null +++ b/StandardAlgorithms/mutating/swap_ranges/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += mutating/swap + diff --git a/StandardAlgorithms/mutating/swap_ranges/swap_ranges.c b/StandardAlgorithms/mutating/swap_ranges/swap_ranges.c index c990c5d..07f2477 100644 --- a/StandardAlgorithms/mutating/swap_ranges/swap_ranges.c +++ b/StandardAlgorithms/mutating/swap_ranges/swap_ranges.c @@ -1,6 +1,6 @@ #include "swap_ranges.h" -#include "../swap/swap.h" +#include "swap.h" #include "Unchanged.spec" void diff --git a/StandardAlgorithms/nonmutating/Makefile b/StandardAlgorithms/nonmutating/Makefile index ab47c00..c7c37bf 100644 --- a/StandardAlgorithms/nonmutating/Makefile +++ b/StandardAlgorithms/nonmutating/Makefile @@ -1,12 +1,6 @@ -include ../Makefile.group +include ../group.mk -clean:: FORCE - $(RM) libnonmutating.a - -lib: libnonmutating.a - -libnonmutating.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +#show: + #echo $(LIB) diff --git a/StandardAlgorithms/nonmutating/adjacent_find/Makefile b/StandardAlgorithms/nonmutating/adjacent_find/Makefile index ab1a703..8100c89 100644 --- a/StandardAlgorithms/nonmutating/adjacent_find/Makefile +++ b/StandardAlgorithms/nonmutating/adjacent_find/Makefile @@ -1,6 +1,3 @@ -CMD=\\adjacentfind -SEC=sec:adjacentfind - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/adjacent_find/depend.mk b/StandardAlgorithms/nonmutating/adjacent_find/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/adjacent_find/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/count/Makefile b/StandardAlgorithms/nonmutating/count/Makefile index 7b6d023..ba5b36c 100644 --- a/StandardAlgorithms/nonmutating/count/Makefile +++ b/StandardAlgorithms/nonmutating/count/Makefile @@ -1,6 +1,5 @@ CMD=\\cnt -SEC=sec:count -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/count/depend.mk b/StandardAlgorithms/nonmutating/count/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/count/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/count2/Makefile b/StandardAlgorithms/nonmutating/count2/Makefile index 4e82d55..dc0c946 100644 --- a/StandardAlgorithms/nonmutating/count2/Makefile +++ b/StandardAlgorithms/nonmutating/count2/Makefile @@ -2,5 +2,5 @@ CMD=\\cnttwo SEC=sec:count2 -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/count2/depend.mk b/StandardAlgorithms/nonmutating/count2/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/count2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/equal/Makefile b/StandardAlgorithms/nonmutating/equal/Makefile index b339be8..8100c89 100644 --- a/StandardAlgorithms/nonmutating/equal/Makefile +++ b/StandardAlgorithms/nonmutating/equal/Makefile @@ -1,8 +1,3 @@ -CMD=\\equal -SEC=sec:equal - -include ../../Makefile.template - -TESTOBJ += ../libnonmutating.a +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/equal/depend.mk b/StandardAlgorithms/nonmutating/equal/depend.mk new file mode 100644 index 0000000..ef151b5 --- /dev/null +++ b/StandardAlgorithms/nonmutating/equal/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += nonmutating/mismatch + diff --git a/StandardAlgorithms/nonmutating/equal/equal.c b/StandardAlgorithms/nonmutating/equal/equal.c index 8108f25..bbc6459 100644 --- a/StandardAlgorithms/nonmutating/equal/equal.c +++ b/StandardAlgorithms/nonmutating/equal/equal.c @@ -1,5 +1,5 @@ #include "equal.h" -#include "../mismatch/mismatch.h" +#include "mismatch.h" bool equal(const value_type* a, size_type n, const value_type* b) diff --git a/StandardAlgorithms/nonmutating/find/Makefile b/StandardAlgorithms/nonmutating/find/Makefile index b0f5838..8100c89 100644 --- a/StandardAlgorithms/nonmutating/find/Makefile +++ b/StandardAlgorithms/nonmutating/find/Makefile @@ -1,6 +1,3 @@ -CMD=\\find -SEC=sec:find - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/find/depend.mk b/StandardAlgorithms/nonmutating/find/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/find/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/find2/Makefile b/StandardAlgorithms/nonmutating/find2/Makefile index e0dacff..c7dccb7 100644 --- a/StandardAlgorithms/nonmutating/find2/Makefile +++ b/StandardAlgorithms/nonmutating/find2/Makefile @@ -2,5 +2,5 @@ CMD=\\findtwo SEC=sec:find2 -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/find2/depend.mk b/StandardAlgorithms/nonmutating/find2/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/find2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/find_end/Makefile b/StandardAlgorithms/nonmutating/find_end/Makefile index 7f811fb..15cda16 100644 --- a/StandardAlgorithms/nonmutating/find_end/Makefile +++ b/StandardAlgorithms/nonmutating/find_end/Makefile @@ -1,12 +1,8 @@ -CMD=\\findend -SEC=sec:find_end - -include ../../Makefile.template +include ../../example.mk # verify "first" #WP_FLAGS += -wp-prop first -#WP_FLAGS += -wp-prop lucy # verify all but "first" # WP_FLAGS += -wp-prop="-first" @@ -17,6 +13,3 @@ include ../../Makefile.template # verify everything but lemmas #WP_FLAGS += -wp-prop="-@lemma" - -TESTOBJ += ../libnonmutating.a - diff --git a/StandardAlgorithms/nonmutating/find_end/depend.mk b/StandardAlgorithms/nonmutating/find_end/depend.mk new file mode 100644 index 0000000..627d387 --- /dev/null +++ b/StandardAlgorithms/nonmutating/find_end/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += nonmutating/equal + diff --git a/StandardAlgorithms/nonmutating/find_end/find_end.c b/StandardAlgorithms/nonmutating/find_end/find_end.c index a7c3b98..bc69e2b 100644 --- a/StandardAlgorithms/nonmutating/find_end/find_end.c +++ b/StandardAlgorithms/nonmutating/find_end/find_end.c @@ -1,29 +1,29 @@ #include "find_end.h" -#include "../equal/equal.h" +#include "equal.h" size_type -find_end(const value_type* a, size_type m, - const value_type* b, size_type n) +find_end(const value_type* a, size_type n, + const value_type* b, size_type p) { - size_type ret = m; + size_type r = n; - if ((0u < n) && (n <= m)) { + if ((0u < p) && (p <= n)) { /*@ - loop invariant bound: ret <= m - n || ret == m; - loop invariant result: ret == m ==> !HasSubRange(a, n+i-1, b, n); - loop invariant result: ret < m ==> EqualRanges{Here,Here}(a + ret, n, b); - loop invariant last: ret < m ==> !HasSubRange(a, ret+1, i+n-1, b, n); - loop assigns i, ret; - loop variant m - i; + loop invariant bound : r <= n - p || r == n; + loop invariant not_found: r == n ==> !HasSubRange(a, p+i-1, b, p); + loop invariant found: r < n ==> EqualRanges{Here,Here}(a+r, p, b); + loop invariant last: r < n ==> !HasSubRange(a, r+1, i+p-1, b, p); + loop assigns i, r; + loop variant n - i; */ - for (size_type i = 0u; i <= m - n; ++i) { - if (equal(a + i, n, b)) { - ret = i; + for (size_type i = 0u; i <= n - p; ++i) { + if (equal(a + i, p, b)) { + r = i; } } } - return ret; + return r; } diff --git a/StandardAlgorithms/nonmutating/find_end/find_end.h b/StandardAlgorithms/nonmutating/find_end/find_end.h index 8132f82..ca7b4af 100644 --- a/StandardAlgorithms/nonmutating/find_end/find_end.h +++ b/StandardAlgorithms/nonmutating/find_end/find_end.h @@ -5,29 +5,29 @@ #include "HasSubRange.spec" /*@ - requires valid: \valid_read(a + (0..m-1)); - requires valid: \valid_read(b + (0..n-1)); + requires valid: \valid_read(a + (0..n-1)); + requires valid: \valid_read(b + (0..p-1)); assigns \nothing; - ensures result: 0 <= \result <= m; + ensures result: 0 <= \result <= n; behavior has_match: - assumes HasSubRange(a, 0, m, b, n); - ensures bound: 0 <= \result <= m-n; - ensures result: EqualRanges{Here,Here}(a + \result, n, b); - ensures last: !HasSubRange(a, \result + 1, m, b, n); + assumes HasSubRange(a, n, b, p); + ensures bound: 0 <= \result <= n-p; + ensures result: EqualRanges{Here,Here}(a + \result, p, b); + ensures last: !HasSubRange(a, \result + 1, n, b, p); behavior no_match: - assumes !HasSubRange(a, 0, m, b, n); - ensures result: \result == m; + assumes !HasSubRange(a, n, b, p); + ensures result: \result == n; complete behaviors; disjoint behaviors; */ size_type -find_end(const value_type* a, size_type m, - const value_type* b, size_type n); +find_end(const value_type* a, size_type n, + const value_type* b, size_type p); #endif /* FIND_END_H_INCLUDED */ diff --git a/StandardAlgorithms/nonmutating/find_first_of/Makefile b/StandardAlgorithms/nonmutating/find_first_of/Makefile index d8822c5..66a32c7 100644 --- a/StandardAlgorithms/nonmutating/find_first_of/Makefile +++ b/StandardAlgorithms/nonmutating/find_first_of/Makefile @@ -1,8 +1,5 @@ -CMD=\\findfirstof -SEC=sec:findfirstof - -include ../../Makefile.template +include ../../example.mk TESTOBJ += ../libnonmutating.a diff --git a/StandardAlgorithms/nonmutating/find_first_of/depend.mk b/StandardAlgorithms/nonmutating/find_first_of/depend.mk new file mode 100644 index 0000000..8d8695e --- /dev/null +++ b/StandardAlgorithms/nonmutating/find_first_of/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += nonmutating/find2 + diff --git a/StandardAlgorithms/nonmutating/find_first_of/find_first_of.c b/StandardAlgorithms/nonmutating/find_first_of/find_first_of.c index 1b09be2..3a5a97f 100644 --- a/StandardAlgorithms/nonmutating/find_first_of/find_first_of.c +++ b/StandardAlgorithms/nonmutating/find_first_of/find_first_of.c @@ -1,6 +1,6 @@ #include "find_first_of.h" -#include "../find2/find2.h" +#include "find2.h" size_type find_first_of (const value_type* a, size_type m, diff --git a/StandardAlgorithms/nonmutating/mismatch/Makefile b/StandardAlgorithms/nonmutating/mismatch/Makefile index 7d5f7f0..8100c89 100644 --- a/StandardAlgorithms/nonmutating/mismatch/Makefile +++ b/StandardAlgorithms/nonmutating/mismatch/Makefile @@ -1,6 +1,3 @@ -CMD=\\mismatch -SEC=sec:mismatch - -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/nonmutating/mismatch/depend.mk b/StandardAlgorithms/nonmutating/mismatch/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/mismatch/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/nonmutating.h b/StandardAlgorithms/nonmutating/nonmutating.h deleted file mode 100644 index 5e50cfc..0000000 --- a/StandardAlgorithms/nonmutating/nonmutating.h +++ /dev/null @@ -1,16 +0,0 @@ - -#ifndef NONMUTATING_H_INCLUDED -#define NONMUTATING_H_INCLUDED - - -#include "equal/equal.h" -#include "mismatch/mismatch.h" -#include "find2/find2.h" -#include "find_first_of/find_first_of.h" -#include "adjacent_find/adjacent_find.h" -#include "search/search.h" -#include "find_end/find_end.h" -#include "count/count.h" - -#endif /* NONMUTATING_H_INCLUDED */ - diff --git a/StandardAlgorithms/nonmutating/search/Makefile b/StandardAlgorithms/nonmutating/search/Makefile index 3082942..15cda16 100644 --- a/StandardAlgorithms/nonmutating/search/Makefile +++ b/StandardAlgorithms/nonmutating/search/Makefile @@ -1,13 +1,8 @@ -CMD=\\search -SEC=sec:search - -include ../../Makefile.template - +include ../../example.mk # verify "first" #WP_FLAGS += -wp-prop first -#WP_FLAGS += -wp-prop lucy # verify all but "first" # WP_FLAGS += -wp-prop="-first" @@ -18,7 +13,3 @@ include ../../Makefile.template # verify everything but lemmas #WP_FLAGS += -wp-prop="-@lemma" - - -TESTOBJ += ../libnonmutating.a - diff --git a/StandardAlgorithms/nonmutating/search/depend.mk b/StandardAlgorithms/nonmutating/search/depend.mk new file mode 100644 index 0000000..627d387 --- /dev/null +++ b/StandardAlgorithms/nonmutating/search/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += nonmutating/equal + diff --git a/StandardAlgorithms/nonmutating/search/search.c b/StandardAlgorithms/nonmutating/search/search.c index f27b30f..5625c42 100644 --- a/StandardAlgorithms/nonmutating/search/search.c +++ b/StandardAlgorithms/nonmutating/search/search.c @@ -1,27 +1,27 @@ #include "search.h" -#include "../equal/equal.h" +#include "equal.h" size_type -search(const value_type* a, size_type m, - const value_type* b, size_type n) +search(const value_type* a, size_type n, + const value_type* b, size_type p) { - if (n <= m) { + if (p <= n) { /*@ - loop invariant bound: i <= m-n+1; - loop invariant not_found: !HasSubRange(a, 0, n+i-1, b, n); + loop invariant bound: i <= n-p+1; + loop invariant not_found: !HasSubRange(a, p+i-1, b, p); loop assigns i; - loop variant m-i; + loop variant n-i; */ - for (size_type i = 0u; i <= m - n; ++i) { - if (equal(a + i, n, b)) { - //@ assert has_match: HasSubRange(a, 0, m, b, n); + for (size_type i = 0u; i <= n - p; ++i) { + if (equal(a + i, p, b)) { + //@ assert has_match: HasSubRange(a, n, b, p); return i; } } } - //@ assert no_match: !HasSubRange(a, 0, m, b, n); - return m; + //@ assert no_match: !HasSubRange(a, n, b, p); + return n; } diff --git a/StandardAlgorithms/nonmutating/search/search.h b/StandardAlgorithms/nonmutating/search/search.h index 097c42e..d46a187 100644 --- a/StandardAlgorithms/nonmutating/search/search.h +++ b/StandardAlgorithms/nonmutating/search/search.h @@ -5,29 +5,29 @@ #include "HasSubRange.spec" /*@ - requires \valid_read(a + (0..m-1)); - requires \valid_read(b + (0..n-1)); + requires \valid_read(a + (0..n-1)); + requires \valid_read(b + (0..p-1)); assigns \nothing; - ensures result: 0 <= \result <= m; + ensures result: 0 <= \result <= n; behavior has_match: - assumes HasSubRange(a, 0, m, b, n); - ensures bound: 0 <= \result <= m-n; - ensures result: EqualRanges{Here,Here}(a+\result, n, b); - ensures first: !HasSubRange(a, 0, \result+n-1, b, n); + assumes HasSubRange(a, n, b, p); + ensures bound: 0 <= \result <= n-p; + ensures result: EqualRanges{Here,Here}(a+\result, p, b); + ensures first: !HasSubRange(a, \result+p-1, b, p); behavior no_match: - assumes !HasSubRange(a, 0, m, b, n); - ensures result: \result == m; + assumes !HasSubRange(a, n, b, p); + ensures result: \result == n; complete behaviors; disjoint behaviors; */ size_type -search(const value_type* a, size_type m, - const value_type* b, size_type n); +search(const value_type* a, size_type n, + const value_type* b, size_type p); #endif /* SEARCH_H_INCLUDED */ diff --git a/StandardAlgorithms/nonmutating/search_n/Makefile b/StandardAlgorithms/nonmutating/search_n/Makefile index 704e6b7..a81ae26 100644 --- a/StandardAlgorithms/nonmutating/search_n/Makefile +++ b/StandardAlgorithms/nonmutating/search_n/Makefile @@ -1,10 +1,7 @@ -CMD=\\searchn -SEC=sec:search_n +include ../../example.mk -export WP_TIMEOUT=20 - -include ../../Makefile.template - -TESTOBJ += ../libnonmutating.a +WP_FLAGS += -wp-split +#WP_FLAGS += -wp-prop="-@lemma" +#WP_FLAGS += -wp-prop match diff --git a/StandardAlgorithms/nonmutating/search_n/depend.mk b/StandardAlgorithms/nonmutating/search_n/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/nonmutating/search_n/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/nonmutating/search_n/search_n.c b/StandardAlgorithms/nonmutating/search_n/search_n.c index 4aa158f..6729973 100644 --- a/StandardAlgorithms/nonmutating/search_n/search_n.c +++ b/StandardAlgorithms/nonmutating/search_n/search_n.c @@ -2,33 +2,58 @@ #include "search_n.h" size_type -search_n(const value_type* a, size_type m, size_type n, value_type b) +search_n(const value_type* a, size_type n, value_type v, size_type p) { - if (0u < n) { - if (n <= m) { + if (0u < p) { + if (p <= n) { size_type start = 0u; /*@ - loop invariant constant: ConstantRange(a, start, i, b); - loop invariant start: 0 < start ==> a[start-1] != b; - loop invariant bound: start <= i + 1; - loop invariant not_found: !HasConstantSubRange(a, i, n, b); + loop invariant match: ConstantRange(a, start, i, v); + loop invariant start: 0 < start ==> a[start-1] != v; + loop invariant bound: start <= i + 1 <= start + p; + loop invariant not_found: !HasConstantSubRange(a, i, v, p); loop assigns i, start; - loop variant m - i; + loop variant n - i; */ - for (size_type i = 0u; i < m; ++i) { - if (a[i] != b) { + for (size_type i = 0u; i < n; ++i) { + if (a[i] != v) { start = i + 1u; + //@ assert not_found: !HasConstantSubRange(a, i+1, v, p); } - else if (n == i + 1u - start) { - return start; + else { + //@ assert match: a[i] == v; + //@ assert match: ConstantRange(a, start, i+1, v); + if (p == i + 1u - start) { + //@ assert bound: start + p == i + 1; + //@ assert match: ConstantRange(a, start, start+p, v); + //@ assert match: \exists integer k; 0 <= k <= n-p && ConstantRange(a, k, k+p, v); + //@ assert match: HasConstantSubRange(a, n, v, p); + return start; + } + else { + //@ assert bound: i + 1 < start + p; + continue; + } } + + //@ assert not_found: !HasConstantSubRange(a, i+1, v, p); } - } - return m; + //@ assert not_found: !HasConstantSubRange(a, n, v, p); + return n; + } + else { + //@ assert not_found: n < p; + //@ assert not_found: !HasConstantSubRange(a, n, v, p); + return n; + } + } + else { + //@ assert bound: p == 0; + //@ assert match: ConstantRange(a, 0, 0, v); + //@ assert match: HasConstantSubRange(a, n, v, 0); + return 0u; } - - return 0u; } diff --git a/StandardAlgorithms/nonmutating/search_n/search_n.h b/StandardAlgorithms/nonmutating/search_n/search_n.h index 65a265d..6a531c3 100644 --- a/StandardAlgorithms/nonmutating/search_n/search_n.h +++ b/StandardAlgorithms/nonmutating/search_n/search_n.h @@ -5,27 +5,29 @@ #include "HasConstantSubRange.spec" /*@ - requires valid: \valid_read(a + (0..m-1)); + requires valid: \valid_read(a + (0..n-1)); assigns \nothing; - ensures result: 0 <= \result <= m; + ensures result: 0 <= \result <= n; behavior has_match: - assumes HasConstantSubRange(a, m, n, b); - ensures result: 0 <= \result <= m-n; - ensures match: ConstantRange(a, \result, \result+n, b); - ensures first: !HasConstantSubRange(a, \result+n-1, n, b); + assumes HasConstantSubRange(a, n, v, p); + assigns \nothing; + ensures result: 0 <= \result <= n-p; + ensures match: ConstantRange(a, \result, \result+p, v); + ensures first: !HasConstantSubRange(a, \result+p-1, v, p); behavior no_match: - assumes !HasConstantSubRange(a, m, n, b); - ensures result: \result == m; + assumes !HasConstantSubRange(a, n, v, p); + assigns \nothing; + ensures result: \result == n; complete behaviors; disjoint behaviors; */ size_type -search_n(const value_type* a, size_type m, size_type n, value_type b); +search_n(const value_type* a, size_type n, value_type v, size_type p); #endif /* SEARCH_N_H_INCLUDED */ diff --git a/StandardAlgorithms/nonmutating/search_n/search_n_test.cpp b/StandardAlgorithms/nonmutating/search_n/search_n_test.cpp index 1ff3278..acd9a84 100644 --- a/StandardAlgorithms/nonmutating/search_n/search_n_test.cpp +++ b/StandardAlgorithms/nonmutating/search_n/search_n_test.cpp @@ -8,26 +8,28 @@ #include "search_n.h" void -test(const std::vector& a, size_type n, value_type v) +test(const std::vector& a, value_type v, size_type n) { assert(std::search_n(a.begin(), a.end(), n, v) == - a.begin() + search_n(a.data(), a.size(), n, v)); + a.begin() + search_n(a.data(), a.size(), v, n)); } int main(int argc, char** argv) { std::vector a{0, 4, 4, 4, 5, 4, 4, 4, 4}; + // successful nontrivial search - test(a, 3, 7); + test(a, 7, 3); // failing nontrivial search - test(a, 6, 4); + test(a, 4, 6); // search for empty range - test(a, 0, 4); + test(a, 4, 0); // search in empty range - test(a, 1, 4); + test(a, 4, 1); // search for too large range - test(a, 20, 4); + test(a, 4, 20); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/numeric/Makefile b/StandardAlgorithms/numeric/Makefile index 4076ca0..e210c33 100644 --- a/StandardAlgorithms/numeric/Makefile +++ b/StandardAlgorithms/numeric/Makefile @@ -1,12 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libnumeric.a - -lib: libnumeric.a - -libnumeric.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/numeric/accumulate/Makefile b/StandardAlgorithms/numeric/accumulate/Makefile index 3aa1814..8100c89 100644 --- a/StandardAlgorithms/numeric/accumulate/Makefile +++ b/StandardAlgorithms/numeric/accumulate/Makefile @@ -1,5 +1,3 @@ -CMD=\\accumulate -SEC=sec:accumulate +include ../../example.mk -include ../../Makefile.template diff --git a/StandardAlgorithms/numeric/accumulate/depend.mk b/StandardAlgorithms/numeric/accumulate/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/numeric/accumulate/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/numeric/adjacent_difference/Makefile b/StandardAlgorithms/numeric/adjacent_difference/Makefile index b7074b0..19ed559 100644 --- a/StandardAlgorithms/numeric/adjacent_difference/Makefile +++ b/StandardAlgorithms/numeric/adjacent_difference/Makefile @@ -1,8 +1,5 @@ -CMD=\\adjacentdifference -SEC=sec:adjacentdifference - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-fct adjacent_difference #WP_FLAGS += -wp-prop rte @@ -10,5 +7,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop difference #WP_FLAGS += -wp-prop @lemma -TESTOBJ += -lnumeric - diff --git a/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference.h b/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference.h index 37ffbd8..148a721 100644 --- a/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference.h +++ b/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference.h @@ -8,7 +8,7 @@ /*@ requires valid: \valid_read(a + (0..n-1)); requires valid: \valid(b + (0..n-1)); - requires separated: \separated(a + (0..n-1), b + (0..n-1)); + requires sep: \separated(a + (0..n-1), b + (0..n-1)); requires bounds: AdjacentDifferenceBounds(a, n); assigns b[0..n-1]; diff --git a/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference_test.cpp b/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference_test.cpp index da2b937..f702744 100644 --- a/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference_test.cpp +++ b/StandardAlgorithms/numeric/adjacent_difference/adjacent_difference_test.cpp @@ -3,7 +3,6 @@ #include #include #include -#include "numeric.h" #include "adjacent_difference.h" int diff --git a/StandardAlgorithms/numeric/adjacent_difference/depend.mk b/StandardAlgorithms/numeric/adjacent_difference/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/numeric/adjacent_difference/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/numeric/adjacent_difference_inv/Makefile b/StandardAlgorithms/numeric/adjacent_difference_inv/Makefile index 89898ee..905f04b 100644 --- a/StandardAlgorithms/numeric/adjacent_difference_inv/Makefile +++ b/StandardAlgorithms/numeric/adjacent_difference_inv/Makefile @@ -1,9 +1,4 @@ -CMD=\\adjacentdifferenceinv -SEC=sec:inverting-adjacentdifference - -include ../../Makefile.template - -TESTOBJ += -lnumeric +include ../../example.mk diff --git a/StandardAlgorithms/numeric/adjacent_difference_inv/adjacent_difference_inv.c b/StandardAlgorithms/numeric/adjacent_difference_inv/adjacent_difference_inv.c index 0eeb3f8..147eced 100644 --- a/StandardAlgorithms/numeric/adjacent_difference_inv/adjacent_difference_inv.c +++ b/StandardAlgorithms/numeric/adjacent_difference_inv/adjacent_difference_inv.c @@ -1,13 +1,13 @@ -#include "../partial_sum/partial_sum.h" -#include "../adjacent_difference/adjacent_difference.h" +#include "partial_sum.h" +#include "adjacent_difference.h" #include "UnchangedTransitive.spec" #include "AdjacentDifferenceInv.spec" /*@ requires valid: \valid(a + (0..n-1)); requires valid: \valid(b + (0..n-1)); - requires separated: \separated(a + (0..n-1), b + (0..n-1)); + requires sep: \separated(a + (0..n-1), b + (0..n-1)); requires bounds: AdjacentDifferenceBounds(a, n+1); assigns a[0..n-1], b[0..n-1]; diff --git a/StandardAlgorithms/numeric/adjacent_difference_inv/depend.mk b/StandardAlgorithms/numeric/adjacent_difference_inv/depend.mk new file mode 100644 index 0000000..3b66d52 --- /dev/null +++ b/StandardAlgorithms/numeric/adjacent_difference_inv/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += numeric/partial_sum +DEPENDENCIES += numeric/adjacent_difference + diff --git a/StandardAlgorithms/numeric/inner_product/Makefile b/StandardAlgorithms/numeric/inner_product/Makefile index 9909689..8100c89 100644 --- a/StandardAlgorithms/numeric/inner_product/Makefile +++ b/StandardAlgorithms/numeric/inner_product/Makefile @@ -1,8 +1,3 @@ -CMD=\\innerproduct -SEC=sec:innerproduct - -include ../../Makefile.template - -#TESTOBJ += -lnumeric +include ../../example.mk diff --git a/StandardAlgorithms/numeric/inner_product/depend.mk b/StandardAlgorithms/numeric/inner_product/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/numeric/inner_product/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/numeric/inner_product/inner_product_test.cpp b/StandardAlgorithms/numeric/inner_product/inner_product_test.cpp index 220161b..3281bef 100644 --- a/StandardAlgorithms/numeric/inner_product/inner_product_test.cpp +++ b/StandardAlgorithms/numeric/inner_product/inner_product_test.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include "inner_product.h" int main(int argc, char** argv) diff --git a/StandardAlgorithms/numeric/iota/Makefile b/StandardAlgorithms/numeric/iota/Makefile index 737218d..3e1aeb4 100644 --- a/StandardAlgorithms/numeric/iota/Makefile +++ b/StandardAlgorithms/numeric/iota/Makefile @@ -1,6 +1,5 @@ CMD=\\IOTA -SEC=sec:iota -include ../../Makefile.template +include ../../example.mk diff --git a/StandardAlgorithms/numeric/iota/depend.mk b/StandardAlgorithms/numeric/iota/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/numeric/iota/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/numeric/numeric.h b/StandardAlgorithms/numeric/numeric.h deleted file mode 100644 index 622e9ae..0000000 --- a/StandardAlgorithms/numeric/numeric.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef NUMERIC_H_INCLUDED -#define NUMERIC_H_INCLUDED - -#include "accumulate/accumulate.h" -#include "inner_product/inner_product.h" -#include "partial_sum/partial_sum.h" -#include "adjacent_difference/adjacent_difference.h" - -#endif /* NUMERIC_H_INCLUDED */ - diff --git a/StandardAlgorithms/numeric/partial_sum/Makefile b/StandardAlgorithms/numeric/partial_sum/Makefile index fc2b928..d91f79d 100644 --- a/StandardAlgorithms/numeric/partial_sum/Makefile +++ b/StandardAlgorithms/numeric/partial_sum/Makefile @@ -1,14 +1,9 @@ -CMD=\\partialsum -SEC=sec:partialsum +export WP_TIMEOUT=25 -export WP_TIMEOUT=20 - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop rte #WP_FLAGS += -wp-prop partialsum #WP_FLAGS += -wp-prop @lemma -TESTOBJ += -lnumeric - diff --git a/StandardAlgorithms/numeric/partial_sum/depend.mk b/StandardAlgorithms/numeric/partial_sum/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/numeric/partial_sum/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/numeric/partial_sum/partial_sum.h b/StandardAlgorithms/numeric/partial_sum/partial_sum.h index ffba896..8379305 100644 --- a/StandardAlgorithms/numeric/partial_sum/partial_sum.h +++ b/StandardAlgorithms/numeric/partial_sum/partial_sum.h @@ -8,7 +8,7 @@ /*@ requires valid: \valid_read(a + (0..n-1)); requires valid: \valid(b + (0..n-1)); - requires separated: \separated(a + (0..n-1), b + (0..n-1)); + requires sep: \separated(a + (0..n-1), b + (0..n-1)); requires bounds: AccumulateBounds(a, n+1); assigns b[0..n-1]; diff --git a/StandardAlgorithms/numeric/partial_sum/partial_sum_test.cpp b/StandardAlgorithms/numeric/partial_sum/partial_sum_test.cpp index 95b075c..d3f5b0e 100644 --- a/StandardAlgorithms/numeric/partial_sum/partial_sum_test.cpp +++ b/StandardAlgorithms/numeric/partial_sum/partial_sum_test.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "numeric.h" +#include "partial_sum.h" int main(int argc, char** argv) diff --git a/StandardAlgorithms/numeric/partial_sum_inv/Makefile b/StandardAlgorithms/numeric/partial_sum_inv/Makefile index 33e6095..905f04b 100644 --- a/StandardAlgorithms/numeric/partial_sum_inv/Makefile +++ b/StandardAlgorithms/numeric/partial_sum_inv/Makefile @@ -1,9 +1,4 @@ -CMD=\\partialsuminv -SEC=sec:inverting-partialsum - -include ../../Makefile.template - -TESTOBJ += -lnumeric +include ../../example.mk diff --git a/StandardAlgorithms/numeric/partial_sum_inv/depend.mk b/StandardAlgorithms/numeric/partial_sum_inv/depend.mk new file mode 100644 index 0000000..3b66d52 --- /dev/null +++ b/StandardAlgorithms/numeric/partial_sum_inv/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += numeric/partial_sum +DEPENDENCIES += numeric/adjacent_difference + diff --git a/StandardAlgorithms/numeric/partial_sum_inv/partial_sum_inv.c b/StandardAlgorithms/numeric/partial_sum_inv/partial_sum_inv.c index 545c654..44d00ab 100644 --- a/StandardAlgorithms/numeric/partial_sum_inv/partial_sum_inv.c +++ b/StandardAlgorithms/numeric/partial_sum_inv/partial_sum_inv.c @@ -1,12 +1,12 @@ -#include "../partial_sum/partial_sum.h" -#include "../adjacent_difference/adjacent_difference.h" +#include "partial_sum.h" +#include "adjacent_difference.h" #include "PartialSumInv.spec" /*@ requires valid: \valid(a + (0..n-1)); requires valid: \valid(b + (0..n-1)); - requires separated: \separated(a + (0..n-1), b + (0..n-1)); + requires sep: \separated(a + (0..n-1), b + (0..n-1)); requires bounds: AccumulateBounds(a, n+1); assigns a[0..n-1], b[0..n-1]; diff --git a/StandardAlgorithms/rules.mk b/StandardAlgorithms/rules.mk new file mode 100644 index 0000000..dc3fb86 --- /dev/null +++ b/StandardAlgorithms/rules.mk @@ -0,0 +1,50 @@ + +# used for Frama-Clang +%.cpp:%.c + cp $< $@ + +%.check:%.c + @$(FR) $(WP_C_FLAGS) -wp-check -wp-out $(patsubst %.c,%.wp, $<) $< + +# only generate proof obligations for why3 +%.why3:%.c FORCE + @$(FR) $(WP_C_FLAGS) $(WP_TIME_FLAGS) -wp-prover why3 -wp-gen -wp-out $(patsubst %.c,%.wp, $<) $< + +# start FR on command line and run provers +%.wp:%.c $(DRIVER) FORCE + @$(FR) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $< + +%.wp++:%.cpp FORCE + @$(FR) $(WP_CXX_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $@ $< + +%.vs-par:%.c FORCE + @$(VS_DIR)/vs.sh -p $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) + +%.vs-pipe:%.c FORCE + @$(VS_DIR)/vs.sh -d $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(notdir $(patsubst %.c,%.wp, $<)) + +%.wprunner:%.c FORCE + @$(SCRIPT_DIR)/wp_runner.sh $< $(WP_C_FLAGS) $(WP_PROVER_FLAGS) -wp-par $(WP_PROCESSES) + +%.av:%.c $(AV_WHY3_CONF) FORCE + @$(AV_C_REPORT) -av-out $@ $< + +# GUI +%.avgui:%.c $(AV_WHY3_CONF) FORCE + @$(FR) $(AV_C_FLAGS) -av-why3-opt " --extra-config $(AV_WHY3_CONF) " -av-out $(patsubst %.c,%.av, $<) $< + +# start FR GUI and run provers +%.wpgui:%.c $(DRIVER) FORCE + @($(FRGUI) $(WP_C_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.c,%.wp, $<) $< &) + +%.wpgui++:%.cpp FORCE + @($(FRGUI) $(WP_CXX_FLAGS) $(WP_PROVER_FLAGS) $(WP_TIME_FLAGS) -wp-out $(patsubst %.cpp,%.wp++, $<) $< ) + +%.normal.c : %.c FORCE + @$(FR) $(WP_C_FLAGS) -wp-no-rte -wp-check -wp-prover none $< -print |\ + $(PERL) -e 'my $$f = join("", <>); $$f =~ s!\A.*(?=/\*@.*\*/[^/]*$*\([^)]++\)\s*+\{)!!s; print $$f;' > $@ + +%.normal-rte.c : %.c FORCE + @$(FR) $(WP_C_FLAGS) -wp-check -wp-prover none $< -print |\ + $(PERL) -e 'my $$f = join("", <>); $$f =~ s!\A.*(?=/\*@.*\*/[^/]*$*\([^)]++\)\s*+\{)!!s; print $$f;' > $@ + diff --git a/StandardAlgorithms/size_type_pair.h b/StandardAlgorithms/size_type_pair.h new file mode 100644 index 0000000..080636c --- /dev/null +++ b/StandardAlgorithms/size_type_pair.h @@ -0,0 +1,15 @@ + +#ifndef SIZE_TYPE_PAIR_H_INCLUDED +#define SIZE_TYPE_PAIR_H_INCLUDED + +#include "typedefs.h" + +struct size_type_pair { + size_type first; + size_type second; +}; + +typedef struct size_type_pair size_type_pair; + +#endif /* SIZE_TYPE_PAIR_H_INCLUDED */ + diff --git a/StandardAlgorithms/sorting/Makefile b/StandardAlgorithms/sorting/Makefile index 611b328..e210c33 100644 --- a/StandardAlgorithms/sorting/Makefile +++ b/StandardAlgorithms/sorting/Makefile @@ -1,7 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - -lib: +include ../group.mk diff --git a/StandardAlgorithms/sorting/heap_sort/Makefile b/StandardAlgorithms/sorting/heap_sort/Makefile index 82d821f..d52c178 100644 --- a/StandardAlgorithms/sorting/heap_sort/Makefile +++ b/StandardAlgorithms/sorting/heap_sort/Makefile @@ -1,9 +1,4 @@ -CMD=\\heapsort -SEC=sec:heap_sort - -include ../../Makefile.template - -TESTOBJ += -lheap +include ../../example.mk diff --git a/StandardAlgorithms/sorting/heap_sort/depend.mk b/StandardAlgorithms/sorting/heap_sort/depend.mk new file mode 100644 index 0000000..9ec3f63 --- /dev/null +++ b/StandardAlgorithms/sorting/heap_sort/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += heap/make_heap +DEPENDENCIES += heap/sort_heap + diff --git a/StandardAlgorithms/sorting/heap_sort/heap_sort.c b/StandardAlgorithms/sorting/heap_sort/heap_sort.c index aaaec12..271ed76 100644 --- a/StandardAlgorithms/sorting/heap_sort/heap_sort.c +++ b/StandardAlgorithms/sorting/heap_sort/heap_sort.c @@ -1,7 +1,7 @@ #include "heap_sort.h" -#include "../heap/make_heap/make_heap.h" -#include "../heap/sort_heap/sort_heap.h" +#include "make_heap.h" +#include "sort_heap.h" void heap_sort(value_type* a, size_type n) diff --git a/StandardAlgorithms/sorting/insertion_sort/Makefile b/StandardAlgorithms/sorting/insertion_sort/Makefile index 0dcd2c6..5d71bfc 100644 --- a/StandardAlgorithms/sorting/insertion_sort/Makefile +++ b/StandardAlgorithms/sorting/insertion_sort/Makefile @@ -1,9 +1,5 @@ -CMD=\\insertionsort -SEC=sec:insertion_sort - - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop=sorted #WP_FLAGS += -wp-prop=reorder @@ -11,6 +7,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop="-@lemma" #WP_FLAGS += -wp-prop="-@assert" -TESTOBJ += -lbinarysearch -lmutating - - diff --git a/StandardAlgorithms/sorting/insertion_sort/depend.mk b/StandardAlgorithms/sorting/insertion_sort/depend.mk new file mode 100644 index 0000000..124239b --- /dev/null +++ b/StandardAlgorithms/sorting/insertion_sort/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += binarysearch/upper_bound +DEPENDENCIES += mutating/rotate + diff --git a/StandardAlgorithms/sorting/insertion_sort/example.gif b/StandardAlgorithms/sorting/insertion_sort/example.gif deleted file mode 100644 index 46e1349..0000000 Binary files a/StandardAlgorithms/sorting/insertion_sort/example.gif and /dev/null differ diff --git a/StandardAlgorithms/sorting/insertion_sort/insertion_sort.c b/StandardAlgorithms/sorting/insertion_sort/insertion_sort.c index 0751df3..ded7f9b 100644 --- a/StandardAlgorithms/sorting/insertion_sort/insertion_sort.c +++ b/StandardAlgorithms/sorting/insertion_sort/insertion_sort.c @@ -1,7 +1,7 @@ #include "insertion_sort.h" -#include "../../binarysearch/upper_bound/upper_bound.h" -#include "../../mutating/rotate/rotate.h" +#include "upper_bound.h" +#include "rotate.h" #include "LowerBound.spec" #include "MultisetUnchangedLemmas.spec" #include "EqualRangesPreservesSorted.spec" diff --git a/StandardAlgorithms/sorting/insertion_sort/insertion_sort_test.cpp b/StandardAlgorithms/sorting/insertion_sort/insertion_sort_test.cpp index 5035625..66159c1 100644 --- a/StandardAlgorithms/sorting/insertion_sort/insertion_sort_test.cpp +++ b/StandardAlgorithms/sorting/insertion_sort/insertion_sort_test.cpp @@ -1,6 +1,6 @@ #include "insertion_sort.h" -#include "../../binarysearch/upper_bound/upper_bound.h" +#include "upper_bound.h" #include #include #include diff --git a/StandardAlgorithms/sorting/is_sorted/Makefile b/StandardAlgorithms/sorting/is_sorted/Makefile index 3ae7e14..8100c89 100644 --- a/StandardAlgorithms/sorting/is_sorted/Makefile +++ b/StandardAlgorithms/sorting/is_sorted/Makefile @@ -1,9 +1,3 @@ -CMD=\\issorted -SEC=sec:is_sorted - -include ../../Makefile.template - -#TESTOBJ += - +include ../../example.mk diff --git a/StandardAlgorithms/sorting/is_sorted/depend.mk b/StandardAlgorithms/sorting/is_sorted/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/sorting/is_sorted/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/sorting/merge/Makefile b/StandardAlgorithms/sorting/merge/Makefile index afb58c0..c239b76 100644 --- a/StandardAlgorithms/sorting/merge/Makefile +++ b/StandardAlgorithms/sorting/merge/Makefile @@ -1,14 +1,8 @@ -CMD=\\merge -SEC=sec:merge -include ../../Makefile.template +include ../../example.mk -#WP_FLAGS += -wp-prop=sorted -#WP_FLAGS += -wp-prop="-@lemma" -#WP_FLAGS += -wp-prop="-@assert" +show: + echo $(TESTOBJ) WP_FLAGS += -wp-split -TESTOBJ += -lmutating - - diff --git a/StandardAlgorithms/sorting/merge/depend.mk b/StandardAlgorithms/sorting/merge/depend.mk new file mode 100644 index 0000000..f955229 --- /dev/null +++ b/StandardAlgorithms/sorting/merge/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += mutating/copy + diff --git a/StandardAlgorithms/sorting/merge/merge.c b/StandardAlgorithms/sorting/merge/merge.c index 7ec8ef4..c8b9acf 100644 --- a/StandardAlgorithms/sorting/merge/merge.c +++ b/StandardAlgorithms/sorting/merge/merge.c @@ -1,5 +1,6 @@ + #include "merge.h" -#include "../../mutating/copy/copy.h" +#include "copy.h" void merge(const value_type* a, size_type n, @@ -18,9 +19,9 @@ merge(const value_type* a, size_type n, loop invariant 0 <= j <= m; loop invariant x == i + j; loop invariant 0 <= x <= n + m - 1; - loop invariant ordnung: \forall integer k; 0 <= k < x && i < n ==> + loop invariant order: \forall integer k; 0 <= k < x && i < n ==> result[k] <= a[i]; - loop invariant ordnung: \forall integer k; 0 <= k < x && j < m ==> + loop invariant order: \forall integer k; 0 <= k < x && j < m ==> result[k] <= b[j]; loop invariant sorted: WeaklySorted(result, x); loop assigns i, j, x, result[0 .. n+m-1]; diff --git a/StandardAlgorithms/sorting/partial_sort/Makefile b/StandardAlgorithms/sorting/partial_sort/Makefile index 57d24b4..19a4fdf 100644 --- a/StandardAlgorithms/sorting/partial_sort/Makefile +++ b/StandardAlgorithms/sorting/partial_sort/Makefile @@ -1,9 +1,8 @@ -CMD=\\partialsort -SEC=sec:partial_sort +include ../../example.mk -include ../../Makefile.template +#WP_FLAGS += -wp-split #WP_FLAGS += -wp-prop="-@lemma" #WP_FLAGS += -wp-prop=@lemma @@ -20,6 +19,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop upper #WP_FLAGS += -wp-prop partition - -TESTOBJ += -lheap -lmutating - diff --git a/StandardAlgorithms/sorting/partial_sort/depend.mk b/StandardAlgorithms/sorting/partial_sort/depend.mk new file mode 100644 index 0000000..f168876 --- /dev/null +++ b/StandardAlgorithms/sorting/partial_sort/depend.mk @@ -0,0 +1,7 @@ + +DEPENDENCIES += mutating/swap +DEPENDENCIES += heap/pop_heap +DEPENDENCIES += heap/push_heap +DEPENDENCIES += heap/make_heap +DEPENDENCIES += heap/sort_heap + diff --git a/StandardAlgorithms/sorting/partial_sort/partial_sort.c b/StandardAlgorithms/sorting/partial_sort/partial_sort.c index 019e75b..785ebc7 100644 --- a/StandardAlgorithms/sorting/partial_sort/partial_sort.c +++ b/StandardAlgorithms/sorting/partial_sort/partial_sort.c @@ -1,20 +1,19 @@ #include "partial_sort.h" -#include "../../heap/make_heap/make_heap.h" -#include "../../heap/pop_heap/pop_heap.h" -#include "../../heap/push_heap/push_heap.h" -#include "../../heap/sort_heap/sort_heap.h" -#include "../../mutating/swap/swap.h" +#include "make_heap.h" +#include "pop_heap.h" +#include "push_heap.h" +#include "sort_heap.h" +#include "swap.h" #include "LowerBound.spec" #include "MultisetUnchangedLemmas.spec" #include "HeapMaximum.spec" - #include "ReorderPreservesLowerBound.spec" #include "ReorderPreservesUpperBound.spec" #include "PartialReorderPreservesLowerBounds.spec" -#include "SwappedInside.spec" +#include "SwappedInsideMultisetUnchanged.spec" #include "SwappedInsidePreservesMultisetUnchanged.spec" void @@ -37,13 +36,13 @@ partial_sort(value_type* a, size_type m, size_type n) for (size_type i = m; i < n; ++i) if (a[i] < a[0u]) { /*@ - assigns a[0..m-1]; - ensures heap: IsHeap(a, m-1); - ensures max: a[m-1] == \old(a[0]); - ensures max: MaxElement(a, m, m-1); - ensures reorder: MultisetUnchanged{Old, Here}(a, m); - ensures unchanged: Unchanged{Old, Here}(a, m, i); - ensures unchanged: Unchanged{Old, Here}(a, m, n); + assigns a[0..m-1]; + ensures heap: IsHeap(a, m-1); + ensures max: a[m-1] == \old(a[0]); + ensures max: MaxElement(a, m, m-1); + ensures reorder: MultisetUnchanged{Old, Here}(a, m); + ensures unchanged: Unchanged{Old, Here}(a, m, i); + ensures unchanged: Unchanged{Old, Here}(a, m, n); */ pop_heap(a, m); //@ assert lower: a[0] <= a[m-1]; @@ -53,39 +52,39 @@ partial_sort(value_type* a, size_type m, size_type n) //@ assert upper: UpperBound(a, 0, m, a[m-1]); //@ assert partition: Partition(a, m, i); //@ assert reorder: MultisetUnchanged{Pre,Here}(a, i); - /*@ - assigns a[m-1], a[i]; - ensures swapped: SwappedInside{Old,Here}(a, m-1, i, n); - */ + + //@ ghost BeforeSwap: swap(a + m - 1u, a + i); - //@ assert lower: a[m-1] < a[i]; - /*@ assert lower: \forall integer k; 0 <= k < m ==> - LowerBound(a,m,i+1,a[k]); */ - //@ assert upper: UpperBound(a, 0, m-1, a[0]); + //@ assert swapped: SwappedInside{BeforeSwap,Here}(a, m-1, i, n); + //@ assert reorder: MultisetUnchanged{BeforeSwap,Here}(a, i+1); //@ assert reorder: MultisetUnchanged{Pre,Here}(a, i+1); //@ assert unchanged: Unchanged{Pre,Here}(a, i+1, n); + //@ assert lower: a[m-1] < a[i]; + //@ assert lower: \forall integer k; 0 <= k < m ==> LowerBound(a, m, i+1, a[k]); + //@ assert upper: UpperBound(a, 0, m-1, a[0]); + /*@ - assigns a[0..m-1]; - ensures heap: IsHeap(a, m); - ensures reorder: MultisetUnchanged{Old,Here}(a, m); - ensures unchanged: Unchanged{Old,Here}(a, m, i+1); - ensures unchanged: Unchanged{Old,Here}(a, i+1, n); + assigns a[0..m-1]; + ensures heap: IsHeap(a, m); + ensures reorder: MultisetUnchanged{Old,Here}(a, m); + ensures unchanged: Unchanged{Old,Here}(a, m, i+1); + ensures unchanged: Unchanged{Old,Here}(a, i+1, n); */ push_heap(a, m); - //@ assert upper: UpperBound(a, 0, m, a[0]); - //@ assert lower: LowerBound(a, m, i+1, a[0]); + //@ assert upper: UpperBound(a, 0, m, a[0]); + //@ assert lower: LowerBound(a, m, i+1, a[0]); } //@ assert partition: Partition(a, m, n); /*@ - assigns a[0..m-1]; - ensures sorted: Sorted(a, m); - ensures reorder: MultisetUnchanged{Old,Here}(a, m); - ensures reorder: MultisetUnchanged{Old,Here}(a, m, n); + assigns a[0..m-1]; + ensures sorted: Sorted(a, m); + ensures reorder: MultisetUnchanged{Old,Here}(a, m); + ensures reorder: MultisetUnchanged{Old,Here}(a, m, n); */ sort_heap(a, m); - //@ assert partition: Partition(a, m, n); //@ assert reorder: MultisetUnchanged{Pre,Here}(a, n); + //@ assert partition: Partition(a, m, n); } } diff --git a/StandardAlgorithms/sorting/partial_sort/partial_sort.gif b/StandardAlgorithms/sorting/partial_sort/partial_sort.gif deleted file mode 100644 index f27ea13..0000000 Binary files a/StandardAlgorithms/sorting/partial_sort/partial_sort.gif and /dev/null differ diff --git a/StandardAlgorithms/sorting/partial_sort/partial_sort_push.gif b/StandardAlgorithms/sorting/partial_sort/partial_sort_push.gif deleted file mode 100644 index 4a04f53..0000000 Binary files a/StandardAlgorithms/sorting/partial_sort/partial_sort_push.gif and /dev/null differ diff --git a/StandardAlgorithms/sorting/selection_sort/Makefile b/StandardAlgorithms/sorting/selection_sort/Makefile index 1a38e6f..e64cc81 100644 --- a/StandardAlgorithms/sorting/selection_sort/Makefile +++ b/StandardAlgorithms/sorting/selection_sort/Makefile @@ -1,10 +1,6 @@ -CMD=\\selectionsort -SEC=sec:selection_sort -export WP_TIMEOUT=10 - -include ../../Makefile.template +include ../../example.mk #WP_FLAGS += -wp-prop="-@lemma" #WP_FLAGS += -wp-prop reorder @@ -13,6 +9,3 @@ include ../../Makefile.template #WP_FLAGS += -wp-prop "UpperBoundShift" #WP_FLAGS += -wp-prop "StrictUpperBoundShift" -TESTOBJ += -lmaxmin -lmutating - - diff --git a/StandardAlgorithms/sorting/selection_sort/depend.mk b/StandardAlgorithms/sorting/selection_sort/depend.mk new file mode 100644 index 0000000..170bb10 --- /dev/null +++ b/StandardAlgorithms/sorting/selection_sort/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += mutating/swap +DEPENDENCIES += maxmin/min_element + diff --git a/StandardAlgorithms/sorting/selection_sort/selection_sort.c b/StandardAlgorithms/sorting/selection_sort/selection_sort.c index dd41386..eaacde2 100644 --- a/StandardAlgorithms/sorting/selection_sort/selection_sort.c +++ b/StandardAlgorithms/sorting/selection_sort/selection_sort.c @@ -1,7 +1,7 @@ #include "selection_sort.h" -#include "../../maxmin/min_element/min_element.h" -#include "../../mutating/swap/swap.h" +#include "min_element.h" +#include "swap.h" #include "LowerBound.spec" #include "ShiftLemmas.spec" #include "SwapImpliesMultisetUnchanged.spec" diff --git a/StandardAlgorithms/sorting/selection_sort/selection_sort_test.cpp b/StandardAlgorithms/sorting/selection_sort/selection_sort_test.cpp index ae70a9d..f78005d 100644 --- a/StandardAlgorithms/sorting/selection_sort/selection_sort_test.cpp +++ b/StandardAlgorithms/sorting/selection_sort/selection_sort_test.cpp @@ -1,6 +1,6 @@ #include "selection_sort.h" -#include "../../maxmin/min_element/min_element.h" +#include "min_element.h" #include #include #include diff --git a/StandardAlgorithms/stack/stack_definition.h b/StandardAlgorithms/stack.h similarity index 55% rename from StandardAlgorithms/stack/stack_definition.h rename to StandardAlgorithms/stack.h index 4a6a55c..3bdd86a 100644 --- a/StandardAlgorithms/stack/stack_definition.h +++ b/StandardAlgorithms/stack.h @@ -1,6 +1,6 @@ -#ifndef STACK_DEFINITION_H_INCLUDED -#define STACK_DEFINITION_H_INCLUDED +#ifndef STACK_H_INCLUDED +#define STACK_H_INCLUDED #include "typedefs.h" @@ -15,5 +15,5 @@ struct Stack typedef struct Stack Stack; -#endif /* STACK_DEFINITION_H_INCLUDED */ +#endif /* STACK_H_INCLUDED */ diff --git a/StandardAlgorithms/stack/Makefile b/StandardAlgorithms/stack/Makefile index cc3cb03..e210c33 100644 --- a/StandardAlgorithms/stack/Makefile +++ b/StandardAlgorithms/stack/Makefile @@ -1,12 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libstack.a - -lib: libstack.a - -libstack.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/stack/stack.c b/StandardAlgorithms/stack/stack.c deleted file mode 100644 index 798e0cf..0000000 --- a/StandardAlgorithms/stack/stack.c +++ /dev/null @@ -1,5 +0,0 @@ - -//dummy file - -#include "stack.h" - diff --git a/StandardAlgorithms/stack/stack.h b/StandardAlgorithms/stack/stack.h deleted file mode 100644 index 660e417..0000000 --- a/StandardAlgorithms/stack/stack.h +++ /dev/null @@ -1,26 +0,0 @@ - -#ifndef STACK_H_INCLUDED -#define STACK_H_INCLUDED - -#include "stack/stack_definition.h" -#include "stack/stack_functions.h" - -#include "Unchanged.spec" -#include "StackCapacitySizeTop.spec" -#include "StackEmptyFull.spec" -#include "StackInvariant.spec" -#include "StackEqual.spec" -#include "StackEquivalence.spec" -#include "StackSeparated.spec" - -#include "stack/stack_equal/stack_equal.h" -#include "stack/stack_init/stack_init.h" -#include "stack/stack_size/stack_size.h" -#include "stack/stack_empty/stack_empty.h" -#include "stack/stack_full/stack_full.h" -#include "stack/stack_top/stack_top.h" -#include "stack/stack_pop/stack_pop.h" -#include "stack/stack_push/stack_push.h" - -#endif /* STACK_H_INCLUDED */ - diff --git a/StandardAlgorithms/stack/stack_definition.c b/StandardAlgorithms/stack/stack_definition.c deleted file mode 100644 index ebc7b6b..0000000 --- a/StandardAlgorithms/stack/stack_definition.c +++ /dev/null @@ -1,3 +0,0 @@ - -#include "stack_definition.h" - diff --git a/StandardAlgorithms/stack/stack_empty/Makefile b/StandardAlgorithms/stack/stack_empty/Makefile index 39ec3ed..8100c89 100644 --- a/StandardAlgorithms/stack/stack_empty/Makefile +++ b/StandardAlgorithms/stack/stack_empty/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackempty -SEC=sec:stackempty - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_empty/depend.mk b/StandardAlgorithms/stack/stack_empty/depend.mk new file mode 100644 index 0000000..1f4c812 --- /dev/null +++ b/StandardAlgorithms/stack/stack_empty/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_init +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack/stack_empty/stack_empty.c b/StandardAlgorithms/stack/stack_empty/stack_empty.c index 51e3d14..40b78b8 100644 --- a/StandardAlgorithms/stack/stack_empty/stack_empty.c +++ b/StandardAlgorithms/stack/stack_empty/stack_empty.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_empty.h" +#include "stack_size.h" bool stack_empty(const Stack* s) diff --git a/StandardAlgorithms/stack/stack_empty/stack_empty.h b/StandardAlgorithms/stack/stack_empty/stack_empty.h index 032e80c..c2bded6 100644 --- a/StandardAlgorithms/stack/stack_empty/stack_empty.h +++ b/StandardAlgorithms/stack/stack_empty/stack_empty.h @@ -2,7 +2,7 @@ #ifndef STACK_EMPTY_H_INCLUDED #define STACK_EMPTY_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_empty/stack_empty_test.cpp b/StandardAlgorithms/stack/stack_empty/stack_empty_test.cpp index a6f1d90..1669db1 100644 --- a/StandardAlgorithms/stack/stack_empty/stack_empty_test.cpp +++ b/StandardAlgorithms/stack/stack_empty/stack_empty_test.cpp @@ -3,17 +3,21 @@ #include #include -#include "stack/stack.h" +#include "stack_init.h" +#include "stack_empty.h" int main(int argc, char** argv) { std::stack a; value_type storage[8]; + Stack b; stack_init(&b, storage, 8); + assert(a.empty() == 1); assert(stack_empty(&b) == 1); std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_equal/Makefile b/StandardAlgorithms/stack/stack_equal/Makefile index c268478..8100c89 100644 --- a/StandardAlgorithms/stack/stack_equal/Makefile +++ b/StandardAlgorithms/stack/stack_equal/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackequal -SEC=sec:stack-runtime-equality - -include ../../Makefile.template - -TESTOBJ += -lnonmutating +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_equal/depend.mk b/StandardAlgorithms/stack/stack_equal/depend.mk new file mode 100644 index 0000000..a569495 --- /dev/null +++ b/StandardAlgorithms/stack/stack_equal/depend.mk @@ -0,0 +1,6 @@ + +DEPENDENCIES += nonmutating/equal +DEPENDENCIES += stack/stack_init + + + diff --git a/StandardAlgorithms/stack/stack_equal/stack_equal.c b/StandardAlgorithms/stack/stack_equal/stack_equal.c index 11bdf2b..e846f7b 100644 --- a/StandardAlgorithms/stack/stack_equal/stack_equal.c +++ b/StandardAlgorithms/stack/stack_equal/stack_equal.c @@ -1,6 +1,7 @@ -#include "stack/stack.h" -#include "../nonmutating/equal/equal.h" +#include "StackLogic.spec" +#include "stack_equal.h" +#include "equal.h" bool stack_equal(const Stack* s, const Stack* t) diff --git a/StandardAlgorithms/stack/stack_equal/stack_equal.h b/StandardAlgorithms/stack/stack_equal/stack_equal.h index 876ff73..0c5a8fa 100644 --- a/StandardAlgorithms/stack/stack_equal/stack_equal.h +++ b/StandardAlgorithms/stack/stack_equal/stack_equal.h @@ -2,7 +2,7 @@ #ifndef STACK_EQUAL_H_INCLUDED #define STACK_EQUAL_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_equal/stack_equal_test.cpp b/StandardAlgorithms/stack/stack_equal/stack_equal_test.cpp index 0956be9..9405389 100644 --- a/StandardAlgorithms/stack/stack_equal/stack_equal_test.cpp +++ b/StandardAlgorithms/stack/stack_equal/stack_equal_test.cpp @@ -1,28 +1,27 @@ - #include #include -#include "stack/stack.h" +#include "stack_equal.h" +#include "stack_init.h" int main(int argc, char** argv) { - value_type x[] = {14, 15, 3}; Stack a; - { - a.obj = x; - a.capacity = 3; - a.size = 2; - } - value_type y[] = {14, 15, -1}; + value_type x[] = {14, 15, 3}; + stack_init(&a, x, 3); + Stack b; - { - b.obj = y; - b.capacity = 3; - b.size = 2; - } + value_type y[] = {14, 15, -1}; + stack_init(&b, y, 3); + + a.size = 2; + b.size = 2; + assert(stack_equal(&a, &b)); std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } + diff --git a/StandardAlgorithms/stack/stack_full/Makefile b/StandardAlgorithms/stack/stack_full/Makefile index 5f33825..72490d9 100644 --- a/StandardAlgorithms/stack/stack_full/Makefile +++ b/StandardAlgorithms/stack/stack_full/Makefile @@ -1,10 +1,7 @@ -CMD=\\stackfull -SEC=sec:stackfull -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk clean:: $(RM) check_full + diff --git a/StandardAlgorithms/stack/stack_full/depend.mk b/StandardAlgorithms/stack/stack_full/depend.mk new file mode 100644 index 0000000..1f4c812 --- /dev/null +++ b/StandardAlgorithms/stack/stack_full/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_init +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack/stack_full/stack_full.c b/StandardAlgorithms/stack/stack_full/stack_full.c index e842c7c..b02a255 100644 --- a/StandardAlgorithms/stack/stack_full/stack_full.c +++ b/StandardAlgorithms/stack/stack_full/stack_full.c @@ -1,5 +1,7 @@ +#include "StackLogic.spec" #include "stack_full.h" +#include "stack_size.h" bool stack_full(const Stack* s) diff --git a/StandardAlgorithms/stack/stack_full/stack_full.h b/StandardAlgorithms/stack/stack_full/stack_full.h index e212945..5de32d8 100644 --- a/StandardAlgorithms/stack/stack_full/stack_full.h +++ b/StandardAlgorithms/stack/stack_full/stack_full.h @@ -2,7 +2,7 @@ #ifndef STACK_FULL_H_INCLUDED #define STACK_FULL_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_full/stack_full_test.cpp b/StandardAlgorithms/stack/stack_full/stack_full_test.cpp index 44cfcec..6d2e585 100644 --- a/StandardAlgorithms/stack/stack_full/stack_full_test.cpp +++ b/StandardAlgorithms/stack/stack_full/stack_full_test.cpp @@ -3,7 +3,8 @@ #include #include -#include "stack/stack.h" +#include "stack_full.h" +#include "stack_init.h" int main(int argc, char** argv) @@ -11,8 +12,10 @@ main(int argc, char** argv) Stack b; value_type storage[6]; stack_init(&b, storage, 6); + assert(stack_full(&b) == 0); std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_functions.c b/StandardAlgorithms/stack/stack_functions.c deleted file mode 100644 index 04d55ce..0000000 --- a/StandardAlgorithms/stack/stack_functions.c +++ /dev/null @@ -1,5 +0,0 @@ - -// dummy file - -#include "stack_functions.h" - diff --git a/StandardAlgorithms/stack/stack_functions.h b/StandardAlgorithms/stack/stack_functions.h index 42854be..1034eb9 100644 --- a/StandardAlgorithms/stack/stack_functions.h +++ b/StandardAlgorithms/stack/stack_functions.h @@ -2,7 +2,7 @@ #ifndef STACK_FUNCTIONS_H_INCLUDED #define STACK_FUNCTIONS_H_INCLUDED -#include "stack_definition.h" +#include "stack.h" void stack_init(Stack* s, value_type* a, size_type n); diff --git a/StandardAlgorithms/stack/stack_init/Makefile b/StandardAlgorithms/stack/stack_init/Makefile index 5d0c16a..8100c89 100644 --- a/StandardAlgorithms/stack/stack_init/Makefile +++ b/StandardAlgorithms/stack/stack_init/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackinit -SEC=sec:stackinit - -include ../../Makefile.template - -stackinit_test: -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_init/depend.mk b/StandardAlgorithms/stack/stack_init/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/stack/stack_init/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/stack/stack_init/stack_init.c b/StandardAlgorithms/stack/stack_init/stack_init.c index 9f809d9..ebc4621 100644 --- a/StandardAlgorithms/stack/stack_init/stack_init.c +++ b/StandardAlgorithms/stack/stack_init/stack_init.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_init.h" void stack_init(Stack* s, value_type* storage, size_type capacity) diff --git a/StandardAlgorithms/stack/stack_init/stack_init.h b/StandardAlgorithms/stack/stack_init/stack_init.h index 7c7944f..01c2a1f 100644 --- a/StandardAlgorithms/stack/stack_init/stack_init.h +++ b/StandardAlgorithms/stack/stack_init/stack_init.h @@ -2,7 +2,7 @@ #ifndef STACK_INIT_H_INCLUDED #define STACK_INIT_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s); diff --git a/StandardAlgorithms/stack/stack_init/stack_init_test.cpp b/StandardAlgorithms/stack/stack_init/stack_init_test.cpp index b56d6c9..b5c3a44 100644 --- a/StandardAlgorithms/stack/stack_init/stack_init_test.cpp +++ b/StandardAlgorithms/stack/stack_init/stack_init_test.cpp @@ -3,19 +3,23 @@ #include #include -#include "stack/stack.h" +#include "stack_init.h" int main(int argc, char** argv) { - std::stack a; - static value_type storage[8]; Stack b; + value_type storage[8]; stack_init(&b, storage, 8); + + std::stack a; + assert(a.size() == 0); assert(b.size == 0); assert(b.capacity == 8); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_pop/Makefile b/StandardAlgorithms/stack/stack_pop/Makefile index 5e34fb1..8100c89 100644 --- a/StandardAlgorithms/stack/stack_pop/Makefile +++ b/StandardAlgorithms/stack/stack_pop/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackpop -SEC=sec:stackpop - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_pop/depend.mk b/StandardAlgorithms/stack/stack_pop/depend.mk new file mode 100644 index 0000000..399985a --- /dev/null +++ b/StandardAlgorithms/stack/stack_pop/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += stack/stack_push +DEPENDENCIES += stack/stack_init +DEPENDENCIES += stack/stack_empty + diff --git a/StandardAlgorithms/stack/stack_pop/stack_pop.c b/StandardAlgorithms/stack/stack_pop/stack_pop.c index afbb64e..e3fc5b6 100644 --- a/StandardAlgorithms/stack/stack_pop/stack_pop.c +++ b/StandardAlgorithms/stack/stack_pop/stack_pop.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_pop.h" +#include "stack_empty.h" void stack_pop(Stack* s) diff --git a/StandardAlgorithms/stack/stack_pop/stack_pop.h b/StandardAlgorithms/stack/stack_pop/stack_pop.h index 4db01b4..b8a83b2 100644 --- a/StandardAlgorithms/stack/stack_pop/stack_pop.h +++ b/StandardAlgorithms/stack/stack_pop/stack_pop.h @@ -2,7 +2,7 @@ #ifndef STACK_POP_H_INCLUDED #define STACK_POP_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_pop/stack_pop_test.cpp b/StandardAlgorithms/stack/stack_pop/stack_pop_test.cpp index 1fa06e1..819d529 100644 --- a/StandardAlgorithms/stack/stack_pop/stack_pop_test.cpp +++ b/StandardAlgorithms/stack/stack_pop/stack_pop_test.cpp @@ -2,7 +2,10 @@ #include #include -#include "stack/stack.h" +#include "stack_pop.h" +#include "stack_init.h" +#include "stack_push.h" +#include "stack_empty.h" int main(int argc, char** argv) @@ -10,9 +13,11 @@ main(int argc, char** argv) Stack a; value_type storage[4]; stack_init(&a, storage, 4); + stack_push(&a, 14); stack_pop(&a); assert(stack_empty(&a)); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_push/Makefile b/StandardAlgorithms/stack/stack_push/Makefile index 9c0a6a8..8100c89 100644 --- a/StandardAlgorithms/stack/stack_push/Makefile +++ b/StandardAlgorithms/stack/stack_push/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackpush -SEC=sec:stackpush - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_push/depend.mk b/StandardAlgorithms/stack/stack_push/depend.mk new file mode 100644 index 0000000..b6d0ece --- /dev/null +++ b/StandardAlgorithms/stack/stack_push/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += stack/stack_init +DEPENDENCIES += stack/stack_empty +DEPENDENCIES += stack/stack_full + diff --git a/StandardAlgorithms/stack/stack_push/stack_push.c b/StandardAlgorithms/stack/stack_push/stack_push.c index 9cd76e8..99af9ca 100644 --- a/StandardAlgorithms/stack/stack_push/stack_push.c +++ b/StandardAlgorithms/stack/stack_push/stack_push.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_push.h" +#include "stack_full.h" void stack_push(Stack* s, value_type v) diff --git a/StandardAlgorithms/stack/stack_push/stack_push.h b/StandardAlgorithms/stack/stack_push/stack_push.h index 7ab0560..ad2323d 100644 --- a/StandardAlgorithms/stack/stack_push/stack_push.h +++ b/StandardAlgorithms/stack/stack_push/stack_push.h @@ -2,7 +2,7 @@ #ifndef STACK_PUSH_H_INCLUDED #define STACK_PUSH_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_push/stack_push_test.cpp b/StandardAlgorithms/stack/stack_push/stack_push_test.cpp index 3e4627a..fa99ed8 100644 --- a/StandardAlgorithms/stack/stack_push/stack_push_test.cpp +++ b/StandardAlgorithms/stack/stack_push/stack_push_test.cpp @@ -2,7 +2,9 @@ #include #include -#include "stack/stack.h" +#include "stack_push.h" +#include "stack_init.h" +#include "stack_empty.h" int main(int argc, char** argv) @@ -10,8 +12,10 @@ main(int argc, char** argv) Stack a; value_type storage[8]; stack_init(&a, storage, 8); + stack_push(&a, 14); assert(!stack_empty(&a)); + std::cout << "\tsuccessful execution of " << argv[0] << "\n"; return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_size/Makefile b/StandardAlgorithms/stack/stack_size/Makefile index 604a488..8100c89 100644 --- a/StandardAlgorithms/stack/stack_size/Makefile +++ b/StandardAlgorithms/stack/stack_size/Makefile @@ -1,8 +1,3 @@ -CMD=\\stacksize -SEC=sec:stacksize - -include ../../Makefile.template - -TESTOBJ: -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_size/depend.mk b/StandardAlgorithms/stack/stack_size/depend.mk new file mode 100644 index 0000000..767d81a --- /dev/null +++ b/StandardAlgorithms/stack/stack_size/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_init + diff --git a/StandardAlgorithms/stack/stack_size/stack_size.c b/StandardAlgorithms/stack/stack_size/stack_size.c index 972577d..370c338 100644 --- a/StandardAlgorithms/stack/stack_size/stack_size.c +++ b/StandardAlgorithms/stack/stack_size/stack_size.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_size.h" size_type stack_size(const Stack* s) diff --git a/StandardAlgorithms/stack/stack_size/stack_size.h b/StandardAlgorithms/stack/stack_size/stack_size.h index af48e22..2e5a7e7 100644 --- a/StandardAlgorithms/stack/stack_size/stack_size.h +++ b/StandardAlgorithms/stack/stack_size/stack_size.h @@ -2,7 +2,7 @@ #ifndef STACK_SIZE_H_INCLUDED #define STACK_SIZE_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_size/stack_size_test.cpp b/StandardAlgorithms/stack/stack_size/stack_size_test.cpp index 9e12a0d..02c85c2 100644 --- a/StandardAlgorithms/stack/stack_size/stack_size_test.cpp +++ b/StandardAlgorithms/stack/stack_size/stack_size_test.cpp @@ -3,23 +3,25 @@ #include #include -#include "stack/stack.h" +#include "stack_size.h" +#include "stack_init.h" int main(int argc, char** argv) { std::stack a; a.push(14); - value_type x[] = {13, 15}; + Stack b; - { - b.obj = x; - b.capacity = 2; - b.size = 1; - } + value_type x[] = {13, 15}; + stack_init(&b, x, 2); + + b.size = 1; + assert(a.size() == 1); assert(stack_size(&b) == 1); std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } diff --git a/StandardAlgorithms/stack/stack_top/Makefile b/StandardAlgorithms/stack/stack_top/Makefile index 10e139f..8100c89 100644 --- a/StandardAlgorithms/stack/stack_top/Makefile +++ b/StandardAlgorithms/stack/stack_top/Makefile @@ -1,8 +1,3 @@ -CMD=\\stacktop -SEC=sec:stacktop - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack/stack_top/depend.mk b/StandardAlgorithms/stack/stack_top/depend.mk new file mode 100644 index 0000000..5e50f70 --- /dev/null +++ b/StandardAlgorithms/stack/stack_top/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += stack/stack_empty +DEPENDENCIES += stack/stack_init + + diff --git a/StandardAlgorithms/stack/stack_top/stack_top.c b/StandardAlgorithms/stack/stack_top/stack_top.c index 4c1021d..2ca3e28 100644 --- a/StandardAlgorithms/stack/stack_top/stack_top.c +++ b/StandardAlgorithms/stack/stack_top/stack_top.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_top.h" +#include "stack_empty.h" value_type stack_top(const Stack* s) diff --git a/StandardAlgorithms/stack/stack_top/stack_top.h b/StandardAlgorithms/stack/stack_top/stack_top.h index 5233e09..9947890 100644 --- a/StandardAlgorithms/stack/stack_top/stack_top.h +++ b/StandardAlgorithms/stack/stack_top/stack_top.h @@ -2,7 +2,7 @@ #ifndef STACK_TOP_H_INCLUDED #define STACK_TOP_H_INCLUDED -#include "stack/stack.h" +#include "StackLogic.spec" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack/stack_top/stack_top_test.cpp b/StandardAlgorithms/stack/stack_top/stack_top_test.cpp index 76a1ace..b12d698 100644 --- a/StandardAlgorithms/stack/stack_top/stack_top_test.cpp +++ b/StandardAlgorithms/stack/stack_top/stack_top_test.cpp @@ -3,7 +3,8 @@ #include #include -#include "stack/stack.h" +#include "stack_top.h" +#include "stack_init.h" int main(int argc, char** argv) @@ -11,14 +12,16 @@ main(int argc, char** argv) std::stack a; a.push(14); a.push(15); - value_type y[] = {14, 15, -1}; + Stack b; - { - b.obj = y; - b.capacity = 3; - b.size = 2; - } + value_type y[] = {14, 15, -1}; + stack_init(&b, y, 3); + + b.size = 2; + assert(a.top() == stack_top(&b)); std::cout << "\tsuccessful execution of " << argv[0] << "\n"; + return EXIT_SUCCESS; } + diff --git a/StandardAlgorithms/stack_axiom/Makefile b/StandardAlgorithms/stack_axiom/Makefile index 43872cf..e210c33 100644 --- a/StandardAlgorithms/stack_axiom/Makefile +++ b/StandardAlgorithms/stack_axiom/Makefile @@ -1,10 +1,3 @@ -include ../Makefile.group -OBJ := +include ../group.mk -clean:: FORCE - : - -# no library here -lib: - : diff --git a/StandardAlgorithms/stack_axiom/axiom_pop_of_push/Makefile b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/Makefile index 4535a10..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_pop_of_push/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiompopofpush -SEC=sec:axiompopofpush - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_pop_of_push/axiom_pop_of_push.c b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/axiom_pop_of_push.c index 96bf2ee..f182f89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_pop_of_push/axiom_pop_of_push.c +++ b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/axiom_pop_of_push.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_pop.h" +#include "stack_push.h" /*@ requires valid: \valid(s) && Invariant(s); @@ -8,7 +10,7 @@ assigns s->size; assigns s->obj[s->size]; - ensures equal: Equal{Pre,Here}(s, s); + ensures equal: Equal{Old,Here}(s, s); */ void axiom_pop_of_push(Stack* s, value_type v) diff --git a/StandardAlgorithms/stack_axiom/axiom_pop_of_push/depend.mk b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/depend.mk new file mode 100644 index 0000000..91b9f32 --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_pop_of_push/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_pop +DEPENDENCIES += stack/stack_push + diff --git a/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/Makefile b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/Makefile index 89646e4..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiompushofpoptop -SEC=sec:axiompushofpoptop - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/axiom_push_of_pop_top.c b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/axiom_push_of_pop_top.c index 7658e4e..42b0394 100644 --- a/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/axiom_push_of_pop_top.c +++ b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/axiom_push_of_pop_top.c @@ -1,5 +1,8 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_pop.h" +#include "stack_push.h" +#include "stack_top.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/depend.mk b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/depend.mk new file mode 100644 index 0000000..001e0ae --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_push_of_pop_top/depend.mk @@ -0,0 +1,5 @@ + +DEPENDENCIES += stack/stack_pop +DEPENDENCIES += stack/stack_push +DEPENDENCIES += stack/stack_top + diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_init/Makefile b/StandardAlgorithms/stack_axiom/axiom_size_of_init/Makefile index 482e6b4..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_init/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_init/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiomsizeofinit -SEC=sec:axiomsizeofinit - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_init/axiom_size_of_init.c b/StandardAlgorithms/stack_axiom/axiom_size_of_init/axiom_size_of_init.c index c0281b2..133a692 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_init/axiom_size_of_init.c +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_init/axiom_size_of_init.c @@ -1,11 +1,13 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_init.h" +#include "stack_size.h" /*@ requires valid: \valid(s); requires size: 0 < n; requires valid: \valid(a + (0..n-1)); - requires separated: \separated(s, a + (0..n-1)); + requires sep: \separated(s, a + (0..n-1)); assigns s->obj, s->capacity, s->size; diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_init/depend.mk b/StandardAlgorithms/stack_axiom/axiom_size_of_init/depend.mk new file mode 100644 index 0000000..1f4c812 --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_init/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_init +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_pop/Makefile b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/Makefile index 14ab79f..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_pop/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiomsizeofpop -SEC=sec:axiomsizeofpop - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_pop/axiom_size_of_pop.c b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/axiom_size_of_pop.c index b7531ec..31009ed 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_pop/axiom_size_of_pop.c +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/axiom_size_of_pop.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_pop.h" +#include "stack_size.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_pop/depend.mk b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/depend.mk new file mode 100644 index 0000000..47efd4a --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_pop/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_pop +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_push/Makefile b/StandardAlgorithms/stack_axiom/axiom_size_of_push/Makefile index 26d42fb..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_push/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_push/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiomsizeofpush -SEC=sec:axiomsizeofpush - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_push/axiom_size_of_push.c b/StandardAlgorithms/stack_axiom/axiom_size_of_push/axiom_size_of_push.c index 3cee595..be5e3e6 100644 --- a/StandardAlgorithms/stack_axiom/axiom_size_of_push/axiom_size_of_push.c +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_push/axiom_size_of_push.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_push.h" +#include "stack_size.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_axiom/axiom_size_of_push/depend.mk b/StandardAlgorithms/stack_axiom/axiom_size_of_push/depend.mk new file mode 100644 index 0000000..48bf8ff --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_size_of_push/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_push +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack_axiom/axiom_top_of_push/Makefile b/StandardAlgorithms/stack_axiom/axiom_top_of_push/Makefile index a61f173..8100c89 100644 --- a/StandardAlgorithms/stack_axiom/axiom_top_of_push/Makefile +++ b/StandardAlgorithms/stack_axiom/axiom_top_of_push/Makefile @@ -1,8 +1,3 @@ -CMD=\\axiomtopofpush -SEC=sec:axiomtopofpush - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_axiom/axiom_top_of_push/axiom_top_of_push.c b/StandardAlgorithms/stack_axiom/axiom_top_of_push/axiom_top_of_push.c index c25ccb7..6c65750 100644 --- a/StandardAlgorithms/stack_axiom/axiom_top_of_push/axiom_top_of_push.c +++ b/StandardAlgorithms/stack_axiom/axiom_top_of_push/axiom_top_of_push.c @@ -1,5 +1,7 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_push.h" +#include "stack_top.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_axiom/axiom_top_of_push/depend.mk b/StandardAlgorithms/stack_axiom/axiom_top_of_push/depend.mk new file mode 100644 index 0000000..6fc7217 --- /dev/null +++ b/StandardAlgorithms/stack_axiom/axiom_top_of_push/depend.mk @@ -0,0 +1,4 @@ + +DEPENDENCIES += stack/stack_top +DEPENDENCIES += stack/stack_push + diff --git a/StandardAlgorithms/stack_wd/Makefile b/StandardAlgorithms/stack_wd/Makefile index d1a9a4b..e210c33 100644 --- a/StandardAlgorithms/stack_wd/Makefile +++ b/StandardAlgorithms/stack_wd/Makefile @@ -1,10 +1,3 @@ -include ../Makefile.group -clean:: FORCE - $(RM) libstack_wd.a +include ../group.mk -lib: libstack_wd.a - -libstack_wd.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ diff --git a/StandardAlgorithms/stack_wd/stack_empty_wd/Makefile b/StandardAlgorithms/stack_wd/stack_empty_wd/Makefile index 2926781..8100c89 100644 --- a/StandardAlgorithms/stack_wd/stack_empty_wd/Makefile +++ b/StandardAlgorithms/stack_wd/stack_empty_wd/Makefile @@ -1,9 +1,3 @@ -CMD=\\stackemptywd -SEC=sec:stackemptywd - -include ../../Makefile.template - -TESTOBJ += -lstack - +include ../../example.mk diff --git a/StandardAlgorithms/stack_wd/stack_empty_wd/depend.mk b/StandardAlgorithms/stack_wd/stack_empty_wd/depend.mk new file mode 100644 index 0000000..0845713 --- /dev/null +++ b/StandardAlgorithms/stack_wd/stack_empty_wd/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_empty + diff --git a/StandardAlgorithms/stack_wd/stack_empty_wd/stack_empty_wd.c b/StandardAlgorithms/stack_wd/stack_empty_wd/stack_empty_wd.c index c764596..de616bb 100644 --- a/StandardAlgorithms/stack_wd/stack_empty_wd/stack_empty_wd.c +++ b/StandardAlgorithms/stack_wd/stack_empty_wd/stack_empty_wd.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_empty.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_wd/stack_pop_wd/Makefile b/StandardAlgorithms/stack_wd/stack_pop_wd/Makefile index c352b9b..8100c89 100644 --- a/StandardAlgorithms/stack_wd/stack_pop_wd/Makefile +++ b/StandardAlgorithms/stack_wd/stack_pop_wd/Makefile @@ -1,8 +1,3 @@ -CMD=\\stackpopwd -SEC=sec:stackpopwd - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_wd/stack_pop_wd/depend.mk b/StandardAlgorithms/stack_wd/stack_pop_wd/depend.mk new file mode 100644 index 0000000..e3b0785 --- /dev/null +++ b/StandardAlgorithms/stack_wd/stack_pop_wd/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_pop + diff --git a/StandardAlgorithms/stack_wd/stack_pop_wd/stack_pop_wd.c b/StandardAlgorithms/stack_wd/stack_pop_wd/stack_pop_wd.c index 0e922c4..317c558 100644 --- a/StandardAlgorithms/stack_wd/stack_pop_wd/stack_pop_wd.c +++ b/StandardAlgorithms/stack_wd/stack_pop_wd/stack_pop_wd.c @@ -1,11 +1,12 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_pop.h" /*@ requires valid: \valid(s) && Invariant(s); requires valid: \valid(t) && Invariant(t); requires equal: Equal{Here,Here}(s, t); - requires separated: Separated(s, t); + requires sep: Separated(s, t); assigns s->size; assigns t->size; diff --git a/StandardAlgorithms/stack_wd/stack_push_wd/Makefile b/StandardAlgorithms/stack_wd/stack_push_wd/Makefile index c745004..8100c89 100644 --- a/StandardAlgorithms/stack_wd/stack_push_wd/Makefile +++ b/StandardAlgorithms/stack_wd/stack_push_wd/Makefile @@ -1,11 +1,3 @@ -CMD=\\stackpushwd -SEC=sec:stackpushwd +include ../../example.mk -include ../../Makefile.template - -TESTOBJ += -lstack - -#WP_FLAGS += -wp-prop equal -#WP_FLAGS += -wp-prop top -#WP_FLAGS += -wp-prop size diff --git a/StandardAlgorithms/stack_wd/stack_push_wd/depend.mk b/StandardAlgorithms/stack_wd/stack_push_wd/depend.mk new file mode 100644 index 0000000..330f4b8 --- /dev/null +++ b/StandardAlgorithms/stack_wd/stack_push_wd/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_push + diff --git a/StandardAlgorithms/stack_wd/stack_push_wd/stack_push_wd.c b/StandardAlgorithms/stack_wd/stack_push_wd/stack_push_wd.c index c0816b8..4ffa8ec 100644 --- a/StandardAlgorithms/stack_wd/stack_push_wd/stack_push_wd.c +++ b/StandardAlgorithms/stack_wd/stack_push_wd/stack_push_wd.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_push.h" #include "StackPushEqual.spec" /*@ @@ -7,7 +8,7 @@ requires valid: \valid(t) && Invariant(t); requires equal: Equal{Here,Here}(s, t); requires not_full: !Full(s) && !Full(t); - requires separated: Separated(s, t); + requires sep: Separated(s, t); assigns s->size, s->obj[s->size]; assigns t->size, t->obj[t->size]; diff --git a/StandardAlgorithms/stack_wd/stack_size_wd/Makefile b/StandardAlgorithms/stack_wd/stack_size_wd/Makefile index 968a0d0..8100c89 100644 --- a/StandardAlgorithms/stack_wd/stack_size_wd/Makefile +++ b/StandardAlgorithms/stack_wd/stack_size_wd/Makefile @@ -1,8 +1,3 @@ -CMD=\\stacksizewd -SEC=sec:stacksizewd - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_wd/stack_size_wd/depend.mk b/StandardAlgorithms/stack_wd/stack_size_wd/depend.mk new file mode 100644 index 0000000..3cb6330 --- /dev/null +++ b/StandardAlgorithms/stack_wd/stack_size_wd/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_size + diff --git a/StandardAlgorithms/stack_wd/stack_size_wd/stack_size_wd.c b/StandardAlgorithms/stack_wd/stack_size_wd/stack_size_wd.c index 2757bf0..88a55ea 100644 --- a/StandardAlgorithms/stack_wd/stack_size_wd/stack_size_wd.c +++ b/StandardAlgorithms/stack_wd/stack_size_wd/stack_size_wd.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_size.h" /*@ requires valid: \valid(s) && Invariant(s); diff --git a/StandardAlgorithms/stack_wd/stack_top_wd/Makefile b/StandardAlgorithms/stack_wd/stack_top_wd/Makefile index 222d602..8100c89 100644 --- a/StandardAlgorithms/stack_wd/stack_top_wd/Makefile +++ b/StandardAlgorithms/stack_wd/stack_top_wd/Makefile @@ -1,8 +1,3 @@ -CMD=\\stacktopwd -SEC=sec:stacktopwd - -include ../../Makefile.template - -TESTOBJ += -lstack +include ../../example.mk diff --git a/StandardAlgorithms/stack_wd/stack_top_wd/depend.mk b/StandardAlgorithms/stack_wd/stack_top_wd/depend.mk new file mode 100644 index 0000000..c11d234 --- /dev/null +++ b/StandardAlgorithms/stack_wd/stack_top_wd/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += stack/stack_top + diff --git a/StandardAlgorithms/stack_wd/stack_top_wd/stack_top_wd.c b/StandardAlgorithms/stack_wd/stack_top_wd/stack_top_wd.c index e3f3d18..64dfc70 100644 --- a/StandardAlgorithms/stack_wd/stack_top_wd/stack_top_wd.c +++ b/StandardAlgorithms/stack_wd/stack_top_wd/stack_top_wd.c @@ -1,5 +1,6 @@ -#include "stack/stack.h" +#include "StackLogic.spec" +#include "stack_top.h" /*@ requires valid: \valid(s) && Invariant(s) && !Empty(s); diff --git a/StandardAlgorithms/typedefs.h b/StandardAlgorithms/typedefs.h index a385b19..f938412 100644 --- a/StandardAlgorithms/typedefs.h +++ b/StandardAlgorithms/typedefs.h @@ -1,3 +1,4 @@ + #ifndef TYPEDEFS_H_INCLUDED #define TYPEDEFS_H_INCLUDED diff --git a/StandardAlgorithms/unique/Makefile b/StandardAlgorithms/unique/Makefile index 47f27be..e210c33 100644 --- a/StandardAlgorithms/unique/Makefile +++ b/StandardAlgorithms/unique/Makefile @@ -1,12 +1,3 @@ -include ../Makefile.group - -clean:: FORCE - $(RM) libunique.a - -lib: libunique.a - -libunique.a: obj $(OBJ) - @ar cr $@ $(OBJ) - @ranlib $@ +include ../group.mk diff --git a/StandardAlgorithms/unique/unique_copy/Makefile b/StandardAlgorithms/unique/unique_copy/Makefile index cdeaf3c..4926c89 100644 --- a/StandardAlgorithms/unique/unique_copy/Makefile +++ b/StandardAlgorithms/unique/unique_copy/Makefile @@ -1,9 +1,7 @@ -CMD=\\uniquecopy -SEC=sec:uniquecopy TEST_DATA=../unique_copy_tests/test-data-compare.txt -include ../../Makefile.template +include ../../example.mk CPPFLAGS += -I../unique_copy_tests #WP_FLAGS += -wp-prop bound diff --git a/StandardAlgorithms/unique/unique_copy2/Makefile b/StandardAlgorithms/unique/unique_copy2/Makefile index fbca388..3f22f68 100644 --- a/StandardAlgorithms/unique/unique_copy2/Makefile +++ b/StandardAlgorithms/unique/unique_copy2/Makefile @@ -3,7 +3,7 @@ CMD=\\uniquecopytwo SEC=sec:uniquecopy2 TEST_DATA=../unique_copy_tests/test-data-compare.txt -include ../../Makefile.template +include ../../example.mk CPPFLAGS += -I../unique_copy_tests report: unique_copy2.normal.c unique_copy2.normal-rte.c @@ -13,4 +13,3 @@ preport: unique_copy2.normal.c unique_copy2.normal-rte.c #WP_FLAGS += -wp-prop @assert #WP_FLAGS += -wp-prop @lemma - diff --git a/StandardAlgorithms/unique/unique_copy2/depend.mk b/StandardAlgorithms/unique/unique_copy2/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/unique/unique_copy2/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/unique/unique_copy2/unique_copy2.h b/StandardAlgorithms/unique/unique_copy2/unique_copy2.h index a9b3cc7..940370a 100644 --- a/StandardAlgorithms/unique/unique_copy2/unique_copy2.h +++ b/StandardAlgorithms/unique/unique_copy2/unique_copy2.h @@ -13,6 +13,8 @@ ensures result: 0 <= \result <= n; ensures unchanged: Unchanged{Old, Here}(b, \result, n); + ensures unchanged: Unchanged{Old, Here}(a, n); + */ size_type unique_copy2(const value_type* a, size_type n, value_type* b); diff --git a/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal-rte.c b/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal-rte.c index af98244..cfae7f8 100644 --- a/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal-rte.c +++ b/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal-rte.c @@ -3,6 +3,7 @@ requires sep: \separated(a + (0 .. n - 1), b + (0 .. n - 1)); ensures result: 0 <= \result <= \old(n); ensures unchanged: Unchanged{Old, Here}(\old(b), \result, \old(n)); + ensures unchanged: Unchanged{Old, Here}(\old(a), \old(n)); assigns *(b + (0 .. n - 1)); */ size_type diff --git a/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal.c b/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal.c index d2de691..ae2521f 100644 --- a/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal.c +++ b/StandardAlgorithms/unique/unique_copy2/unique_copy2.normal.c @@ -3,6 +3,7 @@ requires sep: \separated(a + (0 .. n - 1), b + (0 .. n - 1)); ensures result: 0 <= \result <= \old(n); ensures unchanged: Unchanged{Old, Here}(\old(b), \result, \old(n)); + ensures unchanged: Unchanged{Old, Here}(\old(a), \old(n)); assigns *(b + (0 .. n - 1)); */ size_type diff --git a/StandardAlgorithms/unique/unique_copy3/Makefile b/StandardAlgorithms/unique/unique_copy3/Makefile index e064097..8a6a9bc 100644 --- a/StandardAlgorithms/unique/unique_copy3/Makefile +++ b/StandardAlgorithms/unique/unique_copy3/Makefile @@ -3,7 +3,7 @@ CMD=\\uniquecopythree SEC=sec:uniquecopy3 TEST_DATA=../unique_copy_tests/test-data-compare.txt -include ../../Makefile.template +include ../../example.mk CPPFLAGS += -I../unique_copy_tests #WP_FLAGS += -wp-prop unique diff --git a/StandardAlgorithms/unique/unique_copy3/depend.mk b/StandardAlgorithms/unique/unique_copy3/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/unique/unique_copy3/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/unique/unique_copy3/unique_copy3.c b/StandardAlgorithms/unique/unique_copy3/unique_copy3.c index 2e3e263..13ea0b1 100644 --- a/StandardAlgorithms/unique/unique_copy3/unique_copy3.c +++ b/StandardAlgorithms/unique/unique_copy3/unique_copy3.c @@ -12,7 +12,7 @@ unique_copy3(const value_type* a, size_type n, value_type* b) /*@ loop invariant bound: 0 <= k < i <= n; - loop invariant unique: !HasEqualNeighbors(b, k+1); + loop invariant solitary: !HasEqualNeighbors(b, k+1); loop invariant unchanged: Unchanged{Pre, Here}(b, k+1, n); loop assigns i, k, b[0..n-1]; loop variant n-i; diff --git a/StandardAlgorithms/unique/unique_copy3/unique_copy3.h b/StandardAlgorithms/unique/unique_copy3/unique_copy3.h index 5cccd53..29d6aba 100644 --- a/StandardAlgorithms/unique/unique_copy3/unique_copy3.h +++ b/StandardAlgorithms/unique/unique_copy3/unique_copy3.h @@ -13,8 +13,9 @@ assigns b[0..n-1]; ensures result: 0 <= \result <= n; - ensures unique: !HasEqualNeighbors (b, \result); + ensures solitary: !HasEqualNeighbors (b, \result); ensures unchanged: Unchanged{Old, Here}(b, \result, n); + ensures unchanged: Unchanged{Old, Here}(a, n); */ size_type unique_copy3(const value_type* a, size_type n, value_type* b); diff --git a/StandardAlgorithms/unique/unique_copy4/Makefile b/StandardAlgorithms/unique/unique_copy4/Makefile index ac9aba7..dbadaf6 100644 --- a/StandardAlgorithms/unique/unique_copy4/Makefile +++ b/StandardAlgorithms/unique/unique_copy4/Makefile @@ -3,11 +3,11 @@ CMD=\\uniquecopyfour SEC=sec:uniquecopy4 TEST_DATA=../unique_copy_tests/test-data-compare.txt -export WP_TIMEOUT=15 -include ../../Makefile.template +include ../../example.mk CPPFLAGS += -I../unique_copy_tests +#WP_FLAGS += -wp-split #WP_FLAGS += -wp-prop UniquePreserve #WP_FLAGS += -wp-prop unique #WP_FLAGS += -wp-prop @assert @@ -15,6 +15,6 @@ CPPFLAGS += -I../unique_copy_tests #WP_FLAGS += -wp-prop bound #WP_FLAGS += -wp-prop size #WP_FLAGS += -wp-prop unchanged -#WP_FLAGS += -wp-prop copy +#WP_FLAGS += -wp-prop mapping #WP_FLAGS += -wp-prop="-@lemma" diff --git a/StandardAlgorithms/unique/unique_copy4/depend.mk b/StandardAlgorithms/unique/unique_copy4/depend.mk new file mode 100644 index 0000000..7700c02 --- /dev/null +++ b/StandardAlgorithms/unique/unique_copy4/depend.mk @@ -0,0 +1,3 @@ + +DEPENDENCIES += + diff --git a/StandardAlgorithms/unique/unique_copy4/unique_copy4.c b/StandardAlgorithms/unique/unique_copy4/unique_copy4.c index 16d7423..041b264 100644 --- a/StandardAlgorithms/unique/unique_copy4/unique_copy4.c +++ b/StandardAlgorithms/unique/unique_copy4/unique_copy4.c @@ -20,6 +20,7 @@ unique_copy4(const value_type* a, size_type n, value_type* b) loop invariant mapping: UniquePartition(a, n, k) < i; loop invariant mapping: i <= UniquePartition(a, n, k+1); loop invariant unique: Unique(a, i, b); + loop invariant unchanged: Unchanged{Pre, Here}(a, n); loop invariant unchanged: Unchanged{Pre, Here}(b, k+1, n); loop assigns i, k, b[0..n-1]; loop variant n-i; @@ -38,6 +39,9 @@ unique_copy4(const value_type* a, size_type n, value_type* b) //@ assert size: k == UniqueSize(a, i); //@ assert unique: Unique(a, i, b); } + + //@ assert mapping: i <= UniquePartition(a, n, k+1); + //@ assert unchanged: Unchanged{Pre, Here}(b, k+1, n); } return ++k; diff --git a/StandardAlgorithms/unique/unique_copy4/unique_copy4.h b/StandardAlgorithms/unique/unique_copy4/unique_copy4.h index f8e9a51..2dc6f51 100644 --- a/StandardAlgorithms/unique/unique_copy4/unique_copy4.h +++ b/StandardAlgorithms/unique/unique_copy4/unique_copy4.h @@ -16,6 +16,7 @@ ensures bound: 0 <= \result <= n; ensures size: \result == UniqueSize(a, n); ensures unique: Unique(a, n, b); + ensures solitary: !HasEqualNeighbors (b, \result); ensures unchanged: Unchanged{Old, Here}(a, n); ensures unchanged: Unchanged{Old, Here}(b, \result, n); */ diff --git a/StandardAlgorithms/unique/unique_copy_tests/unique_copy_signature.h b/StandardAlgorithms/unique/unique_copy_tests/unique_copy_signature.h index 898455a..934f9f1 100644 --- a/StandardAlgorithms/unique/unique_copy_tests/unique_copy_signature.h +++ b/StandardAlgorithms/unique/unique_copy_tests/unique_copy_signature.h @@ -2,7 +2,7 @@ #ifndef UNIQUE_COPY_SIGNATURE_TEST_H_INCLUDED #define UNIQUE_COPY_SIGNATURE_TEST_H_INCLUDED -#include "../../typedefs.h" +#include "typedefs.h" #ifdef UNIQUE_COPY_GENERIC @@ -20,7 +20,7 @@ size_t unique_copy(const T* a, size_t n, T* b) extern size_type unique_copy(const value_type* a, size_type n, value_type* b); -#endif /*UNIQUE_COPY_SIGNATURE_TEST_H_INCLUDED */ +#endif /* UNIQUE_COPY_GENERIC */ -#endif /*UNIQUE_COPY_SIGNATURE_TEST_H_INCLUDED */ +#endif /* UNIQUE_COPY_SIGNATURE_TEST_H_INCLUDED */ diff --git a/StandardAlgorithms/wp0.script b/StandardAlgorithms/wp0.script index 15f5970..eb4f9cb 100644 --- a/StandardAlgorithms/wp0.script +++ b/StandardAlgorithms/wp0.script @@ -1,5 +1,95 @@ (* Generated by Frama-C WP *) +Goal typed_ref_external_axiom_size_of_init_ensures_size. +Hint axiom_size_of_init,default,property,size. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_copy_backward_loop_invariant_bound_preserved. +Hint bound,copy_backward,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_copy_loop_invariant_bound_preserved. +Hint bound,copy,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_count2_loop_invariant_bound_preserved. +Hint bound,count2,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_count_loop_invariant_bound_preserved. +Hint bound,count,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_fill_loop_invariant_bound_preserved. +Hint bound,fill,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_find2_loop_invariant_bound_preserved. +Hint bound,find2,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_find_end_loop_variant_positive. +Hint find_end,positive. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_find_first_of_loop_invariant_bound_preserved. +Hint bound,find_first_of,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_find_loop_invariant_preserved. +Hint find,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_heap_parent_ensures_parent. +Hint default,heap_parent,parent,property. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_inner_product_loop_invariant_index_preserved. +Hint index,inner_product,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_insertion_sort_requires_sorted. +Hint default,insertion_sort,property,sorted. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_iota_loop_invariant_bound_preserved. +Hint bound,iota,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_is_heap_loop_invariant_parent_established. +Hint established,is_heap,parent. +Proof. + auto with zarith. +Qed. + Goal typed_ref_external_lemma_AccumulateRead. Hint AccumulateRead,property. Proof. @@ -218,22 +308,11 @@ Proof. intros v n M a. intros. subst x. - apply natlike_rec2 with (z := n); auto with zarith. - { - (* base step *) - rewrite <- Q_CountEmpty; auto with zarith. - } - { - (* induction step *) - intros. - replace (Z.succ z) with (1 + z) by lia. - assert (X: M.[ shift a z] = v \/ M.[ shift a z] <> v) by tauto. - - elim X; intros. - - rewrite Q_CountHit; auto with zarith. - - rewrite <- Q_CountMiss; auto with zarith. - } - + unfold L_Count_2_. + split. + - replace (L_Count_1_ M a 0 n v) with (0 + L_Count_1_ M a 0 n v)%Z by lia. + apply Q_CountSectionBounds; auto with zarith. + - apply Q_CountSectionBounds; auto with zarith. Qed. Goal typed_ref_external_lemma_CountCount2Relation. @@ -254,7 +333,7 @@ Proof. apply Q_Nil; auto with zarith. + intros z Z Step. replace (Z.pred z) with (z - 1)%Z in * by lia. - assert (L.[shift_sint32 a (z - 1)] <> v \/ L.[shift_sint32 a (z - 1)] = v) by tauto. + assert (L.[shift a (z - 1)] <> v \/ L.[shift a (z - 1)] = v) by tauto. destruct H as [Ne|Eq]. - assert (Miss: L_Count_2_ L a (z - 1) v = L_Count_2_ L a z v) by (apply A_CountAxiomatic.Q_CountSectionMiss; auto with zarith). @@ -267,6 +346,15 @@ Proof. apply Q_Hit; auto with zarith. Qed. +Goal typed_ref_external_lemma_CountMonotonic. +Hint CountMonotonic,property. +Proof. + (* This proof should be easy for the automatic provers, + but apparently why3:alt_ergo has problems. *) + intros. + apply Q_CountSectionMonotonic; auto with zarith. +Qed. + Goal typed_ref_external_lemma_CountSectionBounds. Hint CountSectionBounds,property. Proof. @@ -1528,4 +1616,97 @@ split. apply H with (i := n + i); auto with zarith. Qed. +Goal typed_ref_external_max_element_loop_invariant_bound_preserved. +Hint bound,max_element,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_maximum_heap_child_assert_rte_unsigned_overflow_5. +Hint maximum_heap_child,property,rte,unsigned_overflow. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_mismatch_loop_invariant_bound_preserved. +Hint bound,mismatch,preserved. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_pop_heap_call_maximum_heap_child_2_requires_bound_2. +Hint pop_heap,precond-maximum_heap_child. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_pop_heap_loop_variant_positive. +Hint pop_heap,positive. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_random_number_assert_rte_unsigned_downcast. +Hint property,random_number,rte,unsigned_downcast. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_replace_copy_loop_invariant_bounds_preserved. +Hint bounds,preserved,replace_copy. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_replace_loop_invariant_bounds_preserved. +Hint bounds,preserved,replace. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_reverse_assert_rte_unsigned_overflow. +Hint property,reverse,rte,unsigned_overflow. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_reverse_copy_assert_rte_unsigned_overflow. +Hint property,reverse_copy,rte,unsigned_overflow. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_search_n_no_match_ensures_result_part1. +Hint no_match,part-0,property,result,search_n. +Proof. + intros. + subst x x_1 x_2 x_3. + assert(i < i_2)%Z by auto with zarith. + assert(i <> i_2)%Z by auto with zarith. +Qed. + +Goal typed_ref_external_sort_heap_call_pop_heap_requires_bounds. +Hint precond-pop_heap,sort_heap. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_sort_heap_ensures_reorder. +Hint default,property,reorder,sort_heap. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_stack_size_ensures_size. +Hint default,property,size,stack_size. +Proof. + auto with zarith. +Qed. + +Goal typed_ref_external_stack_top_ensures_top. +Hint default,property,stack_top,top. +Proof. + auto with zarith. +Qed. +