Prolog Assignment
Create a program that solves the logic puzzle below. Your program MUST actually SOLVE the puzzle, not just print the results. The program must find one and only one solution to the logic puzzle and that one solution must meet all of the constraints listed below.
1) Fuel Stop charges somewhat less per gallon than Vexon.
2) The business in Irvine charges somewhat more per gallon than the business in Santa Rosa.
3) Gas-N-Go doesn’t charge $1.23 per gallon.
4) The gas station in Lewis charges 8 cents less per gallon than the store in Zamora.
5) Fuel Stop charges 8 cents less per gallon than the store in Santa Rosa.
6) The business in Lewis is either Vexon or Energo.
7) Fuel Stop charges 4 cents less per gallon than Ballantines.
Hints:
a) Prolog doesn’t deal well with floating point. What other form could you use?
b) Remember that variables are capitalized and atoms are all lower case.
c) Look at the slides (especially the logic puzzle) carefully – you can reuse code from the slides.
Get it here: http://www.swi-prolog.org/