Slide 1

Slide 1 text

Fuzzing Without Specifications: Learning Structure from Behaviour Part II Rahul Gopinath 1

Slide 2

Slide 2 text

Fuzzing Without Specifications: Learning Structure from Behaviour Part II Rahul Gopinath 2

Slide 3

Slide 3 text

Prerequisites https://github.com/vrthra/summer2025#readme • Install Python 3.12 • Install Graphviz • Install Z3 • Install Jupyter • Start Jupyter 3

Slide 4

Slide 4 text

http://localhost:8888/notebooks/RoadMap.ipynb 4

Slide 5

Slide 5 text

http://localhost:8888/notebooks/x0_0_Prerequisites.ipynb 5

Slide 6

Slide 6 text

Fuzzing Crash? Program Trash deck technique: 1950s - Gerald Weinberg 6

Slide 7

Slide 7 text

7 Random Fuzzing $ ./fuzz [;x1-GPZ+wcckc];,N9J+?#6^6\e?]9lu
 2_%'4GX"0VUB[E/r ~fApu6b8<{%siq8Z
 h.6{V,hr?;{Ti.r3PIxMMMv6{xS^+'Hq!
 AxB"YXRS@!Kd6;wtAMefFWM(`|J_<1~o}
 z3K(CCzRH JIIvHz>_*.\>JrlU32~eGP?
 lR=bF3+;y$3lodQ&]BS6R&j?#tP7iaV}-}`\?[_[Z^LBM
 PG-FKj'\xwuZ1=Q`^`5,$N$Q@[!CuRzJ2
 D|vBy!^zkhdf3C5PAkR?V((-%>

Slide 8

Slide 8 text

• Insert Instrumentation • Generate inputs • Collect execution feedback • Branches covered during execution • Slightly Mutate Input and try again Collect inputs obtaining new coverage 8 Coverage Guided Fuzzing triangle (1,1,2) def triangle(a, b, c): if a == b: if b == c: return Equilateral else: return Isosceles else: if b == c: return Isosceles else: if a == c: return Isosceles else: return Scalene triangle (1,1,1) AFL 8

Slide 9

Slide 9 text

9 Fuzzing Research: Instrumentation Guided Fuzzing

Slide 10

Slide 10 text

10 Fuzzing Research: Instrumentation Guided Fuzzing Industry Requirements: Uninstrumentable Code

Slide 11

Slide 11 text

Service topology map of Uber showing hundreds of microservices (Source: Uber Engineering) Instrumentation ability or source code access is not always guaranteed

Slide 12

Slide 12 text

12 Industry Requirements: Uninstrumentable Code Coverage Guided Fuzzer Blindspot Potentially Blackbox

Slide 13

Slide 13 text

13 Fuzzing Blackbox Parsers

Slide 14

Slide 14 text

14 Fuzzing Blackbox Parsers $ ./fuzz [;x1-GPZ+wcckc];,N9J+?#6^6\e?]9lu
 2_%'4GX"0VUB[E/r ~fApu6b8<{%siq8Z
 h.6{V,hr?;{Ti.r3PIxMMMv6{xS^+'Hq!
 AxB"YXRS@!Kd6;wtAMefFWM(`|J_<1~o}
 z3K(CCzRH JIIvHz>_*.\>JrlU32~eGP?
 lR=bF3+;y$3lodQ&]BS6R&j?#tP7iaV}-}`\?[_[Z^LBM
 PG-FKj'\xwuZ1=Q`^`5,$N$Q@[!CuRzJ2
 D|vBy!^zkhdf3C5PAkR?V((-%>

Slide 15

Slide 15 text

15 Fuzzing Blackbox Parsers $ ./fuzz -g grammar ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 .................................. Parser Parsed! Interpreter ✓ Grammar

Slide 16

Slide 16 text

16 Formal Languages Formal Language Descriptions 3. Regular Context Free Recursively Enumerable (Chomsky,1956) Possible to infer Argument Stack Return Stack

Slide 17

Slide 17 text

17 Fuzzing Blackbox Parsers $ ./fuzz -g grammar ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 ..................................
 .................................. Parser Parsed! Interpreter ✓ Grammar

Slide 18

Slide 18 text

18 Where to Get the Grammar From? "Be liberal in what you accept, and conservative in what you send"
 (the cause of trouble) Postel's Law

Slide 19

Slide 19 text

19 The standard spec Buggy Implementation "Extra" Features "Accepted" Bugs •Reference Specification?

Slide 20

Slide 20 text

20 The standard spec Buggy Implementation "Extra" Features "Accepted" Bugs •Reference Specification? "Be liberal in what you accept, and conservative in what you send"
 (the cause of trouble) Postel's Law

Slide 21

Slide 21 text

21 Grammar Inference

Slide 22

Slide 22 text

22 Grammar Inference 1984 1993 2014 2022 2019

Slide 23

Slide 23 text

23 L* Grammar Inference

Slide 24

Slide 24 text

24 Grammar Inference (L*) L* (Angluin'84) Learner membership: w ∈ L? equivalence: G = L? yes/no counterexample yes/no Teacher

Slide 25

Slide 25 text

25 Grammar Inference (L*) L* (Angluin) Learner membership: ab ? equivalence: no abbb yes Teacher ?

Slide 26

Slide 26 text

26

Slide 27

Slide 27 text

27 Grammar Inference (L*) ɛ ɛ 0 S Observation Table E Language (L): {s ∈ Σ* : #b's = 1 } Alphabet (Σ) : {a, b} T is Closed (states): ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent (transitions): ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E We begin with S = {ɛ} and E = {ɛ} a 0 b 1 S · Σ

Slide 28

Slide 28 text

28 Grammar Inference (L*) ɛ ɛ 0 S Observation Table E Alphabet (Σ) : {a, b} T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E We begin with S = {ɛ} and E = {ɛ} a 0 b 1 S · Σ Language (L): {s ∈ Σ* : #b's = 1 }

Slide 29

Slide 29 text

29 Grammar Inference (L*) ɛ ɛ 0 b 1 Observation Table S E a 0 ba 1 bb 0 S · Σ T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Language (L): {s ∈ Σ* : #b's = 1 } Alphabet (Σ) : {a, b}

Slide 30

Slide 30 text

30 Grammar Inference (L*) ɛ ɛ 0 b 1 Observation Table S E a 0 ba 1 bb 0 S · Σ T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Language (L): {s ∈ Σ* : #b's = 1 } Alphabet (Σ) : {a, b}

Slide 31

Slide 31 text

31 Grammar Inference (L*) ɛ ɛ 0 b 1 Observation Table S E a 0 ba 1 bb 0 S · Σ T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 32

Slide 32 text

32 Grammar Inference (L*) ɛ ɛ 0 b 1 Observation Table S E a 0 ba 1 bb 0 S · Σ T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 33

Slide 33 text

33 Grammar Inference (L*) Observation Table E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E <$ɛ>:= a <$ɛ> | b <$b> <$b>:= a <$b> | b <$ɛ> | ɛ ɛ ɛ 0 b 1 S a 0 ba 1 bb 0 S · Σ Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 34

Slide 34 text

34 Grammar Inference (L*) Observation Table S E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E bbb ✘ <ɛ> := a <ɛ> | b := a | b <ɛ> | ɛ ɛ ɛ 0 b 1 a 0 ba 1 bb 0 S · Σ Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 35

Slide 35 text

35 Grammar Inference (L*) ɛ ɛ 0 b 1 bb 0 bbb 0 Observation Table S E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 36

Slide 36 text

36 Grammar Inference (L*) ɛ ɛ 0 b 1 bb 0 bbb 0 Observation Table S E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 37

Slide 37 text

37 Grammar Inference (L*) Observation Table S E a 0 ba 1 bba 0 bbba 0 bbbb 0 S · Σ T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E ɛ ɛ 0 b 1 bb 0 bbb 0 Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 38

Slide 38 text

38 Grammar Inference (L*) Observation Table S E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E s1 = [ɛ,] 0 s2 = [bb,] 0 s1.a = [ɛb,] 1 s2.a = [bbb,] 0 ɛ ɛ 0 b 1 bb 0 bbb 0 Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 } a 0 ba 1 bba 0 bbba 0 bbbb 0 S · Σ b b

Slide 39

Slide 39 text

39 Grammar Inference (L*) Observation Table S E T is Closed: ∀ w∈S⋅ Σ, ∃ s ∈ S such that [w,]=[s,] If not closed, add the counter example to S T is Consistent: ∀ s1,s2∈S, if row(s1) = row(s2) then ∀ a ∈ A [s1a,]=[s2a,] If not consistent, add the counter example to E ɛ b ɛ 0 1 b 1 0 bb 0 0 bbb 0 0 Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 } a 0 1 ba 1 0 bba 0 0 bbba 0 0 bbbb 0 0 S · Σ

Slide 40

Slide 40 text

40 Grammar Inference (L*) Observation Table S E <$ɛ> := a <$ɛ> | b <$b> <$b> := a <$b> | b <$bb> | ɛ <$bb>:= a <$bb> | b <$bb> ɛ b ɛ 0 1 b 1 0 bb 0 0 bbb 0 0 a 0 1 ba 1 0 bba 0 0 bbba 0 0 bbbb 0 0 S · Σ Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 41

Slide 41 text

41 Grammar Inference (L*) Observation Table S E <$ɛ> := a <$ɛ> | b <$b> <$b> := a <$b> | ɛ ✓ ɛ b ɛ 0 1 b 1 0 bb 0 0 bbb 0 0 a 0 1 ba 1 0 bba 0 0 bbba 0 0 bbbb 0 0 S · Σ Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 42

Slide 42 text

42 Grammar Inference (L*) -Use a discrimination tree rather than an observation table -Minimise the counter examples through exponential backo ff and binary search of the su ffi x -Intuition LG(w) != BB(w) -So, there should be a short pre fi x
 u such that w = uv where they di ff er originally. Find it through binary search. v is then the distinguishing su ffi x. Minimise that su ff i x. -You need to only add all pre fi xes of u to S. -Remove su ff i xes that do not add any value. Improvements (TTT)

Slide 43

Slide 43 text

43 Grammar Inference (L*) Learner Teacher w G = L? Equivalences Queries are not possible in software engineering scenarios <$ɛ> := a <$ɛ> | b <$b> <$b> := a <$b> | ɛ Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 } ✓

Slide 44

Slide 44 text

44 Grammar Inference (L*) Learner Teacher w G = L? Equivalences Queries are not possible in software engineering scenarios

Slide 45

Slide 45 text

45 L* Teacher with PAC Guarantees ab ✓ ✓ abb ✘ ✘ bb ✓ ✓ aaaa ✓ ✓ bbb ✓ ✘

Slide 46

Slide 46 text

46 L* Teacher with PAC Guarantees ab ✓ ✓ abb ✘ ✘ bb ✓ ✓ aaaa ✓ ✓ bbb ✘ ✘ aaa ✘ ✘ abab ✘ ✘

Slide 47

Slide 47 text

47 L* Teacher with PAC Guarantees Probably Approximately Correct (Valiant'84) Pr(L(A)≢X ≤ ϵ) ≥ 1−δ 1-∈: accuracy 1-δ: confidence Equivalence Query = Multiple Membership Checks Checks come from some sampling distribution D over A* We only get a PAC guarantee based on D qi = [1/ϵ (ln(1/δ) + i ln(2))] Checks made in place of ith equivalence query:

Slide 48

Slide 48 text

48 Grammar Inference (L*) Learner Oracle Membership Checks substitute Equivalence Queries w <ɛ> := a <ɛ> | b := a | b | ɛ := a | b Alphabet (Σ) : {a, b} Language (L): {s ∈ Σ* : #b's = 1 }

Slide 49

Slide 49 text

49 Grammar Inference (PAC-L*) Learner Oracle w Random Sampler (D) Blackbox Hypothesis w ∈ D L(*) Substituting Equivalence Queries ab ✓ ✓ abb ✘ ✘ bb ✓ ✓ aaaa ✓ ✓ bbb ✓ ✘

Slide 50

Slide 50 text

50 Grammar Inference (PAC-L*) Learner Oracle w Random Sampler (D) w ∈ D L(*) Substituting Equivalence Queries Search Space

Slide 51

Slide 51 text

Grammar Inference Problem: Exponential Search Space 2n possibilities for n length string

Slide 52

Slide 52 text

Grammar Inference Problem: Exponential Search Space 2n possibilities for n length string

Slide 53

Slide 53 text

Grammar Inference (with examples) Glade Arvada With good examples, the problem is tractable

Slide 54

Slide 54 text

Finding Good Examples Example corpus? (Blind spots) 54

Slide 55

Slide 55 text

55 Key Idea: Leverage Error Feedback 55 Viable Prefix (Ullman)

Slide 56

Slide 56 text

56 • Differentiate incomplete and incorrect inputs Key Idea: Viable Pre fi xes 56 • Solve one character at a time systematically

Slide 57

Slide 57 text

57 Example Generator a [ 5 1 b , } 4 ] a ∉ [,],{,},",0,1,2,3,4,5,.,. b ∉ [,],0,1,2,3,4,5,6,7,8,9,, } ∉ [,],0,1,2,3,4,5,6,7,8,9,0,, [51,4] 57

Slide 58

Slide 58 text

58 Pre fi xQ AFL(black) INI 62.5 65 CSV 65.7 68.3 JSON 13.8 9.2 TinyC 86.8 47.9 MJS 28.0 19.0 Quality of Examples Branch Coverage Obtained C programs

Slide 59

Slide 59 text

59 Pre fi xQ AFL(black) AFL(gray) INI 62.5 65 77.5 CSV 65.7 68.3 68.5 JSON 13.8 9.2 22.5 TinyC 86.8 47.9 81.6 MJS 28.0 19.0 29.9 Quality of Examples Tex Crash: ]9xdy[zSf$\theta{f!;} ;i\nonfrenchspacing !$$\prec q;7O/, $\downbrace fi ll @Pz \mathstrut{}$^: aK[X|?$47$ ,`D f$)Cg8$* Branch Coverage Obtained C programs

Slide 60

Slide 60 text

60

Slide 61

Slide 61 text

61 Positive and Negative Examples with Pre fi x Queries a [ 5 1 b , } 4 ] a ∉ [,],{,},",0,1,2,3,4,5,.,. b ∉ [,],0,1,2,3,4,5,6,7,8,9,, } ∉ [,],0,1,2,3,4,5,6,7,8,9,0,, [51,4] 61

Slide 62

Slide 62 text

62 Grammar Inference (PL*) Learner Pre fi x Oracle w Blackbox Hypothesis w ∈ B Yes/No Yes/No PL(*) w ∈ H Substituting Equivalence Queries

Slide 63

Slide 63 text

63 Grammar Inference (PL*) Pr(L(A)≢X ≤ ϵ) ≥ 1−δ Relation between D,ϵ,δ and F1 score On Arithmetic (depth limited) L(*) Eq = Pre fi x Sampler Eq = Pre fi x Sampler) (p=0.05) (p=0.5) Eq = Pre fi x Sampler) (p=1.0) Red is good, Blue is bad PL(*) PL(*) PL(*) 1-δ: confidence 1-∈: accuracy

Slide 64

Slide 64 text

64 Grammar Inference (PL*) Pr(L(A)≢X ≤ ϵ) ≥ 1−δ Relation between D,ϵ,δ and F1 score On JSON (depth limited) L(*) Eq = Pre fi x Sampler (p=0.05) Eq = Pre fi x Sampler) (p=0.5) Eq = Pre fi x Sampler) (p=1.0) Red is good, Blue is bad 1-δ: confidence 1-∈: accuracy PL(*) PL(*) PL(*)

Slide 65

Slide 65 text

65

Slide 66

Slide 66 text

66 Oracles

Slide 67

Slide 67 text

67 We Found A Crash

Slide 68

Slide 68 text

Why Did My Program Crash? 8.2 - 27 - -9 / +((+9 * --2 + --+-+-((-1 * +(8 - 5 - 6)) * (-(a-+(((+(4))))) - ++4) / +(-+---((5. 6 - --(3 * -1.8 * +(6 * +-(((-(-6) * ---+6)) / +- -(+-+-7 * (-0 * (+(((((2)) + 8 - 3 - ++9.0 + ---( --+7 / (1 / +++6.37) + (1) / 482) / +++-+0)))) + 8.2 - 27 - -9 / +((+9 * --2 + --+-+-((-1 * +(8 - 5 - 6)) * (-(a-+(((+(4))))) - ++4) / +(-+---((5.6 - --(3 * -1.8 * +(6 * +-(((-(-6) * ---+6)) / +-- (+-+-7 * (-0 * (+(((((2)) + 8 - 3 - ++9.0 + ---(- -+7 / (1 / +++6.37) + (1) / 482) / +++-+0)))) * - +5 + 7.513)))) - (+1 / ++((-84)))))))) * ++5 / +- (--2 - -++-9.0)))) / 5 * --++090 + * -+5 + 7.513) ))) - (+1 / ++((-84)))))))) * 8.2 - 27 - -9 / +(( +9 * --2 + --+-+-((-1 * +(8 - 5 - 6)) * (-(a-+ (((+(4))))) - ++4) / +(-+---((5.6 - --(3 * -1.8 * +(6 * +-(((-(-6) * ---+6)) / +--(+-+-7 * (-0 * ( +(((((2)) + 8 - 3 - ++9.0 + ---(--+7 / (1 / +++6. 37) + (1) / 482) / +++-+0)))) * -+5 + 7.513)))) - (+1 / ++((-84)))))))) * ++5 / +-(--2 - -++-9.0))) ) / 5 * --++090 ++5 / +-(--2 - -++-9.0)))) / 5 * --++090 DD Minimized Input ((4)) 00000 ? ((5)) ? (++5) ? 68

Slide 69

Slide 69 text

69

Slide 70

Slide 70 text

70 Issue 386 from Rhino var A = class extends (class {}){}; Issue 2937 from Closure const [y,y] = []; var {baz:{} = baz => {}} = baz => {}; Issue 385 from Rhino {while ((l_0)){ if ((l_0)) {break;;var l_0; continue }0}} Issue 2842 from Closure Delta Minimization is useful but not su ff i cient

Slide 71

Slide 71 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] 71

Slide 72

Slide 72 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] 72

Slide 73

Slide 73 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] ✓ Did not reproduce the failure 1 * (2 - 3) 73

Slide 74

Slide 74 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] 74

Slide 75

Slide 75 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c 75

Slide 76

Slide 76 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c ✓ Did not reproduce the failure 1 + 3 + 4 76

Slide 77

Slide 77 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c c 77

Slide 78

Slide 78 text

3 * 4 := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c c ✓ Did not reproduce the failure 78

Slide 79

Slide 79 text

( ( 4 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c c c c c c c 79

Slide 80

Slide 80 text

( ( 1 - 2 ) ) := := ' + ' | ' - ' | := ' * ' | ' / ' | := '+' | '-' | '(' ')' | '.' | := | := [0-9] c c c c c c c ✘ reproduced the failure ( ( 1 - 2 ) ) 80

Slide 81

Slide 81 text

( ( 1 - 2 ) ) c c c c c c c ✘ ( ( 1 - 2 ) ) 81

Slide 82

Slide 82 text

( ( 1 - 2 ) ) c c c c c c c ✘ ( ( 1 - 2 ) ) ✘ ( ( 2 * 3 + 4 ) ) 82

Slide 83

Slide 83 text

( ( 1 - 2 ) ) c c c c c c c ✘ ( ( 1 - 2 ) ) ✘ ( ( 2 * 3 + 4 ) ) ✘ ( ( - 2 / 1 ) ) 83

Slide 84

Slide 84 text

( ( 1 - 2 ) ) c c c c c c c ✘ ( ( 1 - 2 ) ) ✘ ( ( 2 * 3 + 4 ) ) ✘ ( ( - 2 / 1 ) ) ✘ ( ( 98 - 0 ) ) 84

Slide 85

Slide 85 text

) ( ( ) ( ( ) 4 ) ( ( 4 ) ) c c c c c c c A 85

Slide 86

Slide 86 text

) ( ( ) ( ( ) 4 ) ( ( 4 ) ) c c c c c c c A 86

Slide 87

Slide 87 text

( ( 4 ) ) c c c c c c c A ( ( ) ) ( ( ) ) 4 Minimized Input Abstract Failure Inducing Input def check(parsed): if parsed.is_nested() and parsed.child.is_nested(): raise Exception() return input 87

Slide 88

Slide 88 text

88 := := ' + ' | ' + ' | ' - ' | ' - ' | := ' * ' | ' * ' | ' / ' | ' / ' | := '+' | '-' | '(' ')' | '(' ')' := := := '(' ')' ((1)) + 2 (23 * ((3)) - 34) (344- 4 + ((223))) (1) - 3 * 773 + (-22 + 1) 1798 - 889 / ((333-1)) * 2 / 3 + 1 34 + ((4)) -334 + (334 - (22) + 919 * 0 + 1 98435747+ 88 + (((0))) + (1) - 1 * 7 / 4 * 889 - 2 8 + ((8)) + --1 + 11223 / 344 - 39 + (1) - 456 + 134 / 45 437 + 8 - 1 * ((9 + ((1))) - 1 + 99111948 + 3 --1 + (112) - 2 + 445) + 0 74 + 334 + ((178 - 88 / (3393-1) * 1002 / 3 + 1+ 3439)) * 223 - 1233 + 334672 2 * ((9)) - (1798 - 889 / (333-1) * 2 / 3 + 100012 + 3434392 + 234 ----6 * 1798 - 889 / (33 778 - (((1) - 3 * 773 + (-22 + 1) * (4545) - 23 - ((2)) * 773 + (-22 + 1) / 3434 + ---1 + 1 / 34343 + 112 349 + (((1) - 3 * 3 + (-22 + 1) ((+ (-22 + 1) * (4545) - 23 - (2) * 773 + ((-22 + 1)) / 3434 + ---1 + 1 / 34343 + 1123 8 + ((8)) + --1 + / 1 - 39 + (1) - 456 + 134 / 45 ))(((1) - 2334 + ((((1)) - 3 * 773 + (-22 + 1) * (2) - 23 - (2) * 773 + (-22 + 1) / 3 74 + 3 + ((178 - 88 / (3393-1) * 1002 / 3 + 1+ 3439)) * - 1233 + 334672)) ((8 + ((8)) + --1 + / 344 - 39 + (1) - 456 + 134 / 45 ))(((1) - 3 * 773 1+ 33+ 24343433 +23343 - ((74 + 334 + ((178 - 88 / (3393-1) * 1002 / 3 + 1+ 3439)) * - 1233 + 334672)) ((8 + ((8)) + --1 + / 344 - 39 + (1) - 456 + 134 / 4 ✘ Specialized Grammar is (()) ✘

Slide 89

Slide 89 text

Input Algebras 89

Slide 90

Slide 90 text

90

Slide 91

Slide 91 text

def jsoncheck(json): ... {...} 91

Slide 92

Slide 92 text

def jsoncheck(json): if any_key_has_null_value(json): fail(’key value must not be null’) process(json) {"abc": null} ✘ is : null 92

Slide 93

Slide 93 text

{"abc": []} ✔ no is : null def jsoncheck(json): if any_key_has_null_value(json): fail(’key value must not be null’) process(json) 93

Slide 94

Slide 94 text

{"abc": 124} ✘ no is "" : def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) process(json) 94

Slide 95

Slide 95 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) process(json) {"": 124} ✔ is "" : 95

Slide 96

Slide 96 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) if any_key_has_null_value(json): fail(’key value must not be null’) process(json) 96

Slide 97

Slide 97 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) if any_key_has_null_value(json): fail(’key value must not be null’) process(json) {"": 124} ✔ is "" : no is : null & 97

Slide 98

Slide 98 text

def jsoncheck(json): if any_key_has_null_value(json): fail(’key value must not be null’) process(json) {"abc": null} ✘ is : null Start Symbol 98

Slide 99

Slide 99 text

def jsoncheck(json): if any_key_has_null_value(json): fail(’key value must not be null’) process(json) {"abc": []} no is : null ✔ Start Symbol 99

Slide 100

Slide 100 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) process(json) {"abc": 124} ✘ is "" : Start Symbol 100

Slide 101

Slide 101 text

is "" : no is : null & def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) if any_key_has_null_value(json): fail(’key value must not be null’) process(json) {"": 124} ✔ Start Symbol 101

Slide 102

Slide 102 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) if any_key_has_null_value(json): fail(’key value must not be null’) process(json) Evogram Automatically Derived 102

Slide 103

Slide 103 text

def jsoncheck(json): if no_key_is_empty_string(json): fail(’one key must be empty’) if any_key_has_null_value(json): fail(’key value must not be null’) process(json) Automatically Derived 103

Slide 104

Slide 104 text

Supercharged Pattern Matchers where is "": is :null where is (()) is / 0 where is "0" is "0x" where is ";;" is "()" is "()" Alternative to Regular Expressions 104