Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
81
Issues
81
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
b4b79ae2
Commit
b4b79ae2
authored
Feb 25, 2019
by
Quentin Garchery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ThreeIdem is only in the logic
parent
f982defa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
23 deletions
+16
-23
examples/three_idem_ring.mlw
examples/three_idem_ring.mlw
+8
-13
examples/three_idem_ring/why3session.xml
examples/three_idem_ring/why3session.xml
+8
-10
examples/three_idem_ring/why3shapes.gz
examples/three_idem_ring/why3shapes.gz
+0
-0
No files found.
examples/three_idem_ring.mlw
View file @
b4b79ae2
...
...
@@ -6,29 +6,24 @@
module ThreeIdempotentRing
use int.Int
type t
val constant zero : t
val function (+) t t : t
val function ( *) t t : t
clone import algebra.Ring as R with
type t = t, constant zero = zero, function (+) = (+), function ( *) = ( *),
clone export algebra.Ring with
axiom .
(** Define multiplication by an integer recursively *)
let rec function mul (x : t) (n : int) : t
let rec
ghost
function mul (x : t) (n : int) : t
requires { n >= 0 }
variant { n }
=
if n = 0 then
zero else x + mul x (n-1)
if n = 0 then
pure{zero} else let r = mul x (n-1) in pure {x + r}
(** We get lemmas from the why3 library *)
clone i
mport int.Exponentiation as Mul with
type t = t, constant one = zero
,
function ( *) = (+), function power = mul,
lemma .
clone i
nt.Exponentiation with type t = t,
constant one = zero, function ( * ) = (+), function power = mul
,
lemma .
(** {2 General results about
unitary
rings} *)
(** {2 General results about rings} *)
(** First results : *)
...
...
examples/three_idem_ring/why3session.xml
View file @
b4b79ae2
...
...
@@ -13,19 +13,19 @@
<goal
name=
"VC mul"
expl=
"VC for mul"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.03"
/></proof>
</goal>
<goal
name=
"
Mul
.Assoc"
proved=
"true"
>
<goal
name=
"
Exponentiation
.Assoc"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"
Mul
.Unit_def_l"
proved=
"true"
>
<goal
name=
"
Exponentiation
.Unit_def_l"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.00"
steps=
"2"
/></proof>
</goal>
<goal
name=
"
Mul
.Unit_def_r"
proved=
"true"
>
<goal
name=
"
Exponentiation
.Unit_def_r"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"0.00"
steps=
"2"
/></proof>
</goal>
<goal
name=
"
Mul
.Power_0"
proved=
"true"
>
<goal
name=
"
Exponentiation
.Power_0"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"
Mul
.Power_s"
proved=
"true"
>
<goal
name=
"
Exponentiation
.Power_s"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"simpl_left"
proved=
"true"
>
...
...
@@ -67,11 +67,9 @@
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"VC mul_star_l"
expl=
"VC for mul_star_l"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"1.02"
steps=
"108"
/></proof>
<proof
prover=
"4"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"VC mul_star_r"
expl=
"VC for mul_star_r"
proved=
"true"
>
<proof
prover=
"1"
><result
status=
"valid"
time=
"3.46"
steps=
"124"
/></proof>
<proof
prover=
"4"
><result
status=
"valid"
time=
"0.01"
/></proof>
</goal>
<goal
name=
"null_star_l"
proved=
"true"
>
...
...
@@ -143,14 +141,14 @@
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.02"
/></proof>
</goal>
<goal
name=
"null2_comm.2"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.
2
2"
/></proof>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.
4
2"
/></proof>
</goal>
</transf>
</goal>
<goal
name=
"swap_equality"
proved=
"true"
>
<transf
name=
"split_vc"
proved=
"true"
>
<goal
name=
"swap_equality.0"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"
1.57
"
/></proof>
<proof
prover=
"0"
><result
status=
"valid"
time=
"
2.30
"
/></proof>
</goal>
<goal
name=
"swap_equality.1"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.01"
/></proof>
...
...
@@ -171,7 +169,7 @@
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.35"
/></proof>
</goal>
<goal
name=
"swap_equality.7"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.
23
"
/></proof>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.
42
"
/></proof>
</goal>
<goal
name=
"swap_equality.8"
proved=
"true"
>
<proof
prover=
"0"
><result
status=
"valid"
time=
"0.02"
/></proof>
...
...
examples/three_idem_ring/why3shapes.gz
View file @
b4b79ae2
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment