Bottom Clause Construction
:- modeb(p(+a,+b,-c,#d)).
a(a1). a(a2). b(b1). b(b2).
Optimization by mode declaration
- replace +type argument in each modeb declaration by constant (registered term ) relevant to example
- replace -type and #type argument by variable
- execute each modeb as Prolog goal.
- If the goal success with ground substitutions then add it to the body of MSH
rel0.att1, rel0.att2, rel0.att3, rel0.att4
(rel0.att1=‘a1’ AND rel0.att2 = ‘b1’)OR
(rel0.att1=‘a1’ AND rel0.att2 = ‘b2’)OR
(rel0.att1=‘a2’ AND rel0.att2 = ‘b1’)OR
(rel0.att1=‘a2’ AND rel0.att2 = ‘b2’)