Giter VIP home page Giter VIP logo

mps-to-dsl's Introduction

mps-to-dsl

Converts MPS file to Scala/Prolog simplex DSL input.

Usage

  1. Download SoPlex.
  2. Select a MPS file from soplex-2.2.0/check directory. For example, select afiro.mps.
  3. Copy the MPS in mps-to-dsl directory.
  4. python3 mps_to_dsl.py < afiro.mps

Scala DSL Output

minimize (10.0*x(6) + -0.6*x(7) + -0.4*x(20) + -0.32*x(26) + -0.48*x(31)) subjectTo {
  -1.0*x(3) + 0.109*x(13) <= 0.0
  1.0*x(2) + 1.0*x(11) <= 310.0
  -0.86*x(1) + -1.06*x(5) + -0.96*x(9) + -1.06*x(10) + 1.0*x(16) == 0.0
  -1.0*x(20) + 1.4*x(26) <= 0.0
  -1.0*x(8) + 1.0*x(14) <= 0.0
  1.0*x(6) + 1.0*x(14) + 1.0*x(15) + 1.0*x(21) + 1.0*x(28) + 1.0*x(30) + -1.0*x(31) == 44.0
  0.108*x(14) + 0.107*x(15) + -1.0*x(25) + 0.109*x(28) + 0.108*x(30) <= 0.0
  -1.06*x(0) + 1.0*x(2) == 0.0
  -1.0*x(7) + 1.4*x(31) <= 0.0
  1.0*x(1) + -1.0*x(18) <= 0.0
  -1.0*x(4) + 1.0*x(28) <= 500.0
  1.0*x(11) + -0.43*x(13) == 0.0
  -1.0*x(27) + 1.0*x(30) <= 0.0
  1.0*x(5) + -1.0*x(12) <= 80.0
  1.0*x(16) + 1.0*x(24) <= 300.0
  -1.0*x(0) + 1.0*x(3) + 1.0*x(20) == 0.0
  -1.0*x(1) + -1.0*x(5) + -1.0*x(9) + -1.0*x(10) + 1.0*x(25) + 1.0*x(26) == 0.0
  2.191*x(4) + 2.219*x(8) + 2.364*x(12) + 2.429*x(18) + -1.0*x(19) + 2.279*x(22) + 2.386*x(23) + 2.249*x(27) + 2.408*x(29) <= 0.0
  1.0*x(13) <= 500.0
  0.301*x(0) + -1.0*x(17) <= 0.0
  1.0*x(0) <= 80.0
  1.0*x(15) + -1.0*x(22) <= 0.0
  1.0*x(9) + -1.0*x(29) <= 0.0
  1.0*x(7) + -1.0*x(13) + 1.0*x(17) + 1.0*x(19) == 0.0
  -0.43*x(14) + -0.37*x(15) + 1.0*x(24) + -0.43*x(28) + -0.39*x(30) == 0.0
  1.0*x(10) + -1.0*x(23) <= 0.0
  0.326*x(1) + 0.301*x(5) + 0.313*x(9) + 0.313*x(10) + -1.0*x(21) <= 0.0
}

Prlog DSL Output

-0.39$4 + -0.37$19 + -0.43$20 + 1.0$22 + -0.43$26 :== 0.0.
1.0$13 + 1.0$22 :<= 300.0.
1.0$1 + -1.0$28 :<= 80.0.
1.0$0 + -1.06$25 :== 0.0.
1.0$12 + -1.0$16 + 1.0$27 + 1.0$29 :== 0.0.
-1.0$1 + 1.0$3 + -1.0$6 + -1.0$15 + -1.0$23 + 1.0$24 :== 0.0.
2.249$7 + 2.279$8 + 2.408$9 + 2.191$11 + -1.0$12 + 2.219$18 + 2.386$21 + 2.364$28 + 2.429$31 :<= 0.0.
1.0$0 + 1.0$10 :<= 310.0.
0.301$25 + -1.0$27 :<= 0.0.
-1.06$1 + -1.06$6 + 1.0$13 + -0.86$15 + -0.96$23 :== 0.0.
-1.0$2 + 1.0$4 + 1.0$14 + 1.0$17 + 1.0$19 + 1.0$20 + 1.0$26 :== 44.0.
1.0$4 + -1.0$7 :<= 0.0.
-1.0$5 + 1.4$24 :<= 0.0.
-1.0$8 + 1.0$19 :<= 0.0.
1.0$10 + -0.43$16 :== 0.0.
-1.0$3 + 0.108$4 + 0.107$19 + 0.108$20 + 0.109$26 :<= 0.0.
-1.0$11 + 1.0$26 :<= 500.0.
1.0$16 :<= 500.0.
1.0$6 + -1.0$21 :<= 0.0.
-1.0$9 + 1.0$23 :<= 0.0.
0.301$1 + 0.313$6 + 0.326$15 + -1.0$17 + 0.313$23 :<= 0.0.
0.109$16 + -1.0$30 :<= 0.0.
1.0$5 + -1.0$25 + 1.0$30 :== 0.0.
1.0$25 :<= 80.0.
1.4$2 + -1.0$29 :<= 0.0.
-1.0$18 + 1.0$20 :<= 0.0.
1.0$15 + -1.0$31 :<= 0.0.
-0.48$2 + -0.4$5 + 10.0$14 + -0.32$24 + -0.6$29 :-> min.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.