- File:
-
- 1 edited
-
src/ResolvExpr/SatisfyAssertions.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/SatisfyAssertions.cpp
r1958fec r3e5dd913 202 202 ast::ptr< ast::Type > toType = assn.first->result; 203 203 ast::ptr< ast::Type > adjType = 204 renameTyVars( adjustExprType( candidate->get_type(), newEnv, sat.symtab ) , GEN_USAGE, false);204 renameTyVars( adjustExprType( candidate->get_type(), newEnv, sat.symtab ) ); 205 205 206 206 // only keep candidates which unify … … 385 385 386 386 /// Limit to depth of recursion of assertion satisfaction 387 static const int recursionLimit = 8;387 static const int recursionLimit = 4; 388 388 /// Maximum number of simultaneously-deferred assertions to attempt concurrent satisfaction of 389 389 static const int deferLimit = 10; … … 417 417 if ( it != thresholds.end() && it->second < sat.costs ) goto nextSat; 418 418 419 // should a limit be imposed? worst case here is O(n^2) but very unlikely to happen. 420 for (unsigned resetCount = 0; ; ++resetCount) { 421 ast::AssertionList next; 422 resetTyVarRenaming(); 423 // make initial pass at matching assertions 424 for ( auto & assn : sat.need ) { 425 // fail early if any assertion is not satisfiable 426 if ( ! satisfyAssertion( assn, sat ) ) { 427 next.emplace_back(assn); 428 // goto nextSat; 429 } 430 } 431 // success 432 if (next.empty()) break; 433 // fail if nothing resolves 434 else if (next.size() == sat.need.size()) { 419 // make initial pass at matching assertions 420 for ( auto & assn : sat.need ) { 421 // fail early if any assertion is not satisfiable 422 if ( ! satisfyAssertion( assn, sat ) ) { 435 423 Indenter tabs{ 3 }; 436 424 std::ostringstream ss; … … 438 426 print( ss, *sat.cand, ++tabs ); 439 427 ss << (tabs-1) << "Could not satisfy assertion:\n"; 440 ast::print( ss, next[0].first, tabs );428 ast::print( ss, assn.first, tabs ); 441 429 442 430 errors.emplace_back( ss.str() ); 443 431 goto nextSat; 444 432 } 445 sat.need = std::move(next);446 433 } 447 434
Note:
See TracChangeset
for help on using the changeset viewer.