Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ModRef'09: Gecode support for MCP

945 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ModRef'09: Gecode support for MCP

  1. 1. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Monadic Constraint Programming with Gecode Pieter Wuille Tom Schrijvers ModRef’09 Lisbon, September 20, 2009
  2. 2. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Modelling languages Zinc approach Gecode approach Separate language: Library for existing language: Very declarative Boilerplate/function calls Transferring data/results Directly callable/usable Not all language features All host-language features
  3. 3. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Modelling languages Zinc approach Gecode approach Separate language: Library for existing language: Very declarative Boilerplate/function calls Transferring data/results Directly callable/usable Not all language features All host-language features MCP approach Best of both worlds: High-level abstractions Very declarative Directly usable + Compositional search transformers
  4. 4. Modelling Languages Monadic Constraint Programming Benchmarks Future Work MCP Framework MCP Framework Constraint Solving framework for Haskell Multiple solvers, variables, domains, search strategies, . . . Fully functional, no side-effects Solver states and search trees are first-class data Defines common syntactic sugar
  5. 5. Modelling Languages Monadic Constraint Programming Benchmarks Future Work FD-MCP: FD solving for MCP FD-MCP: Common FD Infrastructure FD syntax for term and constraint language Model optimizations and decompositions Multiple solver backends
  6. 6. Modelling Languages Monadic Constraint Programming Benchmarks Future Work FD-MCP: FD solving for MCP: example model :: FDModel model = exist 4 $ list@[a,b,c,d] -> list ‘allin‘ (0,711) / sorted list / a + b + c + d @= 711 / a * b * c * d @= 711*100*100*100 / return list main = example_main_void model
  7. 7. Modelling Languages Monadic Constraint Programming Benchmarks Future Work FD-MCP: Solvers FD Solvers Haskell-only solver Pseudo-solver that generates C++ code for Gecode new Real solver using Gecode propagation new Real solver using Gecode search+propagation
  8. 8. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Benchmark: Allinterval Benchmark allinterval 1000 C++ Gecode MCP Generated C++ 100 MCP using Gecode prop MCP using Gecode prop+search 10 MCP Haskell 1 time (s) 0.1 0.01 0.001 0.0001 1e-05 2 4 6 8 10 12 14 16 problem size
  9. 9. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Benchmark: Partition Benchmark partition 1000 C++ Gecode MCP Generated C++ 100 MCP using Gecode prop MCP using Gecode prop+search MCP Haskell 10 1 time (s) 0.1 0.01 0.001 0.0001 4 6 8 10 12 14 16 18 20 problem size
  10. 10. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Future Work Future work More benchmarks Improve performance of MCP using Gecode propagation Parametrized models, loop constructs, reification, . . . More backends, constraints, variable types, . . . Optimizations, generalizations Concurrency
  11. 11. Modelling Languages Monadic Constraint Programming Benchmarks Future Work Thank you! Questions? Further reading: Monadic Constraint Programming, T. Schrijvers, P. Stuckey, P. Wadler. Journal of Functional Programming – to appear. More information: Source code, papers, . . . http://www.cs.kuleuven.be/~pieterw/site.php/Topics/FDMCP

×