Move ptr from solver.h to expr.h