An open API service indexing awesome lists of open source software.

https://github.com/calebwin/lin

a higher-level DSL for linear programming
https://github.com/calebwin/lin

lin linear-programming linear-programming-solver racket rosette solver

Last synced: 7 months ago
JSON representation

a higher-level DSL for linear programming

Awesome Lists containing this project

README

          

# lin
lin is a minimalist [Rosette](http://emina.github.io/rosette/)-based DSL for linear programming. Here's an example...
```racket
; 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](https://docs.racket-lang.org/rosette-guide/sec_solvers-and-solutions.html#%28def._%28%28lib._rosette%2Fquery%2Fcore..rkt%29._current-solver%29%29) to compute satisfiable solutions.