@@ -156,7 +156,7 @@ def finish(status):
156156 cprint ("c [manthan] negative unates" , NegUnate )
157157
158158 Unates = PosUnate + NegUnate
159- if Unates :
159+ if Unates and args . apply_unates == 1 :
160160 qdimacs_list , unsat = _apply_unates_to_qdimacs (
161161 qdimacs_list , PosUnate , NegUnate )
162162 if unsat :
@@ -175,6 +175,9 @@ def finish(status):
175175 shutil .copyfile (qdimacs_path , keep_path )
176176 if getattr (args , "verbose" , 0 ) >= 1 :
177177 cprint ("c [manthan] saved unate-substituted qdimacs:" , keep_path )
178+ elif Unates and args .apply_unates == 0 :
179+ if args .verbose :
180+ cprint ("c [manthan] unates detected; substitution disabled (--apply-unates=0)" )
178181
179182 else :
180183 Unates = []
@@ -333,7 +336,13 @@ def finish(status):
333336 shutil .copyfile (errorformula , last_errorformula_path )
334337 cprint ("c [manthan] last successful error formula:" , last_errorformula_path )
335338 if check == 0 :
336- cprint ("c [manthan] error --- ABC network read fail" )
339+ errorformula = temp_path (temp_stem + "_errorformula.v" )
340+ if args .debug_keep and not os .path .isfile (errorformula ):
341+ errorformula = os .path .abspath (temp_stem + "_errorformula.v" )
342+ cprint ("c [manthan] error --- file_generation_cex failed to read error formula" )
343+ cprint ("c [manthan] errorformula:" , errorformula )
344+ if not args .verbose :
345+ cprint ("c [manthan] hint: rerun with --verb=1 to see ABC stderr" )
337346 status = "failed"
338347 break
339348 if ret == 0 :
@@ -442,6 +451,15 @@ def finish(status):
442451 choices = [0 , 1 ],
443452 help = "enable preprocess: 1; disable: 0; default 1" ,
444453 )
454+ parser .add_argument (
455+ "--apply-unates" ,
456+ nargs = "?" ,
457+ const = 1 ,
458+ default = 1 ,
459+ type = int ,
460+ choices = [0 , 1 ],
461+ help = "substitute unates into the spec: 1; disable substitution: 0; default 1" ,
462+ )
445463 parser .add_argument (
446464 "--multiclass" ,
447465 nargs = "?" ,
0 commit comments