Optimization by Transformation


; Test whether a pipe floats in water
; (gldefun t3 ((p pipe)) (floats p))
(defun t3 (P)
  (>  (* PI (EXPT (/ (CADDR (PROG1 P)) 2)
                 2))
     (* (- (* PI (EXPT (/ (CADDR (PROG1 P)) 2)
                       2))
           (* PI (EXPT (/ (CADR (PROG1 P)) 2)
                       2)))
        (GET (FIFTH (PROG1 P)) 'DENSITY))))

Patterns:


( (prog1 ?v)               ?v )

( (- (* ?n ?x) (* ?n ?y))  (* ?n (- ?x ?y)) )

Contents    Page-10    Prev    Next    Page+10    Index