Given a line in one dimension from p1 to p2, we can find the line of length 1/2 (p2-p1) centered around the midpoint of the first line in MLPQ as follows:
begin%RECURSIVE% /* First we must build the diff relation. It is interesting to note that this relation is what will limit the other relations */ diff(x,y,z) :- x-y>=0, -x+y>=0, z>=0, -z>=0. diff(x,y,z) :- diff(x1,y,z1), x-x1<=1, x-x1>=1, z-z1<=1, z-z1>=1. diff(x,y,z) :- diff(x,y1,z1), y-y1<=1, y-y1>=1, z1-z<=1, z1-z>=1. /* Our initial line */ line(0,6, 0). /* Recursive line definition */ line(x,y,d) :- line(p1,p2,d1), diff(p,p1,z1), diff(p2,p,z), diff(x,p1,z2), diff(p,x,z2), diff(p2,y,z3), diff(y,p,z3), d-d1 = 1. end%RECURSIVE%