aig-upf / tarski

Tarski - An AI Planning Modeling Framework
Apache License 2.0
61 stars 20 forks source link

Get rid of unnecessary "accept" method in visitors #60

Closed gfrances closed 5 years ago

gfrances commented 5 years ago

In spite of affecting a good number of files, this PR does a simple change: it gets rid of the accept() methods in the term/formula FSTRIPS hierarchy, which were doing a redundant job: simply calling the visitor visit() method. That is standard in C++ visitor implementations, but it is not necessary in Python, since the visitor is doing all of the job by calling isinstance anyway. This should not break anything, and tests are passing OK.

I also implemented, as a proof of concept, a term_substitution "wrapper" that offers a cleaner interface to the calling methods that want to compute a term substitution. We could do the same with other transformations, but I didn't want to complicate this PR further.

miquelramirez commented 5 years ago

Sounds good, @gfrances, we will never shake off the C++ mindset :)