Revision: 263
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=263&view=rev
Author: agraef
Date: 2008-06-18 16:00:01 -0700 (Wed, 18 Jun 2008)
Log Message:
-----------
Fix DNF example to accommodate changes in the operator system.
Modified Paths:
--------------
pure/trunk/examples/symbolic.pure
Modified: pure/trunk/examples/symbolic.pure
===================================================================
--- pure/trunk/examples/symbolic.pure 2008-06-18 22:53:32 UTC (rev 262)
+++ pure/trunk/examples/symbolic.pure 2008-06-18 23:00:01 UTC (rev 263)
@@ -27,16 +27,12 @@
/* Disjunctive normal form. */
-// Note that 'not' is already declared in the prelude and is being reused
-// here, so make sure that these match up with the prelude.
-infixl 2 or; infixl 3 and; prefix 3 not;
-
// eliminate double negations:
-not not a = a;
+~~a = a;
// push negations inward (de Morgan's laws):
-not (a or b) = not a and not b;
-not (a and b) = not a or not b;
+~(a or b) = ~a and ~b;
+~(a and b) = ~a or ~b;
// distributivity laws:
a and (b or c) = a and b or a and c;
@@ -47,4 +43,4 @@
a or (b or c) = (a or b) or c;
// Example:
-a or not (b or (c and not d));
+a or ~(b or (c and ~d));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|