jlw501 at cs.york.ac.uk
Wed Dec 19 17:41:03 EST 2007
The main observation I've made it when playing with the values of knowing the
self and perfect communication, nothing else becomes undefined if just
perfect communication is true, it is still dependant on knowing the self if
you can have knowledge. Makes sense.
> Just to clarify, this is a little gag almost. It just demonstrates the
> problem of understanding knowledge as discussed by philosophers.
> perfectcomm is undefined as it is unknown if you can perfectly pass on
> your intention to another person. Likewise, it is unknown if you can
> express your subconscious mind in reason to yourself, hence knowself being
> undefined. The function then just slots these in on the cases of:
> no one knowing it,
> some knowing nothing,
> no one knowing nothing,
> one knowing it,
> and finally the important one (at least for those who are unfortunate
> enough to work in KM), some knowing it.
> Kudos for spotting the redundant line, you are right, sorry I though you
> meant the allKnow (x:) was redundant.
> Sorry, if I've messed with your heads, it's just I've been into Haskell
> for a month and though I'd join (what seems to be) the forum and post
> something quirky.
> Luke Palmer-2 wrote:
>> On Dec 19, 2007 7:26 PM, jlw501 <jlw501 at cs.york.ac.uk> wrote:
>>> I'm new to functional programming and Haskell and I love its expressive
>>> ability! I've been trying to formalize the following function for time.
>>> Given people and a piece of information, can all people know the same
>>> Anyway, this is just a bit of fun... but can anyone help me reduce it or
>>> talk about strictness and junk as I'd like to make a blog on it?
>> This looks like an encoding of some philosophical problem or something.
>> don't really follow. I'll comment anyway.
>>> contains :: Eq a => [a]->a->Bool
>>> contains  e = False
>>> contains (x:xs) e = if x==e then True else contains xs e
>> contains = flip elem
>>> perfectcomm :: Bool
>>> perfectcomm = undefined
>>> knowself :: Bool
>>> knowself = undefined
>> Why are these undefined?
>>> allKnow :: Eq a => [a]->String->Bool
>>> allKnow _ "" = True
>>> allKnow  k = False
>>> allKnow (x:) k = knowself
>>> allKnow (x:xs) k =
>>> comm x xs k && allKnow xs k
>>> comm p  k = False
>> This case will never be reached, because you match against (x:) first.
>>> comm p ps k = if contains ps p then knowself
>>> else perfectcomm
>> And I don't understand the logic here. :-p
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
View this message in context: http://www.nabble.com/Knowledge-tp14423007p14426967.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe