4

例如,如果我像between(1,4,X)?我期望的那样进行查询X=2X=3. 这可能吗?

4

1 回答 1

3
 between(A,B,X):-X is A+1,X<B.
 between(A,B,X):-A2 is A+1,A2<B-1,between(A2,B,X).
于 2008-11-09T07:00:02.887 回答