WatForm / fortress

Fortress: Finite Model Finder for Many-Sorted First-Order Logic
MIT License
5 stars 0 forks source link

Symmetry breaking code refactoring #72

Open nancyday opened 1 year ago

nancyday commented 1 year ago

The symmetry breaking code is currently factored as follows:

compiler/fortressCompilers

transformers/ SymmetryBreakingTransformer SymmetryBreakingTransformerSI (adds sort inference) SymmetryBreakingTransformer_MostUsed (use selection heuristic of breaking on most used elements) SymmetryBreakingTransformer_NoSkolem (do not symmetry break on skolem constants/functions) These are all parameterized by 1) the selection heuristic (which order to choose constants/functions/predicates) 2) the symmetry breaking factory (the functions that take an element and do the symmetry breaking on it)

symmetry/ SymmetryBreaker, Symmetry SymmetryBreakerDL, SymmetryDL (DL = disjunctive limit)

symmetry/StalenessState, StalenessTracker, RemainingIdentifiersTracker

symmetry/SelectionHeuristic, SelectionHeuristicWithConstants a

symmetry/HyperGraph, Microstructure, ExperimentalSymmetryBreakers are probably no longer used

jporemba commented 1 year ago

A few comments (partially following up on my Slack discussion with Nancy):

1) I believe that SymmetryBreakingTransformerSI is intended to be used on problems where sort inference has not already been performed, and you explicitly do not want to keep the inferred sorts once symmetry breaking is done. SymmetryBreakingTransformerSI leaves the sorts unchanged when it is finished - the sort inference is temporary. We introduced this for evaluation purposes, but it is not clear that you would want this behaviour for standard uses.

2) HyperGraph and Microstructure were used during my undergrad thesis, but have no practical use in Fortress (they were a theoretical tool mainly), so can be removed if you wish.

nancyday commented 1 year ago

Additional info from Joe: Even through the FortressTWOCompiler_SI() does not seem to use the SymmetryBreakingTransformerSI, the compilation steps include the SortInferenceTransformer so it does do sort inference. "The reason does not take this approach, is that we wanted to use sort inference for the purposes of symmetry breaking only, but not actually change the sorts of the problem, so that we have as close to an apples-to-apples comparison as possible (maybe changing the sort names changes how Z3 behaves, for example). So the sort inference in v3 is used temporarily during the symmetry breaking process, then thrown away later "