Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
8788a7a2
Commit
8788a7a2
authored
May 05, 2010
by
Andrei Paskevich
Browse files
minor + define 'abs' via if-then-else
parent
f1b3c54e
Changes
2
Hide whitespace changes
Inline
Side-by-side
theories/int.why
View file @
8788a7a2
theory Int
logic zero : int = 0
logic one : int = 1
clone export algebra.UnitaryCommutativeRing with
type t = int, logic zero = zero, logic one = one
logic (< ) (int, int)
logic (<=) (x:int, y:int) = x < y or x = y
logic (> ) (x:int, y:int) = y < x
...
...
@@ -9,11 +15,6 @@ theory Int
clone export relations.TotalOrder with
type t = int, logic rel = (<=)
logic zero : int = 0
logic one : int = 1
clone export algebra.UnitaryCommutativeRing with
type t = int, logic zero = zero, logic one = one
end
...
...
theories/real.why
View file @
8788a7a2
theory Real
logic zero : real = 0.0
logic one : real = 1.0
clone export algebra.Field with
type t = real, logic zero = zero, logic one = one
logic (< )(real, real)
logic (<=)(x:real, y:real) = x < y or x = y
logic (> )(x:real, y:real) = y < x
...
...
@@ -10,21 +15,13 @@ theory Real
clone export relations.TotalOrder with
type t = real, logic rel = (<=)
logic zero : real = 0.0
logic one : real = 1.0
clone export algebra.Field with
type t = real, logic zero = zero, logic one = one
end
theory Abs
use import Real
logic abs(real) : real
axiom Pos: forall x:real. x >= 0.0 -> abs(x) = x
axiom Neg: forall x:real. x <= 0.0 -> abs(x) = -x
logic abs(real) : real = if x >= 0.0 then x else -x
lemma Abs_le: forall x,y:real. abs(x) <= y <-> -y <= x <= y
...
...
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