Commit 6b0eda19 authored by MARCHE Claude's avatar MARCHE Claude

a few tests

parent 7845b21e
theory T
type list 'a = Nil | Cons 'a (list 'a)
function app (l1:list 'a) (l2:list 'a) : (list 'a) =
match l1 with
| Nil -> l2
| Cons x r -> Cons x (app r l2)
end
lemma app_nil : forall l:list 'a. app l Nil = l
type tree = Leaf int | Node tree tree
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE why3session SYSTEM "/usr/local/share/why3/why3session.dtd">
<why3session
name="test-ind/why3session.xml" shape_version="2">
<file
name="../test-ind.why"
verified="false"
expanded="true">
<theory
name="T"
locfile="test-ind/../test-ind.why"
loclnum="2" loccnumb="7" loccnume="8"
verified="false"
expanded="true">
<goal
name="app_nil"
locfile="test-ind/../test-ind.why"
loclnum="12" loccnumb="6" loccnume="13"
sum="57a6eece27d97fc131ecc13471649486"
proved="false"
expanded="true"
shape="ainfix =aappV0aNilV0F">
</goal>
</theory>
</file>
</why3session>
theory TestOverriding
use import settheory.Relation
use import settheory.InverseDomRan
use import settheory.Overriding
use import settheory.Function
constant f : rel int int = singleton (3,4)
constant g : rel int int = f <+ (singleton (5,6))
constant h : rel int int = g <+ (singleton (3,7))
goal testdom1: mem 3 (dom g)
goal testdom2: mem 3 (dom h)
goal testapply1: apply f 3 = 4
goal testapply2: apply g 3 = 4
goal testapply3: apply g 5 = 6
goal testapply4: apply h 3 = 7
goal testapply5: apply h 5 = 6
goal testapply_smoke1: apply h 3 = 8
goal testapply_smoke2: apply h 5 = 9
end
theory TestCompose
use import settheory.Relation
use import settheory.InverseDomRan
use import settheory.Composition
use import settheory.Function
constant f : rel int int = singleton (3,4)
constant g : rel int int = singleton (4,6)
constant h : rel int int = semicolon f g
use import settheory.Interval
constant fun_int_int : set (rel int int) = integer +-> integer
(*
lemma f_is_fun : mem f fun_int_int
lemma g_is_fun : mem g fun_int_int
lemma h_is_fun : mem h fun_int_int
*)
goal test1: mem (apply h 3) (Interval.mk 0 10)
goal test2: 0 <= apply h 3 <= 10
goal test3: apply h 3 = 6
end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment