compiling opl to hal virginia lee mei leng supervisor: dr maria garcia de la banda a/prof kim...
Post on 21-Dec-2015
223 views
TRANSCRIPT
Compiling OPL to HAL
Virginia Lee Mei LengSupervisor: Dr Maria Garcia de la
Banda A/Prof Kim Marriott
Copyright © 2002 Virginia Lee
Modelling Languages
Problem modelling is hard Cater for modeller with no programming
background Capable of expressing the language used by
the experts Solved combinatorial (NP hard) problems
Copyright © 2002 Virginia Lee
Modelling NP hard problems
NP hard problem examples:– Maximize profit – Minimize cost– Map colouring– Timetabling– Resource allocation– Staff scheduling
Closely related Mathematical notations Modelling languages examples GAMS, AMPL
Copyright © 2002 Virginia Lee
What is HAL?
Constraint programming language Jointly developed in Monash University and
Melbourne University Allows experimentation with different solvers Difficult to use for non CP programmers
Copyright © 2002 Virginia Lee
Aim of this project
Add modelling capabilities to HAL
HALModelling Language
User
Compiler
1
HAL Library2
Copyright © 2002 Virginia Lee
OPL
Modelling language Expressive and powerful Used in the commercial world More closely resemble HAL
Copyright © 2002 Virginia Lee
Map colouring example
enum States {WA, SA, NT, VIC, NSW, Q};enum Colours {blue, red, yellow};var Colours colour[States];solve {
colour[WA] <> colour[NT]; colour[WA] <> colour[SA];colour[NT] <> colour[SA]; colour[NT] <> colour[Q];colour[SA] <> colour[Q]; colour[SA] <> colour[NSW];colour[SA] <> colour[VIC]; colour[Q] <> colour[NSW];colour[NSW] <> colour[VIC];
};
Copyright © 2002 Virginia Lee
Project Phases
3 phases1. Lexical analyser and parser
2. Representing OPL data structures
3. Extending HAL’s library• To support Mathematical notations like (forall)• To support search strategies• To incorporate OPL’s reflective functions
Copyright © 2002 Virginia Lee
Progress of the project
Parsers 80% of the OPL syntax 1000 lines of Mercury code HAL code generation
Copyright © 2002 Virginia Lee
Conclusion
This project - Will bridge the gap between modelling and
problem solving for HAL- Ease the task of modelling for HAL users- Is important because it might provide new insight
to tackle NP hard related problems