ruhler / smten

Compiler and runtime of the Smten language for functional programming and orchestration of SMT queries
http://ruhler.github.io/smten
Other
19 stars 8 forks source link

Debugging overwrites generated files #13

Closed ruhler closed 11 years ago

ruhler commented 11 years ago

The debug solver works great if the solver is used for a single query. But often the debug solver with a given filename is used with multiple queries, in which case the later queries overwrite the earlier queries.

This issue is exacerbated by

Can we somehow improve the situation?

I propose the following: instead of only associating a name with the debug solver, let us associate a name with every query. The debug solver can then use the name associated with the query. How this solves things:

In more detail:

Things I don't entirely like about this proposal:

ruhler commented 11 years ago

On naming schemes:

Given that, perhaps the best way to add a name to a query is:

Consistant, readable, doesn't force people to add names, hopefully not too onerous, and gives what we want. I vote for this approach.

ruhler commented 11 years ago

I implemented this in a separate branch. Observations:

This suggests an alternative to me. Maybe we shouldn't associate a debug solver with a file name, but rather a file handle. That way, if you call the solver multiple times, we can just append to the file you gave us.

Benefits of this approach:

I think, rather than merge the debug branch, that this is the approach we ought to take. For convenience we could provide a constructor for the Debug solver which takes a filepath.

ruhler commented 11 years ago

The Smten base doesn't support Handles to files currently, so as an easy way out, I just changed the debug solver to be IO Solver instead of Solver. This appears to very easily fix the problem in a nice, non-invasive way.