furlong v0.2.0 Furlong.Symbolics View Source

Functions for constructing constraints.

x = make_ref()
y = make_ref()

constraint = lte(add(x, 2), add(multiply(y, 5), 10)) # x + 2 <= 5 * y + 10

Link to this section Summary

Functions

Adds two summands, which can be constants, variables, terms, expressions.

Divides a variable / term / expression by a constant.

Creates an equality constraint.

Creates an inequality constraint, where the first argument is greater than or equal to the second argument.

Creates an inequality constraint, where the first argument is less than or equal to the second argument.

Multiplies a variable / term / expression with a constant.

Negates a variable / term / expression.

Reduces common terms in an expression by summing their coefficients.

Subtraction. Minuend and subtrahend can be constants, variables, terms, expressions.

Link to this section Functions

Adds two summands, which can be constants, variables, terms, expressions.

Link to this function

divide(var, denominator)

View Source

Divides a variable / term / expression by a constant.

Creates an equality constraint.

Creates an inequality constraint, where the first argument is greater than or equal to the second argument.

Creates an inequality constraint, where the first argument is less than or equal to the second argument.

Link to this function

multiply(var, coefficient)

View Source

Multiplies a variable / term / expression with a constant.

Negates a variable / term / expression.

Reduces common terms in an expression by summing their coefficients.

Link to this function

subtract(expression, constant)

View Source

Subtraction. Minuend and subtrahend can be constants, variables, terms, expressions.