;; a helper file for lab9-library.ss ;; Searching a graph. ;; ;;(define-structure (city name nbhrs seen?)) (define (have-seen3? c) (city-seen? c)) (define (mark-seen3! c) (set-city-seen?! c #t)) (define (reachable3? here there) (begin (mark-seen3! here) (if (same-city? here there) #t (reachable3-from? (city-nbhrs here) there)))) (define (reachable3-from? loc there) (cond ((null? loc) #f) ((if (have-seen3? (car loc)) #f (reachable3? (car loc) there)) #t) (else (reachable3-from? (cdr loc) there))))