]> gitweb.factorcode.org Git - factor.git/commitdiff
boolean-expr: use sequences:partition
authorAlexander Iljin <ajsoft@yandex.ru>
Mon, 22 Jan 2018 00:30:52 +0000 (01:30 +0100)
committerAlexander Iljin <ajsoft@yandex.ru>
Mon, 22 Jan 2018 00:33:00 +0000 (01:33 +0100)
extra/boolean-expr/boolean-expr.factor

index 2fa0ed3d5ebc4fafa7517ea8fc884440550db085..e65cad440cbf880caf971ecfd882d8be49d01a6a 100644 (file)
@@ -65,11 +65,8 @@ GENERIC: satisfiable? ( expr -- ? )
 METHOD: satisfiable? { ⊤ } drop t ;
 METHOD: satisfiable? { ⊥ } drop f ;
 
-: partition ( seq quot -- left right )
-    [ [ not ] compose filter ] [ filter ] 2bi ; inline
-
 : (satisfiable?) ( seq -- ? )
-    [ \ ¬ instance? ] partition [ x>> ] map intersect empty? ;
+    [ \ ¬ instance? ] partition swap [ x>> ] map intersect empty? ;
 
 METHOD: satisfiable? { □ }
     cnf [ (satisfiable?) ] any? ;