move computation to relational logic