Switch Chalk to recursive solver

+ various fixes related to that.
This commit is contained in:
Florian Diebold
2020-04-10 17:44:43 +02:00
parent 364415b7d6
commit 14570df015
5 changed files with 53 additions and 40 deletions

View File

@@ -16,10 +16,12 @@ use self::chalk::{from_chalk, Interner, ToChalk};
pub(crate) mod chalk;
mod builtin;
/// This controls the maximum size of types Chalk considers. If we set this too
/// high, we can run into slow edge cases; if we set it too low, Chalk won't
/// find some solutions.
const CHALK_SOLVER_MAX_SIZE: usize = 10;
// This controls the maximum size of types Chalk considers. If we set this too
// high, we can run into slow edge cases; if we set it too low, Chalk won't
// find some solutions.
// FIXME this is currently hardcoded in the recursive solver
// const CHALK_SOLVER_MAX_SIZE: usize = 10;
/// This controls how much 'time' we give the Chalk solver before giving up.
const CHALK_SOLVER_FUEL: i32 = 100;
@@ -30,8 +32,7 @@ struct ChalkContext<'a> {
}
fn create_chalk_solver() -> chalk_solve::Solver<Interner> {
let solver_choice =
chalk_solve::SolverChoice::SLG { max_size: CHALK_SOLVER_MAX_SIZE, expected_answers: None };
let solver_choice = chalk_solve::SolverChoice::recursive();
solver_choice.into_solver()
}