lat A(x: String, s: Sign)
lat B(x: String, s: Sign)
lat R(x: String, s: Sign)
A("a"; Pos).
B("a"; Top).
A("b"; Neg).
R("c"; s) :- A("a"; s).
R("c"; s) :- A("b"; s).
R("d"; s) :- A(x; s), B(x; s).
Finally, the program defines three predicate symbols A, B, and C with lattice interpretations. The program then defines three facts and three rules. The two first rules require that in the fact R("c", s) the s element must be at least the least upper bound of s1 and s2 for any facts A("a", s1) and A("b", s2). Thus we compute the fact R("c", Top). The last rule, on the other hand requires that in the fact R("d", s) s must be the greatest lower bound of s1 and s2 for any facts A(x, s1) and B(x, s2). Thus we compute the fact R("d", Pos).
...which leaves me somewhat confused. It could be my own misunderstanding, but I think the explanation does not match the code sample: