Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Why3
why3
Commits
b3937b40
Commit
b3937b40
authored
May 27, 2015
by
Jean-Christophe Filliâtre
Browse files
new theory int.Sum
parent
996a6be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
theories/int.why
theories/int.why
+38
-0
No files found.
theories/int.why
View file @
b3937b40
...
...
@@ -334,6 +334,44 @@ theory NumOf
end
(** {2 Sum} *)
theory Sum
use import Int
use HighOrd
function sum (a b: int) (f: int -> int) : int
(** sum of [f n] for [a <= n <= b] *)
axiom sum_def1:
forall f: int -> int, a b: int.
b < a -> sum a b f = 0
axiom sum_def2:
forall f: int -> int, a b: int.
a <= b -> sum a b f = sum a (b - 1) f + f b
lemma sum_left:
forall f: int -> int, a b: int.
a <= b -> sum a b f = f a + sum (a + 1) b f
lemma sum_ext:
forall f g: int -> int, a b: int.
(forall i. a <= i <= b -> f i = g i) ->
sum a b f = sum a b g
lemma sum_nonneg:
forall f: int -> int, a b: int.
(forall i. a <= i <= b -> 0 <= f i) ->
0 <= sum a b f
lemma sum_decomp:
forall f: int -> int, a b c: int. a <= b <= c ->
sum a c f = sum a b f + sum (b+1) c f
end
(** {2 Factorial function} *)
theory Fact
...
...
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