Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Theorem proving and Unit testing

by FoxtrotUniform (Prior)
on Aug 25, 2004 at 22:15 UTC ( [id://385854]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Theorem proving and Unit testing
in thread Theorem proving and Unit testing

Structural induction is not only possible, but fun and easy (well, possibly for grad-student values thereof). What you want to do is remember that induction consists of a base and a recursive case -- for mathematical induction, this comes from the fact that every natural number but zero is the successor of another nat.

For a binary tree, you'd prove theorems inductively by proving them on leaf nodes, then proving that if both of an interior node's children satisfy the theorem, the interior node must as well. (It's a bit more difficult with lazy languages, but that's not your problem here.)

Nice job on the root node, btw.

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
% man 3 strfry

Replies are listed 'Best First'.
Re^4: Theorem proving and Unit testing
by stvn (Monsignor) on Aug 25, 2004 at 22:33 UTC
    For a binary tree, you'd prove theorems inductively by proving them on leaf nodes, then proving that if both of an interior node's children satisfy the theorem, the interior node must as well.

    Do you see any value though in the 'random' structure part? Or do you think that to prove it on a leaf, then on a interior node would suffice to say that it works? I can see the theoretical beauty of that, but real-world exp. tells me that edge cases are not that easily revealed and running it through several random iterations would be a good idea.

    Nice job on the root node, btw.

    Thanks.

    -stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://385854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-26 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found