I was given this task but I am struggling to formulate the appropriate rules in the correct format. I don't know the exact ways to use the less than/more than signs for this task (>, <, <= etc.)
These are the facts and rules given:
tour(france, 49, 770).
tour(spain, 20, 150).
tour(germany, 26, 370).
tour(italy, 42, 330).
tour(belgium, 46, 540).
medium(germany).
medium(italy).
fitnesslevel(untrained).
fitnesslevel(good).
fitnesslevel(perfect).
fitness_higher(good, untrained).
fitness_higher(perfect, good).
more_fit(F1, F2) :- fitness_higher(F1, F2).
more_fit(F1, F2) :- fitness_higher(F1, F), more_fit(F, F2).
fitness(max, untrained).
fitness(lucy, perfect).
The following are the tasks I was given
1) Add rules for the following predicates:
2) Add rules for this following predicate: suitable(T, P).
3) Which is the correct query to find out which tours are suitable for Max and Lucy?
You write:
I was given this task but I am struggling to formulate the appropriate rules in the correct format. I don't know the exact ways to use the less than/more than signs for this task (>, <, <= etc.)
You should maybe start smaller. Try to read the docs and understand how to use the comparisons for this task. If there is something you don't understand, write a minimal code sample that we can also run. Show what you expect and what you get instead. You could than ask how to fix it.
As it stands, your question is equivalent of posting your homework assignment and asking someone to work out a solution for you and post it here. It works, sometimes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.