SlideShare a Scribd company logo
1 of 36
CLAIRE: A High-Level
Programming Language
for Complex Algorithms
Yves Caseau & al.
Bouygues - Direction des Technologies Nouvelles
Ecole Normale Supérieure
Y. Caseau

02/09/14

1
Outline
Motivations
CLAIRE (short overview)
Rule-based Programming
Set-based Programming
Conclusions

Y. Caseau

02/09/14

2
Background
Combinatorial Optimization and Constraints
• Competitive advantages and reciprocal benefits of CO and CP
techniques
• How to combine them: Hybrid Algorithms

Systematic Approach
•
•
•
•

Resource Allocation, Matching
Scheduling (job-shop, cumulative)
Routing (TSP, VRP, VRPXX)
Time-Tabling

Produce a Library of Hybrid Algorithm
• Building Blocks for Optimization Applications
• Research & Teaching

Y. Caseau

02/09/14

3
CLAIRE: Specifications
Simple and Readable
• executable pseudo-code (teaching CO algorithms)
• few simple (well-understood) concepts

Multi-paradigm
• Objets , Functions
• Rules
• Versions (search tree exploration)

C++ compatibility, Freeware
•
•
•
•
Y. Caseau

generate C++ objets
efficiency similar to hand-written C++
sources and binaries available
Next release will generate Java
02/09/14

4
CLAIRE at a glance
Object-Oriented functional language with parametric
polymorphism
• mixes compiled and interpreted code, static and dynamic typing

Modeling language (sets, relations, ...)
• high level of abstraction, ease of use

Inference engine for object-based rules
• first-order logic (propagation)

Tools for tree search
• choice points and backtracks

Y. Caseau

02/09/14

5
CLAIRE: Industrial Motivations
Better Productivity
• C++ code generator, DLL production (Windows NT)
• Reduction factor approximately 5

Simplify Maintenance
• more readable means easier to maintain
• high level of abstraction, “concise and elegant” programming

Support Reuse
• Black-box component approach is poorly suited to
combinatorial optimization.
• We build source-code libraries

Y. Caseau

02/09/14

6
Objects
Single inheritance class hierarchy
point <: object(x:integer, y:integer)

Parametric Classes
stack[of] <: thing(of:type, contents:list)

Class hierarchy embedded in a multiple inheritance data
type lattice
(1 .. 10) ⊆ (20 .. 30) ⊆ (1 .. 30) ⊆ integer
stack[of = integer] ⊆ stack[of:subtype[integer]] ⊆ stack ⊆ object
tuple(integer,integer) ⊆ list[integer] ⊆ list[integer ∪ float] ⊆ list

Y. Caseau

02/09/14

7
Polymorphism
Free Overloading (attach method to complex types)
f(x:{0},y:(1 .. 12)) → 1
f(x:(0 .. 10), y:integer) → (x + y)
f(x:integer,y:({1,2} U (7 .. 10)) → (x - y)

optimization through code generation
sum(s:subtype[integer]) : integer
→ let d := 0 in (for x in s d :+ x, d)
sum(1 .. 10) ...
let d := 0, m := 10, x := 1 in
(while (x <= m) (d :+ x, x :+ 1), d)

composition polymorphism
• Takes advantage of rules of type f(g(x)) = h(x)
• Example : det(A * B) = det(A) * det(B)
Y. Caseau

02/09/14

8
Sets and Relations
Set-based Programming
• data types are sets (e.g., extensions)
• easy syntax for set expressions
{x in person | x.age ∈ (0 .. 17)}
{x.father | x in person}
list{salary(x) | x in {x in person | x.department = sales}}

Efficient Parametrization (operation/representation)
Relations are first-class citizens (inverses…)
dist[x:(0 .. 100),y:(0 .. 100)] : integer := 0
comment[c:class] : string := ""

Modeling Abilities
meet[s:set[person]] : date := unknown
course[tuple(person,set[person])] : room := unknown
Y. Caseau

02/09/14

9
Hypothetical Reasoning
Worlds
• world+() creates a choice point
• world-() makes a backtrack
• other derived operations

tree search
• Trailing stack, optimized for depth-first search
solve() : boolean ->
when q := pick() in
exists( c in possible(q) |
branch( (column[q] := c, solve())))
else true
branch(e) :: (

world+(),
( (try e catch contradiction

false) |
Y. Caseau

02/09/14

(world-(), false) ))

10
Logical Assertions
CLAIRE uses an “object-oriented” logic which is an
extension of binary DATALOG ...
edge(x,y) | exists(z, edge(x,z) & path(z,y))
⇒ path(x) :add y

with methods ...
exists(z, z = salary(x) & z > 30000 & z < 50000 &
y = 3000 + (z - 30000) * 0.28)
⇒

x.tax := y

and the ability to create new objects and sets
L.p2 ∈ Holds(line(L.p1,x)) ⇒ Holds(L) :add x
L
L.p2

z = size({y in person | y ∈ x.children})
⇒ x.family_size := z + 2
L.p1

Y. Caseau

02/09/14

x
Line(L.p1,x)

11
Rules
Production Rules
rule1(x:person[age:(18 .. 40)]) :: rule(
x.salary < average({y in person | x.department = y.department}
⇒ increase_salary(x) )

Control
•
•
•
•

Rules are triggered by events (updates on slots & arrays)
priorities, inheritance
trigger: once/ exact / many
rule sets and finer control are easy to implement

Queries
• A query is a relation defined by a logical assertion
• naive top-down resolution (no recursion)

Y. Caseau

02/09/14

12
Goodies
Modules
(Fast) Exceptions
Memory Management
Second-Order Types

Y. Caseau

02/09/14

13
Why Compile Rules ?
Performance
• much faster than best RETE-based compiler
• no comparison with RETE-base interpreter

Autonomous objects
• The generated code is purely procedural
• no need for additional engine or data structures
• Ideally suited for Java Beans concept

Dynamic Rules
• Dynamic Libraries
• Consistency-checking at compile-time
• through interpreter (50 times slower)

Y. Caseau

02/09/14

14
Principles for Compiling Rules
Logical
Rules

rewriting

Algebraic
Rules
differentiation

if-write
demons

compiling

Propagation
Formulae

CLAIRE compiles a set of rules into a set of demons
(procedural attachment). Java observable mechanism
could be used.
Y. Caseau

02/09/14

15
Rules Compilation
Complete compilation
• totally procedural C++ code (no auxiliary data structures)
• Sets/Lists/Vectors handling is thoroughly optimized

Benchmarks
• Standard benchmarks are easy to translate (inverse is not true)
• State-of-the-art results (600K to 3Mips on a P166)
• but no inter-rule optimization is performed

Empirical Results
• 10 to 50% penalty compared with hand-optimized procedural
code
• source code reduction factor from 4 to 30.

Y. Caseau

02/09/14

16
Code Example
The Airline scheduler:
city <: thing(
time_zone:integer = 0,
previous_request:set[request],
starting:set[flight],
arriving:set[flight],
starting_plan:set[travel_plan],
arriving_plan:set[travel_plan] )

7 == (9:(AF401):13, 8:(AF301, LU401):12)
8 == (9:(AF401):13, 8:(AF301, LU401):12)
9 == (9:(AF401):13)
10 == (12:(AF011, BA401):19,
10:(AF311, LU511, LU411):16)
11 == (12:(AF011, BA401):19)
12 == (12:(AF011, BA401):19)

complex_plan(r:request, f:flight) :: rule(
(f.fromc = r.start & f.to != r.arrive &
f.depart >= r.depart & (f.depart + f.time) <= r.end_at )
⇒ let r2 := request!(f.to, r.arrive ,(f.depart + f.time), r.end_at) in
(if not(r2 ∈ f.to.previous_request)
(f.to.previous_request :add r2,
r2.start := f.to,
r2.arrive := r.arrive)) )
Y. Caseau

02/09/14

17
Rules Applications
Crane scheduling application
• Propagation of resource constraint
• Complex propagation patterns
– 1 week to implement 3 rules with methods
• minimal performance degradation

Television Advertising Optimization
• very large bin packing with constraints
• Ad-hoc limited tree search with heuristics
• Rules are used for defining heuristic control parameters
(x.satisfaction < minsat & x.productline = … & y ∈ x.products
& y.satisfaction < (minsat / 2) …) => priority(y) :* 2

Y. Caseau

02/09/14

18
Set-Based Programming
Set-based Programming is the combination of:
sets are "first-class citizens" with a choice of multiple
representations (abstraction)
abstract sets may be used to capture "design patterns"
for x in {p.father | p in person} ...
for y in {p in person | p.father.retired? = true} ...
sum({f(x) | x in {y in (1 .. 10) but 5 |

p(y) >0}})

min( i but t, <Atleast, TE)

Y. Caseau

02/09/14

19
Concrete and Abstract Sets
Concrete Sets
• classes for x in person print(x), size(person)
• sets, lists set(1,2,3,4),
list(Peter, Paul, Mary)
• data structure library (Bitvectors, Hset, ...)

Data Types
• Intervals 1 .. n, "abc" ..
• Union, Intersection array U
• Parameterized Types

"abd"
property, list ^ subytpe[char]

for x in person[age:(15 .. 18)] print(x)

Set Expressions
• image
{age(x) | x in person}, list{i + 1 | i in (1 .. 10)}

• selection
{x in person | x.age > 0}, list{i in (1 .. n) | f(i) > 0}
Y. Caseau

02/09/14

20
Extensibility
Classes
• extending the data structure library
Hset[of] <: set_class(of:type,content:list,index:integer)
add(s:Hset[X], y:X) : void
-> let i := hash(s.content,y) in ....
set!(s:Hset) -> {x in s.content | known?(x)}

Patterns
• a pattern is a function call that is dealt with lazily
but(x:abstract_set,y:any) : set -> {z in x | z != y}
%(x:any, y:but[tuple(abstract_set,any)])
=> (x % y.args[1] & x != y.args(2))
Y. Caseau

02/09/14

21
Explicit Iteration
Lazy evaluation directed by set type
for x in person print(x)
for y in (1 .. n) f(y)

Optimization through source code generation
for c in person.descendent
for x in c.instances print(x)
let y := 1 in
(while (y <= n) (f(y), y :+ 1))

Iteration mechanism is extensible
iterate(x:Hset,v:Variable,e:any)
=> for v in x.content (if known?(v) e)
iterate(x:but[tuple(abstract_set,any)],v:Variable,e:any)
=> for v in x.args[1] (if (v != x.args[2]) e)

Y. Caseau

02/09/14

22
Implicit Iteration
Image/selection expressions imply iterations
{x in (1 .. 10) | f(x) > 0}
{length(c.subclass) | c in (class but class)}
let s := {}, x := 1 in
(while (x <= 10) (if (f(x) > 0) s :add x, x :+ 1),
s)

The iteration of such an expression is also lazy :
for x in {x in (1 .. 10) | f(x) > 0} print(x)
for y in {c.slots | c in (class  relation.ancestors)} print(y)
for c in class.instances
if not(c % relation.ancestors) print(c.slots)

Y. Caseau

02/09/14

23
Abstraction: A Tradeoff
CLAIRE supports true abstraction:
• One may substitute a representation by another and not have to
change a line of code
• On the other hand, re-compiling is necessary

CLAIRE supports efficient generic methods
sum(s:subtype[integer]) : integer
=> let d := 0 in (for x in s d :+ x, d)
count(s:subtype[integer]) : integer
=> let d := 0 in (for x in s d :+ 1, d)
min(s:abstract_set,p:property,default:any) ....
Y. Caseau

02/09/14

24
Application: Embedded Linked List
Embedding (using slots) is more efficient
Task <: object( ....
next:Task, prev:Task, ....)

Patterns may represent « virtual linked lists »
chain(x:Task) : list[Task]
-> let l := list(x), in
(while known?(next,x) (x := x.next, l :add x),
l)
insert(x:Task,y:list[Task]) => ...
iterate(x:chain[tuple(Task)],v:Variable,e:any) => …

These lists may be used as usual :
count(chain(t1)), sum({x.weight | x in chain(t0)}), ...
Y. Caseau

02/09/14

25
Feature Combination
iterate(s:Interval, v:Variable, e:any)
=> for v in s.use.users (if SET(v)[v.index] e)
<atleast(x:Task, y:Task) => (x.atleast <= y.atleast)
min(s:any, f:property, default:any) : any
=> let x := default in
(for y in s (if f(x,y) x := y),

// the task with the smallest earliest start
min(i but t, <atleast, TEnd)

x)

date in i, different from t

let x := TEnd in
(for y in i.use.users
(if SET(i)[y.index]

Y. Caseau

(if (y != t)
x)

(if (y.atleast <= x.atleast) x := y))),
02/09/14

26
Structure Iterators
Combining iterators and patterns is useful to iterate
more complex data structures such as trees :
Tree <: object(value:any,right:Tree,left:Tree)
TreeIterator <: object(tosee:list, status:boolean)
iterate(x:by[tuple(Tree,TreeIterator)], v:Variable, e:any)
=> let v := start(x.args[2], x.args[1]) in
while (v != unknown)
(e, v := next(x.args[2], x.args[1])
TreeIteratorDFS <: TreeIterator()
start(x:TreeIteratorDFS, y:Tree) -> ...
next(x:TreeIteratorDFS, y:Tree) -> ...
DFS :: TreeIteratorDFS()
TreeIteratorBFS <: TreeIterator() ...
for x in (myTree by DFS) print(x)
{y.weight | y in (myTree by BFS)}
Y. Caseau

02/09/14

27
A Real-Life Example (I)
// builds a maximum weight complete matching

match()
-> (...,
// initialization
while (HN != N) (if not(grow()) dual_change()))
// a step repeats until the forest is hungarian (return value is false)
// or the matching is improved (return value is true)
// explore is the stack of even nodes that have net been explored yet

grow() : boolean
-> let i := pop(explore) in
( exists( j in {j in GpiSet(i,LastExplored[i] + 1,LastValid[i]) | not(odd?[j])} |
(if (sol-[j] != 0)
(//[SPEAK] grow: add (~S,~S) to forest// i,j,
odd?[j] := true, pushEven+(sol-[j]), tree[j] := i, false)
else (augment(i,j), true))) |
(if (explore[0] != 0) grow()) )

Y. Caseau

02/09/14

28
Hungarian Algorithm (II)
// change the dual feasible solution, throw a contradiction if there are no perfect matching

dual_change() : integer
-> let e := Min( list{vclose[i] | i in {j in Dom | not(odd?[j])}}) in
(//[SPEAK] DUAL CHANGE: we pick epsilon = ~S // e,
if (e = NMAX) contradiction!(),
for k in stack(even) (pi+[k] :+ e, LastExplored[k] := LastValid[k]),
for j in {j in Dom | odd?[j]} (pi-[j] :- e, vclose[j] := NMAX)),
clear(explore),
for i in stack(even)
let l := Gpi[i], k := size(l), toExplore := false in
(while (LastValid[i] < k) (k, toExplore) := reduceStep(i,j,l,k,toexplore),
if toExplore push(explore,i)))
// look at edges outside the valid set one at a time

reduceStep(i:Dom,j:Dom,l:list,k:integer,toExplore:boolean) : tuple(integer,boolean)
-> let j := l[k], c := Cpi(i,j) in
(if (c = 0) (//[SPEAK] dual_change: Add edge ~S,~S // i,j,
Gpiadd(l,i,j,k), toexplore := true)
else (vclose[j] :min c, k :- 1)),
list(k,toexplore))
Y. Caseau

02/09/14

29
CLAIRE Strategy
Phase I: 95 - 97
•
•
•
•

Free Academic Software
Support-as-you-use approach
Productivity gains for R&D projects
Algorithm libraries

Phase II: 98 - 99
•
•
•
•

Deployed Applications
Industrial Users Club
Industrial Support for CLAIRE run-time library
libraries: ECLAIR, Schedule, LP, ...

Phase III: 99 onwards
• part of development tools suite
• looking for collaborations
Y. Caseau

02/09/14

30
Conclusion
CLAIRE is a powerful tool for processing business rules:
• State-of-the-art inference engine
• Expressive Power

CLAIRE is a good tool to implement complex algorithms
for decision aid
• multi-paradigm
• high level of abstraction
• readability

CLAIRE is available
• compiler, interpreter, tools for tracing and debugging
• UNIX and Windows NT: http://www.ens.fr/~laburthe/claire.html
• complete system: (20000 lines), compiler (executable ) 1.5 Mb
– run-time: 5000 lines of code (100K) [Java: 1000 lines]
Y. Caseau

02/09/14

31
Industrial Applications
4 applications written with CLAIRE have been deployed
•
•
•
•

Construction Equipment Inventory
Crane Daily Planning
Call Center Scheduling
Advertising Resource Optimization

A BOUYGUES library of reusable components is being
developed (business objects)
A public library (ENS) of classical algorithms is also
being developed (forthcoming book)

Y. Caseau

02/09/14

32
Future Directions
Component generator
• Stripped Objects (no reflective descriptions)
• Message Interface (DCOM/ CORBA/ …)

Java-based version of CLAIRE
• Simpler Run-time (almost none)
• Generate Human-maintenable code
• Exit Strategy

Simulation Environment
• Finite Event simulation for stochastic optimization
• Agent- based

Optimization Software Platform
• Do not extend CLAIRE but build software components
• Business objects for call center scheduling or routing
Y. Caseau

02/09/14

33
Future Releases
v2.4
• Arrays (dynamic but constant length)
• Improved compiler for floats

v2.5 (?)
• Re-usable C++ Kernel (shorter -simpler -faster)
• Simplified Type System (safer)

v2.9
• Java Compiler (beta version)

v3.0
• Component Compiler (COM ?)
• Improved Code Optimizer

Y. Caseau

02/09/14

34
RoadMap
1999
Jan99

Apr99

2000
Oct99

Jun99

ActiveX/ DCOM

CLAIRE 2.4

Apr00

Jan00

Jun00 Oct00

Simulation Library

IDL interface

µCLAIRE 2.9

Prod. C++ Prod. JAVA

Optimizer v3.0

JAVA µCLAIRE 2.9

Doc 2.4 Spec µC2.9

V2.4

V2.5

Interpreter v3.1

Event Rules

Java Beans

BusinessRules
for Java ...

Doc 3.1

Doc 3.0

V2.9

V3.0

V3.1

C++ & JAVA
Y. Caseau

02/09/14

35
µCLAIRE: what’s up ?
C++ Kernel
– C++ Namespaces
– C++ class components
– Separated Reflective Description

Type System
• Integer Intervals Only
• list[t] replaced by list (LISP) and list<t> (C++, C<t> = C[of = t])
– lists as objects vs. lists as values
– safer (uniform for lists, sets and arrays)

Optimization
• Native Floats
• Uniform C++ Object implementation (but integers)
– simpler debugging
– faster generic methods
– easier maintenance (takes more from C++: e.g., streams)
Y. Caseau

02/09/14

36

More Related Content

What's hot

Modeling the Dynamics of SGD by Stochastic Differential Equation
Modeling the Dynamics of SGD by Stochastic Differential EquationModeling the Dynamics of SGD by Stochastic Differential Equation
Modeling the Dynamics of SGD by Stochastic Differential EquationMark Chang
 
Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Eliezer Silva
 
Introduction to Big Data Science
Introduction to Big Data ScienceIntroduction to Big Data Science
Introduction to Big Data ScienceAlbert Bifet
 
ガウス過程入門
ガウス過程入門ガウス過程入門
ガウス過程入門ShoShimoyama
 
Scala for Java Devs
Scala for Java DevsScala for Java Devs
Scala for Java Devsloverdos
 
Deep generative model.pdf
Deep generative model.pdfDeep generative model.pdf
Deep generative model.pdfHyungjoo Cho
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavVyacheslav Arbuzov
 
Domain Adaptation
Domain AdaptationDomain Adaptation
Domain AdaptationMark Chang
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeRakuten Group, Inc.
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchAhmed BESBES
 
Whiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in PythonWhiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in PythonAndrew Ferlitsch
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsKirill Kozlov
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Matthew Leingang
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Dr. Volkan OBAN
 
Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3Khor SoonHin
 
Algorithm, Review, Sorting
Algorithm, Review, SortingAlgorithm, Review, Sorting
Algorithm, Review, SortingRowan Merewood
 
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)PyData
 

What's hot (20)

Modeling the Dynamics of SGD by Stochastic Differential Equation
Modeling the Dynamics of SGD by Stochastic Differential EquationModeling the Dynamics of SGD by Stochastic Differential Equation
Modeling the Dynamics of SGD by Stochastic Differential Equation
 
Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space
 
Introduction to Big Data Science
Introduction to Big Data ScienceIntroduction to Big Data Science
Introduction to Big Data Science
 
ガウス過程入門
ガウス過程入門ガウス過程入門
ガウス過程入門
 
Scala for Java Devs
Scala for Java DevsScala for Java Devs
Scala for Java Devs
 
Deep generative model.pdf
Deep generative model.pdfDeep generative model.pdf
Deep generative model.pdf
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
 
Domain Adaptation
Domain AdaptationDomain Adaptation
Domain Adaptation
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in Practice
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
Whiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in PythonWhiteboarding Coding Challenges in Python
Whiteboarding Coding Challenges in Python
 
Scala. Introduction to FP. Monads
Scala. Introduction to FP. MonadsScala. Introduction to FP. Monads
Scala. Introduction to FP. Monads
 
Perm winter school 2014.01.31
Perm winter school 2014.01.31Perm winter school 2014.01.31
Perm winter school 2014.01.31
 
NumPy/SciPy Statistics
NumPy/SciPy StatisticsNumPy/SciPy Statistics
NumPy/SciPy Statistics
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Rcommands-for those who interested in R.
Rcommands-for those who interested in R.
 
03.01 hash tables
03.01 hash tables03.01 hash tables
03.01 hash tables
 
Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3Gentlest Introduction to Tensorflow - Part 3
Gentlest Introduction to Tensorflow - Part 3
 
Algorithm, Review, Sorting
Algorithm, Review, SortingAlgorithm, Review, Sorting
Algorithm, Review, Sorting
 
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
 

Viewers also liked

Claire epita-février2014
Claire epita-février2014Claire epita-février2014
Claire epita-février2014Yves Caseau
 
Management socialnetworksfeb2012
Management socialnetworksfeb2012Management socialnetworksfeb2012
Management socialnetworksfeb2012Yves Caseau
 
XEBICON Public November 2015
XEBICON Public November 2015XEBICON Public November 2015
XEBICON Public November 2015Yves Caseau
 
Google socialnetworksmarch08
Google socialnetworksmarch08Google socialnetworksmarch08
Google socialnetworksmarch08Yves Caseau
 
The European CIO Conference - November 27th, 2014
The European CIO Conference - November 27th, 2014The European CIO Conference - November 27th, 2014
The European CIO Conference - November 27th, 2014Yves Caseau
 
Managing Business Processes Communication and Performance
Managing Business Processes Communication and Performance Managing Business Processes Communication and Performance
Managing Business Processes Communication and Performance Yves Caseau
 
Smart homeamsterdamoctober2013
Smart homeamsterdamoctober2013Smart homeamsterdamoctober2013
Smart homeamsterdamoctober2013Yves Caseau
 
Intelligence Artificielle - Journée MEDEF & AFIA
Intelligence Artificielle - Journée MEDEF & AFIAIntelligence Artificielle - Journée MEDEF & AFIA
Intelligence Artificielle - Journée MEDEF & AFIAYves Caseau
 
Cours chapitre7 2012
Cours chapitre7 2012Cours chapitre7 2012
Cours chapitre7 2012Yves Caseau
 
Lean entreprisetwodotzerodauphinefev2014
Lean entreprisetwodotzerodauphinefev2014Lean entreprisetwodotzerodauphinefev2014
Lean entreprisetwodotzerodauphinefev2014Yves Caseau
 
Cours chapitre5 2012
Cours chapitre5 2012Cours chapitre5 2012
Cours chapitre5 2012Yves Caseau
 
Cours chapitre4 2012
Cours chapitre4 2012Cours chapitre4 2012
Cours chapitre4 2012Yves Caseau
 
Cours chapitre2 2012
Cours chapitre2 2012Cours chapitre2 2012
Cours chapitre2 2012Yves Caseau
 
Cours chapitre8 2012
Cours chapitre8 2012Cours chapitre8 2012
Cours chapitre8 2012Yves Caseau
 
Entreprise troispointzeropublicjan2015
Entreprise troispointzeropublicjan2015Entreprise troispointzeropublicjan2015
Entreprise troispointzeropublicjan2015Yves Caseau
 
Cours chapitre6 2012
Cours chapitre6 2012Cours chapitre6 2012
Cours chapitre6 2012Yves Caseau
 
Cours chapitre1 2012
Cours chapitre1 2012Cours chapitre1 2012
Cours chapitre1 2012Yves Caseau
 
Cours chapitre9 2012
Cours chapitre9 2012Cours chapitre9 2012
Cours chapitre9 2012Yves Caseau
 

Viewers also liked (20)

Claire epita-février2014
Claire epita-février2014Claire epita-février2014
Claire epita-février2014
 
Management socialnetworksfeb2012
Management socialnetworksfeb2012Management socialnetworksfeb2012
Management socialnetworksfeb2012
 
XEBICON Public November 2015
XEBICON Public November 2015XEBICON Public November 2015
XEBICON Public November 2015
 
Google socialnetworksmarch08
Google socialnetworksmarch08Google socialnetworksmarch08
Google socialnetworksmarch08
 
GTES UTC 2014
GTES  UTC 2014GTES  UTC 2014
GTES UTC 2014
 
The European CIO Conference - November 27th, 2014
The European CIO Conference - November 27th, 2014The European CIO Conference - November 27th, 2014
The European CIO Conference - November 27th, 2014
 
Managing Business Processes Communication and Performance
Managing Business Processes Communication and Performance Managing Business Processes Communication and Performance
Managing Business Processes Communication and Performance
 
Smart homeamsterdamoctober2013
Smart homeamsterdamoctober2013Smart homeamsterdamoctober2013
Smart homeamsterdamoctober2013
 
Intelligence Artificielle - Journée MEDEF & AFIA
Intelligence Artificielle - Journée MEDEF & AFIAIntelligence Artificielle - Journée MEDEF & AFIA
Intelligence Artificielle - Journée MEDEF & AFIA
 
Disic mars2014
Disic mars2014Disic mars2014
Disic mars2014
 
Cours chapitre7 2012
Cours chapitre7 2012Cours chapitre7 2012
Cours chapitre7 2012
 
Lean entreprisetwodotzerodauphinefev2014
Lean entreprisetwodotzerodauphinefev2014Lean entreprisetwodotzerodauphinefev2014
Lean entreprisetwodotzerodauphinefev2014
 
Cours chapitre5 2012
Cours chapitre5 2012Cours chapitre5 2012
Cours chapitre5 2012
 
Cours chapitre4 2012
Cours chapitre4 2012Cours chapitre4 2012
Cours chapitre4 2012
 
Cours chapitre2 2012
Cours chapitre2 2012Cours chapitre2 2012
Cours chapitre2 2012
 
Cours chapitre8 2012
Cours chapitre8 2012Cours chapitre8 2012
Cours chapitre8 2012
 
Entreprise troispointzeropublicjan2015
Entreprise troispointzeropublicjan2015Entreprise troispointzeropublicjan2015
Entreprise troispointzeropublicjan2015
 
Cours chapitre6 2012
Cours chapitre6 2012Cours chapitre6 2012
Cours chapitre6 2012
 
Cours chapitre1 2012
Cours chapitre1 2012Cours chapitre1 2012
Cours chapitre1 2012
 
Cours chapitre9 2012
Cours chapitre9 2012Cours chapitre9 2012
Cours chapitre9 2012
 

Similar to Claire98

Machine Learning meets DevOps
Machine Learning meets DevOpsMachine Learning meets DevOps
Machine Learning meets DevOpsPooyan Jamshidi
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programmingAlberto Labarga
 
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdfAdvanced-Concepts-Team
 
Poggi analytics - star - 1a
Poggi   analytics - star - 1aPoggi   analytics - star - 1a
Poggi analytics - star - 1aGaston Liberman
 
Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Julian Hyde
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Languagevsssuresh
 
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learningSamGuy7
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues listsJames Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
StacksqueueslistsFraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 

Similar to Claire98 (20)

R language introduction
R language introductionR language introduction
R language introduction
 
Machine Learning meets DevOps
Machine Learning meets DevOpsMachine Learning meets DevOps
Machine Learning meets DevOps
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Spark workshop
Spark workshopSpark workshop
Spark workshop
 
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdf
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Type and proof structures for concurrency
Type and proof structures for concurrencyType and proof structures for concurrency
Type and proof structures for concurrency
 
Poggi analytics - star - 1a
Poggi   analytics - star - 1aPoggi   analytics - star - 1a
Poggi analytics - star - 1a
 
Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
Python classes in mumbai
Python classes in mumbaiPython classes in mumbai
Python classes in mumbai
 
Support Vector Machine.ppt
Support Vector Machine.pptSupport Vector Machine.ppt
Support Vector Machine.ppt
 
svm.ppt
svm.pptsvm.ppt
svm.ppt
 
support vector machine algorithm in machine learning
support vector machine algorithm in machine learningsupport vector machine algorithm in machine learning
support vector machine algorithm in machine learning
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 

More from Yves Caseau

DataAquitaine February 2022
DataAquitaine February 2022DataAquitaine February 2022
DataAquitaine February 2022Yves Caseau
 
Global warming dynamic gamesv0.3
Global warming dynamic gamesv0.3Global warming dynamic gamesv0.3
Global warming dynamic gamesv0.3Yves Caseau
 
Machine Learning for Self-Tracking
Machine Learning for Self-TrackingMachine Learning for Self-Tracking
Machine Learning for Self-TrackingYves Caseau
 
Information Systems for Digital Transformation
Information Systems for Digital TransformationInformation Systems for Digital Transformation
Information Systems for Digital TransformationYves Caseau
 
Lean from the guts
Lean from the gutsLean from the guts
Lean from the gutsYves Caseau
 
Taking advantageofai july2018
Taking advantageofai july2018Taking advantageofai july2018
Taking advantageofai july2018Yves Caseau
 
Software Pitch 2018
Software Pitch 2018Software Pitch 2018
Software Pitch 2018Yves Caseau
 
Big data, Behavioral Change and IOT Architecture
Big data, Behavioral Change and IOT ArchitectureBig data, Behavioral Change and IOT Architecture
Big data, Behavioral Change and IOT ArchitectureYves Caseau
 
Smart selfnovember2013
Smart selfnovember2013Smart selfnovember2013
Smart selfnovember2013Yves Caseau
 
Cours chapitre3 2012
Cours chapitre3 2012Cours chapitre3 2012
Cours chapitre3 2012Yves Caseau
 

More from Yves Caseau (11)

CCEM2023.pptx
CCEM2023.pptxCCEM2023.pptx
CCEM2023.pptx
 
DataAquitaine February 2022
DataAquitaine February 2022DataAquitaine February 2022
DataAquitaine February 2022
 
Global warming dynamic gamesv0.3
Global warming dynamic gamesv0.3Global warming dynamic gamesv0.3
Global warming dynamic gamesv0.3
 
Machine Learning for Self-Tracking
Machine Learning for Self-TrackingMachine Learning for Self-Tracking
Machine Learning for Self-Tracking
 
Information Systems for Digital Transformation
Information Systems for Digital TransformationInformation Systems for Digital Transformation
Information Systems for Digital Transformation
 
Lean from the guts
Lean from the gutsLean from the guts
Lean from the guts
 
Taking advantageofai july2018
Taking advantageofai july2018Taking advantageofai july2018
Taking advantageofai july2018
 
Software Pitch 2018
Software Pitch 2018Software Pitch 2018
Software Pitch 2018
 
Big data, Behavioral Change and IOT Architecture
Big data, Behavioral Change and IOT ArchitectureBig data, Behavioral Change and IOT Architecture
Big data, Behavioral Change and IOT Architecture
 
Smart selfnovember2013
Smart selfnovember2013Smart selfnovember2013
Smart selfnovember2013
 
Cours chapitre3 2012
Cours chapitre3 2012Cours chapitre3 2012
Cours chapitre3 2012
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Claire98

  • 1. CLAIRE: A High-Level Programming Language for Complex Algorithms Yves Caseau & al. Bouygues - Direction des Technologies Nouvelles Ecole Normale Supérieure Y. Caseau 02/09/14 1
  • 2. Outline Motivations CLAIRE (short overview) Rule-based Programming Set-based Programming Conclusions Y. Caseau 02/09/14 2
  • 3. Background Combinatorial Optimization and Constraints • Competitive advantages and reciprocal benefits of CO and CP techniques • How to combine them: Hybrid Algorithms Systematic Approach • • • • Resource Allocation, Matching Scheduling (job-shop, cumulative) Routing (TSP, VRP, VRPXX) Time-Tabling Produce a Library of Hybrid Algorithm • Building Blocks for Optimization Applications • Research & Teaching Y. Caseau 02/09/14 3
  • 4. CLAIRE: Specifications Simple and Readable • executable pseudo-code (teaching CO algorithms) • few simple (well-understood) concepts Multi-paradigm • Objets , Functions • Rules • Versions (search tree exploration) C++ compatibility, Freeware • • • • Y. Caseau generate C++ objets efficiency similar to hand-written C++ sources and binaries available Next release will generate Java 02/09/14 4
  • 5. CLAIRE at a glance Object-Oriented functional language with parametric polymorphism • mixes compiled and interpreted code, static and dynamic typing Modeling language (sets, relations, ...) • high level of abstraction, ease of use Inference engine for object-based rules • first-order logic (propagation) Tools for tree search • choice points and backtracks Y. Caseau 02/09/14 5
  • 6. CLAIRE: Industrial Motivations Better Productivity • C++ code generator, DLL production (Windows NT) • Reduction factor approximately 5 Simplify Maintenance • more readable means easier to maintain • high level of abstraction, “concise and elegant” programming Support Reuse • Black-box component approach is poorly suited to combinatorial optimization. • We build source-code libraries Y. Caseau 02/09/14 6
  • 7. Objects Single inheritance class hierarchy point <: object(x:integer, y:integer) Parametric Classes stack[of] <: thing(of:type, contents:list) Class hierarchy embedded in a multiple inheritance data type lattice (1 .. 10) ⊆ (20 .. 30) ⊆ (1 .. 30) ⊆ integer stack[of = integer] ⊆ stack[of:subtype[integer]] ⊆ stack ⊆ object tuple(integer,integer) ⊆ list[integer] ⊆ list[integer ∪ float] ⊆ list Y. Caseau 02/09/14 7
  • 8. Polymorphism Free Overloading (attach method to complex types) f(x:{0},y:(1 .. 12)) → 1 f(x:(0 .. 10), y:integer) → (x + y) f(x:integer,y:({1,2} U (7 .. 10)) → (x - y) optimization through code generation sum(s:subtype[integer]) : integer → let d := 0 in (for x in s d :+ x, d) sum(1 .. 10) ... let d := 0, m := 10, x := 1 in (while (x <= m) (d :+ x, x :+ 1), d) composition polymorphism • Takes advantage of rules of type f(g(x)) = h(x) • Example : det(A * B) = det(A) * det(B) Y. Caseau 02/09/14 8
  • 9. Sets and Relations Set-based Programming • data types are sets (e.g., extensions) • easy syntax for set expressions {x in person | x.age ∈ (0 .. 17)} {x.father | x in person} list{salary(x) | x in {x in person | x.department = sales}} Efficient Parametrization (operation/representation) Relations are first-class citizens (inverses…) dist[x:(0 .. 100),y:(0 .. 100)] : integer := 0 comment[c:class] : string := "" Modeling Abilities meet[s:set[person]] : date := unknown course[tuple(person,set[person])] : room := unknown Y. Caseau 02/09/14 9
  • 10. Hypothetical Reasoning Worlds • world+() creates a choice point • world-() makes a backtrack • other derived operations tree search • Trailing stack, optimized for depth-first search solve() : boolean -> when q := pick() in exists( c in possible(q) | branch( (column[q] := c, solve()))) else true branch(e) :: ( world+(), ( (try e catch contradiction false) | Y. Caseau 02/09/14 (world-(), false) )) 10
  • 11. Logical Assertions CLAIRE uses an “object-oriented” logic which is an extension of binary DATALOG ... edge(x,y) | exists(z, edge(x,z) & path(z,y)) ⇒ path(x) :add y with methods ... exists(z, z = salary(x) & z > 30000 & z < 50000 & y = 3000 + (z - 30000) * 0.28) ⇒ x.tax := y and the ability to create new objects and sets L.p2 ∈ Holds(line(L.p1,x)) ⇒ Holds(L) :add x L L.p2 z = size({y in person | y ∈ x.children}) ⇒ x.family_size := z + 2 L.p1 Y. Caseau 02/09/14 x Line(L.p1,x) 11
  • 12. Rules Production Rules rule1(x:person[age:(18 .. 40)]) :: rule( x.salary < average({y in person | x.department = y.department} ⇒ increase_salary(x) ) Control • • • • Rules are triggered by events (updates on slots & arrays) priorities, inheritance trigger: once/ exact / many rule sets and finer control are easy to implement Queries • A query is a relation defined by a logical assertion • naive top-down resolution (no recursion) Y. Caseau 02/09/14 12
  • 14. Why Compile Rules ? Performance • much faster than best RETE-based compiler • no comparison with RETE-base interpreter Autonomous objects • The generated code is purely procedural • no need for additional engine or data structures • Ideally suited for Java Beans concept Dynamic Rules • Dynamic Libraries • Consistency-checking at compile-time • through interpreter (50 times slower) Y. Caseau 02/09/14 14
  • 15. Principles for Compiling Rules Logical Rules rewriting Algebraic Rules differentiation if-write demons compiling Propagation Formulae CLAIRE compiles a set of rules into a set of demons (procedural attachment). Java observable mechanism could be used. Y. Caseau 02/09/14 15
  • 16. Rules Compilation Complete compilation • totally procedural C++ code (no auxiliary data structures) • Sets/Lists/Vectors handling is thoroughly optimized Benchmarks • Standard benchmarks are easy to translate (inverse is not true) • State-of-the-art results (600K to 3Mips on a P166) • but no inter-rule optimization is performed Empirical Results • 10 to 50% penalty compared with hand-optimized procedural code • source code reduction factor from 4 to 30. Y. Caseau 02/09/14 16
  • 17. Code Example The Airline scheduler: city <: thing( time_zone:integer = 0, previous_request:set[request], starting:set[flight], arriving:set[flight], starting_plan:set[travel_plan], arriving_plan:set[travel_plan] ) 7 == (9:(AF401):13, 8:(AF301, LU401):12) 8 == (9:(AF401):13, 8:(AF301, LU401):12) 9 == (9:(AF401):13) 10 == (12:(AF011, BA401):19, 10:(AF311, LU511, LU411):16) 11 == (12:(AF011, BA401):19) 12 == (12:(AF011, BA401):19) complex_plan(r:request, f:flight) :: rule( (f.fromc = r.start & f.to != r.arrive & f.depart >= r.depart & (f.depart + f.time) <= r.end_at ) ⇒ let r2 := request!(f.to, r.arrive ,(f.depart + f.time), r.end_at) in (if not(r2 ∈ f.to.previous_request) (f.to.previous_request :add r2, r2.start := f.to, r2.arrive := r.arrive)) ) Y. Caseau 02/09/14 17
  • 18. Rules Applications Crane scheduling application • Propagation of resource constraint • Complex propagation patterns – 1 week to implement 3 rules with methods • minimal performance degradation Television Advertising Optimization • very large bin packing with constraints • Ad-hoc limited tree search with heuristics • Rules are used for defining heuristic control parameters (x.satisfaction < minsat & x.productline = … & y ∈ x.products & y.satisfaction < (minsat / 2) …) => priority(y) :* 2 Y. Caseau 02/09/14 18
  • 19. Set-Based Programming Set-based Programming is the combination of: sets are "first-class citizens" with a choice of multiple representations (abstraction) abstract sets may be used to capture "design patterns" for x in {p.father | p in person} ... for y in {p in person | p.father.retired? = true} ... sum({f(x) | x in {y in (1 .. 10) but 5 | p(y) >0}}) min( i but t, <Atleast, TE) Y. Caseau 02/09/14 19
  • 20. Concrete and Abstract Sets Concrete Sets • classes for x in person print(x), size(person) • sets, lists set(1,2,3,4), list(Peter, Paul, Mary) • data structure library (Bitvectors, Hset, ...) Data Types • Intervals 1 .. n, "abc" .. • Union, Intersection array U • Parameterized Types "abd" property, list ^ subytpe[char] for x in person[age:(15 .. 18)] print(x) Set Expressions • image {age(x) | x in person}, list{i + 1 | i in (1 .. 10)} • selection {x in person | x.age > 0}, list{i in (1 .. n) | f(i) > 0} Y. Caseau 02/09/14 20
  • 21. Extensibility Classes • extending the data structure library Hset[of] <: set_class(of:type,content:list,index:integer) add(s:Hset[X], y:X) : void -> let i := hash(s.content,y) in .... set!(s:Hset) -> {x in s.content | known?(x)} Patterns • a pattern is a function call that is dealt with lazily but(x:abstract_set,y:any) : set -> {z in x | z != y} %(x:any, y:but[tuple(abstract_set,any)]) => (x % y.args[1] & x != y.args(2)) Y. Caseau 02/09/14 21
  • 22. Explicit Iteration Lazy evaluation directed by set type for x in person print(x) for y in (1 .. n) f(y) Optimization through source code generation for c in person.descendent for x in c.instances print(x) let y := 1 in (while (y <= n) (f(y), y :+ 1)) Iteration mechanism is extensible iterate(x:Hset,v:Variable,e:any) => for v in x.content (if known?(v) e) iterate(x:but[tuple(abstract_set,any)],v:Variable,e:any) => for v in x.args[1] (if (v != x.args[2]) e) Y. Caseau 02/09/14 22
  • 23. Implicit Iteration Image/selection expressions imply iterations {x in (1 .. 10) | f(x) > 0} {length(c.subclass) | c in (class but class)} let s := {}, x := 1 in (while (x <= 10) (if (f(x) > 0) s :add x, x :+ 1), s) The iteration of such an expression is also lazy : for x in {x in (1 .. 10) | f(x) > 0} print(x) for y in {c.slots | c in (class relation.ancestors)} print(y) for c in class.instances if not(c % relation.ancestors) print(c.slots) Y. Caseau 02/09/14 23
  • 24. Abstraction: A Tradeoff CLAIRE supports true abstraction: • One may substitute a representation by another and not have to change a line of code • On the other hand, re-compiling is necessary CLAIRE supports efficient generic methods sum(s:subtype[integer]) : integer => let d := 0 in (for x in s d :+ x, d) count(s:subtype[integer]) : integer => let d := 0 in (for x in s d :+ 1, d) min(s:abstract_set,p:property,default:any) .... Y. Caseau 02/09/14 24
  • 25. Application: Embedded Linked List Embedding (using slots) is more efficient Task <: object( .... next:Task, prev:Task, ....) Patterns may represent « virtual linked lists » chain(x:Task) : list[Task] -> let l := list(x), in (while known?(next,x) (x := x.next, l :add x), l) insert(x:Task,y:list[Task]) => ... iterate(x:chain[tuple(Task)],v:Variable,e:any) => … These lists may be used as usual : count(chain(t1)), sum({x.weight | x in chain(t0)}), ... Y. Caseau 02/09/14 25
  • 26. Feature Combination iterate(s:Interval, v:Variable, e:any) => for v in s.use.users (if SET(v)[v.index] e) <atleast(x:Task, y:Task) => (x.atleast <= y.atleast) min(s:any, f:property, default:any) : any => let x := default in (for y in s (if f(x,y) x := y), // the task with the smallest earliest start min(i but t, <atleast, TEnd) x) date in i, different from t let x := TEnd in (for y in i.use.users (if SET(i)[y.index] Y. Caseau (if (y != t) x) (if (y.atleast <= x.atleast) x := y))), 02/09/14 26
  • 27. Structure Iterators Combining iterators and patterns is useful to iterate more complex data structures such as trees : Tree <: object(value:any,right:Tree,left:Tree) TreeIterator <: object(tosee:list, status:boolean) iterate(x:by[tuple(Tree,TreeIterator)], v:Variable, e:any) => let v := start(x.args[2], x.args[1]) in while (v != unknown) (e, v := next(x.args[2], x.args[1]) TreeIteratorDFS <: TreeIterator() start(x:TreeIteratorDFS, y:Tree) -> ... next(x:TreeIteratorDFS, y:Tree) -> ... DFS :: TreeIteratorDFS() TreeIteratorBFS <: TreeIterator() ... for x in (myTree by DFS) print(x) {y.weight | y in (myTree by BFS)} Y. Caseau 02/09/14 27
  • 28. A Real-Life Example (I) // builds a maximum weight complete matching match() -> (..., // initialization while (HN != N) (if not(grow()) dual_change())) // a step repeats until the forest is hungarian (return value is false) // or the matching is improved (return value is true) // explore is the stack of even nodes that have net been explored yet grow() : boolean -> let i := pop(explore) in ( exists( j in {j in GpiSet(i,LastExplored[i] + 1,LastValid[i]) | not(odd?[j])} | (if (sol-[j] != 0) (//[SPEAK] grow: add (~S,~S) to forest// i,j, odd?[j] := true, pushEven+(sol-[j]), tree[j] := i, false) else (augment(i,j), true))) | (if (explore[0] != 0) grow()) ) Y. Caseau 02/09/14 28
  • 29. Hungarian Algorithm (II) // change the dual feasible solution, throw a contradiction if there are no perfect matching dual_change() : integer -> let e := Min( list{vclose[i] | i in {j in Dom | not(odd?[j])}}) in (//[SPEAK] DUAL CHANGE: we pick epsilon = ~S // e, if (e = NMAX) contradiction!(), for k in stack(even) (pi+[k] :+ e, LastExplored[k] := LastValid[k]), for j in {j in Dom | odd?[j]} (pi-[j] :- e, vclose[j] := NMAX)), clear(explore), for i in stack(even) let l := Gpi[i], k := size(l), toExplore := false in (while (LastValid[i] < k) (k, toExplore) := reduceStep(i,j,l,k,toexplore), if toExplore push(explore,i))) // look at edges outside the valid set one at a time reduceStep(i:Dom,j:Dom,l:list,k:integer,toExplore:boolean) : tuple(integer,boolean) -> let j := l[k], c := Cpi(i,j) in (if (c = 0) (//[SPEAK] dual_change: Add edge ~S,~S // i,j, Gpiadd(l,i,j,k), toexplore := true) else (vclose[j] :min c, k :- 1)), list(k,toexplore)) Y. Caseau 02/09/14 29
  • 30. CLAIRE Strategy Phase I: 95 - 97 • • • • Free Academic Software Support-as-you-use approach Productivity gains for R&D projects Algorithm libraries Phase II: 98 - 99 • • • • Deployed Applications Industrial Users Club Industrial Support for CLAIRE run-time library libraries: ECLAIR, Schedule, LP, ... Phase III: 99 onwards • part of development tools suite • looking for collaborations Y. Caseau 02/09/14 30
  • 31. Conclusion CLAIRE is a powerful tool for processing business rules: • State-of-the-art inference engine • Expressive Power CLAIRE is a good tool to implement complex algorithms for decision aid • multi-paradigm • high level of abstraction • readability CLAIRE is available • compiler, interpreter, tools for tracing and debugging • UNIX and Windows NT: http://www.ens.fr/~laburthe/claire.html • complete system: (20000 lines), compiler (executable ) 1.5 Mb – run-time: 5000 lines of code (100K) [Java: 1000 lines] Y. Caseau 02/09/14 31
  • 32. Industrial Applications 4 applications written with CLAIRE have been deployed • • • • Construction Equipment Inventory Crane Daily Planning Call Center Scheduling Advertising Resource Optimization A BOUYGUES library of reusable components is being developed (business objects) A public library (ENS) of classical algorithms is also being developed (forthcoming book) Y. Caseau 02/09/14 32
  • 33. Future Directions Component generator • Stripped Objects (no reflective descriptions) • Message Interface (DCOM/ CORBA/ …) Java-based version of CLAIRE • Simpler Run-time (almost none) • Generate Human-maintenable code • Exit Strategy Simulation Environment • Finite Event simulation for stochastic optimization • Agent- based Optimization Software Platform • Do not extend CLAIRE but build software components • Business objects for call center scheduling or routing Y. Caseau 02/09/14 33
  • 34. Future Releases v2.4 • Arrays (dynamic but constant length) • Improved compiler for floats v2.5 (?) • Re-usable C++ Kernel (shorter -simpler -faster) • Simplified Type System (safer) v2.9 • Java Compiler (beta version) v3.0 • Component Compiler (COM ?) • Improved Code Optimizer Y. Caseau 02/09/14 34
  • 35. RoadMap 1999 Jan99 Apr99 2000 Oct99 Jun99 ActiveX/ DCOM CLAIRE 2.4 Apr00 Jan00 Jun00 Oct00 Simulation Library IDL interface µCLAIRE 2.9 Prod. C++ Prod. JAVA Optimizer v3.0 JAVA µCLAIRE 2.9 Doc 2.4 Spec µC2.9 V2.4 V2.5 Interpreter v3.1 Event Rules Java Beans BusinessRules for Java ... Doc 3.1 Doc 3.0 V2.9 V3.0 V3.1 C++ & JAVA Y. Caseau 02/09/14 35
  • 36. µCLAIRE: what’s up ? C++ Kernel – C++ Namespaces – C++ class components – Separated Reflective Description Type System • Integer Intervals Only • list[t] replaced by list (LISP) and list<t> (C++, C<t> = C[of = t]) – lists as objects vs. lists as values – safer (uniform for lists, sets and arrays) Optimization • Native Floats • Uniform C++ Object implementation (but integers) – simpler debugging – faster generic methods – easier maintenance (takes more from C++: e.g., streams) Y. Caseau 02/09/14 36