Skip to content

Commit

Permalink
release version 19.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jensgerlach committed Jun 26, 2019
1 parent 9be751d commit d8b88b3
Show file tree
Hide file tree
Showing 777 changed files with 7,661 additions and 4,115 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Expand Up @@ -5,18 +5,18 @@ dist: xenial
addons:
apt:
packages:
- astyle
- aspcud
- libgnomecanvas2-dev
- libgtk2.0-dev
- libgtksourceview2.0-dev
- cvc3
- z3
- coq

cache:
directories:
- $HOME/bin
- $HOME/.opam
- /usr/local/bin

env:
global:
Expand All @@ -25,24 +25,27 @@ env:

before_install:
- sudo apt-get update -qq
- sudo wget --no-clobber http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/cvc4-1.6-x86_64-linux-opt -O /usr/local/bin/cvc4 || true
- sudo chmod +x /usr/local/bin/cvc4
- sudo wget --no-clobber https://github.com/ocaml/opam/releases/download/2.0.4/opam-2.0.4-x86_64-linux -O /usr/local/bin/opam || true
- sudo chmod +x /usr/local/bin/opam
- which cvc4 || (
wget --no-clobber http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/cvc4-1.6-x86_64-linux-opt -O $HOME/bin/cvc4 &&
chmod +x $HOME/bin/cvc4
)
- which opam || (
wget --no-clobber https://github.com/ocaml/opam/releases/download/2.0.4/opam-2.0.4-x86_64-linux -O $HOME/bin/opam &&
chmod +x $HOME/bin/opam
)
- opam init --auto-setup --disable-sandboxing --compiler=4.06.1
- opam install --yes depext

install:
- which eprover || ( wget https://github.com/eprover/eprover/archive/E-2.3.tar.gz && tar xf E-2.3.tar.gz && cd eprover-E-2.3 && ./configure --prefix=/usr/local && make -j2 && sudo make install )
- which eprover || ( wget https://github.com/eprover/eprover/archive/E-2.3.tar.gz && tar xf E-2.3.tar.gz && cd eprover-E-2.3 && ./configure --prefix=$HOME && make -j2 && sudo make install )
- opam update
- opam upgrade --yes
- opam depext --yes --noninteractive --install frama-c why3.0.88.3 alt-ergo
- opam pin add why3 0.88.3
- opam depext --yes --noninteractive --install frama-c alt-ergo-free why3
- eval $(opam config env); why3 config --detect

script:
- make -C StandardAlgorithms clean
- make -C StandardAlgorithms report-clean
- make -C StandardAlgorithms test
- eval $(opam config env); export FRAMAC_SHARE=$(frama-c -print-share-path); make -C StandardAlgorithms report
- eval $(opam config env); make -C StandardAlgorithms report
- git diff
Binary file modified ACSL-by-Example.pdf
Binary file not shown.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -14,17 +14,17 @@ 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 18.0 (_Argon_) and relies on the following other sofware packages.
Frama-C 19.0 and relies among others on the following sofware packages.

*Package* | *Version*
--------- | ---------
Why3 | 0.88.3
Alt-Ergo | 2.2.0
Why3 | 1.2.0
Alt-Ergo | 2.0.0
CVC4 | 1.6
CVC3 | 2.4.1
Z3 | 4.8.3
E Prover | 2.2
Coq | 8.7.2
Z3 | 4.8.4
E Prover | 2.3
Coq | 8.9.1

For more details on verifying the examples see the file [README.txt](https://github.com/fraunhoferfokus/acsl-by-example/blob/master/StandardAlgorithms/README.txt).

Expand Down
1 change: 1 addition & 0 deletions StandardAlgorithms/.gitignore
@@ -1,3 +1,4 @@
*_test
*.tex
coq/driver
astraver.why3.conf
274 changes: 274 additions & 0 deletions StandardAlgorithms/All/Makefile
@@ -0,0 +1,274 @@

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:
27 changes: 27 additions & 0 deletions StandardAlgorithms/All/ZeroC/Client.cpp
@@ -0,0 +1,27 @@

#include <Ice/Ice.h>
#include <Printer.h>
#include <stdexcept>

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<PrinterPrx>(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;
}

0 comments on commit d8b88b3

Please sign in to comment.