Hacker News new | past | comments | ask | show | jobs | submit login

    (define-solver yak-solver ()
      (wax-car (car-needs-waxing have-hose)
        (car-waxed)
        (car-needs-waxing))
      (get-new-hose (have-ez-pass)
        (have-hose))
      (borrow-ez-pass (return-mooshi-pillow)
        (have-ez-pass))
      (fix-mooshi-pillow (have-yak)
        (return-mooshi-pillow))
      (visit-zoo ()
        (have-yak)))

    (multiple-value-bind (ok? actions)
        (yak-solver '(car-needs-waxing) '(car-waxed))
      (assert ok?)
      (assert (equal actions
                     '(VISIT-ZOO
                       FIX-MOOSHI-PILLOW
                       BORROW-EZ-PASS
                       GET-NEW-HOSE
                       WAX-CAR)))))






Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: