Conjure Revisited: Towards Automated Constraint Modelling Ozgur - - PowerPoint PPT Presentation

conjure revisited towards automated constraint modelling
SMART_READER_LITE
LIVE PREVIEW

Conjure Revisited: Towards Automated Constraint Modelling Ozgur - - PowerPoint PPT Presentation

Introduction Approach Conclusion Conjure Revisited: Towards Automated Constraint Modelling Ozgur Akgun 1 , Alan M. Frisch 2 , Brahim Hnich 3 , Chris Jefferson 1 , Ian Miguel 1 1 School of Computer Science, University of St Andrews, UK 2


slide-1
SLIDE 1

Introduction Approach Conclusion

Conjure Revisited: Towards Automated Constraint Modelling

Ozgur Akgun1, Alan M. Frisch2, Brahim Hnich3, Chris Jefferson1, Ian Miguel1

1 School of Computer Science, University of St Andrews, UK 2 Artificial Intelligence Group, Dept. of Computer Science, University of York, UK 3 Department of Computer Engineering, Izmir University of Economics, Turkey

ModRef 2010 The 9th International Workshop on Constraint Modelling and Reformulation

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-2
SLIDE 2

Introduction Approach Conclusion

1

Introduction What is? Essence Essence by example Essence′

1

Approach The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

1

Conclusion Coverage and limitations Conclusion and future work

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-3
SLIDE 3

Introduction Approach Conclusion What is? Essence Essence by example Essence′

What is?

Essence: a high level problem specification language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-4
SLIDE 4

Introduction Approach Conclusion What is? Essence Essence by example Essence′

What is?

Essence: a high level problem specification language Conjure: a tool to generate multiple CSP models given a problem specification

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-5
SLIDE 5

Introduction Approach Conclusion What is? Essence Essence by example Essence′

What is?

Essence: a high level problem specification language Conjure: a tool to generate multiple CSP models given a problem specification Essence′: a solver independent, problem class level CSP modelling language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-6
SLIDE 6

Introduction Approach Conclusion What is? Essence Essence by example Essence′

What is?

Essence: a high level problem specification language Conjure: a tool to generate multiple CSP models given a problem specification Essence′: a solver independent, problem class level CSP modelling language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-7
SLIDE 7

Introduction Approach Conclusion What is? Essence Essence by example Essence′

What is?

Essence: a high level problem specification language Conjure: a tool to generate multiple CSP models given a problem specification Essence′: a solver independent, problem class level CSP modelling language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-8
SLIDE 8

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence

A high level problem specification language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-9
SLIDE 9

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence

A high level problem specification language Supports many type constructors that allow problems to be specified in natural ways

boolean, integer, enumeration, unnamed types, set, multi-set, function, relation, tuple, and arbitrary nestings of these type constructors

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-10
SLIDE 10

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence

A high level problem specification language Supports many type constructors that allow problems to be specified in natural ways

boolean, integer, enumeration, unnamed types, set, multi-set, function, relation, tuple, and arbitrary nestings of these type constructors

No CSP modelling decisions involved

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-11
SLIDE 11

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence by example

Problem

given n distinct items, with associated weights and values select a set out of these items maximising total value such that the total weight is not more than that of you can carry

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-12
SLIDE 12

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence by example

given item : enum given w: function item − > int (0 . . ) given v : function item − > int (0 . . ) given cap : int (0 . . ) find x : set

  • f

item maximising sum i : x . v ( i ) such that sum i : x . w( i ) < = cap

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-13
SLIDE 13

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-14
SLIDE 14

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence Operates on problem class level

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-15
SLIDE 15

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence Operates on problem class level Supports boolean and integer decision variables, and multi-dimensional matrices

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-16
SLIDE 16

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence Operates on problem class level Supports boolean and integer decision variables, and multi-dimensional matrices Supports several global constraints, in addition to common arithmetic and logical ones

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-17
SLIDE 17

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence Operates on problem class level Supports boolean and integer decision variables, and multi-dimensional matrices Supports several global constraints, in addition to common arithmetic and logical ones Tailor compiles efficient CSP models to multiple target solvers

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-18
SLIDE 18

Introduction Approach Conclusion What is? Essence Essence by example Essence′

Essence′

Almost a subset of Essence Operates on problem class level Supports boolean and integer decision variables, and multi-dimensional matrices Supports several global constraints, in addition to common arithmetic and logical ones Tailor compiles efficient CSP models to multiple target solvers

Minion Gecode FlatZinc

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-19
SLIDE 19

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The task

Compile Essence specifications to multiple Essence′ models

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-20
SLIDE 20

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The task

Compile Essence specifications to multiple Essence′ models Compilation process needs to be easily modifiable

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-21
SLIDE 21

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The task

Compile Essence specifications to multiple Essence′ models Compilation process needs to be easily modifiable

A term rewriting infrastructure supported by a set of rewrite rules

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-22
SLIDE 22

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-23
SLIDE 23

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-24
SLIDE 24

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-25
SLIDE 25

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input Representations phase

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-26
SLIDE 26

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input Representations phase Auto-Channelling phase

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-27
SLIDE 27

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input Representations phase Auto-Channelling phase Adding structural constraints

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-28
SLIDE 28

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input Representations phase Auto-Channelling phase Adding structural constraints Expression rewriting

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-29
SLIDE 29

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline

Parsing Type checking Validating the input Representations phase Auto-Channelling phase Adding structural constraints Expression rewriting Presentation

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-30
SLIDE 30

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Representations phase

One of the two kinds of modelling decisions

Selecting the viewpoint

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-31
SLIDE 31

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Representations phase

One of the two kinds of modelling decisions

Selecting the viewpoint

Select a representation for every parameter and decision variable

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-32
SLIDE 32

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Representations phase

One of the two kinds of modelling decisions

Selecting the viewpoint

Select a representation for every parameter and decision variable Possible to represent a variable in multiple ways

if it appears in more than one constraint

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-33
SLIDE 33

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

2 representations for sets

Given: set (size 2) of int(1..3)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-34
SLIDE 34

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

2 representations for sets

Given: set (size 2) of int(1..3)

Explicit representation: matrix indexed by [int(1..2)] of int(1..3)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-35
SLIDE 35

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

2 representations for sets

Given: set (size 2) of int(1..3)

Explicit representation: matrix indexed by [int(1..2)] of int(1..3) Occurrence representation: matrix indexed by [int(1..3)] of bool

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-36
SLIDE 36

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x : set ( size n)

  • f

int ( lb . . ub ) such that x subseteq s , f o r a l l i : x . k ( i )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-37
SLIDE 37

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x o ccr : set ( size n)

  • f

int ( lb . . ub ) such that x o ccr subseteq s , f o r a l l i : x o ccr . k ( i )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-38
SLIDE 38

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x e x p l : set ( size n)

  • f

int ( lb . . ub ) such that x e x p l subseteq s , f o r a l l i : x e x p l . k ( i )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-39
SLIDE 39

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x ? : set ( size n)

  • f

int ( lb . . ub ) such that x o ccr subseteq s , f o r a l l i : x e x p l . k ( i )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-40
SLIDE 40

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x e x p l : set ( size n)

  • f

int ( lb . . ub ) find x o ccr : set ( size n)

  • f

int ( lb . . ub ) such that x o ccr subseteq s , f o r a l l i : x e x p l . k ( i )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-41
SLIDE 41

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x e x p l : set ( size n)

  • f

int ( lb . . ub ) find x o ccr : set ( size n)

  • f

int ( lb . . ub ) such that x o ccr subseteq s , f o r a l l i : x e x p l . k ( i ) , x o ccr = x e x p l

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-42
SLIDE 42

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Auto-Channelling phase

More than one representation for a decision variable => pairwise equality constraints!

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-43
SLIDE 43

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Adding structural constraints

Now, representations for decision variables are known

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-44
SLIDE 44

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Adding structural constraints

Now, representations for decision variables are known “Structural constraints” are added to the model

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-45
SLIDE 45

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

The pipeline: Adding structural constraints

Now, representations for decision variables are known “Structural constraints” are added to the model

an alldiff constraint for x_expl a cardinality constraint for x_occr

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-46
SLIDE 46

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example, structural constraints added

given lb , ub , n : int given s : set

  • f

int ( lb . . ub ) find x e x p l : set ( size n)

  • f

int ( lb . . ub ) find x o ccr : set ( size n)

  • f

int ( lb . . ub ) such that x o ccr subseteq s , f o r a l l i : x e x p l . k ( i ) , x o ccr = x expl , { a l l d i f f

  • n

x expl ’ s refinement } , { c a r d i n a l i t y

  • n x occr ’ s

refinement }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-47
SLIDE 47

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example, final

given lb , ub , n : i n t given s o c c r : matrix indexed by [ i n t ( l b . . ub ) ]

  • f

bool f i n d x e x p l : matrix indexed by [ i n t (1 . . n ) ]

  • f

i n t ( l b . . ub ) f i n d x o c c r : matrix indexed by [ i n t ( l b . . ub ) ]

  • f

bool such that f o r a l l i : i n t ( l b . . ub ) . x o c c r [ i ] < = s o c c r [ i ] , f o r a l l i : i n t (1 . . n ) . k ( x e x p l [ i ] ) , f o r a l l i : i n t (1 . . n ) . x o c c r [ x e x p l [ i ] ] = 1 , f o r a l l i : i n t ( l b . . ub ) . ( x o c c r [ i ] = > e x i s t s j : i n t (1 . . n ) . x e x p l [ j ] = i ) , a l l d i f f ( x e x p l ) , sum i : i n t ( l b . . ub ) . x o c c r [ i ] = n

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-48
SLIDE 48

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Non-deterministic Rewriting

Given a set of rewrite rules and a starting term, apply the rules repeatedly.

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-49
SLIDE 49

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Non-deterministic Rewriting

Given a set of rewrite rules and a starting term, apply the rules repeatedly.

normal form

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-50
SLIDE 50

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Non-deterministic Rewriting

Given a set of rewrite rules and a starting term, apply the rules repeatedly.

normal form

More than one rule can match a term.

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-51
SLIDE 51

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Non-deterministic Rewriting

Given a set of rewrite rules and a starting term, apply the rules repeatedly.

normal form

More than one rule can match a term.

Select one at random?

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-52
SLIDE 52

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Non-deterministic Rewriting

Given a set of rewrite rules and a starting term, apply the rules repeatedly.

normal form

More than one rule can match a term.

Select one at random? Apply all matching rules? (produces a list of terms)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-53
SLIDE 53

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-54
SLIDE 54

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

A * B -> A + A, if B is 2 A / B -> A , if B is 1

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-55
SLIDE 55

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

A * B -> A + A, if B is 2 A / B -> A , if B is 1

This is a partial mapping.

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-56
SLIDE 56

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

A * B -> A + A, if B is 2 A / B -> A , if B is 1

This is a partial mapping. Can combine multiple such rules, into a one-to-many mapping.

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-57
SLIDE 57

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

A * B -> A + A, if B is 2 A / B -> A , if B is 1

This is a partial mapping. Can combine multiple such rules, into a one-to-many mapping.

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-58
SLIDE 58

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Rule representation

Rules are represented as directed equations with guards.

A * B -> A + A, if B is 2 A / B -> A , if B is 1

This is a partial mapping. Can combine multiple such rules, into a one-to-many mapping.

Subterms: {A,B,C,D} rule1: A to B rule2: A to C rule3: B to D allRules { (A, {B,C}) , (B, { D }) , (C, { C }) , (D, { D }) }

Handle just one rule.

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-59
SLIDE 59

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Some example rules

essence_expression equivalent_expression guards: properties that essence_expression must satisfy declarations: newly created variables and local aliases for expressions

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-60
SLIDE 60

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example rules: ruleSetEq

a = b a subseteq b /\ b subseteq a guards: a ∼ set of τ, b ∼ set of τ

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-61
SLIDE 61

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example rules: ruleSetSubsetEq

a subseteq b forall i : a . i elem b guards: a ∼ set of τ, b ∼ set of τ

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-62
SLIDE 62

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example rules: ruleSetElem

e elem s exists i : s . i = e guards: e ∼ τ, s ∼ set of τ

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-63
SLIDE 63

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Example rules: ruleSetQuan

forall i : (a union b) . k forall i : a . k /\ forall i : b . k exists i : (a union b) . k exists i : a . k \/ exists i : b . k forall i : (a intersect b) . k forall i : a ( i elem b => k ) forall i : (a intersect b) . k forall i : b ( i elem a => k ) exists i : (a intersect b) . k exists i : a ( i elem b /\ k ) exists i : (a intersect b) . k exists i : b ( i elem a /\ k )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-64
SLIDE 64

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-65
SLIDE 65

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

including previous implementations of Conjure

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-66
SLIDE 66

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

including previous implementations of Conjure

Now, can match with any subexpression, not necessarily complete constraints

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-67
SLIDE 67

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

including previous implementations of Conjure

Now, can match with any subexpression, not necessarily complete constraints

Can work on a non-flat model

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-68
SLIDE 68

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

including previous implementations of Conjure

Now, can match with any subexpression, not necessarily complete constraints

Can work on a non-flat model Able to reason about structure

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-69
SLIDE 69

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Some other tools reason about complete constraints

including previous implementations of Conjure

Now, can match with any subexpression, not necessarily complete constraints

Can work on a non-flat model Able to reason about structure Do more with fewer rules

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-70
SLIDE 70

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Consider: (a union b) subseteq c

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-71
SLIDE 71

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Consider: (a union b) subseteq c Flattened: aux subseteq c /\ aux = a union b

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-72
SLIDE 72

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Consider: (a union b) subseteq c Flattened: aux subseteq c /\ aux = a union b We could have: a subseteq c /\ b subseteq c

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-73
SLIDE 73

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Flattening = lost information

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-74
SLIDE 74

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Flattening = lost information We can still flatten things, but only if we want, using our powerful rewrite rules!

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-75
SLIDE 75

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

Flattening = lost information We can still flatten things, but only if we want, using our powerful rewrite rules! A small problem, where to put helper constraints?

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-76
SLIDE 76

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

given lb , ub , n ,m, k : int find t : set ( size n)

  • f

int ( lb . . ub ) find A : set ( size n) set ( size m)

  • f

int ( lb . . ub ) such that f o r a l l s : A . (max( s ) − max( t ) = k ) = > ( k elem s )

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-77
SLIDE 77

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

@: the bubble attaching operator

max(s) max_s @ bubble guards: s ∼ set of int declarations: max_s : int bubble = (max_s elem s) /\ (forall i : s . i <= max_s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-78
SLIDE 78

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-79
SLIDE 79

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-80
SLIDE 80

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-81
SLIDE 81

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s) forall s: A . (((max_s-max_t) @ (bubble_s /\ bubble_t))=k) => (k elem s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-82
SLIDE 82

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s) forall s: A . (((max_s-max_t) @ (bubble_s /\ bubble_t))=k) => (k elem s) forall s: A . (((max_s-max_t=k) @ (bubble_s /\ bubble_t))) => (k elem s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-83
SLIDE 83

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s) forall s: A . (((max_s-max_t) @ (bubble_s /\ bubble_t))=k) => (k elem s) forall s: A . (((max_s-max_t=k) @ (bubble_s /\ bubble_t))) => (k elem s) forall s: A . (((max_s-max_t=k) => (k elem s)) @ (bubble_s /\ bubble_t))

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-84
SLIDE 84

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s) forall s: A . (((max_s-max_t) @ (bubble_s /\ bubble_t))=k) => (k elem s) forall s: A . (((max_s-max_t=k) @ (bubble_s /\ bubble_t))) => (k elem s) forall s: A . (((max_s-max_t=k) => (k elem s)) @ (bubble_s /\ bubble_t)) forall s: A . (((max_s-max_t=k) => (k elem s)) /\ bubble_s /\ bubble_t)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-85
SLIDE 85

Introduction Approach Conclusion The task The pipeline Non-deterministic Rewriting Some rules Matching expressions, not constraints

Matching expressions, not constraints

forall s: A . (max(s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - max(t) = k) => (k elem s) forall s: A . ((max_s@bubble_s) - (max_t@bubble_t) = k) => (k elem s) forall s: A . (((max_s-max_t) @ (bubble_s /\ bubble_t))=k) => (k elem s) forall s: A . (((max_s-max_t=k) @ (bubble_s /\ bubble_t))) => (k elem s) forall s: A . (((max_s-max_t=k) => (k elem s)) @ (bubble_s /\ bubble_t)) forall s: A . (((max_s-max_t=k) => (k elem s)) /\ bubble_s /\ bubble_t) bubble_t /\ forall s: A . (((max_s-max_t=k) => (k elem s)) /\ bubble_s)

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-86
SLIDE 86

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Coverage of Essence

Essence has 7 core type constructors

matrix, set, mset, partition, tuple, function, relation

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-87
SLIDE 87

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Coverage of Essence

Essence has 7 core type constructors

matrix, set, mset, partition, tuple, function, relation

Type constructors supported: all except partition

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-88
SLIDE 88

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Coverage of Essence

Essence has 7 core type constructors

matrix, set, mset, partition, tuple, function, relation

Type constructors supported: all except partition Also we haven’t yet implemented support for enumerated and unnamed types

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-89
SLIDE 89

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Coverage of Essence

Essence has 7 core type constructors

matrix, set, mset, partition, tuple, function, relation

Type constructors supported: all except partition Also we haven’t yet implemented support for enumerated and unnamed types There are nearly 30 operators defined on these type constructors

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-90
SLIDE 90

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Coverage of Essence

Essence has 7 core type constructors

matrix, set, mset, partition, tuple, function, relation

Type constructors supported: all except partition Also we haven’t yet implemented support for enumerated and unnamed types There are nearly 30 operators defined on these type constructors Almost all of them implemented

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-91
SLIDE 91

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Differences to the prototype implementation

Broader coverage of Essence

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-92
SLIDE 92

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Differences to the prototype implementation

Broader coverage of Essence Representation decisions

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-93
SLIDE 93

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Differences to the prototype implementation

Broader coverage of Essence Representation decisions Auto-channelling becomes very easy

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-94
SLIDE 94

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Differences to the prototype implementation

Broader coverage of Essence Representation decisions Auto-channelling becomes very easy No flattening

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-95
SLIDE 95

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Differences to the prototype implementation

Broader coverage of Essence Representation decisions Auto-channelling becomes very easy No flattening Easier rule authoring

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-96
SLIDE 96

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Conclusion and future work

New version of Conjure with far greater coverage of the Essence language

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-97
SLIDE 97

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Conclusion and future work

New version of Conjure with far greater coverage of the Essence language Immediate future work, covering all of the types and

  • perations in Essence

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-98
SLIDE 98

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Conclusion and future work

New version of Conjure with far greater coverage of the Essence language Immediate future work, covering all of the types and

  • perations in Essence

Capture best modelling practices

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-99
SLIDE 99

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Conclusion and future work

New version of Conjure with far greater coverage of the Essence language Immediate future work, covering all of the types and

  • perations in Essence

Capture best modelling practices Model selection

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling

slide-100
SLIDE 100

Introduction Approach Conclusion Coverage and limitations Conclusion and future work

Conclusion and future work

New version of Conjure with far greater coverage of the Essence language Immediate future work, covering all of the types and

  • perations in Essence

Capture best modelling practices Model selection Investigate multi-model search techniques

Ozgur Akgun, et al. Conjure Revisited: Towards Automated Constraint Modelling