Talk:Proof: Difference between revisions

From Rosetta Code
Content added Content deleted
(Task purpose)
(New section: Huh?)
Line 2: Line 2:
:This seems like less of a computing problem, and more of a discrete math problem. I'm not sure if it's a good task. --[[User:Mwn3d|Mwn3d]] 14:45, 21 December 2007 (MST)
:This seems like less of a computing problem, and more of a discrete math problem. I'm not sure if it's a good task. --[[User:Mwn3d|Mwn3d]] 14:45, 21 December 2007 (MST)
:The task was intended to demonstrate dependent types. I've got some C++ code I'm working that demonstrates how it can be accomplished there. --[[User:Short Circuit|Short Circuit]] 20:50, 21 December 2007 (MST)
:The task was intended to demonstrate dependent types. I've got some C++ code I'm working that demonstrates how it can be accomplished there. --[[User:Short Circuit|Short Circuit]] 20:50, 21 December 2007 (MST)

== Huh? ==

The data type for "natural numbers" is what would be called an "unsigned integer" in other languages, right? Or did you want us to create a data type that can deal with arbitrary-size integers?

If we're merely talking about unsigned ints, then the data type for "even numbers" is of course the exact same thing (since the two sets are isomorphic). So the programming task boils down to writing functions for I/O that take an unsigned int and interpret it as "one half of the number we're talking about". Is that what is intended here? If not, then what exactly are we supposed to do here? You see me somewhat puzzled... [[User:Sgeier|Sgeier]] 17:45, 11 March 2008 (MDT)

Revision as of 23:45, 11 March 2008

The subtype Natural is pre-defined for all Ada implementations. Arithmetic upon that subtype is also pre-defined. This does not appear to be a very interesting problem in Ada. Any suggestions? --Waldorf 14:42, 21 December 2007 (MST)

This seems like less of a computing problem, and more of a discrete math problem. I'm not sure if it's a good task. --Mwn3d 14:45, 21 December 2007 (MST)
The task was intended to demonstrate dependent types. I've got some C++ code I'm working that demonstrates how it can be accomplished there. --Short Circuit 20:50, 21 December 2007 (MST)

Huh?

The data type for "natural numbers" is what would be called an "unsigned integer" in other languages, right? Or did you want us to create a data type that can deal with arbitrary-size integers?

If we're merely talking about unsigned ints, then the data type for "even numbers" is of course the exact same thing (since the two sets are isomorphic). So the programming task boils down to writing functions for I/O that take an unsigned int and interpret it as "one half of the number we're talking about". Is that what is intended here? If not, then what exactly are we supposed to do here? You see me somewhat puzzled... Sgeier 17:45, 11 March 2008 (MDT)