Skip to content

Commit c222c46

Browse files
committed
change repr of pvar to return the repr of the dereferenced value
1 parent fe6fd2d commit c222c46

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

include/pl_search/pvar.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ class PVar : public Term {
9393
*/
9494
int getVarId() const { return var_id; }
9595

96-
std::string repr() const override { return "X" + std::to_string(var_id); }
96+
std::string repr() const override {
97+
if (value) {
98+
return value->dereference()->repr();
99+
}
100+
return "X" + std::to_string(var_id);
101+
}
97102

98103
protected:
99104
virtual bool isEqualTo(Term &other) const override {

0 commit comments

Comments
 (0)