https://github.com/EasyCrypt/easycrypt
Revision 7f08941c82a5d3bdfde6224656f489e5ea6c533b authored by Cameron Low on 19 January 2023, 18:14:06 UTC, committed by Pierre-Yves Strub on 19 January 2023, 21:44:41 UTC
Here is an example of use:

```
require import AllCore.

type t = [
  A of int | B of bool | C
].

module M = {
  proc f(x : t) : int = {
    var y : int <- 0;

    match x with
    | A v => y <- `|v|;
    | B _ => y <- 1;
    | C   => y <- 2;
    end;

    return y;
  }
}.

lemma L : hoare[M.f : true ==> 0 <= res].
proof. by proc; sp; match => [v|b|]; auto=> /> /#. qed.
```
1 parent ba37062
Raw File
Tip revision: 7f08941c82a5d3bdfde6224656f489e5ea6c533b authored by Cameron Low on 19 January 2023, 18:14:06 UTC
[tactic]: added hoare variant for `match`
Tip revision: 7f08941
Makefile
# -*- Makefile -*-

# --------------------------------------------------------------------
DUNE      ?= dune
ECARGS    ?=
ECTOUT    ?= 10
ECJOBS    ?= 0
ECEXTRA   ?= --report=report.log
ECPROVERS ?= Alt-Ergo Z3 CVC4
CHECKPY   ?=
CHECK     := $(CHECKPY) scripts/testing/runtest
CHECK     += --bin-args="$(ECARGS)" --bin-args="$(ECPROVERS:%=-p %)"
CHECK     += --timeout="$(ECTOUT)" --jobs="$(ECJOBS)"
CHECK     += $(ECEXTRA) config/tests.config

# --------------------------------------------------------------------
UNAME_P = $(shell uname -p)
UNAME_S = $(shell uname -s)

# --------------------------------------------------------------------
.PHONY: default build byte native tests check examples
.PHONY: clean install uninstall

default: build
	@true

build:
	rm -f src/ec.exe ec.native
	$(DUNE) build
	ln -sf src/ec.exe ec.native
ifeq ($(UNAME_P)-$(UNAME_S),arm-Darwin)
	-codesign -f -s - src/ec.exe
endif

install: build
	$(DUNE) install

uninstall:
	$(DUNE) uninstall

check: stdlib examples

stdlib: build
	$(CHECK) prelude stdlib

examples: build
	$(CHECK) examples mee-cbc

check: stdlib examples
	@true

clean:
	rm -f ec.native && $(DUNE) clean
	find theories examples -name '*.eco' -exec rm '{}' ';'

clean_eco:
	find theories examples -name '*.eco' -exec rm '{}' ';'
back to top