I am practicing some prolog, below is my code for a prolog predicate(rule) to check the inventory levels, so I try to write a reorder predicate which takes "Part" as an argument and print a message 'Time to reorder' if the inventory level is less than 10, it should normally print that, if it is true, but I`m having some difficulties, could anyone show me where I go wrong?
here`s the rule(prolog predicate):
code:
inventory(part1, 10).
inventory(part2, 7).
inventory(part3, 30).
inventory(part4, 73).
inventory(part5, 3).
reorder(Part):-inventory(Part,Y), Part is (Y < 10), write('time to reorder').
here`s the rule(prolog predicate):
code:
inventory(part1, 10).
inventory(part2, 7).
inventory(part3, 30).
inventory(part4, 73).
inventory(part5, 3).
reorder(Part):-inventory(Part,Y), Part is (Y < 10), write('time to reorder').