Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Vienna Development Method
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Natural number multiplication=== <syntaxhighlight lang="rsl"> multp(i,j:nat)r:nat pre true post r = i*j </syntaxhighlight> Applying the proof obligation <code>forall p:T_p & pre-f(p) => f(p):T_r and post-f(p, f(p))</code> to an explicit definition of <code>multp</code>: <syntaxhighlight lang="rsl"> multp(i,j) == if i=0 then 0 else if is-even(i) then 2*multp(i/2,j) else j+multp(i-1,j) </syntaxhighlight> Then the proof obligation becomes: <syntaxhighlight lang="rsl"> forall i, j : nat & multp(i,j):nat and multp(i, j) = i*j </syntaxhighlight> This can be shown correct by: # Proving that the recursion ends (this in turn requires proving that the numbers become smaller at each step) # [[Mathematical induction]]
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Vienna Development Method
(section)
Add topic