/* SKIER2.LOGIC */ /* A modification of SKIER.LOGIC; the answer to an exercise in Supplement 1. */ suits(Skier, st_sartre) :- is_a(Skier, beginner), wants(Skier, fun). suits(Skier, schloss_heidegger) :- is_a(Skier, beginner), wants(Skier, serious). suits(Skier, chateau_derrida) :- is_a(Skier, advanced), wants(Skier, serious). suits(Skier, wittgenstein_gladbach) :- is_a(Skier, advanced), wants(Skier, fun). is_a(Skier, beginner) :- had_lessons(Skier, L), L < 10. is_a(Skier, beginner) :- has_fitness(Skier, poor). is_a(Skier, semi_skilled) :- had_lessons(Skier, L), L >= 10, has_fitness(Skier, medium). is_a(Skier, semi_skilled) :- had_lessons(Skier, L), L >= 10, L < 40, has_fitness(Skier, good). is_a(Skier, advanced) :- had_lessons(Skier, L), L >= 40, L < 70, has_fitness(Skier, good). is_a(Skier, pro) :- had_lessons(Skier, L), L >= 70, has_fitness(Skier, good). has_fitness(Skier, poor) :- max_pressups(Skier, P), P < 25. has_fitness(Skier, medium) :- max_pressups(Skier, P), P >= 25, P < 50. has_fitness(Skier, good) :- max_pressups(Skier, P), P >= 50.