def test_fmt(): root_expr = prob([v('z')], [do(v('x'))]) assert fmt(root_expr) == 'pr(z|do(x))'
def test_fmt(): root_expr = prob([v("z")], [do(v("x"))]) assert fmt(root_expr) == "pr(z|do(x))"
def pleasantly_fmt(bindings, expr): new_labels = make_pleasant_variable_names(bindings) pleasant_expr = relabel_expr(new_labels, expr) return str(E.fmt(pleasant_expr))
def __str__(self): total_length = self.length + self.heuristic_length return '<ProofState L=%1.1f expr=%s>' % (total_length, fmt(self.root_expr))