class Relation(Expr): def solve(self, for_var): # okay, I conflated classes with objects. an expression _type_ is different from an expression _instance_ . # also, for conciseness, consts and variables could be integers and strings