CSP-based inference of function block finite-state models from - - PowerPoint PPT Presentation

csp based inference of function block finite state models
SMART_READER_LITE
LIVE PREVIEW

CSP-based inference of function block finite-state models from - - PowerPoint PPT Presentation

CSP-based inference of function block finite-state models from execution traces Daniil Chivilikhin, Vladimir Ulyantsev, Anatoly Shalyto, Valeriy Vyatkin INDIN 2017, Emden, Germany 25 July 2017 Program synthesis Derive implementation from


slide-1
SLIDE 1

CSP-based inference of function block finite-state models from execution traces

INDIN 2017, Emden, Germany 25 July 2017

Daniil Chivilikhin, Vladimir Ulyantsev, Anatoly Shalyto, Valeriy Vyatkin

slide-2
SLIDE 2

Program synthesis

2/25

  • Derive implementation from examples/specification

○ From seminal work [A. Church, 1963]

  • Motivation

○ Fundamental in computer science ○ Automation of software engineering ■ Reverse engineering Specification/ examples Implementation Synthesis

slide-3
SLIDE 3

EXE SRC SRC

Reverse engineering of software

3/25

  • Rights limitations
  • Changing standards
  • ….
  • Understanding
  • Optimization
  • Verification
  • ….
slide-4
SLIDE 4

Black-box approach What’s in the box?

4/25

(Controller) EXE SRC

slide-5
SLIDE 5

Target language: IEC 61499 function blocks

5/25

slide-6
SLIDE 6

Test-based reverse engineering

6/25

Tests

Simulation Execution traces Model

Tests gen

Model inference

Preparation

slide-7
SLIDE 7

Scenarios

7/25

Input Event Input vars values Output Event Output vars values

slide-8
SLIDE 8

Basic function block model

Boolean input/output vars

8/25

slide-9
SLIDE 9

Previous/proposed approaches

  • 1. Metaheuristic: [Chivilikhin et al / INDIN’15]
  • Slow
  • Approximate
  • 2. We propose CSP-translation approach
  • Could be faster in practice
  • Exact

9/25 s t

slide-10
SLIDE 10

Proposed approach: translation to Constraint Satisfaction Problem

10/25

CSP-solver Data Solution

Propositional encoding Solution reconstruction

https://srlabs.de/bites/minisat-intro/

slide-11
SLIDE 11

Proposed approach scheme

11/25

Traces

〈...〉, ... , 〈...〉 〈...〉, ... , 〈...〉 〈...〉, ... ,〈...〉

CSP solving No solution (UNSAT) Number of states N CSP

〈, , ℂ〉

Translation function f Constraints ℂ

  • n variables

with domains Traces tree construction Values of variables

  • Automaton

CSP solver

slide-12
SLIDE 12

Traces tree

12/25

slide-13
SLIDE 13

Variables

13/25

slide-14
SLIDE 14

Main constraints (1)

14/25

Tree Automaton

slide-15
SLIDE 15

Main constraints (2)

15/25

Tree Automaton

slide-16
SLIDE 16

Case study: pick-and-place manipulator

16/25

slide-17
SLIDE 17

Trace generation

17/25

All tests with length = 1, 2, 3 #1: 1 #2: 2 … #12: 1, 1, 1 … #39: 3, 3, 3

slide-18
SLIDE 18

Experimental setup

  • Methods

✓ MuACO

  • metaheuristic [Chivilikhin et al (2015)]

✓ fbCSP

  • Proposed approach

✓ fbCSP+BFS

  • fbCSP + BFS-based symm breaking
  • State-of-the-art CSP-solvers

✓ Opturion CPX (Minizinc Challenge 2015 winner) ✓ HaifaCSP (Minizinc Challenge 2016 winner)

18/25

slide-19
SLIDE 19

Fixed number of states: N = 10

19/25

slide-20
SLIDE 20

Minimal model generation

  • Most general pattern in the given data
  • Occam’s razor (law of parsimony):

“Among competing hypotheses, the one with the fewest assumptions should be selected”

20/25

slide-21
SLIDE 21

Minimal model generation

21/25

N = 1 Solve UNSAT N := N + 1 Satisfiable Return solution

slide-22
SLIDE 22

Minimal model generation: results

22/25

slide-23
SLIDE 23

Generated model example

23/25

slide-24
SLIDE 24

Conclusion and Future work

  • Proposed fast exact algorithm for inferring

minimal-sized models of basic FBs for logic control

  • Available: https://github.com/chivdan/cspgen
  • Future/ongoing work

○ Integer/real variables ○ Timers ○ Composite FBs ○ CEGAR for LTL/CTL based inference

24/25

slide-25
SLIDE 25

Thank you for your attention! Daniil Chivilikhin, chivdan@rain.ifmo.ru