compiling opl to hal virginia lee mei leng supervisor: dr maria garcia de la banda a/prof kim...

10
Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

Post on 21-Dec-2015

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

Compiling OPL to HAL

Virginia Lee Mei LengSupervisor: Dr Maria Garcia de la

Banda A/Prof Kim Marriott

Page 2: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: 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

Page 3: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

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

Page 4: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

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

Page 5: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

Copyright © 2002 Virginia Lee

Aim of this project

Add modelling capabilities to HAL

HALModelling Language

User

Compiler

1

HAL Library2

Page 6: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

Copyright © 2002 Virginia Lee

OPL

Modelling language Expressive and powerful Used in the commercial world More closely resemble HAL

Page 7: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

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];

};

Page 8: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

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

Page 9: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

Copyright © 2002 Virginia Lee

Progress of the project

Parsers 80% of the OPL syntax 1000 lines of Mercury code HAL code generation

Page 10: Compiling OPL to HAL Virginia Lee Mei Leng Supervisor: Dr Maria Garcia de la Banda A/Prof Kim Marriott

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