Re: [Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Ryan Ingram
I like using smart constructors to replace :<=>: and :=>: a \/ b = a :\/: b a /\ b = a :/\: b a ==> b = Not a \/ b a <=> b = (a ==> b) /\ (b ==> a) Also, if you generalize Sentence a bit you get a really nice formulation of "true". See my paste at http://hpaste.org/13807#a2 -- ryan 2009/1/10

Re: [Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Holger Siegel
On Sunday 11 January 2009 01:44:50 Andrew Wagner wrote: > Nice Idea, though I don't know that I want something that extensive. I was > more looking for whether there was a better way I could define the > algebraic data type. Let's have a look at your definitions from http://hpaste.org/13807#a1 :

Re: [Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Andrew Wagner
Nice Idea, though I don't know that I want something that extensive. I was more looking for whether there was a better way I could define the algebraic data type. On Sat, Jan 10, 2009 at 6:04 PM, Miguel Mitrofanov wrote: > Look at SYB (Data.Data, Data.Generics.*). For example, your "symbols" > fu

Re: [Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Miguel Mitrofanov
Look at SYB (Data.Data, Data.Generics.*). For example, your "symbols" function can be rewritten as symbols :: Sentence -> [Symbol] symbols s = nub $ listify (const True) s "true" is not that simple, because this code is NOT boilerplate - each alternative is valuable by itself. On 10 Jan 20

[Haskell-cafe] Propositional logic implementation

2009-01-10 Thread Andrew Wagner
All, Is there some better way to do this? It seems like a lot of boilerplate. Thanks! http://hpaste.org/13807#a1 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe