@@ -141,23 +141,10 @@ bool MainSolver::tryAddTermNameFor(PTRef fla, std::string const & name) {
141141sstat MainSolver::simplifyFormulas () {
142142 status = s_Undef;
143143 for (std::size_t i = firstNotPreprocessedFrame; i < frames.frameCount (); ++i) {
144- auto & frame = frames[i];
145- FrameId const frameId = frame.getId ();
146- PreprocessingContext context{.frameCount = i, .perPartition = trackPartitions ()};
147- preprocessor.prepareForProcessingFrame (i);
148- firstNotPreprocessedFrame = i + 1 ;
149-
150- if (not context.perPartition ) {
151- PTRef frameFormula = preprocessFormulasDefault (frame.formulas , context);
152- status = giveToSolver (frameFormula, frameId);
153- } else {
154- vec<PTRef> processedFormulas = preprocessFormulasPerPartition (frame.formulas , context);
155- for (PTRef fla : processedFormulas) {
156- status = giveToSolver (fla, frameId);
157- if (status == s_False) { break ; }
158- }
159- }
160- if (status == s_False) { break ; }
144+ assert (status != s_False);
145+ if (tryPreprocessFormulasOfFrame (i)) { continue ; }
146+ assert (status == s_False);
147+ break ;
161148 }
162149
163150 if (status == s_False) {
@@ -168,6 +155,31 @@ sstat MainSolver::simplifyFormulas() {
168155 return status;
169156}
170157
158+ bool MainSolver::tryPreprocessFormulasOfFrame (std::size_t i) {
159+ auto & frame = frames[i];
160+ FrameId const frameId = frame.getId ();
161+ PreprocessingContext context{.frameCount = i, .perPartition = trackPartitions ()};
162+ preprocessor.prepareForProcessingFrame (i);
163+ firstNotPreprocessedFrame = i + 1 ;
164+
165+ assert (status != s_False);
166+
167+ if (not context.perPartition ) {
168+ PTRef frameFormula = preprocessFormulasDefault (frame.formulas , context);
169+ status = giveToSolver (frameFormula, frameId);
170+ return status != s_False;
171+ }
172+
173+ vec<PTRef> processedFormulas = preprocessFormulasPerPartition (frame.formulas , context);
174+ for (PTRef fla : processedFormulas) {
175+ status = giveToSolver (fla, frameId);
176+ if (status == s_False) { return false ; }
177+ }
178+
179+ assert (status != s_False);
180+ return true ;
181+ }
182+
171183PTRef MainSolver::preprocessFormulasDefault (vec<PTRef> const & frameFormulas, PreprocessingContext const & context) {
172184 assert (not context.perPartition );
173185
0 commit comments