Here is another logic program.
(fact (every-other () ()))
(fact (every-other (?x) (?x)))
(fact (every-other (?a ?b . ?l_rest) (?a . ?r_rest))
(every-other ?l_rest ?r_rest))
For the following queries, write out the series of the facts that are successfully unified to get the result of the query.
- (query (every-other () ?x))
- (query (every-other (frodo gandalf) ?x))
- (query (every-other (frodo merry sam pippin) ?x))