Logo GenPRES

Constraint Module

Orders constraints by priority, applies a constraint to the matching variable in a list of equations and solves the equations. Raises a solver exception when no variable matches.

Functions and values

Function or value Description

apply log c eqs

Full Usage: apply log c eqs

Parameters:
Returns: Variable The variable the constraint is applied to

Apply a constraint to the matching variables in the list of equations.

log : Logger

The logger

c : Constraint

The constraint

eqs : Equation list

The list of Equations

Returns: Variable

The variable the constraint is applied to

eqsName c1 c2

Full Usage: eqsName c1 c2

Parameters:
Returns: bool

Check whether constraint c1 has the same name as constraint c2.

c1 : Constraint
c2 : Constraint
Returns: bool

orderConstraints log cs

Full Usage: orderConstraints log cs

Parameters:
    log : Logger - The logger to log operations
    cs : Constraint list - The list of constraints

Returns: Constraint list

Order constraints based on their score.

log : Logger

The logger to log operations

cs : Constraint list

The list of constraints

Returns: Constraint list

scoreConstraint c

Full Usage: scoreConstraint c

Parameters:
Returns: int * Constraint

Give a constraint a score based on the property. Low scores should be solved first.

c : Constraint

The constraint

Returns: int * Constraint

solve onlyMinIncrMax log sortQue c eqs

Full Usage: solve onlyMinIncrMax log sortQue c eqs

Parameters:
    onlyMinIncrMax : bool - Whether only min incr max should be calculated
    log : Logger - The logger
    sortQue : bool -> Equation list -> (int * Equation) list - The algorithm to sort the equations
    c : Constraint - The constraint
    eqs : Equation list - The list of Equations

Returns: Result<Equation list, (Equation list * Message list)>

Apply a constraint to the matching variables and solve the list of equations.

onlyMinIncrMax : bool

Whether only min incr max should be calculated

log : Logger

The logger

sortQue : bool -> Equation list -> (int * Equation) list

The algorithm to sort the equations

c : Constraint

The constraint

eqs : Equation list

The list of Equations

Returns: Result<Equation list, (Equation list * Message list)>

toString arg1

Full Usage: toString arg1

Parameters:
Returns: string

Print the constraint as a string

arg0 : Constraint
Returns: string

Type something to start searching.