Don't check untaken branches when checking for boolean expression.
authorJoe Marshall <jmarshall@alum.mit.edu>
Tue, 2 Mar 2010 22:19:52 +0000 (14:19 -0800)
committerJoe Marshall <jmarshall@alum.mit.edu>
Tue, 2 Mar 2010 22:19:52 +0000 (14:19 -0800)
src/sf/object.scm

index c6155bb5491a6f82051d69b9bfea98be10f3868f..131863b81c2a8aca662c0622a6e0187ff2009269 100644 (file)
@@ -255,8 +255,10 @@ USA.
   (cond ((expression/call-to-boolean-predicate? expression))
 
        ((conditional? expression)
-        (and (expression/boolean? (conditional/consequent expression))
-             (expression/boolean? (conditional/alternative expression))))
+        (and (or (expression/always-false? (conditional/predicate expression))
+                 (expression/boolean? (conditional/consequent expression)))
+             (or (expression/never-false? (conditional/predicate expression))
+                 (expression/boolean? (conditional/alternative expression)))))
 
        ((constant? expression)
         (or (not (constant/value expression))
@@ -267,7 +269,8 @@ USA.
 
        ((disjunction? expression)
         (and (expression/boolean? (disjunction/predicate expression))
-             (expression/boolean? (conditional/alternative expression))))
+             (or (expression/never-false? (disjunction/predicate expression))
+                 (expression/boolean? (conditional/alternative expression)))))
 
        ((sequence? expression) (expression/boolean? (last (sequence/actions expression))))