[Haskell-cafe] Haskell programs as specifications

Daniel Fischer daniel.is.fischer at googlemail.com
Sun Apr 3 16:39:09 CEST 2011


On Sunday 03 April 2011 16:04:22, Patrick Browne wrote:
> Hi,
> Attached are two programs that represent one-way and two-way traffic on
> a road. I can get the programs to produce reasonable results that match
> our intuitive ideas of roads.
> However, I have 2 question about the programs:
> 
> 1)I cannot get the result suggested by the author that t1 should give
> true in prog1 and false in prog2.

Only took a short look, but that'd probably be because it's wrong, t1 
should give True for both.
You have a road r from a to b and a car c at a. Then after you move the car 
along the road, it will be located at b, regardless of whether it's a one-
way road or traffic may flow in both directions.



More information about the Haskell-Cafe mailing list