PPT Slide
Now we examine a more formal specification for the program to determine
change for a vending machine.
State - {amount_to_be_changed, number_of_quarters, number_of_dimes,
number_of_nickels, number_of_pennies}
Initial State - {amount_to_be_changed is known, all other variables are
Final State - {values are assigned to all variables such that:
amount_to_be_changed == number_of_quarters * 25 +
number_of_dimes * 10 + number_of_nickels * 5
the sum of number_of_quarters, number_of_dimes,
number_of_nickels and number_of_pennies
- values of all variables are known.
Operations - Compute number of whole coin units in a given amount.
and the balance remaining after removal of this number of coin units.
Ordering Relation - Apply operations from largest to smallest unit of currency.