calebwin / lin

a higher-level DSL for linear programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lin

lin is a minimalist Rosette-based DSL for linear programming. Here's an example...

; declare variables
(def desirability)
(def supply)
(def cost)
(def price)
(def profit)

; constrain variables
(let (> price 0))
(let (> cost 0))
(let (equal? profit (+ (* 1 price) (* -1 cost))))
(let (> supply 0))

; set variables
(set desirability 90)
(set supply 50)
(set cost 5)

; maximize
(max profit)

; solution
(get price)

lin compiles your code to Rosette code applying one of a variety of solvers to compute satisfiable solutions.

About

a higher-level DSL for linear programming


Languages

Language:Racket 100.0%