  The first three lines of this file were inserted by  . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex226) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt" "teachpack" "2htdp")) #f)))
  An FSM is one of :
;   – '()
    – ( cons Transition FSM )
 
(define-struct transition [current next])
; A Transition is a structure:
    ( make - transition FSM - State FSM - State )
 
  FSM - State is a Color .
 
  interpretation An FSM represents the transitions that a
  finite state machine can take from one state to another
; in reaction to keystrokes


  FSM - State FSM - State - > Boolean
; Equality predicate for states.
(define (state=? s1 s2)
  (equal? s1 s2))

(check-expect (state=? "red" "green") #false)
(check-expect (state=? "yellow" "green") #false)
(check-expect (state=? "yellow" "yellow") #true)
(check-expect (state=? "red" "red") #true)
(check-expect (state=? "green" "green") #true)

 about the language level of this file in a form that our tools can easily process.
   – '()
 A Transition is a structure:
 in reaction to keystrokes
 Equality predicate for states.
  The first three lines of this file were inserted by  . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex226) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt" "teachpack" "2htdp")) #f)))
  An FSM is one of :
    – ( cons Transition FSM )
 
(define-struct transition [current next])
    ( make - transition FSM - State FSM - State )
 
  FSM - State is a Color .
 
  interpretation An FSM represents the transitions that a
  finite state machine can take from one state to another


  FSM - State FSM - State - > Boolean
(define (state=? s1 s2)
  (equal? s1 s2))

(check-expect (state=? "red" "green") #false)
(check-expect (state=? "yellow" "green") #false)
(check-expect (state=? "yellow" "yellow") #true)
(check-expect (state=? "red" "red") #true)
(check-expect (state=? "green" "green") #true)
