[plt-scheme] Re: boolean operators on integers
It seems not just NOT operation but also AND and OR can be replaced
with arithmetic operations when #t and #f are represented by 1 and 0.
AND is multiplication, and OR is addition (modulo 1).
And if memory serves right, the proof of Godel's incompleteness
theorem involved encoding statements themselves into integers. You
could say that this method turns one type (the statements) into
another type (numbers), and unifies them.
How come computer scientists obsess about segregating things into ever
finer types when all the other sciences are really about finding
unifying themes that brings together apparently disparate phenomena?
;)
--Yavuz
On Sat, Jul 12, 2008 at 17:43, <hendrik at topoi.pooq.com> wrote:
> On Sat, Jul 12, 2008 at 07:35:17AM -0700, wooks wrote:
>>
>>
>> On Jul 12, 9:02 am, Matthias Felleisen <matth... at ccs.neu.edu> wrote:
>> > Can you explain why you think 0 and 1 should have anything to do with
>> > true and false? (I am afraid that it somehow slipped into a document
>> > that may confuse our users and we need to clarify this. -- In
>> > centuries past, around 1738, people thought that 0 stood for #f and
>> > that 1 stood for #t. But this pun hasn't been useful to real
>> > programmer since then so I don't know where one would fine this idea,
>> > except in history books.)
>> >
>
> Recursive function theorists in mid-20'th century or before (definitely
> before computers) used 0 = true and 1 = false. This had the nice effect
> that they could use exponentiation for not:
>
> 0 ** 0 = 1
> 0 ** 1 = 0
>
> -- hendrik
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>