Reasoning Engines

A bird's eye view

Contents

  • Intro
  • Logic-based systems
  • Arithmetic-based systems
  • Local Search
  • IDP
  • DMN

Goal of "reasoning engine"?

"each doctor has at most one shift per day"

"a doctor is present during each shift"

"doctor A never works on mondays"

  • Decide whether solution exists
  • Find any solution
  • Find optimal solution

Solutions

3 broad categories

  • Logic-based
  • Arithmetic-based
  • Local Search
\varphi
φ\varphi
\sum
\sum
\nabla
\nabla

Logic-based

  • Decision problems
  • Discrete variables
  • Disjunctive constraints
  • "Artificial Intelligence"
\forall s \in Shift\colon \exists d \in Doctor \colon Assign(s,d)
sShift:dDoctor:Assign(s,d)\forall s \in Shift\colon \exists d \in Doctor \colon Assign(s,d)
Assign(s_1,d_1) \vee Assign(s_1,d_2) \vee \ldots \vee Assign(s_1,d_n)
Assign(s1,d1)Assign(s1,d2)Assign(s1,dn)Assign(s_1,d_1) \vee Assign(s_1,d_2) \vee \ldots \vee Assign(s_1,d_n)
Assign(s_m,d_1) \vee Assign(s_m,d_2) \vee \ldots \vee Assign(s_m,d_n)
Assign(sm,d1)Assign(sm,d2)Assign(sm,dn)Assign(s_m,d_1) \vee Assign(s_m,d_2) \vee \ldots \vee Assign(s_m,d_n)
\ldots
\ldots

High level:

Low level:

\varphi
φ\varphi

SAT solving

  • Back-end technology
  • Chip verification, cryptography
  • MiniSat, Glucose, Lingeling
x_{11} \vee x_{12} \vee \ldots \vee x_{1n}
x11x12x1nx_{11} \vee x_{12} \vee \ldots \vee x_{1n}
\ldots
\ldots
x_{m1} \vee x_{m2} \vee \ldots \vee x_{mn}
xm1xm2xmnx_{m1} \vee x_{m2} \vee \ldots \vee x_{mn}
\varphi
φ\varphi

Constraint programming

  • Language "intuitive for programmers"
  • Planning, scheduling
  • Chuffed, Gecode, ILOG (IBM), Google Optimization Tools
forall(j in 1..nbshifts)(
    sum(i in 1..nbdoctors)(x[j,i]) >= 1
)
\varphi
φ\varphi

SMT solving

  • Unknown / infinite domains
  • Theorem proving, program verification, chip verification
  • Z3 (Microsoft), CVC (Intel)
\varphi
φ\varphi
\forall s \in Shift\colon \exists d \in Doctor \colon Assign(s,d)
sShift:dDoctor:Assign(s,d)\forall s \in Shift\colon \exists d \in Doctor \colon Assign(s,d)

Answer set programming

  • Rule-like, originating from Logic Programming
  • Strong recursion support
  • SModels, DLV, Clingo
1 \leq \lbrace assign(X,1..n) \rbrace :- ~shift(X)
1{assign(X,1..n)}: shift(X)1 \leq \lbrace assign(X,1..n) \rbrace :- ~shift(X)
\varphi
φ\varphi

Arithmetic-based

  • Optimization
  • Numeric variables
  • Arithmetic constraints
  • "Operations Research"
\sum
\sum
\sum_i x_{1i} \geq 1
ix1i1\sum_i x_{1i} \geq 1
\ldots
\ldots
\sum_i x_{mi} \geq 1
ixmi1\sum_i x_{mi} \geq 1
\sum_{k,i} c_{i}x_{ki}
k,icixki\sum_{k,i} c_{i}x_{ki}

Low level arithmetic formulas

Objective function

  • Floating point variables
  • (Linear) relaxation
  • Routing, scheduling, production planning
  • Cplex (IBM), GuRoBi, Coin-OR, Google Optimization Tools
\sum
\sum
forall(j in 1..nbshifts)(
    sum(i in 1..nbdoctors)(x[j,i]) >= 1
)

Mixed integer programming

\sum_i x_{1i} \geq 1
ix1i1\sum_i x_{1i} \geq 1
\ldots
\ldots
\sum_i x_{mi} \geq 1
ixmi1\sum_i x_{mi} \geq 1
\sum_{j,i} c_{i}x_{ji}
j,icixji\sum_{j,i} c_{i}x_{ji}

Low level:

Objective function:

  • Non-linear programming
    • Quadratic programming
    • Fractional programming
  • Geometric programming
  • Convex programming
  • Semidefinite programming
  • ...
\sum
\sum

In:

  • simple solution
  • (extended) objective function
  • solution "transformations"

Return: best solution encountered

Local search

\nabla
\nabla

During: stochastically transform solution into "neighbor" solution

Local search

\nabla
\nabla

Analogy: hill climbing

  • Large problems
  • Much hand-work
    • designing transformations
    • writing custom search algorithm
  • No optimality guarantee
  • LocalSolver, Tabu search, Simulated annealing

How about IDP?

  • Logic-based
    • constraint programming + answer set programming
  • Rich high-level language
  • Implements the knowledge base paradigm
    • separate knowledge from task
    • solve multiple problems with 1 specification
      • E.g., give explanation for inconsistent constraints

How about DMN?

  • Not quite a "reasoning engine"
    • inherent workflow: input -> output
    • cfr. hamburger problem
  • Similar: rule-based systems
    • business rule management systems

Thanks for your attention!

Questions?

Copy of Solving Technologies

By krr

Copy of Solving Technologies

  • 1,146