Alan M' Frisch Ian Miguel - PowerPoint PPT Presentation

1 / 52
About This Presentation
Title:

Alan M' Frisch Ian Miguel

Description:

Alan M. Frisch Ian Miguel. Joint work with Matt Grum, Chris Jefferson ... Useful for solving a wide range of important, complex problems including ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 53
Provided by: ianm
Category:
Tags: alan | frisch | grum | ian | miguel

less

Transcript and Presenter's Notes

Title: Alan M' Frisch Ian Miguel


1
The Rules of ModellingAutomatic Generation of
Constraint Programs through Refinement
  • Alan M. Frisch Ian Miguel
  • Joint work with Matt Grum, Chris Jefferson
    Bernadette Martinez Hernandez

Artificial Intelligence Group Dept of Computer
Science University of York
School of Computer Science University of St
Andrews
2
Allocating a Divisible ResourceAn Application
to Grid Computing
  • Alan Frisch
  • Artificial Intelligence Group
  • Dept. Computer Science
  • University of York
  • 4pm, CS103

3
Modelling Bottleneck
  • Useful for solving a wide range of important,
    complex problems including scheduling,
    allocation, layout, configuration,
  • Modelling a problem as a constraint program
    requires moderate/great expertise.
  • Major barrier to widespread use of CP.

4
What are CP researchers doing?
  • Model Generation
  • Done in private.
  • Model Selection
  • Case studies
  • Some generalisations from analysis experiments

5
Reducing the Modelling BottleneckAutomated
Modelling
  • 2 to 3 years We have been generating models more
    and more systematically.
  • Embed systematic viewpoint in automated system
    (CONJURE).
  • Takes specification in high-level language
    (ESSENCE).
  • Reformulates specification into a set of correct
    constraint programs.
  • Ongoing add heuristics for model selection.

6
Outline
  • Reduced constraint programming.
  • ESSENCE.
  • CONJURE.
  • The big picture.

7
Part IReduced Constraint Programming
8
What is Constraint Programming?
  • Broad view programming in which constraints
    play a central role.
  • Narrow view solve combinatorial (optimisation)
    problem by
  • mapping it to a constraint satisfaction problem
  • solving the constraint satisfaction problem
  • mapping solution back to original problem

9
What is the (finite domain) CSP?
  • An instance comprises
  • Finite set of variables
  • Each associated with a finite domain
  • Finite set of constraints on the values taken by
    the variables
  • (Objective function)
  • Solution is assignment of values to variables
    that satisfies the constraints (and optimises
    objective function)

10
Modelling Just Do It!
  • Find 3 distinct non-zero digits that sum to 9.

11
Just Do It!
  • Find 3 distinct non-zero digits that sum to 9.
  • Variables X, Y, Z

12
Just Do It!
  • Find 3 distinct non-zero digits that sum to 9.
  • Variables/Domains X, Y, Z1,..9

13
Just Do It!
  • Find 3 distinct non-zero digits that sum to 9.
  • Variables/Domains X, Y, Z1,..9
  • Constraints X ? Y, Y ? Z, X ? Z,
  • XYZ9

14
Just Do It!
  • Find 3 distinct non-zero digits that sum to 9.
  • Variables/Domains X, Y, Z 1..9
  • Constraints X ? Y, Y ? Z, X ? Z,
  • XYZ9
    X ? Y ? Z

15
Just Do It!
  • Find 3 non-zero digits that sum to 9.
  • Variables/Domains X, Y, Z 1..9
  • Constraints X ? Y, Y ? Z, X ? Z,
  • XYZ9
    X ? Y ? Z X lt Y lt Z

16
Just Do It for a Problem
  • Given n and s, find n distinct non-zero digits
    that sum to s.

17
Model Explicit Representation
  • Given n and s, find n distinct non-zero digits
    that sum to s.


1
n
2
3
X

1..9
1..9
1..9
1..9
nnat, snatX matrix (indexed by 1.. n) of 1..9
given find such that
AllDiff(X)Si?1..n Xi s
?
18
Model Occurrence Representation
Given n and s, find n distinct non-zero digits
that sum to s.

1
9
2
3

D
0/1
0/1
0/1
0/1
nnat, snatD matrix (indexed by 1..9) of 0..1?
given find such that
D1 2D2 9D9 sD1 D2
D9 n
19
The SONET Problem
Specification
  • Given nrings rings, nnodes nodes, a set of pairs
    of nodes (communication demand) and an integer
    capacity (of each ring). Install nodes on rings
    satisfying demand and capacity constraints.
    Minimise installations.

Instance
  • nrings2, nnodes5, capacity 4
  • demand n1 n3, n1 n4, n2 n3, n2
    n4, n3 n5

Solution
n3
n1
n2
n5
n3
n4
20
A Model of SONET Problem
rings-nodes
Rings
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
Nodes
rings-nodesr,n 1 iff node n is installed on
ring r.
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
21
A Model of SONET Problem
rings-nodes
Rings
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
Nodes
ScalarProduct gt 0
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
Minimise S S rings-nodesr,n
0..1
0..1
0..1
0..1
0..1
0..1
0..1
0..1
n ? Nodes
r ? Rings

S ? c
S ? c
22
Part II
  • Abstract Problem Specifications
  • The ESSENCE Language

23
ESSENCE
  • The language enables problems to be specified at
    a level of abstraction above that at which
    modelling decisions are made.
  • This requires features not found in current
    constraint programming languages.

24
SONET Specification
given letting given find minimising such
that
nringsnat, nnodesnat, capacitynat Nodes be
1..nnodes demand set of set (size 2) of
Nodes rings mset (size nrings) of set (maxsize
capacity) of Nodes S r ? rings .r ?pair ?
demand . ?r ? rings . pair ? r
25
ESSENCE Provides Abstract Types Sets, Multisets,
Partitions, Range Types, Unnamed TypesFunctions,
Relations, Enumerated Types, Sequences
given letting given find minimising such
that
nringsnat, nnodesnat, capacitynat Nodes be
1..nnodes demand set of set (size 2) of
Nodes rings mset (size nrings) of set (maxsize
capacity) of Nodes S r ? rings .r ?pair ?
demand . ?r ? rings . pair ? r
Abstract types
26
ESSENCE SupportsArbitrarily-Nested Types
Arbitrary nesting of types
given letting given find minimising such
that
nringsnat, nnodesnat, capacitynat Nodes be
1..nnodes demand set of set (size 2) of
Nodes rings mset (size nrings) of set (maxsize
capacity) of Nodes S r ? rings .r ?pair ?
demand . ?r ? rings . pair ? r
27
ESSENCE Supports Quantification over Decision
Variables
given letting given find minimising such
that
nringsnat, nnodesnat, capacitynat Nodes be
1..nnodes demand set of set (size 2) of
Nodes rings mset (size nrings) of set (maxsize
capacity) of Nodes S r ? rings .r ?pair ?
demand . ?r ? rings . pair ? r
Quantifying Over Decision Variables
28
How Usable is ESSENCE?
  • Specifications of 50 problems found in the CSP
    literature written by an undergraduate with no
    background in constraint programming.
  • URL http//www.cs.york.ac.uk/aig/constraints/

29
ESSENCE
Abstract types
Arbitrary nesting of types
ESSENCE ESSENCE -
Quantifying Over Decision Variables
  • ESSENCE has a similar level of abstraction to
    existing constraint languages.

30
Model Generation Informal
Given n and s, find n distinct non-zero digits
that sum to s.
ESSENCE
nnat, snatX matrix (indexed by 1.. n) of 1..9
given find such that
AllDiff(X)Si?1..n Xi s
ESSENCE
given find such that
nnat, snatD matrix (indexed by 1..9) of 0..1
D1 2D2 9D9 sD1 D2
D9 n
31
Formalisation of Model Generation
nnat, sintX set (size n) of 1..9
given find
S x s
such that
x ? X
ESSENCE
nnat, snatX matrix (indexed by 1.. n) of 1..9
given find such that
AllDiff(X)Si?1..n Xi s
ESSENCE
given find such that
nnat, snatD matrix (indexed by 1..9) of 0..1
D1 2D2 9D9 sD1 D2
D9 n
32
Part III
  • Generating Models
  • The CONJURE System

33
A Theory of Model Generation Must Account for
  • Representing complex decision variables.
  • SONET involves finding a multiset of sets.
  • Exploiting channelling.
  • Generate, maintain multiple representations.
  • Identifying and breaking symmetries.
  • XYZ c ? X lt Y lt Z
  • Performing transformations to improve efficiency.
  • XltYltZ, AllDiff(X,Y,Z) ? X lt Y lt Z

34
CONJURE
  • CONJURE automatically generates a set of
    alternative ESSENCE models from ESSENCE
    specifications.
  • Core set of refinement rules.
  • Refine an ESSENCE expression into a set of
    ESSENCE expressions.
  • Produce a set because often many alternative
    refinements of an ESSENCE expression.

35
Rules Must be Compositional
  • Compositional refinement
  • Refinement of an expression is composed of the
    refinements of its sub-expressions.
  • Necessary to handle
  • Unbounded nesting of constraints (usual)
  • A ? (B ? C) lt X
  • Unbounded nesting of types (unique)
  • set, set of sets, set of set of sets,

36
Challenge Compositionality is Difficult
  • Complex variables can have multiple refinements.
    Not all support all operations.
  • Nested variables refinement of outer type must
    be determined without looking arbitrarily deep
    into the nesting.
  • Operators refinement depends on refinement of
    operands.
  • Operators recursion needed to handle arbitrary
    nesting of operands, e.g. ?

37
Refinement via r Operator
  • Function mapping ESSENCE expression to a set of
    ESSENCE expressions.
  • Defined by set of equalities.
  • One per syntactic construct.
  • For easy presentation, each equation broken into
    clauses
  • RuleName1 r(e) ? e1
  • RuleName2 r(e) ? e2
  • RuleNamen r(e) ? en

38
Refining a Specification
  • Refine constraints objective function in turn.
  • Compose results to form final model.
  • Multiple refinements composed multiple models.

MicroSonet
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ring set (size capacity) of Nodes
4 ? ring
4 ? ring set (maxsize capacity) of Nodes
39
Refining MicroSonet
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ring set (size capacity) of Nodes
4 ? ring
  • Refinement begins with r(4 ? ring)
  • Relevant clause of Element rule refines both
    sides, composes the results.

?
Compositionalityat work
r(4) 4
r(ring)
40
FixedSizeSet1 Occurrence Rep
FixedSizeSet1 r (S set (size n) of lb..ub ) ?
  • Associate an axiom schema with this rule
  • ?i ? t. i ? S ? S i

41
ESSENCE Occ Model MicroSonet
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ESSENCE
ring set (size capacity) of Nodes
4 ? ring
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ESSENCE
ring matrix (indexed by Nodes) of bool
sum(ring ) capacity ring 41
1
2
3
nnodes
0/1
0/1
0/1
0/1

ring
42
FixedSizeSet2 Explicit Rep
FixedSizeSet2 r (S set (size n) of t) ?
NB t could be arbitrarily complex
  • Axiom schema ?i ? t. i ? S ? ?j ? 1..n (S
    ji )

43
ESSENCE Explicit Model MicroSonet
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ESSENCE
ring set (size capacity) of Nodes
4 ? ring
nnodesnat, capacitynat
given letting find such that
Nodes be 1..nnodes
ringmatrix (indexed by 1..capacity) of
Nodes
ESSENCE
AllDifferent(ring ) ring 1 4 OR ring 2
4 OR
capacity
1
2
ring

Nodes
Nodes
Nodes
44
Channelling Models
  • Good constraint models often contain multiple
    representations of same abstract variable.
  • Different constraints can often be stated most
    effectively on different representations.
  • We use channelling constraints to maintain
    consistency between the representations.
  • CONJURE can generate these constraints
    automatically.

45
Automatically GeneratingChannelling Models
Sset (size n) of t
(1)
(2)
FixedSizeSet2
FixedSizeSet1
S1 matrix (indxd by t) of bool
S2 matrix (indxd by 1..n) of t
  • ?i ? t (i ? S ? S1 i)
  • ?i ? t (i ? S ? ?j ? 1..n (S2 ji ))

46
(Some) Symmetry Detection is Free!
  • Some refinements, whether manual or automatic,
    introduce symmetry.
  • Some rule clauses introduce symmetry every time
    they are used.
  • The clause can annotate the refined expression
    with a description of the symmetry.
  • E.g. explicit representation of a set of 3
    integers drawn from 1..n.

1
2
3
1..n
1..n
1..n
  • Have named the indices, where the set did not.
  • Introduced index symmetry.

47
Part IV
  • Conclusion
  • The Big Picture

48
What we Hope to Achieve
  • Much of modelling can be formalised as refining
    ESSENCE to ESSENCE
  • Reduce modelling bottleneck with CONJURE.
  • Ongoing work
  • Develop heuristics to select among competing
    models.

49
Why Might we Fail to Build a Competent Automatic
Modeller?
  • Cant get compositionality to work.
  • Some/much of modelling is involved in writing
    ESSENCE specs.

50
Why Might we Fail to Build a Competent Automatic
Modeller?
  • Cant get compositionality to work.
  • Some/much of modelling is involved in writing
    ESSENCE specs.
  • Failure to reach closure
  • Endless list of new modelling steps to
    encapsulate in rules.
  • General mathematical reasoning needed to perform
    transformations
  • Adding implied constraints.
  • Obtaining rule applicability.
  • Obtaining more effective models.

51
Benefits other than Automation
  • A more systematic approach to modelling.
  • Weve noticed missing combinations.
  • Reveal gaps in understanding.
  • Generalisation/Patterns.
  • See a technique used in generating one model and
    recognise its general usefulness.
  • Pedagogical purposes.
  • Modelling almost absent from existing textbooks.
  • ESSENCE could prove useful.
  • We look at modelling differently.
  • Eventually, so will others.

52
  • ESSENCE specifications and CONJURE paper
  • http//www.cs.york.ac.uk/aig/constraints/
Write a Comment
User Comments (0)
About PowerShow.com