def add_definition(self, string): term = self.parse(string) assert qterm.is_combination(term) assert qterm.is_combination(term.operator) assert term.operator.operator.name == '=' assert qterm.is_variable(term.operator.operand) \ or qterm.is_constant(term.operator.operand) name = term.operator.operand.name self.definitions[name] = term
def add_constant(self, constant): atom = self.parse(constant) if qterm.is_variable(atom): atom = qterm.Constant(atom.name, atom.qtype) self.constants[atom.name] = atom