-
Notifications
You must be signed in to change notification settings - Fork 11
/
CompilationContext.scala
36 lines (33 loc) · 1.57 KB
/
CompilationContext.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package yuck.flatzinc.compiler
import scala.collection._
import yuck.core._
import yuck.flatzinc.FlatZincSolverConfiguration
import yuck.flatzinc.ast._
import yuck.util.logging.LazyLogger
/**
* @author Michael Marte
*
*/
final class CompilationContext(
var ast: FlatZincAst, // allow for AST transformation
val cfg: FlatZincSolverConfiguration,
val logger: LazyLogger)
{
val declaredVars = new mutable.HashSet[Expr]
val equalVars = new mutable.AnyRefMap[Expr, mutable.TreeSet[Expr] /* head = representative */]
val impliedConstraints = new mutable.HashSet[yuck.flatzinc.ast.Constraint]
val space = new Space(logger, cfg.checkConstraintPropagation)
val consts = new mutable.AnyRefMap[Expr, AnyVariable] // holds unnamed inline constants
val arrayConsts = new mutable.AnyRefMap[Expr, immutable.IndexedSeq[AnyVariable]] // holds unnamed inline arrays
val vars = new mutable.AnyRefMap[Expr, AnyVariable] // also holds named parameters
val arrays = new mutable.AnyRefMap[Expr, immutable.IndexedSeq[AnyVariable]]
val domains = new mutable.AnyRefMap[Expr, AnyDomain]
val searchVars = new mutable.HashSet[AnyVariable]
val definedVars = new mutable.HashSet[AnyVariable] // variables that occur in a defined_var annotation
val costVars = new mutable.ArrayBuffer[Variable[IntegerValue]]
var costVar: Variable[IntegerValue] = null
var objectiveVar: Variable[IntegerValue] = null
var objective: AnyObjective = null
val implicitlyConstrainedVars = new mutable.HashSet[AnyVariable]
var maybeNeighbourhood: Option[Neighbourhood] = null
}